Lab 4 Manual SQL Injection, John The Ripper
Lab 4 Manual SQL Injection, John The Ripper
CONTACT US
|SECURITY TOOLS >> Damn Vulnerable Web App >> DVWA v1.0.7 >> Current Page |Views:
114383
Pre-Requisite Lab
Damn Vulnerable Web App (DVWA): Lesson 1: How to Install DVWA in Fedora 14
Lab Notes
In this lab we will do the following:
1. We use inject always true SQL statements into the SQL
Injection User ID field with security set to low.
2. We will obtain the username and raw-MD5 password contents
from the users table.
3. We will use John the Ripper to crack the raw-MD5 password
HASH for each user.
Legal Disclaimer
As a condition of your use of this Web site, you warrant to
computersecuritystudent.com that you will not use this Web site
for any purpose that is unlawful or that is prohibited by these
terms, conditions, and notices.
In accordance with UCC § 2-316, this product is provided with "no
warranties, either expressed or implied." The information
contained is provided "as-is", with "no guarantee of
merchantability."
In addition, this is a teaching website that does not condone
malicious behavior of any kind.
Your are on notice, that continuing and/or using this lab outside
your "own" test environment is considered malicious and is
against the law.
© 2012 No content replication of any kind is allowed without
express written permission.
2. Get IP Address
Instructions:
1. ifconfig -a
Notes(FYI):
As indicated below, my IP address is 192.168.1.105.
Please record your IP address.
Section 7: Login to DVWA
1. Start Firefox
Instructions:
1. Click on Firefox
2. Login to DVWA
Instructions:
1. Start up Firefox on BackTrack
2. Place http://192.168.1.106/dvwa/login.php in the address bar.
Replace 192.168.1.106 with Fedora's IP address obtained
in (Section 3, Step 3).
3. Login: admin
4. Password: password
5. Click on Login
Section 8: Set Security Level
1. Set DVWA Security Level
Instructions:
1. Click on DVWA Security, in the left hand menu.
2. Select "low"
3. Click Submit
Section 9: Manual SQL Injection
1. SQL Injection Menu
Instructions:
1. Select "SQL Injection" from the left navigation menu.
2. Basic Injection
Instructions:
1. Input "1" into the text box.
2. Click Submit.
3. Note, webpage/code is supposed to print ID, First name, and
Surname to the screen.
Notes(FYI):
Below is the PHP select statement that we will be exploiting,
specifically $id.
$getid = "SELECT first_name, last_name FROM users WHERE user_id =
'$id'";
10. Display all the columns field contents in the information_schema user
table
Instructions:
1. Input the below text into the User ID Textbox (See Picture).
%' and 1=0 union select null, concat(first_name,0x0a,last_name,0x0a,user,0x0a,password)
from users #
2. Click Submit
Notes(FYI):
Now we have successfully displayed all the necessary
authentication information into this database.
Section 10: Create Password Hash File
1. Create Password Hash File
Instructions:
1. Highlight both admin and the password hash
2. Right Click
3. Copy
2. Open Notepad
Instructions:
1. Applications --> Wine --> Programs --> Accessories -->
Notepad
3. Paste in Notepad
Instructions:
1. Edit --> Paste
4. Format in Notepad
Instructions:
1. Place a ":" immediately after admin
2. Make sure your cursor is immediately after the ":" and hit
the delete button.
3. Now you should see the user admin and the password hash
separated by a ":" on the same line.
4. Cut the username and password combinations for gordonb, 1337,
pablo, and smitty from (Section 11, Step 1) and paste in this
file as well.
5. Save in Notepad
Instructions:
1. Navigate to --> /pentest/passwords/john
2. Name the file name --> dvwa_password.txt
3. Click Save
Section 11: Proof of Lab Using John the Ripper
1. Proof of Lab
Instructions:
1. Bring up a new terminal, see (Section 7, Step 1)
2. cd /pentest/passwords/john
3. ./john --format=raw-MD5 dvwa_password.txt
4. date
5. echo "Your Name"
Replace the string "Your Name" with your actual name.
e.g., echo "John Gray"
Proof of Lab Instructions:
1. Do a <PrtScn>
2. Paste into a word document
3. Upload to Moodle