Skip to content

Instantly share code, notes, and snippets.

@marcosValle
Last active January 22, 2017 18:37
Show Gist options
  • Save marcosValle/ccb3cecc1c2203740baca431630037e9 to your computer and use it in GitHub Desktop.
Save marcosValle/ccb3cecc1c2203740baca431630037e9 to your computer and use it in GitHub Desktop.
cryptoquizz - Misc/Crypto - 50 pt
from pwn import *
import wptools
def getName(conn):
print(conn.recvuntil('What is the birth year of ').decode('utf-8'), end="")
name = conn.recvuntil(' ?', drop=True)
print(name.decode('utf-8'))
return name, conn
def getYear(name):
year = wptools.page(name)
year.get_wikidata()
return year.wikidata['birth']
conn = remote('quizz.teaser.insomnihack.ch',1031)
name, conn = getName(conn)
name = name.decode('utf-8')
year = getYear(name)
year = year[1:5]
print(year)
conn.sendline(year)
'''
[+] Opening connection to quizz.teaser.insomnihack.ch on port 1031: Done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ Hello, young hacker. Are you ready to fight rogue machines ? ~~
~~ Now, you'll have to prove us that you are a genuine ~~
~~ cryptographer. ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ What is the birth year of Markus Jakobsson
Markus_Jakobsson (en)
{
lang: en
title: Markus_Jakobsson
}
www.wikidata.org (wikidata) Markus_Jakobsson
www.wikidata.org (claims) Q5
Markus_Jakobsson (en)
{
cache: <dict(2)> {claims, wikidata}
claims: <dict(1)> {Q5}
description: American computer security researcher, entrepreneur and writer
label: Markus Jakobsson
lang: en
modified: <dict(1)> {wikidata}
props: <dict(2)> {P31, P569}
title: Markus_Jakobsson
what: human
wikibase: Q16204679
wikidata: <dict(2)> {birth, instance}
wikidata_url: https://www.wikidata.org/wiki/Q16204679
}
1968
[*] Closed connection to quizz.teaser.insomnihack.ch port 1031
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment