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
5a0bea6b
🤬
Sign In
Create bin2shell.py
Manish Sharma
committed with
GitHub
2 years ago
5a0bea6b
1 parent
a149e80d
Total 1 files
■ ■ ■ ■ ■ ■
Shellcode/Bin2shellcode/bin2shell.py
1
+
#!/usr/bin/env python
2
+
import sys
3
+
if __name__ == "__main__":
4
+
if len(sys.argv) < 2:
5
+
print "usage: %s file.bin\n" % (sys.argv[0],)
6
+
sys.exit(0)
7
+
8
+
shellcode = "\""
9
+
ctr = 1
10
+
maxlen = 15
11
+
12
+
for b in open(sys.argv[1], "rb").read():
13
+
shellcode += "\\x" + b.encode("hex")
14
+
if ctr == maxlen:
15
+
shellcode += "\" +\n\""
16
+
ctr = 0
17
+
ctr += 1
18
+
shellcode += "\""
19
+
print shellcode
20
+
All occurrences
Please wait...
Page is in error, reload to recover