-
-
Save ahmed-bhs/7d15236d16efcd234d43a68b0e207d13 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import requests | |
import qrtools | |
import re,os | |
from shell_command import shell_call | |
shell_call("rm -f *.png") | |
def decode_qr(r): | |
img="http://35.184.20.243:8002/qrweb/img/"+r | |
os.system("curl "+img+" >> "+r) | |
qr = qrtools.QR() | |
qr.decode(r) | |
return qr.data | |
def qr(im_reg): | |
qrqr='' | |
for im in im_reg: | |
q=decode_qr(im) | |
qrqr = qrqr + q | |
return qrqr | |
url = 'http://35.184.20.243:8002/qrweb/index.php' | |
print "Sending answers... (this challenge takes some time...)" | |
s = requests.Session() | |
r=s.get(url) | |
while True: | |
q = qr(re.findall(r"\d+.png",r.text)) | |
r=s.post('http://35.184.20.243:8002/qrweb/validate.php', data={"qr": q ,'submit':'Submit+query'}) | |
if 'CTF' in r.text : | |
print(r.text) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment