1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
public class safe_process
{
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)";
public static bool PostData()
{
bool result = false;
for (int i = 0; i < HttpContext.Current.Request.Form.Count; i++)
{
result = CheckData(HttpContext.Current.Request.Form[i].ToString());
if (result)
{
break;
}
}
return result;
}
public static bool GetData()
{
bool result = false;
for (int i = 0; i < HttpContext.Current.Request.QueryString.Count; i++)
{
result = CheckData(HttpContext.Current.Request.QueryString[i].ToString());
if (result)
{
break;
}
}
return result;
}
public static bool CookieData()
{
bool result = false;
for (int i = 0; i < HttpContext.Current.Request.Cookies.Count; i++)
{
result = CheckData(HttpContext.Current.Request.Cookies[i].Value.ToLower());
if (result)
{
break;
}
}
return result;
}
public static bool referer()
{
bool result = false;
return result = CheckData(HttpContext.Current.Request.UrlReferrer.ToString());
}
public static bool CheckData(string inputData)
{ if (Regex.IsMatch(inputData, StrRegex))
{
return true;
}
else
{
return false;
}
}
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
protected void Application_BeginRequest(Object sender, EventArgs e)
{
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>";
if (Request.Cookies != null)
{
if (SteelMachining.Common.safe_360.CookieData())
{
Response.Write(q);
Response.End();
}
}
if (Request.UrlReferrer != null)
{
if (SteelMachining.Common.safe_360.referer())
{
Response.Write(q);
Response.End();
}
}
if (Request.RequestType.ToUpper() == "POST")
{
if (SteelMachining.Common.safe_360.PostData())
{
Response.Write(q);
Response.End();
}
}
if (Request.RequestType.ToUpper() == "GET")
{
if (SteelMachining.Common.safe_360.GetData())
{
Response.Write(q);
Response.End();
}
}
}
|
之前,网上爆出了ecshop最新的0day .论坛里也有人直接给出了EXP 相信好多基友都拿了不少的站吧. 这几天正好有个朋友要我帮忙拿一个站 看了一下,ecshop的 直接...
什么叫Medusa? Medusa为一个规模性平行面,模块化设计,迅速和登陆的野蛮人。目地是适用很多容许远程控制认证的服务项目。该专用工具的关键作用包含根据进程的并行处理检测 - 能够 对好几个服务...
Slowloris DOS进攻也可称之为:Slowloris拒绝服务攻击进攻; 普遍的DDOS进攻有SYN flood、UDP flood、ICMP flood等。在其中SYN flo...
一、Ewebeidtor编辑器漏洞 eWebEditor是根据电脑浏览器的、眼见为实的线上HTML在线编辑器。它可以在网页页面上完成很多桌面上编辑软件(如:Word)所具备的强劲可视性编写作用。 &...
服务器提权之webshell提权的一些经验总结。 第一,WEBSHELL 权限提升技巧 C:\DocumentsandSettings\AllUsers\Applic...
以前就有人公布过拿shell过程 今天再给大家具体演示一下 KesionCMS V6.5 拿shell! 演示网站:www.xxxx.com 直接打开后台 admin/login.asp...