cyber-security-resources/exploit_development/sockets_example.py

26 lines
465 B
Python
Raw Permalink Normal View History

2022-02-21 11:25:45 -05:00
import socket
import sys
import threading
import struct
IP = "127.0.0.1"
PORT=8080
jmpesp = ????
offset = ????
buf = ????
payload = ????
payload = "POST %s\r\n\r\n" % payload
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.settimeout(2)
sock.connect((IP,PORT))
sock.send(payload)
print "Buffer sent! (len %d)" % len(payload)
try:
print sock.recv(4096)
print "No crash...."
except:
print "Server died, Yayyyy!!"