Installation
Damn Vulnerable Web Services (DVWS) is a vulnerable web application that has various insecure web service elements. It provides a platform for learning about real-world web service vulnerabilities.
https://github.com/snoopysecurity/dvws
WSDL Enumeration
You can find the vulnerable component, service.php, by spidering DVWS using Burp Suite.
The SOAP service processes requests including _check_user_information_, _owasp_apitop10_, _population_ and _return_price_.
XPATH Injection
User Login:
| |
User Password:
| |
Command Injection
Original Request
Initially, the parameter value of _name_ is set to “find”.
Edited Request
By changing the parameter value of _name_ from “find” to “dir”, we can observe a different response.
Cross Site Tracing (XST)
DVWS indicates a vulnerability with the message “The NuSOAP Library service is vulnerable to a Cross-site scripting flaw.” Exploit DB provides a published exploit: (https://www.exploit-db.com/exploits/34565/)
Note: We modified the source code at \dvws\vulnerabilities\xst\xst.php because of an issue with cookie creation. The following code snippet was moved to the beginning of xst.php:
As noted by DVWS, the vulnerable page is /dvws/vulnerabilities/wsdlenum/service.php/
The following payload was used to carry out the XST attack:
| |
Changing the GET method to a TRACK method yields the following:
This results in cookie information disclosure.
The article “Penetration Testing with OWASP Top 10 - 2017 A7 Cross-Site Scripting (XSS)” provides a more in-depth look at XST.
REST API SQL Injection
| |
Extract Information
| |
Extract Table Name
| |
Extract Column Name
| |
Dump Data From Extracted Table and Column Names
| |
For a deeper dive into SQL Injection, refer to the article “_ Penetration Testing with OWASP Top 10 - 2017 A1 Injection_.”
XML External Entity 2
| |
Request
Response
JSON Web Token (JWT) Secret Key Brute Force
The correct secret key, 1234567890, has been successfully identified.
Same Origin Method Execution (SOME)
Cross-Origin Resource Sharing (CORS)
Checking for Arbitrary Origin Trust
Request
The Origin request header is modified to “http://xyz.com”.
Response
The response shows that the application permits access from all domains (including the arbitrary origin http://xyz.com).
The presence of the Access-Control-Allow-Credentials: true response header indicates that unauthorized third-party websites might be able to execute privileged operations and access sensitive data.
Content of cors_poc.html
| |
Request
Response
[![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVWZDD0nOsM2CYCrtQajPhOT16sgofIDHUfMaOOZGYmG-AUjPlcE7BrBUMo8-eWHNvr85Lkf