Practical 14: DVWA Tool

===== SOURCE: Pract_14_DVWA _Tool (1).docx =====

Practical 14: DVWA Tool
Aim:Penetration Testing with DVWA(Damn Vulnerable Web Application)


SQL Injection command
SQL Injection is a type of attack where an attacker tricks a website into running harmful database commands by inserting malicious code into input fields, like login forms or search boxes. If the website doesn’t properly filter user input, the attacker can access, modify, or even delete data from the database.
For the SQL Injection attack, I tried a basic SQLi payload to check if the website is vulnerable
Like: ‘ OR ‘1’=’1' —
“ OR “1”=”1" —
‘ OR ‘1’=’1'#

Some of these payloads resulted in errors, while others successfully executed the attack, bypassing authentication and returning database values. This confirms that the application is vulnerable to SQL Injection. 

 

SQL Injection (Blind):
Blind SQL Injection is a sneaky hacking technique where attackers extract data from a database even when error messages are hidden. Unlike regular SQL injection, you don’t see direct results — instead, you infer information bit by bit through true/false questions.

What is different here versus the previous SQLi attack, is that instead of data as an output we only get a TRUE, i.e., User ID exists in the database., or a FALSE, i.e., User ID is MISSING from the database., message which indicates if our query worked or not. 

3. DOM-Based Cross-Site Scripting (XSS) : 
DOM-Based Cross-Site Scripting (XSS) is a type of XSS attack where the vulnerability exists in the client-side script rather than the server. It happens when JavaScript modifies the DOM (Document Object Model) based on untrusted user input, allowing an attacker to inject malicious scripts.
For example, if a website takes input from the URL and inserts it into the page without proper validation, an attacker can craft a URL with a malicious script. When a victim opens the URL, the script executes in their browser, potentially stealing cookies, redirecting them, or performing other malicious actions.
We can see that there is the URL parameter
We can check if a XSS vulnerability exists by passing a very simple payload: <script>alert(document.cookie)</script> 
The payload “alert(document.cookie)” is a JavaScript function that retrieves the user’s cookies and displays them in an alert box.“document.cookie” contains all the cookies stored for the current domain.


we will have received the victim’s cookie. 

4. File Upload
It doesnt check that file contain a virus or not and directly uploads to the server.

5. CSRF
A Cross-Site Request Forgery (CSRF) attack in DVWA (Damn Vulnerable Web Application) tricks an authenticated user's browser into executing an unwanted action—such as changing their password—on the target site without their consent. 
Cross-Site Request Forgery (CSRF) occurs when an attacker tricks a user into performing actions on a web application where they’re already authenticated. Without proper request verification, attackers can exploit the user’s session to execute unauthorized actions like changing settings or making purchases. Effective CSRF prevention involves using anti-CSRF tokens, checking request origins, and sometimes requiring re-authentication for high-risk actions.

LAB SAFETY: Perform security testing only on systems, accounts, and networks you own or have explicit permission to test. Use isolated training targets and follow instructor directions.