{"id":553,"date":"2017-06-03T14:40:03","date_gmt":"2017-06-03T14:40:03","guid":{"rendered":"http:\/\/sigterm.ch\/?p=553"},"modified":"2017-06-03T14:40:03","modified_gmt":"2017-06-03T14:40:03","slug":"hackyeaster-2017-write-up","status":"publish","type":"post","link":"https:\/\/sigterm.ch\/?p=553","title":{"rendered":"HackyEaster 2017 write-up"},"content":{"rendered":"<p>Easter 2017 &#8211; means new HackyEaster challenges are online. The challenges were easier than the ones on Hackvent 2016. For HackyEaster\u00a0all challenges are released at once and it does not matter in what time-frame the challenges are solved, this makes the CTF much less stressful than Hackvent. I\u00a0solved my last challenge on April 16th at 01:24 AM and completed the CTF after eleven\u00a0others did before me. Here is a screenshot of the ranking at the time I finished the last challenge.<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-559\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1-183x300.png\" alt=\"\" width=\"183\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1-183x300.png 183w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1-625x1024.png 625w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1-768x1259.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1-937x1536.png 937w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/Screenshot_20170416-105902-1.png 1025w\" sizes=\"auto, (max-width: 183px) 100vw, 183px\" \/><\/a><br \/>\nAfter the competition ended in total 53 hackers solved all challenges and got the full points.<br \/>\n<!--more--><\/p>\n<h1>01 &#8211; Puzzle this!<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-560 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_01-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_01-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_01.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions:\u00a0<span id=\"nofSolutions\">882<\/span><br \/>\nAn easy one to start with.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-561 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_01_task-274x300.png\" alt=\"\" width=\"274\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_01_task-274x300.png 274w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_01_task.png 614w\" sizes=\"auto, (max-width: 274px) 100vw, 274px\" \/><\/p>\n<h2>Solution<\/h2>\n<p>You could actually play the game by clicking on the fields. If you were able to solve it the QR code was revealed. I started to play the game but in the end finalized the QR code with gimp, as I was faster this way. \ud83d\ude42<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-564 size-full\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/gimp_magic-1.png\" alt=\"\" width=\"273\" height=\"259\" \/><\/p>\n<h1>02 &#8211; Lots of Dots<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-565 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_02-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_02-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_02.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: 647<br \/>\nThe dots in the following image contain a secret message. Can you find it?<br \/>\n(click to enlarge)<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-566 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots-300x45.png\" alt=\"\" width=\"300\" height=\"45\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots-300x45.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots-1024x154.png 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots-768x116.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots-1536x231.png 1536w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/dots-2048x309.png 2048w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Solution<\/h2>\n<p>While\u00a0examining the picture in Gimp I recognized\u00a0that the orange color has slight different specifications. The bigger dots are\u00a0RGB 232\/178\/97 and the small ones\u00a0RGB 232\/178\/98! To solve this challenge I selected one of the colors with the pipette and filled the background with it. Then I\u00a0used the &#8220;fuzzy select tool&#8221; to select a region based on the color. I just clicked somewhere inside the picture and the code was revealed:\u00a070 57 49 36 13 22 8 42<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-567 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots-300x66.png\" alt=\"\" width=\"300\" height=\"66\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots-300x66.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots-1024x224.png 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots-768x168.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots-1536x336.png 1536w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution_dots.png 1758w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h1>03 &#8211; Favorite Letters<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-568 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_03-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_03-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_03.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/Goo9ping\/\">Goo9ping<\/a><br \/>\nLevel: easy<br \/>\nSolutions: 802<br \/>\nFrancesca&#8217;s favourite letter is s<br \/>\nRiley&#8217;s favourite letter is o<br \/>\nEllie&#8217;s favourite letter is a<br \/>\nVince&#8217;s favourite letter is p<br \/>\nQuintain&#8217;s favourite letter is r<br \/>\nOtto&#8217;s favourite letter is i<br \/>\nDavid&#8217;s favourite letter is p<br \/>\nTom&#8217;s favourite letter is l<br \/>\nPaul&#8217;s favourite letter is e<br \/>\nUlrich&#8217;s favourite letter is y<br \/>\nHenry&#8217;s favourite letter is w<br \/>\nNorman&#8217;s favourite letter is h<br \/>\nLouis&#8217; favourite letter is i<br \/>\nZane&#8217;s favourite letter is s<br \/>\nYork&#8217;s favourite letter is c<br \/>\nBob&#8217;s favourite letter is h<br \/>\nMeave&#8217;s favourite letter is s<br \/>\nIan&#8217;s favourite letter is o<br \/>\nSidney&#8217;s favourite letter is g<br \/>\nGeorge&#8217;s favourite letter is s<br \/>\nKitty&#8217;s favourite letter is d<br \/>\nWilbert&#8217;s favourite letter is h<br \/>\nAdam&#8217;s favourite letter is t<br \/>\nXander&#8217;s favourite letter is i<br \/>\nCallum&#8217;s favourite letter is e<br \/>\nJack&#8217;s favourite letter is r<\/p>\n<h2>Solution<\/h2>\n<p>This challenge can be solved with bash in 1 line:<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ sort file.txt | grep -o '.$' | tr -d '\\012\\015'\nthepasswordishieroglyphics<\/pre>\n<h1>04 &#8211; Cool Car (mobile)<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-570 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_04-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_04-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_04.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: <span id=\"nofSolutions\">481<\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-571 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_11-38-51-251x300.jpg\" alt=\"\" width=\"251\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_11-38-51-251x300.jpg 251w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_11-38-51-857x1024.jpg 857w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_11-38-51-768x917.jpg 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_11-38-51.jpg 988w\" sizes=\"auto, (max-width: 251px) 100vw, 251px\" \/><\/p>\n<h2>Solution<\/h2>\n<p>I downloaded and decompiled the APK. The sensors are somehow used to change the graph in the mobile app. While browsing through the source code files I found interesting code-parts in two different files:<br \/>\n<strong>ps\/hacking\/hackyeaster\/android\/Activity.java:<\/strong><\/p>\n<pre class=\"wrap:true lang:java decode:true\">...\nif (l &gt;= 1000.0d) {\n    k = sha1(\"file:\/\/\/android_asset\/www\/index.html\");\n}\nthis.appView.loadUrl(\"javascript:sensorFeedback('{\\\"k\\\": \\\"\" + k + \"\\\", \\\"l\\\": \\\"\" + l + \"\\\"}')\");\n...<\/pre>\n<p><strong>assets\/www\/challenge04.html:<\/strong><\/p>\n<pre class=\"wrap:true lang:java decode:true\">...\nif (jsonResp.k) {\n    decryptScrambledEggWithKey(jsonResp.k);\n    clearInterval(intervalId);\n}\n...<\/pre>\n<p>This means &#8216;k&#8217; is the key to decrypt the scrambled egg, and &#8216;k&#8217; is nothing else than the sha1 sum of the string\u00a0&#8220;file:\/\/\/android_asset\/www\/index.html&#8221;. I rebuilt the java-script function which is used to decrypt the scrambled egg and got the QR code.<\/p>\n<pre class=\"wrap:true lang:xhtml decode:true\">&lt;html&gt;\n&lt;script type=\"text\/javascript\" src=\"js\/crypto-js\/aes.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"js\/crypto-js\/sha1.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"js\/crypto-js\/core-min.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"js\/crypto-js\/enc-base64-min.js\"&gt;&lt;\/script&gt;\n&lt;img class=\"eggImage\" id=\"scrambledEggImage\" \/&gt;&lt;br \/&gt;\n&lt;script&gt;\nscrambledEggCipher = 'U2FsdGVkX1+KZ3l0MlF......&lt;truncated&gt;......BCA5nYgqRIl7iA==';\ndecryptScrambledEggWithKey(\"d2d109036a07c1080a6e77e8063cebdc155f888b\");\nfunction decryptScrambledEggWithKey(key) {\n\tvar decrypted = CryptoJS.AES.decrypt(scrambledEggCipher, key);\n\tvar fin = 'data:image\/png;base64,' + CryptoJS.enc.Latin1.stringify(decrypted);\n\tconsole.log(fin);\n\tdocument.getElementById('scrambledEggImage')\n\t\t\t.setAttribute(\n\t\t\t\t\t'src',\n\t\t\t\t\t'data:image\/png;base64,'\n\t\t\t\t\t\t\t+ CryptoJS.enc.Latin1.stringify(decrypted));\n}\n&lt;\/script&gt;\n&lt;\/html&gt;<\/pre>\n<p>This html page then reveals the QR code:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-572 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution-04-288x300.png\" alt=\"\" width=\"288\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution-04-288x300.png 288w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution-04.png 623w\" sizes=\"auto, (max-width: 288px) 100vw, 288px\" \/><\/p>\n<h1>05 &#8211; Key Strokes<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-574 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_05-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_05-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_05.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: 532<\/p>\n<pre class=\"\">esc i c e l a n d esc a y a n k e e space f o x\nspace esc o f l o w e r up esc $ esc i y esc e esc a\ny esc \/ l a return esc r w esc right right right\nright esc x i f r esc e esc X x x : s \/ c e \/ a g i\nc \/ return esc down d d esc i m esc Z Z<\/pre>\n<h2>Solution<\/h2>\n<p>This one took me some time until I found out what to do with it. I first thought it&#8217;s a log from a keylogger. After thinking about where this could make sense, I finally figured out it is from the editor VI! After typing it exactly the way described I got the password:\u00a0<strong>magicwandfrankfoxy<\/strong>.<\/p>\n<h1>06 &#8211; Message to Ken<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-576 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_06-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_06-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_06.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: <span id=\"nofSolutions\">460<\/span><br \/>\nBarbie has written a secret message for her sweetheart Ken. Can you decrypt it?<\/p>\n<pre>Fabrgal JaeM Hsa faonah uiff;rnl tf btuxbrffuinhzoroyhitbM Fincta dd<\/pre>\n<p>Hint:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-588 size-full\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/barbie.png\" alt=\"\" width=\"181\" height=\"53\" \/><\/p>\n<h2>Solution<\/h2>\n<p>I had no clue what to do here. After googling for &#8220;barby encryption&#8221; I came across this interesting link:\u00a0<a href=\"https:\/\/www.pri.org\/stories\/2017-01-17\/barbie-typewriter-toys-had-secret-ability-encrypt-messages-they-didnt-think-girls#barbie-encoder\">Barbie typewriter encoding<\/a>! It even has an encoder on the website which works. The decoded string is:<br \/>\nBeloved Ken. The secret password is <strong>lipglosspartycocktail<\/strong>. Barbie xx<\/p>\n<h1>07 &#8211; Crypto for Rookies<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-577 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_07-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_07-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_07.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: <span id=\"nofSolutions\">458<\/span><br \/>\nThis crypto is not hard to crack.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-589 size-full\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/cryptoforrookies.png\" alt=\"\" width=\"284\" height=\"360\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/cryptoforrookies.png 284w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/cryptoforrookies-237x300.png 237w\" sizes=\"auto, (max-width: 284px) 100vw, 284px\" \/><\/p>\n<h2>Solution<\/h2>\n<p>&#8211; B O N T B B O K &#8211;&gt; <a href=\"http:\/\/www.dcode.fr\/dancing-men-cipher\">http:\/\/www.dcode.fr\/dancing-men-cipher<\/a><br \/>\n&#8211; B O N T E A O K &#8211;&gt; Base64 encoded<br \/>\n&#8211; B O N T E B R K &#8211;&gt; Index of the alphabet<br \/>\n&#8211; B A N T E B O K &#8211;&gt; Rot13<br \/>\n&#8211; C O N T E B O K &#8211;&gt; <a href=\"http:\/\/www.pruzkumnik.cz\/praxe\/sifry\/tabulky.html\">http:\/\/www.pruzkumnik.cz\/praxe\/sifry\/tabulky.html<\/a><br \/>\n&#8211; B O N T E B O A &#8211;&gt; Reverse string<br \/>\n&#8211; B O P T E B O K &#8211;&gt; Caesar (rot 3)<br \/>\n&#8211; B O N Y E B O K &#8211;&gt;\u00a0Character codes<br \/>\nAfter having decrypted all words we need to get the final password. If we keep the format exactly as in the picture and look at the columns and rows we see that in each column one character is different than the others. If we take all different characters from left to right we get the final password: <strong>CAPYBARA<\/strong><\/p>\n<h1>08 &#8211; Snd Mny (mobile)<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-579 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_08-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_08-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_08.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: 330<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-580 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-33-46-300x42.jpg\" alt=\"\" width=\"300\" height=\"42\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-33-46-300x42.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-33-46-768x107.jpg 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-33-46.jpg 987w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h2><strong>Solution<\/strong><\/h2>\n<p>Not much information here. I again worked with the decompiled APK and went through the code. In one java class I found what was needed to solve this challenge.<br \/>\n<strong>ps\/hacking\/hackyeaster\/android\/SndActivity.java<\/strong><\/p>\n<pre class=\"wrap:true lang:java decode:true\">...\nif (\"android.intent.action.SEND\".equals(action) &amp;&amp; type != null &amp;&amp; HTTP.PLAIN_TEXT_TYPE.equals(type)) {\n    String text = intent.getStringExtra(\"android.intent.extra.TEXT\");\n    if (text != null &amp;&amp; \"c95259de1fd719814daef8f1dc4bd64f9d885ff0\".equals(sha1(text.toLowerCase()))) {\n        ((TextView) findViewById(C0085R.id.sndTextView)).setText(\"Thank you!!\");\n...\n}\n...<\/pre>\n<p>We need to send an android action.SEND intent as PLAIN_TEXT_TYPE containing a text which matches\u00a0the sha1 hash &#8220;c95259de1fd719814daef8f1dc4bd64f9d885ff0&#8221;. Cracking the sha1 hash was easy as no salt was used. The needed text is &#8220;money&#8221;.<br \/>\nWe can send Android intents from the command line with ADB:<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">am [start|instrument]\nam start [-a &lt;action&gt;] [-d &lt;data_uri&gt;]\n[-t &lt;mime_type&gt;] [-c &lt;category&gt; [-c &lt;category&gt;] ...]\n[-e &lt;extra_key&gt; &lt;extra_value&gt;\n[-e &lt;extra_key&gt; &lt;extra_value&gt; ...]\n[-n &lt;component&gt;] [-D] [&lt;uri&gt;]\nam instrument [-e &lt;arg_name&gt; &lt;arg_value&gt;] [-p &lt;prof_file&gt;] [-w] &lt;component&gt;<\/pre>\n<p>I solved this challenge with the following two commands:<\/p>\n<pre class=\"wrap:true lang:sh decode:true \">$ adb shell\n$ am start -a android.intent.action.SEND -t \"text\/plain\" -e android.intent.extra.TEXT \"money\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-581 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-46-29-205x300.jpg\" alt=\"\" width=\"205\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-46-29-205x300.jpg 205w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-46-29.jpg 594w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><br \/>\nI over-engineered the solution for this challenge a bit, as it would have been possible to just share the text &#8220;money&#8221; with the app in Android to solve it. \ud83d\ude42<\/p>\n<h1>09 &#8211; Microscope (mobile)<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-582 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_09-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_09-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_09.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: easy<br \/>\nSolutions: 414<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-583 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-35-300x102.jpg\" alt=\"\" width=\"300\" height=\"102\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-35-300x102.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-35-768x261.jpg 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-35.jpg 1006w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/> <a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-42.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-584\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-42-169x300.jpg\" alt=\"\" width=\"169\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-42-169x300.jpg 169w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-42-576x1024.jpg 576w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-42.jpg 720w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a><\/p>\n<h2>Solution<\/h2>\n<p>Another mobile challenge, again I worked with the decompiled APK.<br \/>\n<strong>ps\/hacking\/hackyeaster\/android\/MicroscopeActivity.java<\/strong><\/p>\n<pre class=\"wrap:true lang:java decode:true \">...\nwebview.loadUrl(\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/challenge09_su6z47IoTT7.html\".replace('6', '5'));\n...<\/pre>\n<p>The URL gets changed because there is &#8220;.replace(&#8216;6&#8217;, &#8216;5&#8217;)&#8221; in the code. The QR Code is embedded in the website\u00a0<a href=\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/challenge09_su5z47IoTT7.html\">https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/challenge09_su5z47IoTT7.html<\/a>\u00a0and if we look at the HTML source code we can see the image is loaded from\u00a0<a href=\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/images\/challenge\/egg09_fs0sYle2SN.png\">https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/images\/challenge\/egg09_fs0sYle2SN.png<\/a>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-585 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg09_fs0sYle2SN-300x300.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg09_fs0sYle2SN-300x300.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg09_fs0sYle2SN-150x150.png 150w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg09_fs0sYle2SN.png 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h1>10 &#8211; An egg or not &#8230;<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-586 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_10-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_10-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_10.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/inik\/\">inik<\/a><br \/>\nLevel: medium<br \/>\nSolutions: <span id=\"nofSolutions\">233<\/span><br \/>\n&#8230; an egg, that&#8217;s the question!<br \/>\nAre you able to answer this question and find the (real) egg?<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/10_aneggornot.svg\" width=\"480\" height=\"480\" \/><\/p>\n<h2>Solution<\/h2>\n<p>Analyzing the SVG shows that there are duplicate coordinate declarations! In SVGs the last of the duplicated coordinates will be used, as it just overwrites existing locations with the new declarations. To solve this challenge, I wrote a python script which ignores duplicates if there is already a declaration for the coordinates.<\/p>\n<pre class=\"wrap:true lang:python decode:true \">from collections import Counter\nFILE = \".\/aneggornot.svg\"\nSOLUTION = \".\/solution.svg\"\ncontent = []\n'''\n    in the original svg file duplicate coordinate declarations are found!\n    in SVG files the last coordinates defined in the file will be used,\n    therefore in the original file duplicated lines at the end of the file will be used.\n    this challenge is solved by removing duplicate lines which come later, this will reveal the new QR code\n'''\nwith open(FILE) as f:\n    for i, line in enumerate(f):\n        item = line.split(\" \")\n        fnd = False\n        for c, x in enumerate(content):\n            if len(x) == 4 and len(item) == 4\\\n                    and item[1] == x[1] and item[2] == x[2]:\n                print(\"[+] Duplicate found - Don't use it in solution\")\n                fnd = True\n                break\n        if not fnd:\n            content.append(item)\nsolution = open(SOLUTION, 'w')\nfor line in content:\n    for x in line:\n        solution.write(\"%s \" % x)<\/pre>\n<p>Finally the solution looks like this:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/10_solution.svg\" width=\"480\" height=\"480\" \/><\/p>\n<h1>11 &#8211; Tweaked Tweet (mobile)<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-590 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_11-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_11-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_11.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: medium<br \/>\nSolutions: 108<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-592\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-47-205x300.jpg\" alt=\"\" width=\"205\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-47-205x300.jpg 205w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-47-701x1024.jpg 701w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-47-768x1122.jpg 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-47.jpg 876w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-591\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-38-300x253.jpg\" alt=\"\" width=\"300\" height=\"253\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-38-300x253.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-38-1024x864.jpg 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-38-768x648.jpg 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/photo_2017-04-23_12-51-38.jpg 1080w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h2>Solution<\/h2>\n<p>This was the\u00a0last mobile challenge. The only useful part I extracted from the APK was:<\/p>\n<pre class=\"wrap:true lang:java decode:true\">startActivity(new Intent(\"android.intent.action.VIEW\", Uri.parse(\"https:\/\/twitter.com\/intent\/tweet?text=%23%EF%BC%A8a%EF%BD%83%EF%BD%8By%CE%95%EF%BD%81ste%EF%BD%92%E2%80%A9201%EF%BC%97%E2%80%A9%E2%85%B0%EF%BD%93%E2%80%80a%E2%80%84l%EF%BD%8F%EF%BD%94%E2%80%80%CE%BFf%E2%80%89%EF%BD%86un%EF%BC%81%E2%80%A8%23%D1%81tf%E2%80%88%23%EF%BD%88%EF%BD%81%CF%B2king-lab\")));<\/pre>\n<p>This one almost drove my crazy!<br \/>\nI tried to find any suspicious pattern, like to identify standard ASCII characters and extended ASCII characters, mapping them to 0s and 1s, exclude all extended ones, exclude all standard ones, etc. In the end I was identifying\u00a0characters which were used as\u00a0some Unicode combinations instead of the standard, most simple way. But I did not come to any solution.. After wasting hours on this one I just googled for &#8220;Twitter steganography&#8221;. First link\u00a0<a href=\"http:\/\/holloway.co.nz\/steg\/\">http:\/\/holloway.co.nz\/steg\/<\/a>\u00a0hosts a converter which can be used to decode our message!!!<br \/>\nIf we enter our decoded string &#8220;#\uff28a\uff43\uff4by\u0395\uff41ste\uff52\u2029201\uff17\u2029\u2170\uff53\u2000a\u2004l\uff4f\uff54\u2000\u03bff\u2009\uff46un\uff01\u2028#\u0441tf\u2008#\uff48\uff41\u03f2king-lab&#8221; into the decoder on the website, we get the result:\u00a0<strong>st3g4isfunyo.<\/strong><br \/>\nStego is no fun yo \ud83d\ude41<\/p>\n<h1>12 &#8211; Once Upon a File<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-593\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_12-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_12-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_12.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/inik\/\">inik<\/a><br \/>\nLevel: medium<br \/>\nSolutions: <span id=\"nofSolutions\">252<\/span><br \/>\nOnce upon a <a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/12_onceupon.zip\">file<\/a> there was a hidden egg. It&#8217;s still waiting to be saved by a noble prince or princess.<\/p>\n<h2>Solution<\/h2>\n<p>&#8216;binwalk&#8217; is a tool to identify header information within a file. If multiple files are hidden in one single file, &#8216;binwalk&#8217; can identify and automatically extract these files. With &#8216;binwalk&#8217; this challenge is pretty easy to solve.<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ unzip 12_onceupon.zip\nArchive:  12_onceupon.zip\n  inflating: file\n$ binwalk -e file\nDECIMAL       HEXADECIMAL     DESCRIPTION\n--------------------------------------------------------------------------------\n36447         0x8E5F          Unix path: \/0\/1\/2\/3\/4\/5\/6\/7\/8\/9\/:\/;\/&lt;\/=\/&gt;\/?\/@\/A\/B\/C\/D\/E\/F\/G\/H\/I\/J\/K\/L\/M\/N\/O\/P\/Q\/R\/S\/T\/U\/V\/W\/X\/Y\/Z\/[\/\\\/]\/^\/_\/`\/a\/b\/c\/d\/e\/f\/g\/h\/i\/j\/k\/l\/m\/n\/o\n184320        0x2D000         Zip archive data, at least v2.0 to extract, compressed size: 439156, uncompressed size: 5242880, name: file\n623596        0x983EC         End of Zip archive\n$ cd _file.extracted\/\n$ ls\n2D000.zip  file\n$ binwalk -e file\nDECIMAL       HEXADECIMAL     DESCRIPTION\n--------------------------------------------------------------------------------\n36447         0x8E5F          Unix path: \/0\/1\/2\/3\/4\/5\/6\/7\/8\/9\/:\/;\/&lt;\/=\/&gt;\/?\/@\/A\/B\/C\/D\/E\/F\/G\/H\/I\/J\/K\/L\/M\/N\/O\/P\/Q\/R\/S\/T\/U\/V\/W\/X\/Y\/Z\/[\/\\\/]\/^\/_\/`\/a\/b\/c\/d\/e\/f\/g\/h\/i\/j\/k\/l\/m\/n\/o\n1093632       0x10B000        Microsoft Cabinet archive data, 17834 bytes, 1 file\n2832320       0x2B37C0        Microsoft Cabinet archive data, 17834 bytes, 1 file\n3116030       0x2F8BFE        Microsoft executable, MS-DOS\n3788479       0x39CEBF        mcrypt 2.2 encrypted data, algorithm: blowfish-448, mode: CBC, keymode: 8bit\n3793983       0x39E43F        mcrypt 2.2 encrypted data, algorithm: blowfish-448, mode: CBC, keymode: 8bit\n4477995       0x44542B        mcrypt 2.2 encrypted data, algorithm: blowfish-448, mode: CBC, keymode: SHA-1 hash\n5073287       0x4D6987        mcrypt 2.2 encrypted data, algorithm: blowfish-448, mode: CBC, keymode: 8bit\n5075359       0x4D719F        mcrypt 2.2 encrypted data, algorithm: blowfish-448, mode: CBC, keymode: 8bit\n5173248       0x4EF000        PNG image, 480 x 480, 8-bit colormap, non-interlaced\n5173767       0x4EF207        Zlib compressed data, best compression\n$ cd _file.extracted\/\n$ ls\n 10B000.cab   2B37C0.cab   4EF207   4EF207.zlib   egg12.png  'eg'$'\\t''Z2.png'\n<\/pre>\n<p>The QR code is in the file &#8216;egg12.png&#8217;.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-595\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg12-300x300.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg12-300x300.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg12-150x150.png 150w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg12.png 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h1>13 &#8211; Lost the Thread<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-596\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_13-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_13-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_13.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/CoderKiwi\/\">CoderKiwi<\/a><br \/>\nLevel: medium<br \/>\nSolutions: 126<br \/>\nSearching for eggs is fun! But sometimes they come in weird shapes and sizes. Download the image and wind up the strand!<br \/>\n<a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/13_thread.png\"><button class=\"downloadButton\" type=\"button\">Download the image<\/button><\/a><\/p>\n<h2>Solution<\/h2>\n<p>If we open the png with Gimp we can identify a pattern with two different shapes.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-597\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/thread_gimp-300x34.png\" alt=\"\" width=\"300\" height=\"34\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/thread_gimp-300x34.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/thread_gimp-1024x116.png 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/thread_gimp-768x87.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/thread_gimp.png 1383w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nOn first sight it looks like Morse-Code, but as there are only two different shapes it must be bits.<br \/>\nI wrote a python script which reads the pixels of the image. If a line is complete without interruption it is a 1. If the line is interrupted at the beginning by a transparent pixel it is a 0.<\/p>\n<pre class=\"wrap:true lang:python decode:true\">from PIL import Image\nim = Image.open('thread.png', 'r')\npixel_values = list(im.getdata())\nresult = \"\"\nfor c,x in enumerate(pixel_values):\n    if c &gt; 2 and pixel_values[c-2][3] == 255 or pixel_values[c-1][3] == 255:\n        #ignore\n        continue\n    if pixel_values[c][3] == 255 and pixel_values[c+1][3] == 0:\n        result += \"0\"\n    if pixel_values[c][3] == 255 and pixel_values[c+1][3] == 255:\n        result += \"1\"\nprint result<\/pre>\n<pre class=\"wrap:true lang:sh decode:true \">$ python2 solution.py\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111011111011111110000000010000010110110100000100000000101110100111001011101000000001011101001011010111010000000010111010100010101110100000000100000101010001000001000000001111111010101011111110000000000000000111100000000000000000111001101111111110011000000001110000101100100101010000000000111011110000101010100000000111000011110110011011000000000110101110000101100100000000000000000101000111100100000000111111100001100010001000000001000001010000101010000000000010111010010001011100000000000101110100010110010100000000001011101011101010101110000000010000010111111011100000000000111111101100100110001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000<\/pre>\n<p>The result string looks like it contains ASCII art. I replace all the &#8216;0&#8217; with &#8216;.&#8217; and all the &#8216;1&#8217; with Unicode blocks &#8216;\u2588&#8217;. If we play a bit with the editor, resize the window, we get the QR.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-598\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/solution.png\" alt=\"\" width=\"169\" height=\"203\" \/><br \/>\nWe scan the QR code we get the password &#8216;<strong>kiwisarekewl<\/strong>&#8216;.<\/p>\n<h1>14 &#8211; Shards<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-599\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_14-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_14-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_14.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: medium<br \/>\nSolutions: <span id=\"nofSolutions\">252<\/span><br \/>\nOh no! What a mess!<br \/>\n<a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/14_shards.zip\"><button class=\"downloadButton\" type=\"button\">Download the shards<\/button><\/a><\/p>\n<h2>Solution<\/h2>\n<p>We unzip the file and get 1600 files.<\/p>\n<pre class=\"wrap:true lang:sh decode:true \">$ ls | wc -l\n1601\n$ ls -u | head -10\nimg_4094_G_1385030273_12.png\nimg_4089_k_1402213399_12.png\nimg_4077_n_1752533258_19.png\nimg_4072_J_2017475834_21.png\nimg_4050_N_1946535358_21.png\nimg_4049_n_2125616175_23.png\nimg_4095_I_1080239564_26.png\nimg_4035_w_1070882995_27.png\nimg_4033_E_2047396671_19.png\nimg_3996_s_1197910755_29.png<\/pre>\n<p>After trying out different ways of sorting I found the right way to do it:<\/p>\n<pre class=\"wrap:true lang:python decode:true\">|0| |1||2|    |3|    |4|\nimg_230_N_1501859652_31.png\nSort by 2 (a..zA..Z), 4, 3, 1<\/pre>\n<p>I wrote a script in Python which sorts all the images the right way, creates a new image and combines all the shards in the right way to get the final image.<\/p>\n<pre class=\"wrap:true lang:python decode:true\">import sys\nfrom PIL import Image\nimport glob\nfiles = glob.glob('.\/*.png')\nsplitted = []\nfor x in files:\n    x = x.replace(\".png\", \"_png\")\n    splitted.append(tuple(x.split('_')))\n'''\n    |0| |1||2|    |3|    |4|\n    img_230_N_1501859652_31.png\n    --\n    Sort by 2 (a..zA..Z), 4, 3, 1\n    http:\/\/stackoverflow.com\/questions\/28136374\/python-sort-strings-alphabetically-lowercase-first\n'''\nsorted_files = sorted(splitted, key=lambda x: (x[2].swapcase(), int(x[4]), int(x[3]), int(x[1])))\nnew_im = Image.new('RGB', (40*12,40*12))\ncounter = 0\nwhile counter &lt; 40:\n    sublist = []\n    x = 0\n    while x &lt; 40:\n        c = (counter * 40)+x\n        fname = sorted_files[c][0]+\"_\"+sorted_files[c][1]+\"_\"+sorted_files[c][2]+\"_\"+sorted_files[c][3]+\"_\"+sorted_files[c][4]+\".\"+sorted_files[c][5]\n        sublist.append(fname)\n        x += 1\n    for x in sublist:\n        print x\n    print \"------\"\n    images = map(Image.open, sublist)\n    x_offset = 0\n    for im in images:\n        y_offset = counter * im.size[0]\n        new_im.paste(im, (x_offset, y_offset))\n        x_offset += im.size[0]\n    counter+=1\nnew_im.show()\n#new_im.save('result.jpg')<\/pre>\n<p>&nbsp;<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-600\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-300x300.jpg\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-300x300.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-150x150.jpg 150w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result.jpg 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h1>15 &#8211; P Cap<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-601\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_15-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_15-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_15.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: medium<br \/>\nSolutions: <span id=\"nofSolutions\">181<\/span><br \/>\nWhat about a little P cap?<br \/>\n<a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/15_cap.pcapng\"><button class=\"downloadButton\" type=\"button\">Download the cap<\/button><\/a><\/p>\n<h2>Solution<\/h2>\n<p>I started analyzing the file with Wireshark. I found various interesting things inside the PCAPNG file. I landed on a suspicious polish forum but the traffic was encrypted and I didn&#8217;t find a key to decrypt the traffic. Then I analyzed the DNS queries and found a radio streaming service, but this was a dead end as well.<br \/>\nFinally I focussed on the SMB traffic. I used the function &#8220;Follow TCP&#8221; stream in Wireshark, selected only the incoming traffic and raw format. This way I could save the incoming SMB traffic to a file. From now on I could work with my favorite forensic tool &#8216;binwalk&#8217;. \ud83d\ude42<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ binwalk -e smb.bin\nDECIMAL       HEXADECIMAL     DESCRIPTION\n--------------------------------------------------------------------------------\n8157          0x1FDD          JPEG image data, JFIF standard 1.01\n8187          0x1FFB          TIFF image data, big-endian, offset of first image directory: 8\n13244         0x33BC          JPEG image data, JFIF standard 1.01\n13274         0x33DA          TIFF image data, big-endian, offset of first image directory: 8\n113880        0x1BCD8         Zip archive data, at least v2.0 to extract, compressed size: 1169, uncompressed size: 1379, name: imnothere.txt\n115187        0x1C1F3         End of Zip archive\n$ cd _smb.bin.extracted\/\n$ ls\n1BCD8.zip  imnothere.txt<\/pre>\n<p>A file called &#8220;imnothere.txt&#8221; is really suspicious! Again, using &#8216;binwalk&#8217; on it shows the txt file is a JPEG image and not a text file.<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ binwalk imnothere.txt\nDECIMAL       HEXADECIMAL     DESCRIPTION\n--------------------------------------------------------------------------------\n0             0x0             JPEG image data, JFIF standard 1.01\n30            0x1E            TIFF image data, big-endian, offset of first image directory: 8\n<\/pre>\n<p>I simply rename the file to imnothere.jpg and this is the result:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-602\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/imnothere.jpg\" alt=\"\" width=\"52\" height=\"10\" \/><br \/>\nNow comes the confusing part! I tried to find anything related to this php file inside the PCAP file but didn&#8217;t succeed. It was a dead end and I tried to find other things inside the PCAP, but didn&#8217;t manage to find any&#8230; I stopped working on this challenge for some days and then tried again. I came to the conclusion that the really suspicious file imnothere.txt must be something. And finally tried to use this php path on the hackyeaster site:<br \/>\n<a href=\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/7061n.php\">https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/7061n.php<\/a><br \/>\nThis page reveals the needed QR code!<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-603\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/download-300x300.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/download-300x300.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/download-150x150.png 150w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/download.png 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nI didn&#8217;t like this challenge at all, because the end of the challenge was really irritating. Having a PCAP file and finding a path to a PHP file somehow leads to the conclusion that there must be more inside the PCAP file. It was really far fetched to try the path on the main HackyEaster website. I wasted way\u00a0too much time on this one.<\/p>\n<h1>16 &#8211; Pathfinder<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-604\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_16-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_16-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_16.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/MaMe82\/\">MaMe82<\/a><br \/>\nLevel: medium<br \/>\nSolutions: <span id=\"nofSolutions\">181<\/span><br \/>\nCan you find the right path?<\/p>\n<pre class=\"code\">hackyeaster.hacking-lab.com:9999<\/pre>\n<h2>Solution<\/h2>\n<p>This challenge was a really nice one! Somehow the description of the challenge leads to the conclusion to connect to the server with netcat or telnet. But this does not return any response. Using nmap on the port 9999 reveals that it&#8217;s running an &#8216;abyss&#8217;\u00a0webserver. We can use &#8216;curl&#8217; to connect to it.<\/p>\n<pre class=\"wrap:true lang:sh decode:true \">$ nmap -p 9999 hackyeaster.hacking-lab.com\nStarting Nmap 7.40 ( https:\/\/nmap.org ) at 2017-04-23 14:41 CEST\nNmap scan report for hackyeaster.hacking-lab.com (80.74.140.117)\nHost is up (0.010s latency).\nrDNS record for 80.74.140.117: urb80-74-140-117.ch-meta.net\nPORT     STATE SERVICE\n9999\/tcp open  abyss\nNmap done: 1 IP address (1 host up) scanned in 0.08 seconds\n$ curl hackyeaster.hacking-lab.com:9999\n{\"Answer\":\"I only talk to PathFinder!\"}<\/pre>\n<p>No matter what I tried, the webserver always returned the same response. After trying to send different things to webserver I tried to change the UserAgent to &#8216;PathFinder&#8217; and it worked!<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ curl -A \"PathFinder\" hackyeaster.hacking-lab.com:9999\n{\"Answer\":\"Follow one of the possible paths\",\"paths\":[1,3,5,8]}\n$ curl -A \"PathFinder\" hackyeaster.hacking-lab.com:9999\/1\n{\"Answer\":\"Go on! Follow one of the possible paths\",\"paths\":[5]}\n$ curl -A \"PathFinder\" hackyeaster.hacking-lab.com:9999\/1\/5\n{\"Answer\":\"You've left the path!\"}<\/pre>\n<p>It looks like we have to call all the possible path combinations. This calls for a recursive solution! My python script to solve this challenge looks as follows:<\/p>\n<pre class=\"wrap:true lang:python decode:true\">import urllib2\nimport json\nimport time\nhost = \"http:\/\/hackyeaster.hacking-lab.com\"\nport = \"9999\"\nopener = urllib2.build_opener()\nopener.addheaders = [('User-Agent', 'PathFinder')]\nfinish = False\ndef solve(path):\n    global finish\n    if finish:\n        return\n    u = host+\":\"+port+\"\/\"+path\n    print(\"[+] Call URL: \" + u)\n    resp = opener.open(u).read()\n    j = json.loads(resp)\n    if j['Answer'].startswith(\"This\"):\n        print(\"[!] Dead End...\")\n        return\n    elif j['Answer'].startswith(\"Thanks\"):\n        print(\"[!!!] FOUND [!!!]\")\n        print resp\n        finish = True\n        return\n    if \"paths\" in j:\n        for x in j['paths']:\n            solve(path+str(x))\nsolve(\"\")<\/pre>\n<p>It turns out we have to\u00a0bruteforce a Sudoku game. Nice! \ud83d\ude42<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">[+] Call URL: http:\/\/hackyeaster.hacking-lab.com:9999\/157294683269358174843716529496583712528971346731642895972135468685427931314869257\n[!!!] FOUND [!!!]\n{\"Answer\":\"Thanks PathFinder you saved my life by giving me the solution to this sudoku!\",\"sudoku\":[[0,0,0,2,0,4,6,0,0],[2,0,9,0,0,0,0,0,0],[0,0,0,0,0,6,5,0,0],[0,0,6,5,0,0,7,1,0],[0,0,0,9,0,0,0,4,0],[7,3,1,0,0,0,0,0,0],[0,7,0,0,3,0,0,0,8],[0,8,0,0,2,7,0,3,1],[0,1,4,0,6,0,0,0,0]],\"your_solution\":[[1,5,7,2,9,4,6,8,3],[2,6,9,3,5,8,1,7,4],[8,4,3,7,1,6,5,2,9],[4,9,6,5,8,3,7,1,2],[5,2,8,9,7,1,3,4,6],[7,3,1,6,4,2,8,9,5],[9,7,2,1,3,5,4,6,8],[6,8,5,4,2,7,9,3,1],[3,1,4,8,6,9,2,5,7]],\"Secret\":\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/images\/challenge\/egg16_UYgXzJqpfc.png\"}<\/pre>\n<p>The link\u00a0<a href=\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/images\/challenge\/egg16_UYgXzJqpfc.png\">https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/images\/challenge\/egg16_UYgXzJqpfc.png<\/a>\u00a0reveals the QR code.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-605\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg16_UYgXzJqpfc-300x300.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg16_UYgXzJqpfc-300x300.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg16_UYgXzJqpfc-150x150.png 150w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/egg16_UYgXzJqpfc.png 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h1>17 &#8211; Monster Party<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-607\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_17-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_17-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_17.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/otaku\/\">otaku<\/a><br \/>\nLevel: medium<br \/>\nSolutions: 75<br \/>\nThe monsters do have a big party, jumping around like fools.<br \/>\nEach of them has its own jump-pattern. When two or more meet on a field, they are happy to see each other, but continue hopping. Passing the border on either side makes them appear again on the opposite side.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-608\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/monsters-300x253.png\" alt=\"\" width=\"300\" height=\"253\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/monsters-300x253.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/monsters.png 670w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nMake the monsters jump, and they will reveal you a secret!<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_board.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-609 size-large\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_board-1024x815.png\" alt=\"\" width=\"584\" height=\"465\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_board-1024x815.png 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_board-300x239.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_board-768x611.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_board.png 1289w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<h2>Solution<\/h2>\n<p>This challenge looked\u00a0like there would be a lot of coding effort to solve it. But fortunately looking at the source code reveals, that the board was created by using Javascript. Many parts can\u00a0be reused.<br \/>\nI implemented a jump button to\u00a0simulate the jumps of the monsters. I also added a second table where I colorize all fields\u00a0with at least one monster black. But somehow it never revealed a QR code. Apparently it wasn&#8217;t as straight forward as I first thought. After reading the challenge description again I noticed that there is no information about the starting conditions, it&#8217;s not mentioned if the monsters already did a jump or not. What means the first jump the monsters do could be another one as I implemented. I added an offset of 1 and then the QR code was revealed after 72\u00a0jumps!<br \/>\nMy implementation can be found <a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/17_monsters.html\">here<\/a>.<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_solution.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-610\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_solution-140x300.png\" alt=\"\" width=\"140\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_solution-140x300.png 140w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/17_solution.png 473w\" sizes=\"auto, (max-width: 140px) 100vw, 140px\" \/><\/a><\/p>\n<h1>18 &#8211; Nitwit&#8217;s Doormat Key<\/h1>\n<p><a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_18.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-611\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_18-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_18-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_18.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/CoderKiwi\/\">CoderKiwi<\/a><br \/>\nLevel: medium<br \/>\nSolutions: <span id=\"nofSolutions\">267<\/span><br \/>\nBeing sure that no one can read the obfuscated code, bunny Nitwit has hidden the egg behind his login-page.<br \/>\n<a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/hackyeaster.hacking-lab.com\/hackyeaster\/nitwik\/\" target=\"_blank\" rel=\"noopener noreferrer\"><button class=\"downloadButton\" type=\"button\">Login Page<\/button><\/a><br \/>\nFind out the username and password to show that he lives up to his own name!<\/p>\n<h2>Solution<\/h2>\n<p>We can actually debug this. I first saved the page locally and added the &#8216;debugger&#8217; keyword to the end of the script. Then I opened the page with &#8216;firedebug&#8217; and set a breakpoint at the end of the script where the &#8216;debugger&#8217; keyword is.<br \/>\nThe Javascript code is heavily obfuscated and encrypted, but as Javascript runs on the client side, the final source which is executed must be revealed before execution. My breakpoint in &#8216;firedebug&#8217; revealed this:<\/p>\n<pre class=\"wrap:true lang:js decode:true\">window.addEventListener(\"load\", init, false);\nfunction init() {\n  document.getElementById(\"sub\").addEventListener(\"click\", logMeInScotty, false);\n}\nfunction sendRequest(url, cb) {\n  var ll = new XMLHttpRequest();\n  ll.onreadystatechange = function() {\n    if (ll.readyState == 4 &amp;&amp; ll.status == 200) {\n      var l1 = ll.responseText;\n      cb(l1);\n    }\n  };\n  ll.open(\"GET\", url, true);\n  ll.send();\n}\nfunction logMeInScotty() {\n  var lI = document.getElementById(\"uzr\").value;\n  var l1l = document.getElementById(\"puzzwerd\").value;\n  if (lI.length == 12 &amp;&amp; (lI[0] == \"b\") &amp;&amp; (lI.charCodeAt(0) == lI.charCodeAt(1) - 19) &amp;&amp; (String.fromCharCode(lI.charCodeAt(3) &amp; 0x7F) == \"n\") &amp;&amp; (lI[3] == lI[2]) &amp;&amp; (lI.charCodeAt(4) == lI.charCodeAt(1) + lI[7] * 1) &amp;&amp; (lI[5] == \"X!&amp;)=\" [0]) &amp;&amp; (lI[6] == String.fromCharCode(109)) &amp;&amp; (lI[7] == (1 &lt;&lt; 2)) &amp;&amp; (lI[8] == \"s\") &amp;&amp; (lI.charCodeAt(8) == lI.charCodeAt(9) - 1) &amp;&amp; (lI[10] == lI[7] - 1) &amp;&amp; (lI[11] == String.fromCharCode(114))) {\n    if (l1l == magic(lI)) {\n      dataUrl = 'https:' + String.fromCharCode(47, 47) + 'hackyeaster.hacking-lab.com\/hackyeaster\/files\/' + lI + l1l + '.txt';\n      sendRequest(dataUrl, function(lIl) {\n      document.getElementById(\"egg\").src = \"data:image\/png;base64,\" + lIl;\n    });\n  } else {\n      alert(\"Haha wrong password!\");\n    }\n  } else {\n    alert(\"Haha wrong username!\");\n  }\n}\nfunction magic(str) {\n  var l11 = \"\";\n  for (var l1I = str.length - 1; l1I &gt;= 0; l1I--) {\n    if (l1I &gt; 5) {\n      l11 += moreMagic(str[l1I]);\n    } else {\n      l11 = moreMagic(str[l1I]) + l11;\n    }\n  }\n  return l11;\n}\nfunction moreMagic(c) {\n  return String.fromCharCode(c.charCodeAt(0) + 1);\n}<\/pre>\n<p>Finding out the username was much harder than the password. But with some manual work I eventually\u00a0got it:<\/p>\n<pre class=\"lang:default decode:true\">01. 98      = b\n02. 98 + 19 = 117 = u\n03. n\n04. n = 110d = x &amp; 0x7f\n   1101110b = x &amp; 1111111b\n   1101110b = n\n05. 117 + 4 * 1 = 121 = y\n06. \"X!&amp;)=\"[0] = X\n07. 109 -&gt; m\n08. 1 &lt;&lt; 2 == 4\n09. s\n10. t\n11. 4-1 = 3\n12. r\n--&gt; bunnyXm4st3r<\/pre>\n<p>Getting the password was much easier, as we could just run the magic function with the username! The password is\u00a0<strong>cvoozYs4ut5n<\/strong>. The egg with the QR code is then downloaded from this URL\u00a0<a href=\"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/files\/bunnyXm4st3rcvoozYs4ut5n.txt\">https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/files\/bunnyXm4st3rcvoozYs4ut5n.txt<\/a>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-612\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/18-300x300.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/18-300x300.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/18-150x150.png 150w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/18.png 480w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h1>19 &#8211; Disco Time<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-613\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_19-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_19-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_19.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/DeathsPirate\/\">DeathsPirate<\/a><br \/>\nLevel: hard<br \/>\nSolutions: <span id=\"nofSolutions\">139<\/span><br \/>\nDisco time!<br \/>\n<img decoding=\"async\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/disco1.gif\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/disco2.gif\" width=\"200\" height=\"200\" \/><img decoding=\"async\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/disco3.gif\" \/><\/p>\n<h2>Solution<\/h2>\n<p>This is\u00a0the first challenge\u00a0rated as hard.<br \/>\nFirst step with gifs is always to look at the single frames. The gifs with the cats didn&#8217;t reveal anything interesting. But disco2.gif did.<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ convert *.gif frames\/out.png\n$ ls -u frames\/ | head -10\nout-4184.png\nout-4187.png\nout-4186.png\nout-4185.png\nout-4183.png\nout-4182.png\nout-4181.png\nout-4180.png\nout-4179.png\nout-4178.png\n<\/pre>\n<p>If we look at the frames folder, we can see a lot of red and white images. Looks like a pattern. We have 31 pictures before the color changes, this seems important.<br \/>\nI tried to combine the frames to a new picture with &#8216;montage&#8217;. &#8216;montage&#8217; takes the pictures by name and orders them from top left corner to the top right corner, then it goes to the next line and so on.<br \/>\nI used montage this way:<\/p>\n<pre class=\"wrap:true lang:sh decode:true \">montage frames\/*.png -geometry 48x48+1+1 -tile 31x200 result.png<\/pre>\n<p>This takes all the pictures from the frames folder and combines it into result.png. Result.png is 48&#215;48 pixels and the boarders between the frames are 1 pixel. It takes 31 pictures per row and then goes to the next row. I had to do some trial and error to find the right values.<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-617 size-large\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-159x1024.png\" alt=\"\" width=\"159\" height=\"1024\" \/><\/a><br \/>\nAfter rotating the picture and flipping it vertically I got this picture:\u00a0<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-618 size-large\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2-1024x159.png\" alt=\"\" width=\"584\" height=\"91\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2-1024x159.png 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2-300x47.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2-768x119.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2-1536x238.png 1536w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result2-2048x317.png 2048w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><br \/>\nIt&#8217;s a bit hard to read, but the codeword is &#8220;<strong>PixelPixiesArePractical<\/strong>&#8220;.<br \/>\nHelpful Links:<br \/>\n<a href=\"http:\/\/helpdeskgeek.com\/how-to\/create-a-photo-montage-with-imagemagick\/\">http:\/\/helpdeskgeek.com\/how-to\/create-a-photo-montage-with-imagemagick\/<\/a><br \/>\n<a href=\"http:\/\/www.imagemagick.org\/Usage\/montage\/\">http:\/\/www.imagemagick.org\/Usage\/montage\/<\/a><\/p>\n<h1>20 &#8211; Spaghetti Hash<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-619\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_20-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_20-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_20.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: hard<br \/>\nSolutions: <span id=\"nofSolutions\">162<\/span><br \/>\nLazy Larry needs to improve the security of his password hashing implementation. He decides to use SHA-512 as a new hashing algorithm in order to be super secure. Unfortunately, the database column for the hash can only hold 128 bit. As Bob is too lazy to extend the column and all the code related to it, he decides to shrink the output of the SHA-512 operation, to 128 bit. For this purpose he picks certain characters from the SHA-512 output for producing the new value.<br \/>\nYou got hold of four password hashes, calculated with Bob&#8217;s new implementation. Can you find the corresponding passwords?<\/p>\n<pre class=\"code\"> hash 1: 87017a3ffc7bdd5dc5d5c9c348ca21c5\n hash 2: ff17891414f7d15aa4719689c44ea039\n hash 3: 5b9ea4569ad68b85c7230321ecda3780\n hash 4: 6ad211c3f933df6e5569adf21d261637<\/pre>\n<p>Lucky you, you know that the following web service is calculating Bob&#8217;s algorithm. However, the web service only accepts strings of length 4 or less &#8211; brute-forcing a password list thus is no option, since the passwords you are looking for are all longer.<\/p>\n<pre class=\"code\">https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/hash?string=abcd<\/pre>\n<h2>Solution<\/h2>\n<p>The hardest part of this was to find out how the hash was shortened. I wrote a python script to solve this challenge.<br \/>\nFirst I use\u00a0the webservice on hackyeaster.hacking-lab.com to find out which elements of the sha512 hash were taken into the shortened hash. To accomplish this i generate random 4-letter strings, calculate\u00a0the\u00a0sha512 hash and get the shortened hash from the webservice. I take the first element\u00a0from the shortened hash and get the indices of all the matching elements in the sha512 hash. I repeat this with the next hash and only keep the indices\u00a0which were there before &#8211; until I only have 1 left. Afterwards I move to the next element and repeat. This way I get get all exact positions which are used from the sha512 hash.<br \/>\nThe second step was to bruteforce the passwords. Luckily no salt was used to hash the passwords, so I downloaded a wordlist with the top passwords\u00a0and used it to bruteforce. I calculate the sha512 hashes of the passwords and whenever all elements of the shortened hash match with the\u00a0positions\u00a0in the sha512 hash I have a password.<br \/>\nHere is the full python script:<\/p>\n<pre class=\"wrap:true lang:js decode:true\">import hashlib\nimport urllib2\nimport random, string\nurl = \"https:\/\/hackyeaster.hacking-lab.com\/hackyeaster\/hash?string=\"\ndef call_page(string):\n    resp = urllib2.urlopen(url+string).read()\n    return resp+\"\\n\"\ndef random_str():\n   return ''.join(random.choice(string.lowercase) for i in range(4))\ndef sha_512(st):\n    hash_object = hashlib.sha512(st)\n    hex_dig = hash_object.hexdigest()\n    return hex_dig\ndef dict_attack(hsh, positions):\n    try:\n        words = open(\"..\/22\/10_million_password_list_top_1000000.txt\", 'r')\n    except(IOError):\n        print '[-] Error: Check your wordlist path.\\n'\n        sys.exit(1)\n    words = words.readlines()\n    for word in words:\n        wrd = word.replace('\\n', '').replace('\\r', '')\n        hash = hashlib.sha512(wrd).hexdigest()\n        bob_hash = \"\";\n        for x in positions:\n            bob_hash += str(hash[x])\n        if hsh == bob_hash:\n            print(\"[+] Found! :)\\n\" + bob_hash + \" == \" + wrd)\n            return wrd\nprint(\"[+] Find position pattern...\")\npositions = []\nfor i in range(32):\n    indeces = []\n    while len(indeces) != 1:\n        st = random_str()\n        sha = sha_512(st)\n        hackysha = call_page(st)\n        ind = [n for n, x in enumerate(sha) if x == hackysha[i]]\n        if len(indeces) == 0:\n            indeces = ind\n        else:\n            for n,x in enumerate(indeces):\n                if x not in ind:\n                    del indeces[n]\n        #print indeces\n    print(\"[+] Found position \" + str(i+1) + \": \" + str(indeces[0]))\n    positions.append(indeces[0])\nprint(\"[+] Found all positions: \" + str(positions))\nprint(\"[+] Cracking passwords\")\npw1 = dict_attack(\"87017a3ffc7bdd5dc5d5c9c348ca21c5\", positions)\npw2 = dict_attack(\"ff17891414f7d15aa4719689c44ea039\", positions)\npw3 = dict_attack(\"5b9ea4569ad68b85c7230321ecda3780\", positions)\npw4 = dict_attack(\"6ad211c3f933df6e5569adf21d261637\", positions)\nprint(\"[+] Done, got all passwords\")<\/pre>\n<p>And this is how it looks like when executing the script:<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ python solution.py\n[+] Find position pattern...\n[+] Found position 1: 65\n[+] Found position 2: 17\n[+] Found position 3: 115\n[+] Found position 4: 31\n[+] Found position 5: 45\n[+] Found position 6: 11\n[+] Found position 7: 67\n[+] Found position 8: 92\n[+] Found position 9: 0\n[+] Found position 10: 7\n[+] Found position 11: 123\n[+] Found position 12: 37\n[+] Found position 13: 5\n[+] Found position 14: 22\n[+] Found position 15: 87\n[+] Found position 16: 124\n[+] Found position 17: 25\n[+] Found position 18: 89\n[+] Found position 19: 38\n[+] Found position 20: 61\n[+] Found position 21: 90\n[+] Found position 22: 109\n[+] Found position 23: 63\n[+] Found position 24: 28\n[+] Found position 25: 102\n[+] Found position 26: 12\n[+] Found position 27: 47\n[+] Found position 28: 59\n[+] Found position 29: 110\n[+] Found position 30: 86\n[+] Found position 31: 24\n[+] Found position 32: 18\n[+] Found all positions: [65, 17, 115, 31, 45, 11, 67, 92, 0, 7, 123, 37, 5, 22, 87, 124, 25, 89, 38, 61, 90, 109, 63, 28, 102, 12, 47, 59, 110, 86, 24, 18]\n[+] Cracking passwords\n[+] Found! :)\n87017a3ffc7bdd5dc5d5c9c348ca21c5 == Prodigy\n[+] Found! :)\nff17891414f7d15aa4719689c44ea039 == Cleveland\n[+] Found! :)\n5b9ea4569ad68b85c7230321ecda3780 == benchmark\n[+] Found! :)\n6ad211c3f933df6e5569adf21d261637 == 12345678\n[+] Done, got all passwords\n<\/pre>\n<p>The passwords are &#8216;<strong>Prodigy<\/strong>&#8216;, &#8216;<strong>Cleveland<\/strong>&#8216;, &#8216;<strong>benchmark<\/strong>&#8216; and &#8216;<strong>12345678<\/strong>&#8216;.<\/p>\n<h1>21 &#8211; MonKey<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-621\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_21-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_21-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_21.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: hard<br \/>\nSolutions: 74<br \/>\nThe monkey is laughing at you. Get the hidden egg from his binary.<br \/>\n<a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/21_Monkey.ipa\"><button class=\"downloadButton\" type=\"button\">Monkey&#8217;s file<\/button><\/a><\/p>\n<h2>Solution<\/h2>\n<p>This challenge was the hardest one for me.<br \/>\nFirst step was to rename the ipa file to zip and extract the content. There are a lot of interesting files but no QR code in sight.\u00a0Running &#8216;strings&#8217; on the Monkey binary reveals some information. We can see that the library CCCrypt is used, there are function named aesDecrypt and aesEncrypt, we can see an encrypted string which probably is our encrypted QR code. And then there are these two strings &#8220;thisIStheKEYyoyo&#8221; and &#8220;monkeyluv$Banana&#8221;. I was a bit disappointed at the first moment, I thought this was too easy! But I was wrong, the 2 strings didn&#8217;t work as keys no matter how I tried. It is time to use a disassembler. I used hopper to solve this task.<br \/>\nMost interesting function is onBtnPressed. I worked mostly with the generated pseudo code of hopper, which worked pretty well:<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-633 size-large\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1-1024x540.png\" alt=\"\" width=\"584\" height=\"308\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1-1024x540.png 1024w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1-300x158.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1-768x405.png 768w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1-1536x809.png 1536w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper1.png 1816w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-634\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper2.png\" alt=\"\" width=\"692\" height=\"198\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper2.png 692w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper2-300x86.png 300w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/a><br \/>\nWe can see in the else-part at\u00a0the end of the function, the two strings\u00a0&#8220;thisIStheKEYyoyo&#8221; and &#8220;monkeyluv$Banana&#8221; are used in a log output\u00a0to display the nopeCat! Nice play\u00a0<a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a>, nice play! \ud83d\ude09<br \/>\nProceeding with the reverse engineering\u00a0I found this method call:<strong><em> r4 = [[NSString stringWithFormat:@&#8221;%@omo%@&#8221;, @&#8221;makybk&#8221;, @&#8221;oaenklo&#8221;] retain];<\/em><\/strong> This method results in the string &#8220;makybkomooaenklo&#8221;. But that string does\u00a0not work as key either.<br \/>\nSo, I stepped backwards from where the key actually was used:<\/p>\n<ul>\n<li>aesDecrypt, the key used is r5<\/li>\n<li>r5 is r6 UTF8\u00a0decoded<\/li>\n<li>r5 is equal r4, r4 is &#8220;makybkomooaenklo&#8221;<\/li>\n<li>As r5 was assigned from r6 before, we have to follow r6<\/li>\n<li>r6 was last changed in the function sub_a75c()<\/li>\n<li>input to\u00a0sub_a75c is the key entered in the app, output is r6<\/li>\n<\/ul>\n<p>We have to look closer what exactly happens in the function sub_a75c()<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-636\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper3.png\" alt=\"\" width=\"743\" height=\"288\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper3.png 743w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hopper3-300x116.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/a><br \/>\nIf we simplify this method to something more readable and only take the needed values from\u00a0the array &#8217;27fbc&#8217;, we get this function:<\/p>\n<pre class=\"wrap:true lang:c decode:true\">void sub_a75c(int original_password, int result) {\n    27fbc = [0x07, 0x09, 0x00, 0x0f, 0x08, 0x05, 0x01, 0x0a, 0x02, 0x04, 0x06, 0x0e, 0x0c, 0x0d, 0x03, 0x0b, 0x00]\n    x = 0;\n    while (x &lt; 0x10) {\n        result[x] = original_password + 27fbc[x];\n        x++;\n    }\n}<\/pre>\n<p>We have a password with the length of 16 characters. In this method the order of the characters of\u00a0our password is chosen and a new string resulting in &#8216;makybkomooaenklo&#8217; is created. &#8216;int original_password&#8217; is a pointer to the address of the first element\/character of the password used in the app and to it an offset from the array &#8217;27fbc&#8217; is added. All values inside &#8217;27fbc&#8217; are smaller than 0x10. Means that the ordering of the entered password is changed inside this function. In the app someone enters a password, this function changes the order of the characters and the result of it is the known string &#8216;makybkomooaenklo&#8217;. But the\u00a0first typed\u00a0password is used to decrypt the egg.<\/p>\n<ul>\n<li>End &#8216;result&#8217; is &#8216;makybkomooaenklo&#8217;<\/li>\n<li>result[0] is address_of_first_character_of_our_password + 27fbc[0] (Which is 0x07)<\/li>\n<li>result[0] is the character which is at position 0x07 of our password<\/li>\n<\/ul>\n<p>We don&#8217;t know the entered key, but we know what it becomes after the function &#8216;sub_a75c&#8217;. Now we can reverse the function and get the key to decrypt the QR code!<\/p>\n<pre class=\"wrap:true lang:python decode:true \">sub_a75c = [0x07, 0x09, 0x00, 0x0f, 0x08, 0x05, 0x01, 0x0a, 0x02, 0x04, 0x06, 0x0e, 0x0c, 0x0d, 0x03, 0x0b, 0x00]\nstring = \"makybkomooaenklo\"\nresult = \"\"\nfor n in range(len(string)):\n    for c,x in enumerate(sub_a75c):\n        if x == n:\n            result += string[c]\n            break\nprint(\"[+] Password found: '\" + result + \"'\")<\/pre>\n<p>To reverse the string I loop over the lenght of &#8216;makybkomooaenklo&#8217; and for each\u00a0position (0..15) we check at what index in &#8216;sub_a75c&#8217; this number is located. When we found the position, we know the position of the character in the &#8216;makybkomooaenklo&#8217; string.<br \/>\nRunning the function reveals the password &#8216;<strong>koolokambamonkey<\/strong>&#8216;. With this key we can decrypt the encrypted image of the QR code.<br \/>\n<a href=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/sol_21.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-637\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/sol_21.png\" alt=\"\" width=\"542\" height=\"608\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/sol_21.png 542w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/sol_21-267x300.png 267w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/a><\/p>\n<h1>22 &#8211; Game, Set and Hash<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-623\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_22-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_22-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_22.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: hard<br \/>\nSolutions: 226<br \/>\nCan you beat the tennis master?<\/p>\n<pre class=\"code\">hackyeaster.hacking-lab.com:8888<\/pre>\n<h2>Solution<\/h2>\n<p>This one was pretty straight forward. You connect to the server, the server gives you a sha1 hash and you have to decrypt it. If you manage to do so in the given time it&#8217;s a point for you otherwise for the server. The points are counted the same way as a Tennis match is counted. The game is started by entering &#8220;y&#8221;.<\/p>\n<pre class=\"wrap:true lang:sh decode:true \">$ nc hackyeaster.hacking-lab.com 8888\nReady for the game?\ny\nLet's go!\n99bde068af2d49ed7fc8b8fa79abe13a6059e0db320bb73459fd96624bb4b33f\nWrong! Point for me.\n----------------------\nPlayer &gt; 0 0\nMaster   0 15\n----------------------\n<\/pre>\n<p>I first tried to solve it the same way as I solved PathFinder, with dictionary bruteforce. But apparently there is some logic behind, whenever the server is losing he uses stronger,combined passwords which are not in my wordlists and wins the game. Using this method the server always won 7-6,7-6,7-6. \ud83d\ude00<\/p>\n<pre class=\"wrap:true lang:sh decode:true \">$ python solution.py\n...\n----------------------\nPlayer &gt; 6 6 6 5\nMaster   7 7 6 6\n----------------------\n9f27e1246ab067a1aeb1e71e773a0e0ceb3bcd6844593977b2d8e94ea74e233e\n--&gt;9f27e1246ab067a1aeb1e71e773a0e0ceb3bcd6844593977b2d8e94ea74e233e\nWrong! Point for me.\n----------------------\nPlayer &gt; 6 6 6\nMaster   7 7 7\n----------------------\nYou lose!\n...FINISH...<\/pre>\n<p>I solved it by using an API to crack the password hashes. I registered a free account on\u00a0<a href=\"http:\/\/md5decrypt.net\">http:\/\/md5decrypt.net<\/a>. This service was able to crack all password hashes and so I won the game. I think there is\u00a0a more elegant solution to somehow trick the servers logic and win the game. But as I already had a working solution I was too lazy to look for another one. \ud83d\ude09<br \/>\nMy python script:<\/p>\n<pre class=\"wrap:true lang:python decode:true\">import socket\nimport sys\nimport re\nimport hashlib\nimport urllib2\nhost = \"hackyeaster.hacking-lab.com\"\nport = 8888\napi_host = \"http:\/\/md5decrypt.net\/Api\/api.php\"\napi_email = \"your_email@address.com\"\napi_key = \"YOUR_API_KEY_XXX\"\ndef dict_attack(hsh):\n    try:\n        words = open(\".\/10_million_password_list_top_100000.txt\", 'r')\n    except(IOError):\n        print '[-] Error: Check your wordlist path.\\n'\n        sys.exit(1)\n    words = words.readlines()\n    for word in words:\n        wrd = word.replace('\\n', '').replace('\\r', '')\n        hash = hashlib.sha256(wrd).hexdigest()\n        if hsh == hash:\n            print \"[+] Password is: \" + wrd, \"\\n\"\n            return wrd+\"\\n\"\n    return \"\\n\"\ndef api_call(hsh):\n    url = api_host+\"?hash=\"+hsh+\"&amp;hash_type=sha256\"+\"&amp;email=\"+api_email+\"&amp;code=\"+api_key\n    resp = urllib2.urlopen(url).read()\n    print(\"[+] Password is: \" + resp)\n    return resp+\"\\n\"\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\ns.connect((host, port))\n# Start the game\ntm = s.recv(1024)\nprint(\"%s\" % tm.decode('ascii'))\ns.sendall(b'y\\n')\ntm = s.recv(1024)\nprint(\"%s\" % tm.decode('ascii'))\nwhile True:\n    tm = s.recv(1024)\n    if not tm:\n        print(\"...FINISH...\")\n        break\n    print(\"%s\" % tm.decode('ascii'))\n    last_line = str(tm.decode('ascii').splitlines()[-1])\n    # Check if the response is hash or text\n    try:\n        int(last_line, 16)\n    except:\n        # Not hex value\n        continue\n    print(\"--&gt;\" + last_line)\n    #solution = dict_attack(last_line)\n    solution = api_call(last_line)\n    s.sendall(solution)\ns.close()<\/pre>\n<p>Here is the output of running the script:<\/p>\n<pre class=\"wrap:true lang:sh decode:true\">$ python solution.py\n...\n--&gt;8f0634444a04df777ef0837f13627769ef65ca3bca3f3732ee13a7bb2d936045\n[+] Password is: rajat962\nCorrect! Point for you.\n----------------------\nPlayer   6 6 5 40\nMaster &gt; 0 0 0 0\n----------------------\n3d597cf4ffb063c2f8c9f09a8efed76f70c6428752771959a5233fc5bc3c564a\n--&gt;3d597cf4ffb063c2f8c9f09a8efed76f70c6428752771959a5233fc5bc3c564a\n[+] Password is: emilio3403\nCorrect! Point for you.\n----------------------\nPlayer &gt; 6 6 6\nMaster   0 0 0\n----------------------\nYou win! Solution is: !stan-the_marth0n$m4n\n...FINISH...<\/pre>\n<p>The password needed to get the points is &#8220;<strong>!stan-the_marth0n$m4n<\/strong>&#8220;.<\/p>\n<h1>23 &#8211; Lovely Vase<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-624 size-medium\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_23-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_23-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_23.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/PS\/\">PS<\/a><br \/>\nLevel: hard<br \/>\nSolutions: 83<br \/>\nWhat a nice vase! Beautiful, don&#8217;t you think?<\/p>\n<pre class=\"code\">trickhesitenadrfairairstp<\/pre>\n<pre class=\"code\">tedtunbhscnprissnaoeoasab<\/pre>\n<pre class=\"code\">hacektpsrnediiahrtartirlf<\/pre>\n<h2>Solution<\/h2>\n<p>The image of the vase gave some hints how to get the passwords from the 3 strings. To solve this one you must know about Transposition Ciphers and Rail-Fence Ciphers. More information can be found on\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Transposition_cipher\">https:\/\/en.wikipedia.org\/wiki\/Transposition_cipher<\/a>.<br \/>\n<strong>1.<\/strong><br \/>\nThe top part of the vase reveals how to arrange the string of the first text and how to read it. It looks like a square. So I aligned the first string as a square 5&#215;5.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-625 size-full\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/1.png\" alt=\"\" width=\"81\" height=\"79\" \/><br \/>\nWe read the text the same way as the pattern shows on the vase and we start in the top left corner. It&#8217;s a bit tricky in the middle, but in the end the solution for the first string is: &#8220;<strong>the first part is adriane rick<\/strong>&#8220;.<br \/>\n<strong>2.<\/strong><br \/>\nThe second pattern on the vase clearly shows a Rail-Fence cipher. I arranged the string this way:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-626\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/2.png\" alt=\"\" width=\"206\" height=\"53\" \/><br \/>\nNow again we start reading in the top left corner but follow the zig-zag stream. We get the sentence &#8220;<strong>the second part is susanna bob<\/strong>&#8220;.<br \/>\n<strong>3.<\/strong><br \/>\nFor the last part the vase doesn&#8217;t\u00a0help much. I could not read a pattern from the image. So I just aligned it like the first one 5&#215;5. And because of the first two solutions I knew the sentence would start wiht &#8220;the third part is&#8221;. This made it a lot easier.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-627\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/3.png\" alt=\"\" width=\"82\" height=\"79\" \/><br \/>\nThis time we start reading on the bottom left corner upwards. As soon as we reach the top, we continue on the second column upwards again. Solution of this one is: &#8220;<strong>the third part isclaire frank<\/strong>&#8220;.<br \/>\nCombine all the three names and we get the final password:<br \/>\n<strong>adrianericksusannabobclairefrank<\/strong><\/p>\n<h1>24 &#8211; Your Passport, please<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-628\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_24-300x188.jpg\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_24-300x188.jpg 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/challenge_24.jpg 732w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nAuthor: <a href=\"https:\/\/www.hacking-lab.com\/user\/profile\/inik\/\">inik<\/a><br \/>\nLevel: hard<br \/>\nSolutions: 93<br \/>\nAfter another exhausting Easter, Thumper decides to travel abroad for recreation. As a real h4x0r, he of course is using his own, homemade e-passport:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-630\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hacky_epass-300x208.png\" alt=\"\" width=\"300\" height=\"208\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hacky_epass-300x208.png 300w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/hacky_epass.png 739w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\nWrite a client which connects to the virtual terminal, and fetch the portrait photo stored on Thumper&#8217;s passport! The virtual terminal is running on:<\/p>\n<pre class=\"code\">hackyeaster.hacking-lab.com:7777<\/pre>\n<p>As a starting point for your client, the following eclipse project is provided:<br \/>\n<a href=\"https:\/\/sigterm.ch\/stuff\/hackyeaster17\/24_epassclient.zip\"><button class=\"downloadButton\" type=\"button\">Download project<\/button><\/a><\/p>\n<h2>Solution<\/h2>\n<p>On first sight this challenge looks pretty hard. I never heard about the jmrtd library nor anything about how to read out ePassports. But I know Java and with a bit of googling I was able to solve this challenge pretty fast.<br \/>\nMost information needed to get the image with JMRTD can be found in the documentation:<\/p>\n<ul>\n<li><a href=\"http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/org\/jmrtd\/PassportService.html\">http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/org\/jmrtd\/PassportService.html<\/a><\/li>\n<li><a href=\"http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/org\/jmrtd\/lds\/icao\/DG2File.html\">http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/org\/jmrtd\/lds\/icao\/DG2File.html<\/a><\/li>\n<li><a href=\"http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/org\/jmrtd\/lds\/iso19794\/FaceImageInfo.html\">http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/org\/jmrtd\/lds\/iso19794\/FaceImageInfo.html<\/a><\/li>\n<\/ul>\n<p>It was necessary to change localhost to the hackyeaster server in\u00a0HE17Terminal.java. And the rest was all done in the Java class\u00a0JMRTDMain.java.<br \/>\nFist thing to do is to call the doBAC() function. This is used to do the basic access control. Normally you would have to do some authentication and provide a key for it. But in our implementation this is\u00a0not necessary &#8211; we create a BACKeySpec object with the details of the passport to readout.<br \/>\nThe passport image is saved in the DG2File. I&#8217;ve found this information in the documentations mentioned before:<\/p>\n<h4>EF_DG2<\/h4>\n<pre class=\"\">public static final\u00a0short EF_DG2<\/pre>\n<div class=\"block\">File identifier for data group 2. Data group 2 contains face image data.<\/div>\n<dl>\n<dt><span class=\"seeLabel\">See Also:<\/span><\/dt>\n<dd><a href=\"http:\/\/static.javadoc.io\/org.jmrtd\/jmrtd\/0.5.9\/constant-values.html#org.jmrtd.PassportService.EF_DG2\">Constant Field Values<\/a><\/dd>\n<\/dl>\n<p>From the DG2File we can read out the face information with the function getFaceInfos() and from there we get the image with the function getImageInputStream().<br \/>\nHere is my implementation of the JMRTDMain class:<\/p>\n<pre class=\"wrap:true lang:java decode:true\" title=\"JMRTDMain.java\">package ch.he17.epassclient;\nimport java.io.ByteArrayInputStream;\nimport java.io.DataInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.smartcardio.CardException;\nimport javax.smartcardio.CardTerminal;\nimport org.jmrtd.BACKeySpec;\nimport org.jmrtd.PassportService;\nimport org.jmrtd.lds.LDSFileUtil;\nimport org.jmrtd.lds.icao.DG2File;\nimport org.jmrtd.lds.iso19794.FaceImageInfo;\nimport org.jmrtd.lds.iso19794.FaceInfo;\nimport ch.he17.epassclient.terminal.HE17Terminal;\nimport net.sf.scuba.smartcards.CardService;\nimport net.sf.scuba.smartcards.CardServiceException;\npublic class JMRTDMain {\n\tpublic static void main(String[] args) throws CardServiceException, CardException, IOException {\n\t\tCardTerminal cardTerminal = new HE17Terminal();\n\t\tCardService cService = CardService.getInstance(cardTerminal);\n\t\tPassportService passService = new PassportService(cService);\n\t\tcardTerminal.waitForCardPresent(1000);\n\t\tpassService.open();\n\t\tpassService.sendSelectApplet(false);\n\t\t\/*\n\t\t * P&lt;HLAEASTERWOOD&lt;&lt;THUMPER&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;\n\t\t * P012345673HLA7707076M21010150000007&lt;&lt;&lt;&lt;&lt;&lt;&lt;96\n\t\t *\/\n\t\tBACKeySpec bacKey = new BACKeySpec() {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t@Override\n            public String getDocumentNumber() {\n                return \"P01234567\";\n            }\n            @Override\n            public String getDateOfBirth() {\n                return \"770707\";\n            }\n            @Override\n            public String getDateOfExpiry() {\n                return \"210101\";\n            }\n        };\n        passService.doBAC(bacKey);\n        InputStream is = passService.getInputStream(PassportService.EF_DG2);\n        DG2File dg2File = (DG2File) LDSFileUtil.getLDSFile(PassportService.EF_DG2, is);\n        List&lt;FaceImageInfo&gt; allFaceImageInfos = new ArrayList&lt;&gt;();\n        List&lt;FaceInfo&gt; faceInfos = dg2File.getFaceInfos();\n        for (FaceInfo faceInfo : faceInfos) {\n            allFaceImageInfos.addAll(faceInfo.getFaceImageInfos());\n        }\n        if (!allFaceImageInfos.isEmpty()) {\n            FaceImageInfo faceImageInfo = allFaceImageInfos.iterator().next();\n            int imageLength = faceImageInfo.getImageLength();\n            DataInputStream dataInputStream = new DataInputStream(faceImageInfo.getImageInputStream());\n            byte[] buffer = new byte[imageLength];\n            dataInputStream.readFully(buffer, 0, imageLength);\n            InputStream inputStream = new ByteArrayInputStream(buffer, 0, imageLength);\n            Path destination = Paths.get(\".\/result.png\");\n            Files.copy(inputStream, destination);\n        }\n\t}\n}<\/pre>\n<p>Running this Java program saves the image as result.png in the running folder.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-631\" src=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-1-188x300.jpg\" alt=\"\" width=\"188\" height=\"300\" srcset=\"https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-1-188x300.jpg 188w, https:\/\/sigterm.ch\/wp-content\/uploads\/2017\/04\/result-1.jpg 200w\" sizes=\"auto, (max-width: 188px) 100vw, 188px\" \/><br \/>\n&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Easter 2017 &#8211; means new HackyEaster challenges are online. The challenges were easier than the ones on Hackvent 2016. For HackyEaster\u00a0all challenges are released at once and it does not matter in what time-frame the challenges are solved, this makes &hellip; <a href=\"https:\/\/sigterm.ch\/?p=553\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,5],"tags":[21,22,37,38,39,66,68,78,79,114,128,130,137,165,167,169],"class_list":["post-553","post","type-post","status-publish","format-standard","hentry","category-ctf","category-security","tag-asm","tag-assembly","tag-capture-the-flag","tag-crypto","tag-ctf","tag-hacking","tag-hacking-lab","tag-hacky-easter","tag-hackyeaster","tag-owasp","tag-reverse-engineering","tag-reversing","tag-security","tag-web-application-security","tag-write-up","tag-writeup"],"_links":{"self":[{"href":"https:\/\/sigterm.ch\/index.php?rest_route=\/wp\/v2\/posts\/553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sigterm.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sigterm.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sigterm.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sigterm.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=553"}],"version-history":[{"count":0,"href":"https:\/\/sigterm.ch\/index.php?rest_route=\/wp\/v2\/posts\/553\/revisions"}],"wp:attachment":[{"href":"https:\/\/sigterm.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sigterm.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sigterm.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}