Information#
Version#
By | Version | Comment |
---|---|---|
noraj | 1.0 | Creation |
CTF#
- Name : Insomni'hack teaser 2017
- Website : teaser.insomnihack.ch
- Type : Online
- Format : Jeopardy
- CTF Time : link
Description#
cryptoquizz - Misc/Crypto - 50 pts - realized by cryptopathe
Hello, young hacker. Are you ready to fight rogue machines ? Now, you'll have to prove us that you are a genuine cryptographer.
Running on quizz.teaser.insomnihack.ch:1031
Solution#
Goal: In this challenge, a server a get us a name (of a famous cryptographer) and we have to find his/her birth year. Then we must send the year to the server and do it again for others cryptographers until we get the flag.
To find the year of someone famous it is possible to use the Wikimedia API. I tried the API sandbox and figured that it was difficult to use it manually.
The wikimedia API works for all the Wikimedia Fundation entities, for example: Wikipedia, Wikidata,...
As we only want the birt year of the cryptographer we should prefer to use Wikidata instead of wikipedia, there is less data to parse.
As I like ruby for scripting, I chose to use a ruby gem: a Wikidata API Client named wikidata-client. Here is the documentation.
Fist I only looked for the first person of the result. But I had soem wrong asnwer. Because the server is giving wrong or partial name. For example the server give Ross Anderson but there are:
- Ross Anderson an alpine skier
- Ross Anderson a swimmer
- Ross J. Anderson a computer scientist, cryptographer
Another example is the server also giving diminutive or nickname like Ron Rivest for Ronald Rivest. This is not a problem for Ronald but with Jim Massey this is. There is a cryptographer named James Lee Massey and his nickname Jimmy Massey and the diminutive of Jimmy is Jim. Problem is that the real Jim Massey is a comics writer and the server is giving a diminutive of a nickname of James Lee Massey...
So I had to create a homonym avoidance by checking the occupation of the person but this function takes too much time as it needs more requests and regex. So I finally disabled this function because it was making my requests timed out. So I had to run my script several and have the luck not to search for ambiguous name and to finally get the flag.
Here is my ruby script:
Here is the output of the script:
Flag was: INS{GENUINE_CRYPTOGRAPHER_BUT_NOT_YET_A_PROVEN_SKILLED_ONE}
.
Opinion: I don't kniw if cryptopathe (challenge's author) did it on purpose to make it harder or did it unintentionally because he/she didn't checked his/her challenge and used a crappy data set, but giving wrong, partial, diminutive, nickname is very problematic for searches. I think this is not a well written challenge.