Skip to content

Instantly share code, notes, and snippets.

@faidamine
Last active September 28, 2018 22:39
Show Gist options
  • Save faidamine/55a16227bffd74b4f150e02841d4d8d4 to your computer and use it in GitHub Desktop.
Save faidamine/55a16227bffd74b4f150e02841d4d8d4 to your computer and use it in GitHub Desktop.
#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