<?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 0xZew on Medium]]></title>
        <description><![CDATA[Stories by 0xZew on Medium]]></description>
        <link>https://medium.com/@0xZew?source=rss-156a7765f49d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nDIcdfho60IqvwOjXjEY_g.jpeg</url>
            <title>Stories by 0xZew on Medium</title>
            <link>https://medium.com/@0xZew?source=rss-156a7765f49d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:00:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xZew/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[ASCWG CTF competition Finals Digital Forensics Writeup]]></title>
            <link>https://medium.com/@0xZew/ascwg-ctf-competition-finals-digital-forensics-writeup-6f53b4e3562d?source=rss-156a7765f49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f53b4e3562d</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[0xZew]]></dc:creator>
            <pubDate>Wed, 24 Sep 2025 13:51:58 GMT</pubDate>
            <atom:updated>2025-09-24T13:51:58.010Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello again everyone! I hope you’re all doing well. I’m a bit late this time since I was busy studying deepfake analysis to tackle the last challenge. Anyway, I’ve put together a writeup for the forensics challenges in the Arab War Games — enjoy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MbXjN5nBLG3_Xouo" /></figure><h3><strong>Challenge Name : Stealthy extraction</strong></h3><p><strong>I was provided a rar file contains “HKLM.hiv” and “Microsoft-Windows-PowerShell%4Operational.evtx”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*PGtHjqXrB4OSxVQZI6iGwQ.png" /><figcaption><strong>Image 1</strong></figcaption></figure><p>I started by examining the .evtx file and there was 663 events i started looking for ID 4104 which was marked as warning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*9vE-CCVsqKcGc4yzjFnXZQ.png" /><figcaption><strong>Image 2</strong></figcaption></figure><p>as you can see, a base64 bulk of data decoding it with cyberchef gave me a script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPsjbuv6dhLxkxo9thmYiQ.png" /><figcaption><strong>Image 3</strong></figcaption></figure><p>It appears the attacker attempted to exfiltrate a specific file named flag.txt. To do so, they compressed it into a RAR archive and protected it with a password, which explains the presence of the encrypted RAR file, the key to decrypt the rar file is in the path <em>“HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EFS\DecryptRequest” <br>“$TargetKey = Get-ChildItem -Path $EFSBasePath | Select-Object -First 1&quot;<br></em>that explains everything the attacker used the key to encrypt the file then made some operations on the key and then sent it with the file through the FTP server.</p><p>The file <strong>HKLM.hiv</strong> could not be parsed by Registry Explorer or RegRipper because it does not represent a standard registry hive. In Windows, <strong>HKEY_LOCAL_MACHINE (HKLM)</strong> is not stored as a single file; it is a logical root key that links to multiple separate hives on disk, including SYSTEM, SOFTWARE, SAM, SECURITY, and DEFAULT. Forensic tools are designed to handle these individual hive files, not a combined or “live” export of HKLM. As a result, HKLM.hiv is treated as invalid. To analyze its contents, the file would need to be loaded into Windows with reg load and then the individual sub-hives extracted for proper parsing.</p><p>I didn’t do that.. I just opened it using notepad 😅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQ77Ubs5Bc-jdXU3bxUxbQ.png" /><figcaption><strong>Image 4</strong></figcaption></figure><p>While inspecting the script we searched the path referenced and located a registry key named <strong>AF3FBAC8–496E-424A-80F4–845D0B88822D</strong>. The remainder of the script appears to perform key exfiltration; those actions occurred after the key was accessed and therefore are not part of the initial encryption activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*fXwZPAexjGp1RiLiBl7wEw.png" /><figcaption><strong>Image 5</strong></figcaption></figure><h3>Challenge Name : The Glasnost Files</h3><p>I was given a corrupted rar file that needs to be fixed, I used bunch of tools/commands like “file” to identify the file and it was a zip file</p><blockquote>binwalk can be used to extract the files compressed in there without getting involved in all of this because it is a <em>carver</em> and <em>scanner</em>. It goes byte by byte through the entire file looking for <em>any</em> signature it recognizes (ZIP, PNG, GZIP, RAR, Zlib, ELF, etc.).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*nHK-r2yz86JM2Hvdp1JH3w.png" /><figcaption><strong>Image 6</strong></figcaption></figure><blockquote>The photo was also corrupted invalid IHDR data, it’s talking about the PNG file’s first critical chunk as every PNG starts with the 8-byte signature <em>“89 50 4E 47 0D 0A 1A 0A” </em>Then comes the <strong>IHDR chunk</strong>, which is the <em>image header</em>. It stores width (4 bytes), height (4 bytes), bit depth (1 byte), color type (1 byte), compression method (1 byte, always 0), filter method (1 byte, always 0), interlace method (1 byte, 0 or 1), then a CRC (4 bytes). So “invalid IHDR data” means The values in width/height/depth/type/etc. are outside the allowed range (e.g. negative, zero, too large). Or the CRC for the IHDR chunk doesn’t match the data</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*iz2nEyY98a6RHpGNBRAlTA.png" /><figcaption><strong>Image 7</strong></figcaption></figure><p>As you can see the bytes indicating the filter method, Compression methods are 1s and it should be 0s</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*GQcChyFeTb7NE3RbeN4vhA.png" /><figcaption><strong>Image 8</strong></figcaption></figure><p>Converting them to 0s, another error appears IHDR CRC error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*7AXt0xyroHe9bXxkwlMU0g.png" /><figcaption><strong>Image 9</strong></figcaption></figure><p>After fixing the IHDR chunk, the CRC needed to be recalculated. The original CRC value was B0 E6 65 8D, but once corrected, the proper CRC32 is A8 3F 3E FB (as shown in Image 8)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*2pY2Ay5qUfT1VLiKkB0FWQ.png" /><figcaption><strong>Image 10</strong></figcaption></figure><p>Now it is fixed trying to open it with eog and it opens and renders</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*w1WuB1DkoMBZgu7aJ5pQsg.png" /><figcaption><strong>Image 11</strong></figcaption></figure><p>decoding the Base64 using cyberchef</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*_vxZL4rK9cVr7XB0y3yLrA.png" /><figcaption><strong>Image 12</strong></figcaption></figure><p><em>Flag : ASCWG{Wh0_Kn3w_CRC_!$_!MpOrt@nt}</em></p><h3>Challenge Name : Are you General Ludd ??</h3><p>I was provided a photo made with deepfake for Tony stark</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*2XM4t17UmNU8EhErRbU5qg.png" /><figcaption><strong>Image 13</strong></figcaption></figure><p>The Challenge Idea was to prove that this photo is made with deepfake through calculating the sha1 of 5 values, I didn’t know how to do that back then, even though the author tried to simplify the challenge by explaining many things.. I tried looking for ways to calculate the Blur in the image, Highlights, sharpness, colors.. etc but it wasn’t the right way as i didn’t have the original photo.</p><p>After studying and some guidance from the author I was put in the right track to diffrentiate between fake and real images, I had to calculate the ELA, Residual mean, Residual standard deviation, NR Score, Laplacian Variance</p><blockquote>- ELA usually means Error Level Analysis in digital forensics and image analysis. It’s a technique used to detect whether an image has been digitally altered (forged, edited, or spliced). JPEG compression works by saving different parts of an image at different error levels. If you resave a genuine image as JPEG, all areas should show similar error levels because the compression is uniform. But if an image has been tampered with (e.g., someone copied and pasted an object into it), the edited areas usually compress differently. ELA highlights those differences by showing a heatmap of error levels — bright or darker spots where edits likely happened. Detect digital forgeries (photoshopped objects, altered text, fake documents). Identify spliced images (two photos combined which is in our case). Verify authenticity in digital forensics investigations.</blockquote><blockquote>- A residual mean is a way to measure how far off your prediction or model is from the actual observed value. Formally, in statistics and machine learning: Residual = Observed Value − Predicted Value</blockquote><blockquote>- The residual standard deviation is a measure of how much the data points spread around the regression line (or prediction model). Residual Standard Deviation= root of ∑(yi​−yi*​) squared divided by n−p</blockquote><blockquote>where yi = observed value, yi* = predicted value, n = number of observations, P = number of parameters estimated (e.g., in simple regression, p=2 → slope + intercept) so it’s basically standard deviation but for residuals anyways, it is used to Measure model fit quality Smaller residual std → model predictions are close to reality. and if it is Larger residual std → predictions are less accurate</blockquote><blockquote>- The Laplacian is a second-order derivative filter that highlights edges and areas of rapid intensity change in an image If you compute the variance of the Laplacian, you get a single number that measures how much detail (edges) exists in the image.. The most common application is image sharpness or blur detection, High Laplacian variance → many edges, image is sharp. Low Laplacian variance → few edges, image is blurry, it is also used in forensics for detecting image tampering sometimes, since blur differences can be suspicious</blockquote><blockquote>- NR Score In image forensics and computer vision, “NR” = No-Reference (also called blind quality assessment). Unlike metrics such as PSNR or SSIM (which require the original reference image to compare against), an NR_Score estimates the quality of an image without having the original ( which is also our case ) it is usefull because it Detects if an image has been tampered with, compressed multiple times, or altered.</blockquote><p>Using Script to calculate all of that on the photo provided</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*d8cDmmfwWUIlPjl9E2R70w.png" /></figure><p>And using another script to calculate the Error level analysis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*mUjcygTMu8QXFKkIQ4inGw.png" /></figure><p>and now calculating the sha1sum using this command<br><em> “echo -n ‘value1,value2,value3,value4,value5’ | sha1sum” and we get the flag</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*nTu1TMBt0ztnNgsKKDgwPA.png" /></figure><p>I hope you enjoyed the writeup! It’s quite late now, as it took me 4–5 days to dive into and learn these new deepfake analysis topics. Hopefully, you found something new and valuable here. Thanks for reading ❤</p><p><strong>For support<br>Instapay : </strong><a href="https://ipn.eg/S/moaz712/instapay/1lg04lwh"><strong>moaz712@instapay.com</strong></a></p><p>SocialMedia : <a href="https://www.instagram.com/moaz._.hossam/">Instagram</a>, <a href="https://www.linkedin.com/in/0xzew/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f53b4e3562d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CAT Reloaded CTF 2025 DFIR writeup]]></title>
            <link>https://medium.com/@0xZew/cat-reloaded-ctf-2025-dfir-writeup-43a5f405a660?source=rss-156a7765f49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/43a5f405a660</guid>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[cats]]></category>
            <dc:creator><![CDATA[0xZew]]></dc:creator>
            <pubDate>Thu, 28 Aug 2025 02:52:26 GMT</pubDate>
            <atom:updated>2025-08-28T02:52:26.520Z</atom:updated>
            <content:encoded><![CDATA[<p>Helloooo Investigators, welcome again to another CTF writeup.. this time it’s kinda cool as the ideas were pretty good even though I managed to solve only 4 out 5 within the time of the CTF but i’ve learned a lot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*WUB-8EXZnZs1p6mr" /></figure><h3>Let’s start with<strong> Index of secrets</strong> :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*JuuM7v-bbWq-Ib6o.png" /></figure><p>I was given a ZIP archive which, when extracted, contained a RAR file (c.rar). Extracting that RAR revealed a C folder, representing a Windows filesystem image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*b3c9g3rutsGZXv6y-GbXzA.png" /></figure><p>I started exploring a bit and found something interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBqmeq2bSmZ0Qisd-IdXWQ.png" /></figure><p>It’s a .lnk file which was referring to a flag.txt file on the Desktop of the user named “wh1pl4sh”<br>There was a clue in the description “Windows search indexes everything” so I directly navigated to the file that had the search history</p><pre>C:\ProgramData\Microsoft\search\data\applications\windows\windows.edb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*e7kkQBnkzO5t692arh9wSw.png" /></figure><p>With WinSearchDBAnalyzer, I successfully parsed both the search history and the file’s contents</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fZlo28ZOYzKNA3yhOxGIw.jpeg" /></figure><p>Flag : CATF{ESE_DB_F0r3ns1cs}</p><h3><strong>Erased Traces :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*YsGBfa1-cI1-SqA6.png" /></figure><p>I was given a disk image and was asked to retrieve deleted files, so I started by launching autopsy and navigating through deleted files, I found 4 deleted files which I thought that these was the critical files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8PLIpoo3Wjm-mrIHgcB5Q.png" /></figure><p>I attempted to extract these files using Autopsy, but all I got were 0B files. This indicated that some anti-forensic technique had been applied to prevent file carving. Fortunately, I had my own ways: I used DiskDrill, a powerful tool I’m familiar with from past experience, to recover deleted files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YsvhcuAKvq_a314Yr0eMsg.png" /><figcaption>Universal Scan</figcaption></figure><p>And I found the files we wanted to carve :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nc8OjmuwfuP4NE50M27HlQ.png" /></figure><p>Recovering these files and I got them with it’s contents</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*frfuRy9LL0qwG538vMTMGg.png" /></figure><p>I switched to Linux to perform the file forensics, as I feel more comfortable working with files there. After copying the files, I ran the file command on the first one (CAT1) and obtained the following result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*53UpmuyPUCBDvNya708qZg.png" /></figure><p>I just ran cat and there it was — XD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*sWsdj2iVOSihKvlkH23uwQ.png" /></figure><p>And just like that, the flag has been obtained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PkavlLF7GamRZBeb3vBmQ.png" /></figure><p>Flag : CATF{whip1@$h_iz_da_b3$t_m0v13_3va!}</p><h3><strong>Loser :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*uxHqpRqCgsIL3ikQ.png" /></figure><p>Once again, I was working with another filesystem image, but this time I decided to make it more fun. I was tasked with investigating a cracked game the user had downloaded, but I noticed that there were two user accounts on the system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*5goExgQExR9tFyEuIe_V6g.png" /></figure><p>Looking at the name of the author of the challenge “t0orf3n” i decided to ignore the other user completely :D</p><p>started by looking at the Browser history located at<em> “C:\Users\t0orf3n\AppData\Local\Microsoft\Edge\User Data\Default\History”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-cLwYFUW_FSwFxsnC--S_A.jpeg" /></figure><p>You could use DB Browser for SQLite, but since I wanted to make it more fun, I just used Notepad. As you can see, the file clearly contains the cracked game’s name and a LimeWire link 😛 — more than enough to prove that this was indeed the cracked game.</p><p>I targeted PCA (Program Compatibility Assistant) data because it tracks detailed information about executed applications, including their installation history, launch attempts, and compatibility events. Since the user had downloaded a cracked game, examining PCA provided a high-probability location for uncovering evidence of software execution and potential traces of the cracked application</p><pre>C:\Windows\AppCompat\pca</pre><p>I Found 3 Files.. one of them was 0 Bytes, Opening the first one and searching for the cracked game name and I found 2 parts of the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hlpksW0G2oiLspgi1hdsA.jpeg" /></figure><p>Opening the other file gave me the missing part :D <br>Was Fun Playing it that way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bghISEA-iYjNd5P_GIHKA.jpeg" /></figure><p><em>Flag: CATF{C:\Users\t0orf3n\AppData\Local\Temp\GreenHell.crack.exe_3_2025–07–12 13:34:17.726}</em></p><h3><strong>Dead Icon Speaks :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*c7in8XhsPmjzROe6.png" /></figure><p>I was provided another Filesystem image :/<br>anyways, this challenge idea was kinda cool the description says an icon rendered into the depths of a forgotten cache, so I immediatly started by investigating the iconcache and thumbcache files located at : <em>C:\Users\wh1pl4sh\AppData\Local\Microsoft\Windows\Explorer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*ZzjtvJdEByt3-wAoVB2hyQ.png" /></figure><p>I used Thumcache_viewer for that task</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*k53fyawKUWKJfHfQ8O1agg.png" /></figure><p>Extracted all of that into a folder and saw that while scrolling through the icons and now I have the second part</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RgabvSrv6P6EJXHHZmqNwQ.png" /></figure><p>I returned to the filesystem and began parsing the $MFT using Eric Zimmerman’s MFTcmd. While reviewing the resulting CSV file, something caught my attention, a prefetch entry associated with a sus executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfEHOJXKlf1kKEfJVWpwcw.png" /></figure><p><em>Flag : CATF{flagstealer.exe:thumbn41l_pwn}</em></p><p>The fifth and final challenge… I was so close to solving it, and finally did — just 10 minutes after the competition ended.</p><h3>Vanishing Point :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*G7B3FMY4xxSuhYgCOH8tIA.png" /></figure><p>This time, I was provided with a disk image in the .ad1 format, which Autopsy couldn’t open directly. However, I managed to access it using one of my favorite CTF tricks.</p><p>From the challenge description, it was clear that someone had accessed the laptop after the user stepped away for a coffee. While examining the Downloads folder, I found sdelete, which strongly indicated the use of secure deletion tool</p><blockquote>SDelete is a secure deletion utility from Microsoft Sysinternals. Unlike a normal delete operation, which only removes file system references to a file, SDelete overwrites the file’s data with random patterns, making recovery through traditional forensic carving nearly impossible.</blockquote><p>I parsed the $I30 in the downloads folder to see if there is anything interesting and I found this file named “ZZZZZZZZZZZZZZ.ZZZZ” which was an indicator that sdelete was used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zqR5yjdpuQaY60ct8zULFg.png" /></figure><p>After noticing the ‘Z’ files, which appeared to be important and potentially deleted, I immediately checked for a prefetch file related to SDelete — and found one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*-cc6gtW5vY3VDx6R1aMeuw.png" /></figure><p>I then used Eric Zimmerman’s PEcmd to parse the prefetch file, and the results were quite revealing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*BwuYE_b7SZIezAwqk1adVg.jpeg" /></figure><p>The presence of the sdelete executable in the Downloads folder indicates that it was obtained from the internet, and its use confirms that it was employed to securely delete the file.</p><p>At this point, I went down a rabbit hole searching for any trace of the deleted file. I dug through the .evtx event logs, the hidden $MFT file, registry hives, attached devices, the file system, and even browser history. I practically examined every available artifact, but still couldn’t find a single lead.</p><p>While reviewing the web history, I came across a mega.nz link. However, it pointed to a personal dashboard and wasn’t shared publicly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*nbGtSKj13wtvfnbF5Gs0lg.png" /></figure><p>There were no cookies associated with that link. However, after spending some more time going through the filesystem, I came across an entry for https+++mega.nz at the following location:</p><pre>Vanished/Users/Test_VM/AppData/Roaming/Mozilla/Firefox/Profiles/aovvtx71.default-release/storage/default/</pre><p>This was particularly interesting — upon inspecting its data.sqlite, I discovered a session cookie</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-cVV1X5GCR7F9AQrfZDpQ.png" /></figure><pre>sid:KzT8Yrzzx1wvEu7onfHY_jlCbkFhelZtYURnSYiw8kwiwqQXwYhfXgmxUg<br>kBAD7u96LfoKWM3ZfdOK-qeEjOev2XLQnSrGAgB48gtiOpQvgF9EpLN2SFa9CVa-d1wY0y_O4759JXMXFhja_CN5QlYg3XOhpl4P96R2s35t13MUPa8_J2blpLo7BtkxI26ZIRy5MVFNHy2DDoATpifByOQFwZVK42cX4N_ddqYyS1QQAtULUu4wRkPXUBX5-oHsX-WRhs-Bv45RVDuXE0NfXwsaMXXC5mLCxy-FLrJtxwFigCREjOADraH9pZ7w13YQjUAuV4Xxo1nky8Wrg74HA4_We-f9vhW1fwwHs4ygvVJFjWwl63D4k9mdGrfapCPPVgxKwsLEBKSKRXOQM4x3whmcIAIigu_nepb4lNXS9Ohs82WfAIwbexW8FSOA4c9RYC029qaZFUqKDgrvFjrwaWuMha_kyTirY-yS8onr6nM7qHmNKifd1AMw0FL8FpcM1L3iHg3EwguW_nUVIbouL6aICnd2YtyJHAYUbABEekG1GHnqNApEU1q55JDI_FsOqqIVrpNAhrvE37lYIyTOXPDu7kicNYfRm4Zw-LB8ggYFiSvJr1f4m3BhIV0OFrivqHkNRO2DeGNrcP54mbX3C0srlJ11Xvnqzp4mKfwcWgsPOjNWjYvUQinx8BWv6fsLIHzzaUnyDxOnunoy9gTylwUAy0g_hdt5h2u1pOp3GjmfSW1kEAJtxbnbsIXPJ0UHj6QBlDpsy0HzqWufudhQxf18eXG7LelcUiisXG55UvThwgXvDdEGTD51BeO5lPfPZywB4r5oZvL8jpEsZHKSmmblHrJaHbkJ64GKJQQpfZmO0P5JVs2zRF4o70K9bk45KAMWSe_xZBXc8YQpKeD8x_UdvNlUbwi3hU9VKSiQ<br>brandseed+Y8AFV8oe1b5b-upueWCOj77cuFziMQBj1gAKx3We3UY</pre><p>I first tried replacing the session in my browser with the one I recovered, but it didn’t work — most likely because it had already expired. Later, the challenge author asked participants to open tickets and share their progress since the challenge had no solves. After I shared mine, he hinted that I was supposed to gain access to that account and that there was actually a simpler way 😅. Unfortunately, the competition ended while I was stuck at that point. Sometime after, I asked ChatGPT and got the idea to copy the entire folder into my Firefox directory on my Linux machine.</p><pre>/home/kali/.mozilla/firefox/&lt;profile_name&gt;/storage/default</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*ky87yawHXLzFZFl4Bf7b5w.png" /></figure><p>Honestly, that was really cool — I never expected it to work. The author told me about it after the competition, and until then I had assumed there must have been another method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*MSZQr-FeFMeuaq0LbPfioA.png" /></figure><p><em>Flag: CATF{5t34l3r5_tr1ck5_R3v34l3d_by_4_g00d_br0ws3r_f0r3ns1cs_1nv15t1g4t0r}</em></p><p>And that brings this little adventure to an end. Every challenge felt like peeling back another layer of mystery — sometimes frustrating, sometimes mind-blowing, but always worth it. Writeups like these are my way of sharing the ride, because what’s the point of discovering cool tricks if not to pass them on? Here’s to more rabbit holes, more late-night ‘a-ha’ moments, and more flags waiting to be found 🥂</p><p>If you vibed with this journey, learned something new, or just enjoyed tagging along, you can fuel future explorations by supporting me through InstaPay: <a href="https://ipn.eg/S/moaz712/instapay/1IgO4l">https://ipn.eg/S/moaz712/instapay/1IgO4l</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43a5f405a660" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ASCWG Qualifications 2025 CTF Digital Forensics challenges Writeup]]></title>
            <link>https://medium.com/@0xZew/ascwg-qualifications-2025-ctf-digital-forensics-challenges-writeup-c60ea13e902a?source=rss-156a7765f49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c60ea13e902a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <dc:creator><![CDATA[0xZew]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 14:44:13 GMT</pubDate>
            <atom:updated>2025-08-04T16:11:42.351Z</atom:updated>
            <content:encoded><![CDATA[<h3>ASCWG 2025 CTF Forensics Qualification Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*qYxXhgtyV8KwhWT2.jpeg" /></figure><p>Pariticipated in 2024 for fun and decided to participate this year to compete and here we go managed to get to top 11 without crypto or reverse ahaha XD</p><h3><strong>1. Broken Interface :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*ZKtDB9u748eDbIyC.png" /></figure><p>I was provided with that description that has the flag format and a <strong>Broken Interface.evtx</strong> file</p><p>I started by opening the file in Event viewer and filtering for Level = Warning and EventID = 4104 as i noticed that the Information Level is kinda useless for our investigation and that Event ID <strong>4104</strong> in Windows Event Viewer refers to <strong>PowerShell Script Block Logging</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBFSqC9ztoVmlmuszi8sIg.png" /></figure><p>Upon reviewing the Warnings, I noticed that most were generated on 6/30/2025 and various other dates, except for a single entry from 7/3/2025, which stood out to me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FewkaQ9_aXT7Xwxt7JNx7Q.jpeg" /></figure><p>Reviewing that Warning, I identified the script as a malicious in-memory code execution setup. It attempts to bypass the Windows Antimalware Scan Interface (AMSI) by constructing the string AmsiScanBuffer in an obfuscated manner and likely overwriting it in memory, thereby disabling AMSI&#39;s ability to detect and scan malicious PowerShell content.</p><p>This snippet shows the script building the string AmsiScanBuffer in an obfuscated way, commonly used to bypass AMSI detection. Obfuscation helps evade signature-based defenses by hiding known malicious strings</p><pre>$a = &quot;Ams&quot;<br>$b = &quot;iSc&quot;<br>$c = &quot;anBuf&quot;<br>$d = &quot;fer&quot;<br>$signature = [System.Text.Encoding]::UTF8.GetBytes($a + $b + $c + $d)<br></pre><p>This line writes a sequence of bytes into the memory region where AmsiScanBuffer is found, effectively <strong>neutralizing AMSI&#39;s scanning capability</strong> in the current PowerShell session.</p><pre>[void][Win32.Kernel32]::WriteProcessMemory($hProcess, [IntPtr]::Add($region.BaseAddress, $k), $replacement, $replacement.Length, [ref]$bytesWritten)</pre><p>The script iterates through memory regions of the current process and specifically checks for those mapped to clr.dll, which is the core .NET library loaded in PowerShell and also our first part of the flag</p><pre>if ([Win32.Kernel32]::GetMappedFileName($hProcess, $region.BaseAddress, $pathBuilder, $MAX_PATH) -gt 0) {<br>            $path = $pathBuilder.ToString()<br>            if ($path.EndsWith(&quot;clr.dll&quot;, [StringComparison]::InvariantCultureIgnoreCase)) {<br>                # Scan the region for the pattern<br>                $buffer = New-Object byte[] $region.RegionSize.ToInt64()<br>                $bytesRead = 0<br>                [void][Win32.Kernel32]::ReadProcessMemory($hProcess, $region.BaseAddress, $buffer, $buffer.Length, [ref]$bytesRead)<br>                for ($k = 0; $k -lt ($bytesRead - $signature.Length); $k++) {<br>                    $found = $True<br>                    for ($m = 0; $m -lt $signature.Length; $m++) {<br>                        if ($buffer[$k + $m] -ne $signature[$m]) {<br>                            $found = $False<br>                            break<br>                        }<br>                    }</pre><p>Scrolling down for the ScriptBlockID :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d5ERsRKxsffQmcq2WotfRA.jpeg" /></figure><p>And wohoo got the FLAG !<br><strong>ASCWG{clr.dll,be58fff7-bb11–4b73-b5bb-f16fd28fb683}</strong></p><h3><strong>2. A Worm in your apple</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*IzgCWGu0MmsUtFHA.png" /></figure><p>I was provided with a file named A_Worm_in_your_apple.dmg which is first time to encounter but i guessed it would be an apple ( MacOS img ) from the name XD</p><p>I tried using HFSexplorer and many other tools but none worked so I had to look for another creative way, I used 7z :P and started parsing the file system Insane right ?!! ahaha</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*44TOo6PClgn0K0THq4ppNA.png" /></figure><p>Based on the description, I suspected a persistence technique was in play. I began searching for related artifacts and came across the LaunchAgents folder. Inside it, I found a file named com.apple.mdworker.plist. Upon opening it in a text editor for inspection, I discovered something Very interesting !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Soii0sfYFYAmk_bqDwU0yw.png" /></figure><p>I found a .sh file, which was unusual to see referenced within a .plist file. This immediately raised suspicion. Navigating to the file’s location and examining its contents, I discovered it executed a command that was encoded in hexadecimal — a common technique used to obfuscate malicious behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*erqTXsZSgWkESh-okUs5Lg.png" /></figure><p>Upon decoding the hex string using CyberChef, it revealed a command designed to establish a connection with a <strong>Command and Control (C2) server “ 94.142.138.177”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73o7H2LDtE0IEBGgW5uc7w.png" /></figure><p>The discovery of a hex-encoded command leading to a suspicious IP address made it clear that this was no ordinary script. Uploading the .sh file to <strong>VirusTotal</strong> confirmed my suspicion, as several engines flagged it as malicious.</p><p>The Graph was not usefull, I just added it because it looks cool :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JourYgUFHNTVILF23-VEFg.png" /></figure><p>To further validate the threat, I conducted an open-source search using the IP address 94.142.138.177. This led me to several blog posts and threat intelligence reports documenting a well-known piece of <strong>macOS malware</strong> called <strong>Atomic Stealer (aka AMOS)</strong> — known for targeting macOS users and exfiltrating sensitive data through obfuscated shell scripts and C2 communication.<br>Flag: <strong>ASCWG{94.142.138.177:Atomic}</strong></p><h3><strong>3. I Broke The Chain</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*UysVR1xbl-C9ae9E.png" /></figure><p>I was provided with a disk image (.ad1) and was asked to get a hacker’s wallet address and the IP and port of his C2</p><p>This challenge was kinda fun, and I wanna share it from 2 perspectives <br><strong>Forensic Investigator :</strong> <br>I Firstly, opened the image in FTK imager, and started examining the disk image and I found a hidden directory within the Parent directory “Cursor” named “.cursor” and within that directory there was a very interesting thing, A lot of java related files, firefox files, and the important Part Solidity directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*R6hISHrf3QLLxI8GsVbjgw.jpeg" /></figure><blockquote>Solidity is a high-level programming language designed for writing smart contracts on the Ethereum blockchain</blockquote><p>which is very important for our task, there was a file “index.js” within the directory that had our 3 flag parts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjly6BOYqt5cbbPlR_r9sw.jpeg" /></figure><p>Here you go, you little investigator, Flag: <strong>ASCWG{185.134.89.10:8080,0xf5B5D624C2536698F99C3E2FB8a70830b42fdE24}</strong></p><p><strong>From a DFIR CTF Player Perspective:</strong></p><p>I extracted the whole Filesystem</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*ZJfaIoWJK3dXTJZ4otOMKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*yIuA3LTbbnYAfnkKHw92Wg.png" /></figure><p>Then Copied that to my linux machine because I love working from there :P<br>and just ran the grep command with some regex</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*PL8ITNyHB0qEycLYN3Zk3Q.png" /></figure><p>As you can see, I found the wallet instantly and the file that has it<br>Cool right? :D</p><h3><strong>4. Front runner</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*iUgskSRv-EhVr3Mp-sTw1w.png" /></figure><blockquote>Description : A smart contract was deployed in a rush, the Web3 auditor didn’t finish his code auditing, thus the contract was hacked and drained down to the last cent. The attacker, deployed fake contracts. Your task as a DF analyst, should you choose to accept it, is to find the address of the vulnerable contract, the function itself, and the vulnerable function opcode. NOTE: The address of the hacker is in the challenge named ‘I Broke The Chain’ Flag Format: ASCWG{ADDRESS:FUNCTION():FUNCTION OPCODE}</blockquote><p>I had nothing this time except the line “NOTE: The address of the hacker is in the challenge named ‘I Broke The Chain” from the description which made me go back to the previous challenge “I Broke The Chain” and start searching with that wallet address “<strong>0xf5B5D624C2536698F99C3E2FB8a70830b42fdE24” </strong>on smart contract sites like Sepolia, Etherscan.io ..etc and it was there on sepolia also there was 3 Contracts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hO_BjI7VIymvcbYThIYmmA.jpeg" /></figure><p>A failed transaction against a specific contractID combined with knowledge that the attacker deployed many fake contracts is a strong indicator that the failed transaction targeted the real (original) contract.<br>which is our first part of the flag “0x9000d6768fcdf86bbf9791b35adbd8862c0684bb”</p><p>Now, I need to know the vulnerable function.. i took the long way started trying to know what is<strong> Front running</strong></p><blockquote><strong>Overview</strong></blockquote><blockquote>Frontrunning is a technique where an attacker exploits the time delay between when a pending transaction is observed, and its inclusion in a block. By placing their own transaction with a higher gas price ahead of the victim’s transaction, the attacker can manipulate the outcome of certain contract interactions for their benefit. Frontrunning is a concern for decentralized exchanges, auctions, or any scenario where transaction order matters.</blockquote><blockquote><strong>Description</strong></blockquote><blockquote>Frontrunning occurs when an attacker gains an advantage by executing transactions ahead of others, particularly when they have knowledge of pending transactions that are about to be included in a block. In the context of smart contracts, frontrunning can be detrimental in scenarios where transaction order impacts the outcome. an attacker can observe a victim’s pending transaction intended to buy a specific token at a certain price. They can then quickly submit their own transaction with a higher gas price in order to buy the same token at a lower price before the victim’s transaction executes. This allows the attacker to benefit from the price difference at the expense of the victim. Frontrunning can be executed by anyone observing the mempool, but can also originate from block producers themselves.</blockquote><p>Then I started analyzing the OPcode using decompiler “Ethervm.io”, I found a lot of functions but only one caught my attention “PlaceBid()” function as the attacker would exploit it to place his bid and be the first on the block and put the victim in the second place making where he achieves <strong>priority execution</strong>, meaning their transaction affects the system state <em>before</em> the victim’s transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0DniJRHSVmW60MfWrLg1Q.png" /></figure><p>The revert statement is used in a way that suggests a potential re-entrancy attack. When revert is called, it can trigger a fallback function in another contract, which can then call the original function again before the state changes are finalized. Also “revert(memory[temp2 + var0 -temp2])” is suspicious. and the code uses msg.sender in a way that can be manipulated by an attacker. as storage[0x01] = msg.sender can be used to overwrite a critical storage variable with an attacker&#39;s address.</p><p>After this analysis, we have to find the OPCode that part was the hardest..<br>Looking at the disassembly of the Code we can find a lot of OPcodes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*lT3zyT7v37WskFYBny1VXQ.png" /></figure><p>I’m sure it’s PUSH4 because it pushes exactly 4 bytes which is all the attacker needs to supply the function selector for the HighestBidder() function. By doing this, the attacker can invoke that function directly, allowing them to position themselves as the top bidder. In this case, the selector being pushed is 0x91f90157<strong> </strong>and that completes the attack sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*40lkPYqDvq-lmDUO9lL3Tw.jpeg" /></figure><p>FLAG: <strong>ASCWG{0x9000d6768fcdf86bbf9791b35adbd8862c0684bb,PlaceBid(),PUSH4 0x91f90157}</strong></p><p>It’s the first time to make Writeup for forensic challenges, so I hope that you have learned something from it 😅<br>It was a nice CTF.. If you have any questions don’t hesitate to contact me<br>Goodluck ♥️</p><p>Linkedin : <a href="https://www.linkedin.com/in/0xzew/">https://www.linkedin.com/in/0xzew/</a></p><p>For Support.. you may buy me coffee 😔<br>InstaPay : <a href="https://ipn.eg/S/moaz712/instapay/1lgO4l">https://ipn.eg/S/moaz712/instapay/1lgO4l</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c60ea13e902a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Try Hack Me — Valley]]></title>
            <link>https://medium.com/@0xZew/try-hack-me-valley-986fd98894c5?source=rss-156a7765f49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/986fd98894c5</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[0xZew]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 15:45:22 GMT</pubDate>
            <atom:updated>2024-09-15T17:03:34.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>Try Hack Me — Valley WalkThrough</h3><p>Hello Everyone, that’s a write-up for the challenge Valley on the TryHackMe Platform I hope you enjoy, learn, and get some knowledge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*eovQvaSArZbruey2VVulNw.png" /></figure><p>First of all I scanned the target Using Nmap and i found some juicy stuff like ports 22,80,37370 is open</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1LOi5jFZqBtMMNPG0MIe6Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqKiTVG6iosXQyKnrsal7w.png" /></figure><p>as I found port 80 is opened I went immediately to check what website is being hosted on that port and I found this one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KDA-YTMLrp9uMTTu1gh5yQ.png" /></figure><p>I clicked on the 2 buttons, navigated through the website and I noticed that we got 2 directories ‘pricing’ and ‘gallery’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sS26i3GM1BLUtC2-pBilwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeWayjtRMVqZMzbTMywEIA.png" /></figure><p>when clicking on any photo of the photos in the gallery directory it redirects me to another directory called ‘static’ with the name of the photo (in the URL )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5XXhP6SnCtNT9_5h9WNRw.png" /></figure><p>so I decided to run gobuster on all of these directories and I found something interesting a ‘/00&#39;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UH5nCUlVcivtp96w6KACqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ENPo4A71hG6MAu9OOH1UiA.png" /></figure><p>then I went to see what is the content of that file/photo and I found that it contains this information which indicates the existence of another directory called /dev12343224123123</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xGr7dogrv8CUMZuAst_YA.png" /></figure><p>I got that into my URL and I found a login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*19ZMqXBUnNyl8pzfcDVEFA.png" /></figure><p>I started trying SQL injection but it failed so I kept going through the source code and I found many files “style.css”, “dev.js” and “button.js” files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5v9uQqBQNzv8iqXpv-MJ2Q.png" /></figure><p>I went to the files one by one and nothing interesting except for the dev.js</p><p>I found credentials in there and a script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpeTQJAGiScDHaoE10y_cw.png" /></figure><p>I logged in using these creds and it redirected me to the page in the script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sLIQ8Wtbbcu_cZ_zEInGQ.png" /></figure><p>the line “ — stop reusing credentials” was good to notice, I logged into the FTP service on port 37370 using the same credentials and it got me in also I found many pcap files, so I downloaded them all</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3umM7cqvZ6KLdPrBSvRzTw.png" /></figure><p>after that, I used Wireshark to open the files and tried to analyze them but nothing was useful so I tried exporting objects on the file named “ siemHTTP2.pcapng” and there were a lot of files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g03TI68466Ah-bEz-V1hpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0F469Jk8iKjZ4XRqw8Mww.png" /></figure><p>Navigating through them all I found creds in that one called “index(1).html” Now we go username and password let’s try logging in using SSH</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-HaUZkP6ZNS77qvTUkufw.png" /></figure><p>I found the user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HnWFnzhww8QcjJ61XfU1g.png" /></figure><p>Now, as a normal user on the machine I need to use privilege escalation techniques while navigating through the system, I found a file called valleyAuthenticator in the home directory so I opened a Python server and downloaded the file on my machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C7TRLYZzJ27BbuREnn_qZg.png" /></figure><p>I used strings on the executable and found a link referring to upx site so, I tried decompressing the file using upx then used grep command to look for usernames, although I found no usernames, I found numbers and letters that looked like an MD5 hashes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*wbtkLtaJZzT3qBafFerrmg.png" /></figure><p>Itook the hashes and cracked them, and it was a username and a password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXuHiBd3gKLfudzJOdEXdA.png" /></figure><p>I logged in to SSH using these creds and it got me in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbGugjiSOgtmIBC8a0fS6w.png" /></figure><p>I went to check if there is scripts being run by crontabs and there was photoEncrypt.py, I used nano to see what’s inside and found that it is using base64.py library</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*1jKJGk4GUAj8qBUFdeWmdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QTff7Wczzm7FwKU_S3ToA.png" /></figure><p>I located the base64.py library and I saw that it can be edited by ValleyAdmins group which we are a part of</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*EOq7LzjP0r3y5WSB_x5TYg.png" /></figure><p>I injected the command into the base64.py and then used the bin/bash file with -p to get privileges</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*APSDkniKa4BypJKwAdKi2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*cpV0u5QLLsAvQ_wq2dAfBw.png" /></figure><p>as you can see now I’m root, I went to the root directory and listed it’s files and found the flag in the root.txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5G9ugmmbHtSx17l9VSUKA.png" /></figure><p>I hope you enjoyed the writeup :)</p><p>Thank you for reading ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=986fd98894c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>