<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by D0kj4 on Medium]]></title>
        <description><![CDATA[Stories by D0kj4 on Medium]]></description>
        <link>https://medium.com/@othnieladisso?source=rss-83db74bc8638------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yHJxkahlZA7XWNPt_ehPCA.png</url>
            <title>Stories by D0kj4 on Medium</title>
            <link>https://medium.com/@othnieladisso?source=rss-83db74bc8638------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:41:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@othnieladisso/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reverse engineering of The Phoenix Quest CTF organized by ACXS IT]]></title>
            <link>https://medium.com/@othnieladisso/reverse-engineering-of-the-phoenix-quest-ctf-organized-by-acxs-it-c680373f520a?source=rss-83db74bc8638------2</link>
            <guid isPermaLink="false">https://medium.com/p/c680373f520a</guid>
            <dc:creator><![CDATA[D0kj4]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 16:28:08 GMT</pubDate>
            <atom:updated>2025-02-16T16:28:08.077Z</atom:updated>
            <content:encoded><![CDATA[<p>The 15th February 2025 in the building of ACXS IT, the final of The Phoenix Quest CTF took place. For the qualification four challenges were proposed, here is my resolution above: <a href="https://github.com/OthnielAD/Qualif-the-phoenix-quest-CTF.git">https://github.com/OthnielAD/Qualif-the-phoenix-quest-CTF.git</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*lHNoCsagI5aEZyFgMVTYbw.png" /><figcaption>Challenges reverse engineering</figcaption></figure><p>I’ll starting by challenge “Le code du Forgeron”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*8yB4Oc9UX9PZ1loR6lq5PA.png" /></figure><p>For this challenge we received a file. It is a linux executable (ELF 64-bit).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*686OTEAg2lw1zpalaDFe3w.png" /></figure><p>We give execution rights with the command: <strong>chmod +x keygen_forgeron</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*WUZKVrfohfb8mUM_n9SYbg.png" /></figure><p>After running the binary, we see that we have to enter a username then, a key is generated and if it is valid I think the flag is displayed. We launch directly into the code in order to better understand the challenge. I use Ghidra for this purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*4sxR4V29tGvjQhQNzqDH6w.png" /></figure><p>Well here is the main function which contains important functions for obtaining the flag. First we know that the flag is encrypted thanks to the “decrypt_flag” function and there is also the “generate_key” function which generates the key. Let’s take a look at these two functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*sp3D1BXm1t867iiEVxpTrw.png" /><figcaption>generate_key function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*h2_IKtErAbeGn3cCTVuBNA.png" /><figcaption>decrypt_flag function</figcaption></figure><p>Ok well I think we have two possibilities to have the flag either by using the generate_key function which uses the username to generate a key that it compares to the key “KEY-222–666” or we reverse the decrypt_flag function to have the flag. Well I went with the first option found the right username to enter to have the key KEY-222–666. <br>For this let’s understand what the generate_key function does and how to obtain the key KEY-222–666.</p><p>This code generates a key in the format KEY-XXX-YYY based on the sum of the ASCII values ​​of the characters in a given string. It iterates through each letter in the input, adds up their ASCII values, and then uses this total to create the key: the first part is this sum in hexadecimal, and the second is its triple, also in hexadecimal. To get KEY-222–666, you need a string whose sum of ASCII characters is 546 in decimal (or 0x222 in hexadecimal).</p><p>Well the code is understood let’s find the username. So for that I took the logic of the function in python by adding a small key which allows me to pass the characters whose sum of the ASCII code would be equal to 546 and here is a little the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*5xxTEffG2EvJXksziCEm9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*x9_4ds9O01azPZXHVSbMJQ.png" /></figure><p>The flag is: <strong><em>TPQCTF{Cr@ck3d_Keyg3n_5a412814e}</em></strong></p><p>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p><h4>The next challenge is Obfuscated Vault.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*wIQorCAP3Szq_6NMMaTxuA.png" /></figure><p>We also received a 64-bit ELF linux executable. We run it see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*S-mq7EL8AwxNE5bbIuR40w.png" /></figure><p>Apparently we need to find the right password to get the flag. We decompile the binary with ghidra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*mj7UaJ_w9kWIDrguaNLFZg.png" /></figure><p>Ok here we have 3 important functions: anti_debug(), check_password() and decrypt_flag(). Given the name of each of the functions we can already imagine their usefulness. The anti_debug() function for example, prevents debugging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*cjhcO1qWv8bGiKpPqqFPuw.png" /></figure><p>I was interested in the decrypt flag() function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*QrvSVvTbYSjtLsnW8H32sw.png" /></figure><p>Well the function applies an xor operation on each character of flag encrypted with “0x2a”. Ok that’s good let’s go and find the encrypted flag in the binary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*sHaG1ixeMweW2nf3XTVblg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*MrR83MMCX-Erb0AVXu-uxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5A99cQHlpyA-NIHISHwbig.png" /></figure><p>The flag is: <strong><em>TPQCTF{0bfusc4t3d_v4ul7_unl0ck3d}</em></strong></p><p>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p><h4><strong>The last challenge is Nobody</strong></h4><p>For this challenge we were given a Linux kernel module as a 64-bit ELF (Executable and Linkable Format) file. The question is should we run it or dig around to find the flag ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*lAKyDaGWHCKkjw47Om_5cQ.png" /></figure><p>A strings on the file and we get this string: <strong>IGMOJ1OLb0ydm3wtCNOuCI8sr19nPQwkrk9vULXxUWGfXpJ2CpDxXNV0UNUaPcAqPpD0XcXcPcIqXu0</strong><br>Well we keep it for later and we move on to ghidra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*hA0uJtM1VJGA-7E8KL0D-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*sCTqsw5pmLMlBGJBeuNliA.png" /></figure><p>Four functions, the most attractive: transform_char()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*N_X8d9iXjypoCL51P7gcNA.png" /></figure><p>This function applies a specific encryption or transformation to the lowercase and uppercase letters of the alphabet, modifying their ASCII value while retaining their alphabetic nature as a kind of substitution algorithm. Well, we’ll rewrite it in Python, that will be useful to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*VaCGvn-xXby5VShtQ0SZsg.png" /></figure><p>Well I have already inserted the string from earlier into the code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*F4_sGzsXhz3fu12fM4CIQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nhZaUxiT6iPLi2nZuNB3UQ.png" /></figure><p>Nothing!!! Nothing. I’m putting the output from earlier back into the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*tDHKasCnEu3T7EqNbx-NXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*CFiCBtDK6to_HbCYIRsQVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NO2rV--2mO7yMemwYK7c3Q.png" /></figure><p>Nothing!!!mdr</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*70xp1kpC7B36pOxLINGrgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*Q-2CSmCld37nlt9iri6S3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYhT0541OtNEGPma1iZiMQ.png" /></figure><p>Finally it gave. The flag is: <strong><em>TPQCTF{Knowledge_1s_p0wer_b4f241dbd6fe2ab45cc32a2e4c6335ab}</em></strong></p><p>Thanks for reading and see you next time…..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c680373f520a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MetaCTF April 2024 Flash CTF writeups]]></title>
            <link>https://medium.com/@othnieladisso/metactf-april-2024-flash-ctf-writeups-6549822e2c19?source=rss-83db74bc8638------2</link>
            <guid isPermaLink="false">https://medium.com/p/6549822e2c19</guid>
            <dc:creator><![CDATA[D0kj4]]></dc:creator>
            <pubDate>Sat, 27 Apr 2024 14:44:00 GMT</pubDate>
            <atom:updated>2024-04-27T14:44:00.986Z</atom:updated>
            <content:encoded><![CDATA[<p>Salut à tous, le 26 avril passé j’ai eu a participé au Flash CTF, un mini CTF de 2h de temps (18h à 20h GMT+1) avec au total 5 challenges. J’ai résolu 4/5 pendant les deux heures mais j’ai fini par résoudre le dernier🙂. Let’s goooo….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ve-q3my6zIv4_Rm0pMCJA.png" /></figure><h3>Commençons par le binary exploitation le seul que j’ai fait après le CTF</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sobmI86ec0_6leZsKOEjAw.png" /></figure><p>Bon après téléchargement du binaire je le décompile rapidement avec ghidra et il y a deux fonction sur lequel il faut se concentrer pour trouver a vulnérabilité et les voici:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*e7lpEqYDdlQESKs2JEI5bQ.png" /></figure><p>Ici, dans le code principal, nous constatons déjà l’utilisation de printf() sans spécification de format (%). Ce qui fait penser à la vulnérabilité de “format strings”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*B9qRzQwFbs7EGYF-RbX4dw.png" /></figure><p>Voici la fonction que je peux appeler “win” car elle ouvre le fichier flag.txt et l’affiche à l’écran.</p><p>Le problème est que la foncton win n’est jamais appelé à dans la fonction principale, alors voyons comment exploiter la vulnérabilité détectée pour atteindre cette fonction.<br>A partir de là j’ai commencé à voir si on peut lire le flag sur la pile mais rien, alors voyons si on peut détourner le fonctionnement du programme en écrasant une fonction par notre fnction “win”.<br>Pour celà, essayons de voir le décalage qu’il faut pour écrire sur la pile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*NiGpnu-_V5QnbyfUq3l8-w.png" /></figure><p>Bon après plusieurs essai le voilà nous avons notre décalage qui est de 7 alors passons à la conception de notre exploit.<br>Avant l’exploit, expliquons ce qui est à fait.</p><p>Puisqu’il existe une fonction win qui imprime le flag, notre objectif est d’y rediriger l’exécution du programme, mais quoi écrasé ? L’appel se fait de cette façon :</p><p>printf(tmp_buf);<br>puts(“blah”);<br>printf(fin_buf);</p><p>La meilleure des choses à faire actuellement est d’écraser la première fonction “printf” par notre “win” car cela imprimerait d’abord notre tampon initial qui contiendrait la charge utile de la chaîne de format, puis “fin_buf” contiendrait simplement l’entrée modifiée, ce qui n’a pas d’importance car à ce stade, “printf” aurait déjà été écrasé par “win”.</p><p>Alors si vous avez bien compris voici notre exploit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*nVVSwSICrZWkhut39Jkziw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*iVSv_MMqAJkaJj4AjCpW-w.png" /></figure><h3>Le flag: <strong>MetaCTF{1337_h@kkaR}</strong></h3><h3>Sautons sur le reverse</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUhSZDUYxrgUaOAvblUjVg.png" /></figure><p>Ce challenge est assez basique et bon pour un début. L’objectif est de trouver le nom de l’architecture utilisé pour compilé le binaire. Pou réussir ce défis, la commande<strong> file</strong> suffira amplement:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cf_2-euiJeMycbABx5T23A.png" /></figure><h3>Le flag: Tensilica Xtensa</h3><h3>Le web….</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHyqDSmxrL7EGCWPLrMmvQ.png" /></figure><p>Interessant pour tester ces compétences en détection de vulnérabilité SQLi. Commençons par télécharger le code source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6FrZuR_u1jEVKuu4I5Fzwg.jpeg" /></figure><p>Eh bien comme moi, nous identifions une vulnérabilité SQLi basique alors passons à sa résolution…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*GDUBh9wg_jAi0wYG3b_vaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*XTdXN1UBFgVHH4q5VM6Lew.png" /></figure><h3>Le flag: MetaCTF{time_to_move_my_money}</h3><h3>Le défi de Crypto</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9Zl0TqFGn2dEZ4IfmawHQ.png" /></figure><p>Par trop compliqué j’ai aussi aimé il s’agit d’un fichier zip avec password oublié. L’obectif trouvé le password pour avoir le flag… Let’s gooo</p><p>J’ai d’abord commencé à créer mon dico avec “crunch”…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*LkNTAKyqF9r4mDv17IqhcQ.png" /></figure><p>Ensuite j’ai créé le hash du fichier zip avec “zip2john”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*UTmoTVdRAUw5p3yj2wghXg.png" /></figure><p>Enfin je le craque avec “john” et ma wordlist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*5G0I4Mt_uw5TRAtbatLwWw.png" /></figure><p>Biimm…</p><h3>Le flag: MetaCTF{w0w_stup1d35t_c0mbin4t10n_1v3_he4rd_in_my_l1f3}</h3><h3>En dernier le forensic….</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kb85yOcq563Va6qW-WUDrg.png" /></figure><p>Après aavoir télécharger le fichier image bon j’ai utilisé Autopsy pour l’investigation… je vous montre</p><p>on commence par lancé autopsy qui génère un lien pour avoir accès à l’interface de travaill goo allons sur “http://localhost:9999/autopsy”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*6nYzNocWS0AedqAqSqOPDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBWf28HBFQ6cSy_dx89z2A.png" /></figure><p>Voilà un peu comment ça se présente on clique sur “NewCase”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*-BLCrRJsx5PVbe5CBnNvmQ.png" /></figure><p>ok on continue avec “NewCase”… Notez que ces informations sont a remplir sinon vous n’aurez pas accès au contenu du fichier img.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*7JQCRJwOLVwEK3JIPsI7Iw.png" /></figure><p>“Add Host”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*LU2IbAd9w53o-OiX8V7JYg.png" /></figure><p>“Add Host”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*057vRs-pht8PX42PC6WvsA.png" /></figure><p>Vous cliquez sur “Add Image File” et avec la commande “realpath &lt;file.img&gt;” vous aurez le chemin absolu du fichier image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*jVhbMnJ0AHcegnxgOxSj4w.png" /></figure><p>Après avoir collé le chemin absolu, le context nous a parlé de la deuxième partition ce qui veut dire qu’il y a plusieurs partition donc au niveau du “Type” on laisse l’option “disk” coché et pour le dernier aussi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*zAUB1tseABVu88-0ZQ_myQ.png" /></figure><p>Après avoir cliqué sur “Next” vous allez tomber sur l’interface ci-dessus validé juste avec “Add”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*Jyx6EnoFDpVd-QgsngcVHw.png" /></figure><p>On coche la deuxième partition puis sur “Analyze” et ensuite vous verrez “File Analyze” cliquez dessus..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GV82SWrivatR-VCnIP7wmw.png" /></figure><p>Bon voilà le contenu de la deuxième partition, cherchons le flag…. En commençant à cliquer sur le répertoire “M”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*WR7iGdhyOOcgntxUM_CRzg.png" /></figure><p>Il s’est fait que chaque caractère du flag etait un répertoire contenu dans dans le caractère qui le précède…</p><h3>Le flag: MetaCTF{its_a_part1ti0n_t4ble3_p4rty}</h3><p>Eh bien c’était le dernier challenge. Vivement que cette initiative de FlashCTF continue… Je compte bien terminer le prochain 1h avant la fin🤪🤪</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6549822e2c19" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>