SQL injection UNION attack, determining the number of columns returned by the query
![](https://blog.esna.tech/wp-content/uploads/2023/01/1-6-1024x763.jpg)
sqli 3問目、union atackで、カラム数をNULLを使って調べる問題
/filter?category=xxx のリクエストをヒストリーで確認
repeaterに。
![](https://blog.esna.tech/wp-content/uploads/2023/01/2-4-1024x748.jpg)
categoryパラメータを
‘+UNION+SELECT+NULL,NULL–
エラーなくなるまで、NULLを足していく
‘+UNION+SELECT+NULL,NULL,NULL–
NLLL 3つでエラー消えました
ということで、カラムは3つ!
![](https://blog.esna.tech/wp-content/uploads/2023/01/3-4-1024x771.jpg)
クリアされている
このsqliをburp scanで検知できる?
上のリクエストを、右クリックで do active scan
![](https://blog.esna.tech/wp-content/uploads/2023/01/4-2-1024x749.jpg)
すぐ検知できました
scanは、’ と ” で判定しているよう(今回のケースでは
sqlmapも試しましたが、エラー吐きます
他のテストサイトなら動いたけど、オプション違うのかな
![](https://blog.esna.tech/wp-content/uploads/2023/01/5-2.jpg)
python sqlmap.py -u “xxxx.web-security-academy.net/filter?category=aa” –cookie “session=xxxxxxxxxxxxxxxxxxxx” –tables
[CRITICAL] all tested parameters do not appear to be injectable.
–)v
コメント