Last active
September 28, 2018 22:39
-
-
Save faidamine/55a16227bffd74b4f150e02841d4d8d4 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/python | |
#Faid Mohammed Amine | |
#Fb : piratuer | |
import commands | |
############### HackCon CTF 2017 - Rev 50 - KeyGen | |
def get_nums(dic): | |
for key in range(11,99): | |
res = commands.getstatusoutput('echo "'+str(key)+'" | ltrace -o data -e strncmp ./match_me') | |
text=open('data') | |
letter=str(text.read().split('"')[3])[0].lower() | |
dic[letter] = key | |
return dic | |
cipher = "firhfgferfibbqlkdfhh" | |
passwd = "" | |
dico = {} | |
get_nums(dico) | |
for a in cipher: | |
passwd += str(dico[a]) | |
print passwd | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment