crash.software
Projects
Pull Requests
Issues
Builds
ticofookfook
Code
Files
Commits
Branches
Tags
Pull Requests
Code Comments
Code Compare
Issues
List
Boards
Milestones
Builds
Statistics
Contributions
Source Lines
Child Projects
Projects
STRLCPY
ticofookfook
Commits
c838876c
🤬
Sign In
Create bin2shell.py
Manish Sharma
committed with
GitHub
2 years ago
c838876c
1 parent
9d1f8c39
Total 1 files
■ ■ ■ ■ ■ ■
Shellcode/bin2shell/bin2shell.py
1
+
#!/usr/bin/env python
2
+
3
+
import sys
4
+
5
+
if __name__ == "__main__":
6
+
if len(sys.argv) < 2:
7
+
print "usage: %s file.bin\n" % (sys.argv[0],)
8
+
sys.exit(0)
9
+
10
+
shellcode = "\""
11
+
ctr = 1
12
+
maxlen = 15
13
+
14
+
for b in open(sys.argv[1], "rb").read():
15
+
shellcode += "\\x" + b.encode("hex")
16
+
if ctr == maxlen:
17
+
shellcode += "\" +\n\""
18
+
ctr = 0
19
+
ctr += 1
20
+
shellcode += "\""
21
+
print shellcode
22
+
All occurrences
Please wait...
Page is in error, reload to recover