GOAL : To solve the lab, perform a SQL injection attack that causes the application to display details of all products in any category, both released and unreleased.
์ฃผ์ ์ฒ๋ฆฌ๋ฅผ ํ๋๊น ์๋ก์ด ์ํ์ด ๋ณด์ธ๋ค.(+ ๋ด๊ฐ ์นดํ ๊ณ ๋ฆฌ ๋ค์ ์ด ๊ฐ์ด ๊ทธ๋๋ก ์ถ๋ ฅ๋๋ค.. -> ์ ๋ณด๋ฅผ ์ฌ๊ธฐ์ ์ถ๋ ฅํ ์๋ ์์ ๋ฏ) ์๋ง ์ด ์ด์ ๋ SQL ๊ตฌ๋ฌธ์ WHERE Categories='Gifts' AND ??? ์ด๋ฐ์์ผ๋ก ์์ด์ ํด๋นํ๋ ์ ๋ค๋ง ๊ฐ์ ธ์๋๋ฐ ์์ ์ฃผ์ ์ฒ๋ฆฌํ๋๊น ๊ทธ ์กฐ๊ฑด(๋ญ์ง ๋ชจ๋ฅด์ง๋ง)์ ์ ์ธํ ์ ๋ค๋ ๋ค ๋ณด์ฌ์ฃผ๋ ๋ฏ (์ฆ AND๋ถํฐ ๋ค ๋ ๋ผ๊ฐ๋๊ฑฐ)
์ด๋ฐ์์ผ๋ก ๊ฑ ์ฃผ์๋ง ์์ ๋ด๋ ์๋ก์ด ์ ๋ณด๋ฅผ ํ๋ํ ์๋ ์์๊ฒ ๊ฐ๋ค ํญ์ where์ ์ด where ๋ณ์ = ใ ใ ์ด๋ฐ์์ผ๋ก๋ง ๋๋๋๊ฒ ์๋ํ ๋๊น ใ ใ
null์ union์์ ์ฐ๋ ์ด์ ? -> null๋ ๋ชจ๋ ๋ฐ์ดํฐ ํ์ ์ด๋ compatibleํ๊ธฐ ๋๋ฌธ์ ๋ฐ๋ก ๋ฐ์ดํฐ ํ์ ์ ์ํ ์ค๋ฅ๋ฅผ ํผํ ์ ์๋ค.(ํ์ง๋ง NullPointerException ๋๋ ๊ฒฝ์ฐ๋ ์์ผ๋๊น ์กฐ์ฌ)
์ ์ฌ์ดํธ์์ null ๋์ 1,1,1,1,1,1,1,1 ํด์คฌ์ ๋๋ ์๋ฒ ์ค๋ฅ๊ฐ ๋ด๋ค. ์๋ง integer(1)์ด๋ compatibleํ์ง ์์ column์ด ์์ด์์ผ ๊ฒ์ผ๋ก ๋ณด์ธ๋ค.
์ฐธ๊ณ ๋ก Oracle์์๋ select ๋ฌธ์ ํ ๋ ๋ฌด์กฐ๊ฑด from์ ํด์ ํ ์ด๋ธ๋ช ์ ํฌํจ์์ผ์ฃผ์ด์ผํ๋ค. ์ด๋ ์ฐ์ด๋ ํ ์ด๋ธ์ด dual ํ ์ด๋ธ์ด๋ค!
On Oracle databases, every SELECT statement must specify a table to select FROM. If your UNION SELECT attack does not query from a table, you will still need to include the FROM keyword followed by a valid table name.
There is a built-in table on Oracle called dual which you can use for this purpose. For example: UNION SELECT 'abc' FROM dual
'๐ Security > Web' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋๋ฆผํต(Dreamhack)] xss-1 (0) | 2023.09.22 |
---|---|
[BurpSuite] Cluster Bomb Attack (0) | 2023.03.06 |
[BurpSuite] Intruder ๊ธฐ๋ฅ ์์ ๊ณต๊ฒฉ๋ค ์ ๋ฆฌ (0) | 2023.03.03 |
[SQL Injection ํ] ๋ด๊ฐ ์ถ์ธกํ ๋ฉํ์ ๋ณด(ํ ์ด๋ธ๋ช /์นผ๋ผ๋ช ๋ฑ)์ด ๋ง๋์ง ํ์ธํ๋ ๋ฐฉ๋ฒ (0) | 2023.03.02 |
[์นํดํน ์ ๋ฌธ ์๋ฆฌ์ฆ (1)] BurpSuite ์ฌ์ฉ๋ฒ (0) | 2023.02.10 |