.Net网站架构设计(七)网络安全

.Net网站架构设计(七)网络安全

.Net网站架构(七)网络安全

谈到网络安全,首先得说一下web网站有哪些最常见漏洞。

非法输入


Unvalidated Input

在数据被输入程序前忽略对数据合法性的检验是一个常见的编程漏洞。随着OWASP对Web应用程序脆弱性的调查,非法输入的问题已成为大多数Web应用程序安全漏洞方面的一个普遍现象。

方案:要在web前端,和服务器端对数据的合法性进行验证

[csharp]  view plain  copy
  1. public class PageValidate   
  2.   
  3.     {   
  4.   
  5.         private static Regex RegPhone = new Regex("^[0-9]+[-]?[0-9]+[-]?[0-9]$");   
  6.   
  7.         private static Regex RegNumber = new Regex("^[0-9]+$");   
  8.   
  9.         private static Regex RegNumberSign = new Regex("^[+-]?[0-9]+$");   
  10.   
  11.         private static Regex RegDecimal = new Regex("^[0-9]+[.]?[0-9]+$");   
  12.   
  13.         private static Regex RegDecimalSign = new Regex("^[+-]?[0-9]+[.]?[0-9]+$"); //等价于^[+-]?\d+[.]?\d+$   
  14.   
  15.         private static Regex RegEmail = new Regex("^[\\w-]+@[\\w-]+\\.(com|net|org|edu|mil|tv|biz|info)$");//w 英文字母或数字的字符串,和 [a-zA-Z0-9] 语法一样   
  16.   
  17.         private static Regex RegCHZN = new Regex("[\u4e00-\u9fa5]");   
  18.   
  19.    
  20.   
  21.         public PageValidate()   
  22.   
  23.         {   
  24.   
  25.         }   
  26.   
  27.    
  28.   
  29.    
  30.   
  31.         //数字字符串检查#region 数字字符串检查           
  32.   
  33.         public static bool IsPhone(string inputData)   
  34.   
  35.         {   
  36.   
  37.             Match m = RegPhone.Match(inputData);   
  38.   
  39.             return m.Success;   
  40.   
  41.         }   
  42.   
  43.         /**//// <summary>   
  44.   
  45.         /// 检查Request查询字符串的键值,是否是数字,最大长度限制   
  46.   
  47.         /// </summary>   
  48.   
  49.         /// <param name="req">Request</param>   
  50.   
  51.         /// <param name="inputKey">Request的键值</param>   
  52.   
  53.         /// <param name="maxLen">最大长度</param>   
  54.   
  55.         /// <returns>返回Request查询字符串</returns>   
  56.   
  57.         public static string FetchInputDigit(HttpRequest req, string inputKey, int maxLen)   
  58.   
  59.         {   
  60.   
  61.             string retVal = string.Empty;   
  62.   
  63.             if(inputKey != null && inputKey != string.Empty)   
  64.   
  65.             {   
  66.   
  67.                 retVal = req.QueryString[inputKey];   
  68.   
  69.                 if(null == retVal)   
  70.   
  71.                     retVal = req.Form[inputKey];   
  72.   
  73.                 if(null != retVal)   
  74.   
  75.                 {   
  76.   
  77.                     retVal = SqlText(retVal, maxLen);   
  78.   
  79.                     if(!IsNumber(retVal))   
  80.   
  81.                         retVal = string.Empty;   
  82.   
  83.                 }   
  84.   
  85.             }   
  86.   
  87.             if(retVal == null)   
  88.   
  89.                 retVal = string.Empty;   
  90.   
  91.             return retVal;   
  92.   
  93.         }           
  94.   
  95.         /**//// <summary>   
  96.   
  97.         /// 是否数字字符串   
  98.   
  99.         /// </summary>   
  100.   
  101.         /// <param name="inputData">输入字符串</param>   
  102.   
  103.         /// <returns></returns>   
  104.   
  105.         public static bool IsNumber(string inputData)   
  106.   
  107.         {   
  108.   
  109.             Match m = RegNumber.Match(inputData);   
  110.   
  111.             return m.Success;   
  112.   
  113.         }   
  114.   
  115.    
  116.   
  117.         /**//// <summary>   
  118.   
  119.         /// 是否数字字符串 可带正负号   
  120.   
  121.         /// </summary>   
  122.   
  123.         /// <param name="inputData">输入字符串</param>   
  124.   
  125.         /// <returns></returns>   
  126.   
  127.         public static bool IsNumberSign(string inputData)   
  128.   
  129.         {   
  130.   
  131.             Match m = RegNumberSign.Match(inputData);   
  132.   
  133.             return m.Success;   
  134.   
  135.         }           
  136.   
  137.         /**//// <summary>   
  138.   
  139.         /// 是否是浮点数   
  140.   
  141.         /// </summary>   
  142.   
  143.         /// <param name="inputData">输入字符串</param>   
  144.   
  145.         /// <returns></returns>   
  146.   
  147.         public static bool IsDecimal(string inputData)   
  148.   
  149.         {   
  150.   
  151.             Match m = RegDecimal.Match(inputData);   
  152.   
  153.             return m.Success;   
  154.   
  155.         }           
  156.   
  157.         /**//// <summary>   
  158.   
  159.         /// 是否是浮点数 可带正负号   
  160.   
  161.         /// </summary>   
  162.   
  163.         /// <param name="inputData">输入字符串</param>   
  164.   
  165.         /// <returns></returns>   
  166.   
  167.         public static bool IsDecimalSign(string inputData)   
  168.   
  169.         {   
  170.   
  171.             Match m = RegDecimalSign.Match(inputData);   
  172.   
  173.             return m.Success;   
  174.   
  175.         }           
  176.  
  177.   
  178.  
  179.         #endregion   
  180.   
  181.    
  182.   
  183.         //中文检测#region 中文检测   
  184.   
  185.    
  186.   
  187.         /**//// <summary>   
  188.   
  189.         /// 检测是否有中文字符   
  190.   
  191.         /// </summary>   
  192.   
  193.         /// <param name="inputData"></param>   
  194.   
  195.         /// <returns></returns>   
  196.   
  197.         public static bool IsHasCHZN(string inputData)   
  198.   
  199.         {   
  200.   
  201.             Match m = RegCHZN.Match(inputData);   
  202.   
  203.             return m.Success;   
  204.   
  205.         }       
  206.  
  207.   
  208.  
  209.         #endregion   
  210.   
  211.    
  212.   
  213.         //邮件地址#region 邮件地址   
  214.   
  215.         /**//// <summary>   
  216.   
  217.         /// 是否是浮点数 可带正负号   
  218.   
  219.         /// </summary>   
  220.   
  221.         /// <param name="inputData">输入字符串</param>   
  222.   
  223.         /// <returns></returns>   
  224.   
  225.         public static bool IsEmail(string inputData)   
  226.   
  227.         {   
  228.   
  229.             Match m = RegEmail.Match(inputData);   
  230.   
  231.             return m.Success;   
  232.   
  233.         }           
  234.  
  235.   
  236.  
  237.         #endregion   
  238.   
  239.    
  240.   
  241.         //其他#region 其他   
  242.   
  243.    
  244.   
  245.         /**//// <summary>   
  246.   
  247.         /// 检查字符串最大长度,返回指定长度的串   
  248.   
  249.         /// </summary>   
  250.   
  251.         /// <param name="sqlInput">输入字符串</param>   
  252.   
  253.         /// <param name="maxLength">最大长度</param>   
  254.   
  255.         /// <returns></returns>               
  256.   
  257.         public static string SqlText(string sqlInput, int maxLength)   
  258.   
  259.         {               
  260.   
  261.             if(sqlInput != null && sqlInput != string.Empty)   
  262.   
  263.             {   
  264.   
  265.                 sqlInput = sqlInput.Trim();                               
  266.   
  267.                 if(sqlInput.Length > maxLength)//按最大长度截取字符串   
  268.   
  269.                     sqlInput = sqlInput.Substring(0, maxLength);   
  270.   
  271.             }   
  272.   
  273.             return sqlInput;   
  274.   
  275.         }           
  276.   
  277.         /**//// <summary>   
  278.   
  279.         /// 字符串编码   
  280.   
  281.         /// </summary>   
  282.   
  283.         /// <param name="inputData"></param>   
  284.   
  285.         /// <returns></returns>   
  286.   
  287.         public static string HtmlEncode(string inputData)   
  288.   
  289.         {   
  290.   
  291.             return HttpUtility.HtmlEncode(inputData);   
  292.   
  293.         }   
  294.   
  295.         /**//// <summary>   
  296.   
  297.         /// 设置Label显示Encode的字符串   
  298.   
  299.         /// </summary>   
  300.   
  301.         /// <param name="lbl"></param>   
  302.   
  303.         /// <param name="txtInput"></param>   
  304.   
  305.         public static void SetLabel(Label lbl, string txtInput)   
  306.   
  307.         {   
  308.   
  309.             lbl.Text = HtmlEncode(txtInput);   
  310.   
  311.         }   
  312.   
  313.         public static void SetLabel(Label lbl, object inputObj)   
  314.   
  315.         {   
  316.   
  317.             SetLabel(lbl, inputObj.ToString());   
  318.   
  319.         }           
  320.   
  321.         //字符串清理   
  322.   
  323.         public static string InputText(string inputString, int maxLength)   
  324.   
  325.         {               
  326.   
  327.             StringBuilder retVal = new StringBuilder();   
  328.   
  329.    
  330.   
  331.             // 检查是否为空   
  332.   
  333.             if ((inputString != null) && (inputString != String.Empty))   
  334.   
  335.             {   
  336.   
  337.                 inputString = inputString.Trim();   
  338.   
  339.                    
  340.   
  341.                 //检查长度   
  342.   
  343.                 if (inputString.Length > maxLength)   
  344.   
  345.                     inputString = inputString.Substring(0, maxLength);   
  346.   
  347.                    
  348.   
  349.                 //替换危险字符   
  350.   
  351.                 for (int i = 0; i < inputString.Length; i++)   
  352.   
  353.                 {   
  354.   
  355.                     switch (inputString[i])   
  356.   
  357.                     {   
  358.   
  359.                         case '"':   
  360.   
  361.                             retVal.Append(""");   
  362.   
  363.                             break;   
  364.   
  365.                         case '<':   
  366.   
  367.                             retVal.Append("<");   
  368.   
  369.                             break;   
  370.   
  371.                         case '>':   
  372.   
  373.                             retVal.Append(">");   
  374.   
  375.                             break;   
  376.   
  377.                         default:   
  378.   
  379.                             retVal.Append(inputString[i]);   
  380.   
  381.                             break;   
  382.   
  383.                     }   
  384.   
  385.                 }                   
  386.   
  387.                 retVal.Replace("'"" ");// 替换单引号   
  388.   
  389.             }   
  390.   
  391.             return retVal.ToString();   
  392.   
  393.                
  394.   
  395.         }   
  396.   
  397.         /**//// <summary>   
  398.   
  399.         /// 转换成 HTML code   
  400.   
  401.         /// </summary>   
  402.   
  403.         /// <param name="str">string</param>   
  404.   
  405.         /// <returns>string</returns>   
  406.   
  407.         public static string Encode(string str)   
  408.   
  409.         {               
  410.   
  411.             str = str.Replace("&","&");   
  412.   
  413.             str = str.Replace("'","''");   
  414.   
  415.             str = str.Replace("\"",""");   
  416.   
  417.             str = str.Replace(" "," ");   
  418.   
  419.             str = str.Replace("<","<");   
  420.   
  421.             str = str.Replace(">",">");   
  422.   
  423.             str = str.Replace("\n","<br>");   
  424.   
  425.             return str;   
  426.   
  427.         }   
  428.   
  429.         /**//// <summary>   
  430.   
  431.         ///解析html成 普通文本   
  432.   
  433.         /// </summary>   
  434.   
  435.         /// <param name="str">string</param>   
  436.   
  437.         /// <returns>string</returns>   
  438.   
  439.         public static string Decode(string str)   
  440.   
  441.         {               
  442.   
  443.             str = str.Replace("<br>","\n");   
  444.   
  445.             str = str.Replace(">",">");   
  446.   
  447.             str = str.Replace("<","<");   
  448.   
  449.             str = str.Replace(" "," ");   
  450.   
  451.             str = str.Replace(""","\"");   
  452.   
  453.             return str;   
  454.   
  455.         }   
  456.   
  457.    
  458.   
  459.         public static string SqlTextClear(string sqlText)   
  460.   
  461.         {   
  462.   
  463.             if (sqlText == null)   
  464.   
  465.             {   
  466.   
  467.                 return null;   
  468.   
  469.             }   
  470.   
  471.             if (sqlText == "")   
  472.   
  473.             {   
  474.   
  475.                 return "";   
  476.   
  477.             }   
  478.   
  479.             sqlText = sqlText.Replace(",""");//去除,   
  480.   
  481.             sqlText = sqlText.Replace("<""");//去除<   
  482.   
  483.             sqlText = sqlText.Replace(">""");//去除>   
  484.   
  485.             sqlText = sqlText.Replace("--""");//去除--   
  486.   
  487.             sqlText = sqlText.Replace("'""");//去除'   
  488.   
  489.             sqlText = sqlText.Replace("\"""");//去除"   
  490.   
  491.             sqlText = sqlText.Replace("=""");//去除=   
  492.   
  493.             sqlText = sqlText.Replace("%""");//去除%   
  494.   
  495.             sqlText = sqlText.Replace(" """);//去除空格   
  496.   
  497.             return sqlText;   
  498.   
  499.         }   
  500.  
  501.         #endregion   
  502.   
  503.    
  504.   
  505.         //是否由特定字符组成#region 是否由特定字符组成   
  506.   
  507.         public static bool isContainSameChar(string strInput)   
  508.   
  509.         {   
  510.   
  511.             string charInput = string.Empty;   
  512.   
  513.             if (!string.IsNullOrEmpty(strInput))   
  514.   
  515.             {   
  516.   
  517.                 charInput = strInput.Substring(0, 1);   
  518.   
  519.             }   
  520.   
  521.             return isContainSameChar(strInput, charInput, strInput.Length);   
  522.   
  523.         }   
  524.   
  525.    
  526.   
  527.         public static bool isContainSameChar(string strInput, string charInput, int lenInput)   
  528.   
  529.         {   
  530.   
  531.             if (string.IsNullOrEmpty(charInput))   
  532.   
  533.             {   
  534.   
  535.                 return false;   
  536.   
  537.             }   
  538.   
  539.             else   
  540.   
  541.             {   
  542.   
  543.                 Regex RegNumber = new Regex(string.Format("^([{0}])+$", charInput));   
  544.   
  545.                 //Regex RegNumber = new Regex(string.Format("^([{0}]{{1}})+$", charInput,lenInput));   
  546.   
  547.                 Match m = RegNumber.Match(strInput);   
  548.   
  549.                 return m.Success;   
  550.   
  551.             }   
  552.   
  553.         }   
  554.  
  555.         #endregion   
  556.   
  557.    
  558.   
  559.         //检查输入的参数是不是某些定义好的特殊字符:这个方法目前用于密码输入的安全检查#region 检查输入的参数是不是某些定义好的特殊字符:这个方法目前用于密码输入的安全检查   
  560.   
  561.         /**//// <summary>   
  562.   
  563.         /// 检查输入的参数是不是某些定义好的特殊字符:这个方法目前用于密码输入的安全检查   
  564.   
  565.         /// </summary>   
  566.   
  567.         public static bool isContainSpecChar(string strInput)   
  568.   
  569.         {   
  570.   
  571.             string[] list = new string[] { "123456""654321" };   
  572.   
  573.             bool result = new bool();   
  574.   
  575.             for (int i = 0; i < list.Length; i++)   
  576.   
  577.             {   
  578.   
  579.                 if (strInput == list[i])   
  580.   
  581.                 {   
  582.   
  583.                     result = true;   
  584.   
  585.                     break;   
  586.   
  587.                 }   
  588.   
  589.             }   
  590.   
  591.             return result;   
  592.   
  593.         }   
  594.  
  595.         #endregion   
  596.   
  597.     }   
  598.   
  599.    


失效的访问控制


Broken Access Control

大部分企业都非常关注对已经建立的连接进行控制,但是,允许一个特定的字符串输入可以让攻击行为绕过企业的控制。

解决方案:

采用Atho2的方式对用户身份进行验证;将AccessToken  保存到Cookie里面;设置Cookie失效策略;

当然在分布架构下面;需要用户集中式Redis集群管理用户Session,而在应用级是无状态的。

失效的账户和线程管理


Broken Authentication and Session Management

有良好的访问控制并不意味着万事大吉,企业还应该保护用户的密码、会话令牌、账户列表及其它任何可为攻击者提供有利信息、能帮助他们攻击企业网络的内容。

跨站点脚本攻击


Cross Site Scripting Flaws

这是一种常见的攻击,当攻击脚本被嵌入企业的Web页面或其它可以访问的Web资源中,没有保护能力的台式机访问这个页面或资源时,脚本就会被启动,这种攻击可以影响企业内成百上千员工的终端电脑。
解决方案:要在可能的输入项中过滤所有

缓存溢出问题


Buffer Overflows

这个问题一般出现在用较早的编程语言、如C语言编写的程序中,这种编程错误其实也是由于没有很好地确定输入内容在内存中的位置所致。

注入式攻击


Injection Flaws

如果没有成功地阻止带有语法含义的输入内容,有可能导致对数据库信息的非法访问,在Web表单中输入的内容应该保持简单,并且不应包含可被执行的代码。
解决方案:

1、要使用服务端的可能带来的服务SQL注入的地方进行验证;

2、涉及SQL语句查询是使用SQL变量(强烈推荐)

3、用通用的方法检验是否存在特殊字符

[csharp]  view plain  copy
  1. namespace YQSH.EIMS  
  2. {  
  3.     using System;  
  4.     public class SqlPourInto  
  5.     {  
  6.         private System.Collections.Specialized.NameValueCollection Param;  
  7.         public SqlPourInto(System.Collections.Specialized.NameValueCollection param)  
  8.         {  
  9.             this.Param = param;  
  10.         }  
  11.   
  12.         public bool HandleParam()  
  13.         {  
  14.             if (Param.Count == 0)  
  15.                 return true;  
  16.             for (int i = 0; i < Param.Count; i++)  
  17.                 if (!IsSafeString(Param[i].ToString()))  
  18.                     return false;  
  19.             return true ;  
  20.         }  
  21.         public bool IsSafeString(string strText)  
  22.         {  
  23.             bool bResult = true;  
  24.             strText = System.Text.RegularExpressions.Regex.Replace(strText, "(<[b|B][r|R]/*>)+|(<[p|P](.|\\n)*?>)""\n");    //<br>  
  25.             string[] UnSafeArray = new string[23];  
  26.             UnSafeArray[0] = "'";  
  27.             UnSafeArray[1] = "xp_cmdshell ";  
  28.             UnSafeArray[2] = "declare ";  
  29.             UnSafeArray[3] = "netlocalgroupadministrators ";  
  30.             UnSafeArray[4] = "delete ";  
  31.             UnSafeArray[5] = "truncate ";  
  32.             UnSafeArray[6] = "netuser ";  
  33.             UnSafeArray[7] = "add ";  
  34.             UnSafeArray[8] = "drop ";  
  35.             UnSafeArray[9] = "update ";  
  36.             UnSafeArray[10] = "select ";  
  37.             UnSafeArray[11] = "union ";  
  38.             UnSafeArray[12] = "exec ";  
  39.             UnSafeArray[13] = "create ";  
  40.             UnSafeArray[14] = "insertinto ";  
  41.             UnSafeArray[15] = "sp_ ";  
  42.             UnSafeArray[16] = "exec ";  
  43.             UnSafeArray[17] = "create ";  
  44.             UnSafeArray[18] = "insert ";  
  45.             UnSafeArray[19] = "masterdbo ";  
  46.             UnSafeArray[20] = "sp_ ";  
  47.             UnSafeArray[21] = ";-- ";  
  48.             UnSafeArray[22] = "1= ";  
  49.             foreach (string strValue in UnSafeArray)  
  50.             {  
  51.                 if (strText.ToLower().IndexOf(strValue) > -1)  
  52.                 {  
  53.                     bResult = false;  
  54.                     break;  
  55.                 }  
  56.             }  
  57.             return bResult;  
  58.         }  
  59.     }  
  60. }  


异常错误处理


Improper Error Handling

当错误发生时,向用户提交错误提示是很正常的事情,但是如果提交的错误提示中包含了太多的内容,就有可能会被攻击者分析出网络环境的结构或配置。
解决方案:Web.config,中将错误配置:

[html]  view plain  copy
  1. <customErrors mode="RemoteOnly">  
  2.      <error statusCode="403" redirect="NoAccess.htm" />  
  3.      <error statusCode="404" redirect="FileNotFound.htm" />  
  4. </customErrors>  


不安全的存储


Insecure Storage

对于Web应用程序来说,妥善保存密码、用户名及其他与身份验证有关的信息是非常重要的工作,对这些信息进行加密则是非常有效的方式,但是一些企业会采用那些未经实践验证的加密解决方案,其中就可能存在安全漏洞。
解决方案:对于密码可以采用2次的MD5加密,并验证密码得复杂程度。

程序拒绝服务攻击


Application Denial of Service

与拒绝服务攻击 (DoS)类似,应用程序的DoS攻击会利用大量非法用户抢占应用程序资源,导致合法用户无法使用该Web应用程序。

解决方案

Ddos攻击解决方案

代码解决方案:

[csharp]  view plain  copy
  1. 解决方案:  
  2. 1、避免XSS的方法之一主要是将用户所提供的内容输入输出进行过滤。ASP.NET的Server.HtmlEncode()或功能更强的Microsoft Anti-Cross Site Scripting Library。  
  3. 2、整体网站的过滤处理,下面是通用处理方法。  
  4.    
  5. public class safe_process  
  6.     {  
  7.         private const string StrRegex = @"<[^>]+?style=[\w]+?:expression\(|\b(alert|confirm|prompt)\b|^\+/v(8|9)|<[^>]*?=[^>]*?&#[^>]*?>|\b(and|or)\b.{1,6}?(=|>|<|\bin\b|\blike\b)|/\*.+?\*/|<\s*script\b|<\s*img\b|\bEXEC\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\s+(TABLE|DATABASE)";  
  8.         public static bool PostData()  
  9.         {  
  10.             bool result = false;  
  11.             for (int i = 0; i < HttpContext.Current.Request.Form.Count; i++)  
  12.             {  
  13.                 result = CheckData(HttpContext.Current.Request.Form[i].ToString());  
  14.                 if (result)  
  15.                 {  
  16.                     break;  
  17.                 }  
  18.             }  
  19.             return result;  
  20.         }  
  21.    
  22.         public static bool GetData()  
  23.         {  
  24.             bool result = false;  
  25.             for (int i = 0; i < HttpContext.Current.Request.QueryString.Count; i++)  
  26.             {  
  27.                 result = CheckData(HttpContext.Current.Request.QueryString[i].ToString());  
  28.                 if (result)  
  29.                 {  
  30.                     break;  
  31.                 }  
  32.             }  
  33.             return result;  
  34.         }  
  35.    
  36.         public static bool CookieData()  
  37.         {  
  38.             bool result = false;  
  39.             for (int i = 0; i < HttpContext.Current.Request.Cookies.Count; i++)  
  40.             {  
  41.                 result = CheckData(HttpContext.Current.Request.Cookies[i].Value.ToLower());  
  42.                 if (result)  
  43.                 {  
  44.                     break;  
  45.                 }  
  46.             }  
  47.             return result;  
  48.         }  
  49.         public static bool referer()  
  50.         {  
  51.             bool result = false;  
  52.             return result = CheckData(HttpContext.Current.Request.UrlReferrer.ToString());  
  53.         }  
  54.         public static bool CheckData(string inputData)  
  55.         {  
  56.   
  57. if (Regex.IsMatch(inputData, StrRegex))  
  58.             {  
  59.                 return true;  
  60.             }  
  61.             else  
  62.             {  
  63.                 return false;  
  64.             }  
  65.         }  
  66.     }  
  67. 在Global.asax中的Application_BeginRequest中调用上面的方法进行处理,代码如下:  
  68. protected void Application_BeginRequest(Object sender, EventArgs e)  
  69.   {  
  70.             string q = "<div style='position:fixed;top:0px;width:100%;height:100%;background-color:white;color:green;font-weight:bold;border-bottom:5px solid #999;'><br>您的提交带有不合法参数!</div>";  
  71.             if (Request.Cookies != null)  
  72.             {  
  73.                 if (SteelMachining.Common.safe_360.CookieData())  
  74.                 {  
  75.                     Response.Write(q);  
  76.                     Response.End();  
  77.                 }  
  78.             }  
  79.    
  80.             if (Request.UrlReferrer != null)  
  81.             {  
  82.                 if (SteelMachining.Common.safe_360.referer())  
  83.                 {  
  84.                     Response.Write(q);  
  85.                     Response.End();  
  86.                 }  
  87.             }  
  88.    
  89.             if (Request.RequestType.ToUpper() == "POST")  
  90.             {  
  91.                 if (SteelMachining.Common.safe_360.PostData())  
  92.                 {  
  93.    
  94.                     Response.Write(q);  
  95.                     Response.End();  
  96.                 }  
  97.             }  
  98.             if (Request.RequestType.ToUpper() == "GET")  
  99.             {  
  100.                 if (SteelMachining.Common.safe_360.GetData())  
  101.                 {  
  102.                     Response.Write(q);  
  103.                     Response.End();  
  104.                 }  
  105.             }  
  106.   }  


不安全的配置管理


Insecure Configuration Management

有效的配置管理过程可以为Web应用程序和企业的网络架构提供良好的保护。

不安全的网络传输

解决方案:对敏感数据进行加密

                  采用安全的传输通道(专网,或者VPN)

                   采取加密协议如Https

网络数据伪造

                 采取数据加密认证

网络篡改

                 采取数据认证

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CTF网络安全大赛培训主要面向学生、零安全基础、新手、测试转安全、开发转安全、运维转安全、安服转安全以及对网络安全比较感兴趣的同学。这种培训通常涵盖了一系列的题目类型,包括Web渗透、RE逆向、Misc杂项、PWN二进制漏洞利用、Crypto密码破译等等。通过参加这样的大赛培训,学生可以通过赛项检验网络组建、安全架构和网络安全运维管控等方面的技术技能,同时也能够培养团队协作和创新能力,提升职业能力和就业竞争力。这种大赛培训通过引领专业教学,为学生提供了实践动手的机会,让他们能够在实践中学习并应用所学的知识和技能。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [零基础+进阶系统化渗透测试工程师+CTF网络安全大赛学习指南](https://blog.csdn.net/fengzheng126/article/details/118439238)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [入门网络安全必备CTF题型介绍](https://blog.csdn.net/Hack0812/article/details/128070882)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [网络信息安全-培训(中高职业院校)](https://download.csdn.net/download/qq_48609816/87316302)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值