Dvwa
Dvwa
Introduction :-
Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is
damn vulnerable. Its main goals are to be an aid for security professionals to test their
skills and tools in a legal environment, help web developers better understand the
processes of securing web applications and aid teachers/students to teach/learn web
application security in a class room environment. Damn Vulnerable Web Application
(DVWA) is a RandomStorm OpenSource project. For further details about the services
and products RandomStorm offer please visit; http://www.randomstorm.com. The
DVWA project started in December 2008 and has steadily grown in popularity. It is
now used by thousands of security professionals, students and teachers world wide.
DVWA is now included in popular penetration testing Linux distributions such as
Samurai Web Testing Framework and many others.
Vulnerabilities
DVWA as the name suggests is vulnerable to the most common types of web
application vulnerabilities. DVWA incorporates most of the Open Web Application
Security Project's (OWASP) top 10 web application security risks for 2010 as
reported in the OWASP TOP 10 document.
https://owasp.org/www-pdf-archive/OWASP_Top_10_-_2010.pdf
The OWASP Top 10 Web Application Security Risks for 2010 are:
A1: Injection
A2: Cross-Site Scripting (XSS)
A3: Broken Authentication and Session Management
A4: Insecure Direct Object References
A5: Cross-Site Request Forgery (CSRF)
A6: Security Misconfiguration
A7: Insecure Cryptographic Storage
A8: Failure to Restrict URL Access
A9: Insufficient Transport Layer Protection
A10: Unvalidated Redirects and Forwards
File Inclusion: Allows an ‘attacker’ to include remote/local files into the web
application.
Cross Site Scripting (XSS): An ‘attacker’ can inject their own scripts into the
web application/database. DVWA includes Reflected and Stored XSS.
Easter eggs: Full path Disclosure, Authentication bypass and some others.
(find them!
POC-1:-
POC-3(Command Execution):-
MITIGATIONS:-
Utilize or require strong passwords
Allow a limited number of login attempts
Employ the use of CAPTCHAs
Set time delays between attempts
Limit failed login attempts
http://192.168.234.134/dvwa/vulnerabilities/csrf/?
password_new=yuvi&password_conf=yuvi&Change=Change
After pasting the url in browser then the password will be changed
MITIGATION:-
Token Synchronization
Double-Submitting Cookies
Same-Site Cookies
Enabling User Interaction
Custom Headers for Requests
CSRF Mitigation with Bright Security
Now after running the following query ' or 1=2 union select user, password
from users# we will get the list of password hash to which we can easily de-
hash to know the password
MITIGATION
Filter database inputs
Restrict database code
Restrict database access
Maintain applications and databases
Monitor application and database inputs and communications
MITIGATION
Use parameterized queries to ensure that user input cannot interfere with the
structure of the intended SQL query.
Use secure coding practices, independent of the language.
Avoid dynamic SQL at all costs.
Filter inputs, restrict database code, restrict database access, maintain, and monitor
the application and database.
Stop writing dynamic queries with string concatenation.
Then after running this script we will get the session id that can be used for
session hijakcing
<script>alert(document.cookie)</script>
Copy this path and paste into the url we will get a new path
The above path from .php?cmd=cat+/etc/passwd we will get the password file
MITIGATION