การฉีดต่อต้าน -sql ที่แข็งแกร่งเก็บรวบรวมมานานแล้วดีมากมิฉะนั้นจะไม่ถูกส่งไปยังทุกคนใช่!
รหัสโปรแกรม
-
'ระบบป้องกัน -
Dim Bqs, Berrc, Biii, Burl
bqs = request.serverVariables (query_string)
หาก request.serverVariables (https) = ปิดจากนั้น burl = http: // else burl = https: // end ถ้า
burl = burl & request.serverVariables (server_name)
หาก request.serverVariables (server_port) <> 80 จากนั้น burl = burl &: & request.serverVariables (server_port) สิ้นสุดถ้า
BURL = BURL & Request.ServerVariables (URL)
ถ้า request.QueryString <> burl = burl &? & request.qurystring สิ้นสุดถ้า
'burl = request.serverVariables (URL)
Dim Bnothis (61)
Bnothis (0) = ผู้ใช้สุทธิ
bnothis (1) =@a
Bnothis (2) =/เพิ่ม
bnothis (3) = exec%20master.dbo.xp_cmdshell
Bnothis (4) = ผู้ดูแลระบบ LocalGroup สุทธิ
Bnothis (5) = เลือก
Bnothis (6) = นับ
Bnothis (7) = ASC
Bnothis (8) = Char
Bnothis (9) = กลาง
Bnothis (10) = cscript.exe
Bnothis (11) = ประกาศ
Bnothis (12) = แทรก
Bnothis (13) = ลบ
Bnothis (14) = หล่น
Bnothis (15) = ตัดทอน
bnothis (16) = wscript.shell
Bnothis (17) =%20
Bnothis (18) =
Bnothis (19) = สคริปต์
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_password
bnothis (30) = exec master.dbo.sp_addsrvrolemember
Bnothis (31) = สร้าง
Bnothis (32) = exec xp_reg
Bnothis (33) = สำรองข้อมูล
Bnothis (34) = Net localgroup administic
Bnothis (35) = ASC
Bnothis (36) =+dir+
Bnothis (37) = Drop Table
bnothis (38) = exec master.dboard
Bnothis (39) = master.dboard
bnothis (40) = master.dbo.xp_regwrite
bnothis (41) = master.dbo.sysdatabases
Bnothis (42) = ประกาศ
bnothis (43) = exec sp_oacreate
bnothis (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_regremovemultistic
Bnothis (59) = xp_regwrite
Bnothis (60) = แทรกเข้าไปใน
Bnothis (61) =
berrc = false
สำหรับ biii = 0 ถึง Ubound (Bnothis)
ถ้า instr (bqs, bnothis (biii)) <> 0 หรือ instr (burl, bnothis (biii)) <> 0 จากนั้น
berrc = true
สิ้นสุดถ้า
ต่อไป
ถ้า berrc แล้ว
ลื่น
validentry = true
ถ้าไม่ใช่ ismpty (เซสชัน (เข้าสู่ระบบ)) ค่า = false
ถ้า Validentry แล้ว
การขึ้นรูป const = 8
const create = true
สลัว fso
Dim Ts
Dim Myfilename
'Dim Strlog
Dim Strtime, Strip, Strwords, Struse, Strport
myFilename = server.mappath (/visited_forum.txt)
ตั้งค่า fso = server.createObject (scripting.filesystemobject_100502)
ตั้งค่า ts = fso.opentextfile (myfilename, forappending, สร้าง)
strip = request.serverVariables (remote_addr) &
ถ้า strip = ดังนั้น
strip = request.serverVariables (http_x_forwardded_for) & for) &
สิ้นสุดถ้า
stort = request.serverVariables (remote_port)
strwords = request.serverVariables (query_string)
strtime = ตอนนี้ ()
struser = request.serverVariables (http_user_agent)
'เขียนข้อมูลปัจจุบันเพื่อบันทึกไฟล์ข้อความ
รายละเอียดของผู้โจมตี TS.Writeline:
TS.WriteLine Attacker ที่อยู่ IP: & Strip
TS.Writeline Attainer Port: & stort
TS.WriteLine Client Machine สภาพแวดล้อมที่เกี่ยวข้อง: & Struser
เวลาโจมตี TS.Writeline: & Strongime
หน้าการโจมตี TS.Writeline: & Burl
คำสั่งการโจมตี TS.Writeline: & Strongs
TS.WriteLine ------------------------------------------- ------------------------------------------------------ ---------------------------------
ts.writeline
'สร้าง Varialbe เซสชันเพื่อตรวจสอบในครั้งต่อไปสำหรับการประเมินค่า
เซสชัน (เข้าสู่ระบบ) = ใช่
ตั้งค่า ts = ไม่มีอะไร
ตั้งค่า fso = ไม่มีอะไร
สิ้นสุดถ้า
Response.write <ภาษาสคริปต์ = JavaScript> การแจ้งเตือน ('ระบบพรอมต์↓/n/n โปรดอย่าป้อนอักขระที่ผิดกฎหมาย [& bqs &] เพื่อลอง!/n/n ip [& strip &: & strport &] จะเป็น ถูกแบน!/n/n หากคุณมีคำถามใด ๆ โปรดติดต่อผู้ดูแลระบบ QQ: XXXXXX ');
Response.end
สิ้นสุดถ้า
-