国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

強力防SQL注入

2019-11-17 04:15:45
字體:
來源:轉載
供稿:網友

很久之前收集的,非常不錯,不然也不會發給大家,呵呵!

 程序代碼
<%
'防注入系統
dim bqs,berrc,biii,burl
bqs=request.servervariables("query_string")

If Request.ServerVariables("HTTPS") = "off" Then bUrl = "http://" Else bUrl = "https://" End If
bUrl = bUrl & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then bUrl = bUrl &":"& Request.ServerVariables("SERVER_PORT") End If
bUrl = bUrl & Request.ServerVariables("URL")
If Request.QueryString <>"" Then bUrl = bUrl & "?" & Request.QueryString End If

'burl=Request.ServerVariables("URL")

dim bnothis(61)
bnothis(0)="net user"
bnothis(1)="@a"
bnothis(2)="/add"
bnothis(3)="exec%20master.dbo.xp_cmdshell"
bnothis(4)="net localgroup administrators"
bnothis(5)="select"
bnothis(6)="count"
bnothis(7)="asc"
bnothis(8)="char"
bnothis(9)="mid"
bnothis(10)="cscrbnothis(19)="script"
bnothis(20)="system32"
bnothis(21)="CmdShell"
bnothis(22)="sysadmin"
bnothis(23)="serveradmin"
bnothis(24)="setupadmin"
bnothis(25)="securityadmin"
bnothis(26)="diskadmin"
bnothis(27)="bulkadmin"
bnothis(28)="exec master.dbo.sp_addlogin"
bnothis(29)="exec master.dbo.sp_pass
Word"
bnothis(30)="exec master.dbo.sp_addsrvrolemember"
bnothis(31)="create"
bnothis(32)="exec xp_reg"
bnothis(33)="backup"
bnothis(34)="net localgroup administrators"
bnothis(35)="Asc"
bnothis(36)="+dir+"
bnothis(37)="drop table"
bnothis(38)="exec master.dbo.sp_addextendedbnothis(44)="EXEC sp_oamethod"
bnothis(45)="xp_"
bnothis(46)="Sp_"
bnothis(47)="%2B"
bnothis(48)="%5c"
bnothis(49)="@"
bnothis(50)="Sp_OAMethod"
bnothis(51)="Sp_OASetProperty"
bnothis(52)="Sp_OAStop"
bnothis(53)="Xp_regaddmultistring"
bnothis(54)="Xp_regdeletekey"
bnothis(55)="Xp_regdeletevalue"
bnothis(56)="Xp_regenumvalues"
bnothis(57)="Xp_regread"
bnothis(58)="Xp_regremovemultistring"
bnothis(59)="Xp_regwrite"
bnothis(60)="insert into"
bnothis(61)=".txt"
berrc=False
for biii= 0 to ubound(bnothis)
if instr(bqs,bnothis(biii))<>0 or instr(burl,bnothis(biii))<>0 Then
berrc=true
end if
next
if berrc Then

  Dim   ValidEntry    
  ValidEntry   =   True  
  If   not   IsEmpty(
session("LogIn"))   Then   ValidEntry   =   False  
  If   ValidEntry   Then    
  Const   ForAppending   =   8  
  Const   Create   =   true  
  Dim   fso  
  DIM   TS  
  DIM   MyFileName  
  'Dim   strLog  
  Dim   strTime,strip,strwords,struser,strport
   
  MyFileName   =   Server.MapPath("/visited_forum.txt")  
  Set   FSO   =   Server.CreateObject("Scripting.FileSystemObject_100502")  
  Set   TS   =   FSO.OpenTextFile(MyFileName,   ForAppending,   Create)
 
  strip=Request.ServerVariables ("REMOTE_ADDR")   &   ""
  if strip="" then
  strip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")   &   ""
  end if

  strport=Request.ServerVariables("REMOTE_PORT")
  strwords=request.servervariables("query_string")
  strtime=now()
  struser=request.servervariables("http_user_agent")
 
  '   Write   current   information   to   Log   Text   File.  
  Ts.writeline   "攻擊者詳細資料:"  
  Ts.writeline   "攻擊者IP地址:"&strip
  Ts.writeline   "攻擊者端口:"&strport
  Ts.writeline   "客戶端機器的相關環境:"&struser
  Ts.writeline   "攻擊時間:"&strtime
  Ts.writeline   "攻擊頁面:"&burl
  Ts.writeline   "攻擊語句:"&strwords
  Ts.writeline   "----------------------------------------"  
  TS.Writeline   "" 
  '   Create   a   session   varialbe   to   check   next   time   for   ValidEntry  
  Session("LogIn")   =   "yes"  
  Set   TS   =   Nothing  
  Set   FSO   =   Nothing  
  End   If

Response.Write "<Script Language=javaScript>alert('系統提示↓/n/n請不要輸入非法字符["&bqs&"]嘗試注入!/n/n您的IP["&strip&":"&strport&"]將被本站禁止!/n/n如有疑問請聯系管理員QQ:xxxxxx');top.location.href='/forum/index.asp';</Script>"
Response.end
end If
%>


上一篇:asp模板引擎

下一篇:ASP服務器簡單探針

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 梁河县| 井研县| 楚雄市| 滁州市| 郓城县| 宁武县| 沈阳市| 古田县| 永川市| 射洪县| 广河县| 达拉特旗| 韶山市| 昌宁县| 沙坪坝区| 康定县| 葫芦岛市| 修文县| 巨野县| 双峰县| 灵寿县| 汶川县| 营口市| 汝阳县| 安国市| 通城县| 阳西县| 缙云县| 蒲江县| 商南县| 克拉玛依市| 栾川县| 佳木斯市| 鄂州市| 常熟市| 昭平县| 伊金霍洛旗| 峨眉山市| 唐山市| 盈江县| 平江县|