<?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 Mohamed atiaa on Medium]]></title>
        <description><![CDATA[Stories by Mohamed atiaa on Medium]]></description>
        <link>https://medium.com/@meto0x01?source=rss-ae6982da45dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o61QG2rQENEnOHhOgWQShg.png</url>
            <title>Stories by Mohamed atiaa on Medium</title>
            <link>https://medium.com/@meto0x01?source=rss-ae6982da45dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 01:55:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meto0x01/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 Quals CTF 2024 Reverse Challenge]]></title>
            <link>https://medium.com/@meto0x01/ascwg-quals-ctf-2024-reverse-challenge-459ac3b91a2f?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/459ac3b91a2f</guid>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 13:01:35 GMT</pubDate>
            <atom:updated>2025-07-10T13:01:35.114Z</atom:updated>
            <content:encoded><![CDATA[<h3>— W4rm Up —</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YIYgb6O5fdyUZUYf.png" /></figure><p>Challenge Link</p><pre>Challenge Link : https://drive.google.com/file/d/1Ya9KgMH46sbxQ1CK4m-i7GkYm9FRKK4h/view?usp=sharing</pre><p>Solve :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bk7k3x7dR9gQ3EweteLpCg.png" /></figure><p>Once we open the challenge in IDA, we can see that it’s try to use PyInstaller. One of the popular tools to extract such packages is ‘PyInstxtractor’. So, let’s go ahead and try it out</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLv5sPTfrJmyOJrO4fG7Ow.png" /></figure><p>lt’s open the directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J76mw0y7ijVksPUTFbVVMQ.png" /></figure><p>after open the file with cat will find the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l73fZWZvR0OuSPZAi05ewA.png" /></figure><p>Flag: ASCWG{W3lcom3_t0_th3_W4r_z0n3_G4m35}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=459ac3b91a2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Challenge Writeup:exclus1ve]]></title>
            <link>https://medium.com/@meto0x01/challenge-writeup-exclus1ve-d578df3ff97f?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d578df3ff97f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 12:36:22 GMT</pubDate>
            <atom:updated>2025-07-08T12:36:22.496Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJZ01cl12yjALL2Jz2LLYw.png" /></figure><h3>Challenge Details</h3><ul><li><strong>Challenge Name:</strong> exclus1ve</li><li><strong>Category:</strong> Malware Reverse Engineering</li><li><strong>Level:</strong> Easy</li><li><strong>Points:</strong> 50</li><li><strong>Description:</strong> I have written a C program that acts as a Demo for XOR encryption, check how cool it is!.</li><li>Link:<a href="https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/exclus1ve">https://hubchallenges.s3.euwest1.amazonaws.com/reverse/exclus1ve</a></li></ul><h4>Solve :</h4><ol><li>frist thing we make in all challenges is know all information can we gathering</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eNbvNwkDdkWHG7jeH60J_A.png" /></figure><p>So now we know wahat we need let’s try open it with ida or any dissassembler you have</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-Y6d_7y_tOtJiOTyxPpVw.png" /></figure><p>As we see the app frist thing is check if our password == this string “Cyb3rTalents”</p><ol><li>Checks if the user enters the correct key.</li><li>If the key is correct, it uses that key to <strong>decrypt</strong> some hidden data using the XOR operation and print this message but will not print flag</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SlheLVRCRvSfJNVRgihYCQ.png" /></figure><p>we should make script to decrypt the flag now we have the encrypted data and the key to decrypt it</p><p>nut frist make decompile our code</p><p>These are four 64-bit integers (8 bytes each).</p><ul><li>Total = 32 bytes of encrypted data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABQfT_9yWl-GFnt2cB162w.png" /></figure><p>so let’s write the decrypt code <br>frist thing it’s convert the v6 array into a byte array using pointer casting.</p><ul><li>Iterates through all 32 bytes.</li><li>Each byte is XORed with one character from the key.</li><li>The key is reused in a loop using i % 12 (since the key is 12 characters long).</li><li>This operation decrypts each byte of the hidden message.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7mMOpyiSrWlE2vwAJlVdQ.png" /></figure><p>Let’s run it to check if he works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*dzIZESC3dv_MSEPh6Ul9qA.png" /></figure><h4>flag :FLAG{Great_efforts_Great_results}</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d578df3ff97f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Challenge Writeup: bronze ASM]]></title>
            <link>https://medium.com/@meto0x01/challenge-writeup-bronze-asm-8d5fcfe0b8a1?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d5fcfe0b8a1</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 11:33:15 GMT</pubDate>
            <atom:updated>2025-07-07T11:33:15.643Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JvUl-PQU2GsuEKALk0dNFw.png" /></figure><h3>Challenge Details</h3><ul><li><strong>Challenge Name:</strong> bronze ASM</li><li><strong>Category:</strong> Malware Reverse Engineering</li><li><strong>Level:</strong> Easy</li><li><strong>Points:</strong> 50</li><li><strong>Description:</strong> This Challenge will help you understand how to analyze simple assembly code. The flag is the parameter of the function in the format FLAG{0_%X_0} (where %X is the parameter in hexadecimal).</li></ul><p><strong>Link:</strong><a href="https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/ASM_v1.asm">https://hubchallenges.s3.euwest1.amazonaws.com/reverse/ASM_v1.asm</a></p><h3>Solution</h3><p>The challenge provides an assembly code snippet (ASM_v1.asm) and states that the flag is a function parameter in a specific format. Our goal is to analyze this assembly to determine the correct parameter value.</p><h4>1. Analyze the Provided Assembly Code</h4><p>Let’s examine the assembly code provided:</p><p>Code snippet</p><pre>push    rbp<br>mov     rbp, rsp<br>mov     DWORD PTR [rbp-4], edi  ; Parameter is moved from edi to local variable<br>mov     eax, DWORD PTR [rbp-4]  ; Parameter is moved from local variable to EAX<br>sal     eax, 3                  ; Logical left shift EAX by 3 bits<br>cmp     eax, 5744               ; Compare EAX with 5744<br>sete    al                      ; Set AL to 1 if EAX == 5744, else 0<br>movzx   eax, al                 ; Zero-extend AL to EAX<br>pop     rbp<br>ret</pre><h4>2. Deconstruct the Assembly Instructions</h4><ul><li><strong>push rbp / </strong><strong>mov rbp, rsp / </strong><strong>pop rbp / </strong><strong>ret</strong>: These are standard function prologue and epilogue instructions. They set up and tear down the stack frame for the function.</li><li><strong>mov DWORD PTR [rbp-4], edi</strong>: This instruction moves the value from the edi register into a memory location on the stack (at rbp-4). In the x64 calling convention, the first integer or pointer argument to a function is typically passed in the edi register. Thus, edi holds our <strong>parameter</strong>.</li><li><strong>mov eax, DWORD PTR [rbp-4]</strong>: The parameter, now stored in the stack, is moved into the eax register. eax is the lower 32-bit portion of rax, often used for general-purpose arithmetic and return values.</li><li><strong>sal eax, 3</strong>: This is a <strong>&quot;Shift Arithmetic Left&quot;</strong> instruction. It shifts the bits in the eax register to the left by 3 positions. A left shift by N bits is equivalent to multiplying the value by 2^N. Therefore, sal eax, 3 is equivalent to eax = eax * 2^3, or eax = eax * 8.</li><li><strong>cmp eax, 5744</strong>: This instruction <strong>compares</strong> the current value in eax (which is parameter * 8) with the decimal value 5744. This comparison sets various flags in the CPU&#39;s flag register.</li><li><strong>sete al</strong>: This instruction means &quot;Set if Equal&quot;. It sets the al register (the lower 8 bits of eax) to 1 if the previous comparison (cmp) indicated that the two values were equal, otherwise it sets al to 0. This is typically used to return a boolean result (True/False) from the function.</li><li><strong>movzx eax, al</strong>: This instruction &quot;Move with Zero Extend&quot;. It takes the 1-byte value from al (which is either 0 or 1) and copies it to the 4-byte eax register, filling the upper bytes with zeros.</li></ul><h4>3. Derive the Parameter Value</h4><p>The critical part for finding the parameter is the comparison:</p><p>eax (which is parameter * 8) is compared to 5744. For the sete al instruction to set al to 1 (indicating a &quot;true&quot; condition, likely the success state for the flag), the values must be equal.</p><p>So, we have the equation:</p><p>parameter * 8 = 5744</p><p>To find the parameter:</p><p>parameter = 5744 / 8 parameter = 718</p><h4>4. Format the Flag</h4><p>The challenge specifies the flag format as FLAG{0_%X_0}, where %X is the parameter in hexadecimal.</p><p>First, convert the decimal parameter 718 to hexadecimal:</p><ul><li>718div16=44 remainder 14 (which is E in hex)</li><li>44div16=2 remainder 12 (which is C in hex)</li><li>2div16=0 remainder 2 (which is 2 in hex)</li></ul><p>Reading the hexadecimal digits from bottom to top, 718 in decimal is 2CE in hexadecimal.</p><p>Now, substitute this into the flag format: FLAG{0_2CE_0}</p><h3>The Flag</h3><p>FLAG{0_2CE_0}</p><h4><a href="https://www.linkedin.com/in/mohamed-atiaa-185202299/">https://www.linkedin.com/in/mohamed-atiaa-185202299/</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d5fcfe0b8a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Challenge Writeup: GUI I]]></title>
            <link>https://medium.com/@meto0x01/challenge-writeup-gui-i-aa58b38740ae?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa58b38740ae</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Sun, 06 Jul 2025 17:00:30 GMT</pubDate>
            <atom:updated>2025-07-06T17:00:30.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJN1Fg92L89mzrg7ai5vJQ.png" /></figure><h3>Challenge Details</h3><ul><li><strong>Challenge Name:</strong> GUI I</li><li><strong>Category:</strong> Malware Reverse Engineering</li><li><strong>Level:</strong> Easy</li><li><strong>Points:</strong> 50</li><li><strong>Description:</strong> The correct input is the flag, format flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}</li><li><strong>Link:</strong> <a href="https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/GUI.exe">https://hubchallenges.s3.eu-west1.amazonaws.com/reverse/GUI.exe</a></li></ul><h3>Solution</h3><p>The challenge provides a Windows executable (GUI.exe). Since it&#39;s a &quot;GUI&quot; challenge in the &quot;Malware Reverse Engineering&quot; category, the first step is typically to run the executable and observe its behavior, then proceed to static analysis if the GUI interaction isn&#39;t immediately obvious.</p><h4>. Initial Execution and Observation</h4><p>Upon running GUI.exe, a simple Windows Form application appears. It contains:</p><ul><li>A <strong>button</strong> labeled “button1”.</li><li>Eight <strong>checkboxes</strong> labeled “checkBox1” through “checkBox8”.</li><li>A few <strong>labels</strong>, notably label2, label3, and label4.</li></ul><p>Interacting with the checkboxes changes their state (checked/unchecked). Clicking “button1” seems to be the primary interaction point. There’s no immediate input field for a flag. This suggests the flag is either generated, or derived from a specific sequence of inputs.</p><h4>2. Static Analysis (Decompilation)</h4><p>Given it’s a .NET executable (common for C# Windows Forms apps), a decompiler like <strong>dnSpy</strong> or <strong>ILSpy</strong> is ideal. Opening GUI.exe in dnSpy immediately reveals the C# source code.</p><p>Navigating to the Form1 class and examining the event handlers, the button1_Click method stands out as the core logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MajC05cpc1O5MeBdnnZTSA.png" /></figure><h4>3. Understanding the Logic</h4><p>The button1_Click method reveals the following:</p><ul><li><strong>Binary Input:</strong> The eight checkboxes (checkBox1 to checkBox8) are treated as an 8-bit binary number. When &quot;button1&quot; is clicked, the code iterates through these checkboxes. If a checkbox at index i (starting from 0) is checked, 2^i is added to a running total num. This effectively converts the checkbox pattern into its decimal equivalent. This decimal value is displayed in label4.</li><li><strong>Hidden Key:</strong> A Label named label3 (which is set to Visible = false in InitializeComponent(), making it hidden from the user) contains a space-separated string of numbers.</li><li>The string is: &quot;92 98 87 93 113 95 105 85 106 94 95 105 85 89 87 91 105 87 104 85 89 95 102 94 91 104 53 115&quot;</li><li><strong>Decryption Condition:</strong> The critical line is if (targetNumber + 10 == num).</li><li>targetNumber is the current number being read from the hidden label3 string (indexed by the current variable).</li><li>num is the decimal value calculated from the user&#39;s checkbox input.</li><li>For a character to be revealed, the num value (from checkboxes) must be equal to the current targetNumber from label3 <strong>plus 10</strong>.</li><li><strong>Flag Construction:</strong> If the condition is met, the num value is cast to a character ((char)num) and appended to label2. The current index is then incremented, moving to the next targetNumber in the label3 sequence.</li></ul><h4>4. Decrypting the Flag</h4><p>To get the flag, we need to iterate through each number in the label3 string, add 10 to it, and convert the result to its corresponding ASCII character.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pudOwxlprJudv4QAR4LGpQ.png" /></figure><p>Let&#39;s break down the hidden numbers:</p><ul><li>92 + 10 = 102 (ASCII: f)</li><li>98 + 10 = 108 (ASCII: l)</li><li>87 + 10 = 97 (ASCII: a)</li><li>93 + 10 = 103 (ASCII: g)</li><li>113 + 10 = 123 (ASCII: {)</li><li>95 + 10 = 105 (ASCII: i)</li><li>105 + 10 = 115 (ASCII: s)</li><li>85 + 10 = 95 (ASCII: _)</li><li>106 + 10 = 116 (ASCII: t)</li><li>94 + 10 = 104 (ASCII: h)</li><li>95 + 10 = 105 (ASCII: i)</li><li>105 + 10 = 115 (ASCII: s)</li><li>85 + 10 = 95 (ASCII: _)</li><li>89 + 10 = 99 (ASCII: c)</li><li>87 + 10 = 97 (ASCII: a)</li><li>91 + 10 = 101 (ASCII: e)</li><li>105 + 10 = 115 (ASCII: s)</li><li>87 + 10 = 97 (ASCII: a)</li><li>104 + 10 = 114 (ASCII: r)</li><li>85 + 10 = 95 (ASCII: _)</li><li>89 + 10 = 99 (ASCII: c)</li><li>95 + 10 = 105 (ASCII: i)</li><li>102 + 10 = 112 (ASCII: p)</li><li>94 + 10 = 104 (ASCII: h)</li><li>91 + 10 = 101 (ASCII: e)</li><li>104 + 10 = 114 (ASCII: r)</li><li>53 + 10 = 63 (ASCII: ?)</li><li>115 + 10 = 125 (ASCII: })</li></ul><p>Concatenating these characters yields the flag.</p><h3>The Flag</h3><p>flag{this_caesar_cipher?}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa58b38740ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writeup for Challenge: Developer Locks]]></title>
            <link>https://medium.com/@meto0x01/writeup-for-challenge-developer-locks-5384da05f995?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5384da05f995</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Sun, 06 Jul 2025 12:26:34 GMT</pubDate>
            <atom:updated>2025-07-06T12:26:34.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMsOXrlq7FOyP0P_N9hMjA.png" /></figure><p><strong>Category:</strong> Malware Reverse Engineering<br> <strong>Level:</strong> Easy<br> <strong>Points:</strong> 50</p><p><em>Download Link : </em><a href="https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/CT-rev-b1.exe"><em>https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/CT-rev-b1.exe</em></a></p><h3>Challenge Description</h3><blockquote><em>You are given a binary </em><em>.exe file.<br> Your goal is to give it the correct </em><strong><em>hash</em></strong><em> to make it happy 😄<br> Let&#39;s see what&#39;s inside and reverse it!</em></blockquote><blockquote>now after we opened it with Detect it easy we figure out this program written by C# ok lit’s continue</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZU6L1PqTM0XJxtdyu06OMQ.png" /></figure><h3>Step 1: Open in dnSpy</h3><p>Using <strong>dnSpy</strong> to reverse the executable, we quickly locate the Main method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7JEhuTACpHQD09JFTZ3zPA.png" /></figure><p>The program prints a message, reads a string input from the user, and checks:</p><p>At this point, we had two possible approaches to try:</p><ul><li>Attempt to figure out the original value that was hashed using MD5.</li><li>Or try to <strong>decrypt</strong> the hash directly — since it’s static and doesn’t change.</li></ul><p>Although MD5 is not actual encryption and isn’t technically reversible, in many cases we can recover the original value using online tools that rely on <strong>rainbow tables</strong>.</p><h4>This is the site i used <br><a href="https://www.md5online.org/md5-decrypt.html"><em>https://www.md5online.org/md5-decrypt.html</em></a><em>?</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlgSdzoUCDjjYkgYHUtEug.png" /></figure><blockquote>flag is<br><strong>Pic@tchuz00</strong></blockquote><h4><a href="https://www.linkedin.com/in/mohamed-atiaa-185202299/">https://www.linkedin.com/in/mohamed-atiaa-185202299/</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5384da05f995" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberTalents-Get rid of them all]]></title>
            <link>https://medium.com/@meto0x01/cybertalents-get-rid-of-them-all-aae3497b75f8?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/aae3497b75f8</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Sun, 06 Jul 2025 10:10:19 GMT</pubDate>
            <atom:updated>2025-07-06T10:12:01.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Fz0WATc36IFd3RZBfORow.png" /></figure><p>Today, we’re kicking things off with a classic: the <strong>“Get rid of them all”</strong> challenge from <strong>CyberTalents</strong>.</p><h3>Challenge Overview</h3><ul><li><strong>Challenge Name:</strong> Get rid of them all</li><li><strong>Category:</strong> Malware Reverse Engineering</li><li><strong>Level:</strong> Easy</li><li><strong>Points:</strong> 50</li><li><strong>Description:</strong> “Someone corrupted the file so that we cannot execute it, and we need your help. Obtain the flag, format flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}”</li><li><strong>Link:</strong> <a href="https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/get-rid-of-them.jar">https://hubchallenges.s3.eu-west-1.amazonaws.com/reverse/get-rid-of-them.jar</a></li></ul><p>The challenge provides us with a .jar file that&#39;s supposedly corrupted and won&#39;t execute. Our mission is to analyze it and extract the hidden flag.</p><h3>Initial Analysis: Understanding the .jar File</h3><p>Before diving into the solution, let’s quickly understand what a <strong>.jar file</strong> is and what it implies for reverse engineering.</p><p>A .jar (Java Archive) file is essentially a standard <strong>.zip</strong> file specifically designed for Java applications. It bundles all necessary components like <strong>.class files</strong> (which contain Java bytecode), resources, and a MANIFEST.MF file that holds important metadata about the application.</p><p>Unlike native executables (.exe or ELF) which compile directly to machine code, .jar files contain <strong>bytecode</strong>. This bytecode runs on the Java Virtual Machine (JVM) and has a distinct advantage for reverse engineers: it&#39;s relatively easy to <strong>decompile</strong> back into human-readable Java source code. This makes understanding the application&#39;s logic significantly simpler than analyzing raw assembly.</p><p>The challenge states the file is “corrupted.” This could mean a few things:</p><ol><li><strong>Partial damage:</strong> Some bytecode or the .jar structure itself is broken.</li><li><strong>Intentional alteration:</strong> The creator might have deliberately modified it to prevent normal execution, forcing reverse engineering.</li><li><strong>Missing or corrupted </strong><strong>MANIFEST.MF:</strong> This could prevent the JVM from identifying the main entry point.</li></ol><p>Regardless of the cause, our task is to navigate this corruption and retrieve the flag.</p><h3>Tools Used</h3><p>For this specific challenge, our primary tool will be:</p><ul><li><strong>JD-GUI:</strong> A popular standalone graphical utility that decompiles Java .class files. It&#39;s excellent for quickly Browse and analyzing the source code of Java applications within .jar archives.</li></ul><h3>Solution Steps</h3><p><strong>Solving “Get rid of them all”</strong></p><ol><li><strong>JD-GUI is working:</strong> You’ve successfully opened get-rid-of-them.jar.</li><li><strong>Flag Location:</strong> In ctf.class, you found an <strong>obfuscated string</strong> variable named flag.</li><li><strong>Deobfuscation Key:</strong> The main method in ctf.class calls o.l_1(flag), where o is an object from <strong>ooo.class</strong>. This l_1 function in ooo.class is responsible for deobfuscating the flag.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8PGFy5TXbPtx_C08QRvgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G34G16WXTwTIk43E4Ui0dw.png" /></figure><p>Now that we’ve gone into the code, we found some code encoded in Base64. Let’s head over to CyberChef and check the decode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKo_kn0LYkZel5wujpnhnw.png" /></figure><h3>flag :</h3><blockquote>flag{b@d_ch@@rs_@@@re_B@@@@d}</blockquote><p><a href="https://www.linkedin.com/in/mohamed-atiaa-185202299/">https://www.linkedin.com/in/mohamed-atiaa-185202299</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aae3497b75f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ELF Master — cybertalents]]></title>
            <link>https://medium.com/@meto0x01/elf-master-cybertalents-94b28cd547b9?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/94b28cd547b9</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Mon, 12 May 2025 16:53:03 GMT</pubDate>
            <atom:updated>2025-05-12T16:53:03.574Z</atom:updated>
            <content:encoded><![CDATA[<h3>ELF Master — cybertalents</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vXEJZbsJ677oW9WjI3K8bA.png" /></figure><p>Here we have a reverse challenge and It is classified as Basic At first glance, you might think that there is no idea and you will leave it.</p><p>But when we download it and try to run it, we will see this<br>because you did not read the description</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*smLkLLqIa_x23MDwD_o7JA.png" /></figure><p>The goal of the challenge was to deal with a modified ELF (Executable and Linkable Format) file that did not contain a valid entry point. The problem was that the entry point</p><p>When examining the file with the readelf tool, it was found that the file had an incorrect entry point value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YU4tiS0IcMb34phlKa3GVw.png" /></figure><p>The entry point is the address from which a program’s execution begins. In this file, the entry point was 0x0, which means that when you try to run the file, the system won’t know where to start execution.</p><p>I made several attempts.<br>The goal was to try to determine the entry point using Rizin:<br>We tried using Rizin (an advanced analysis tool) to search for the entry point. Our goal was to manually change the entry point if we didn’t find it correctly defined, but this attempt was unsuccessful.</p><p>Then we used the objcopy tool to determine the entry point:<br>After failing to use Rizin, we decided to use the objcopy tool to change the entry point. Initially, we tried using the <strong>— set-entry=0x1080 </strong>option, but unfortunately, we encountered an error because the tool didn’t support this option.</p><p>Finally, we corrected the option in objcopy:<br>The option was modified to use <strong>— set-start=0x1080 instead of — set-entry</strong>. This option correctly sets the starting point for the program. When we run the following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6ZTP7HS7yIFazWJazfn3A.png" /></figure><p>Now, a new copy of the file has been created with the entry point modified to <strong>0x1080</strong>.</p><p>After the modification, we rechecked the modified file using readelf -h ./ELF+Master.fixed to confirm that the modification was successful. The result was as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLAzNktuTeqdDm9bljw3ZA.png" /></figure><p>As you can see, the entry point has been updated to address 0x1080, which means the file now has a valid entry point.</p><h4>Now let’s try to run it again and this was the result:</h4><p>we get the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHMs8xOQjz_Tdlhpc0tTSg.png" /></figure><blockquote>flag{D0_1_L00k_L1k3_4n_3LF_M4st3r}</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94b28cd547b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 5 — IDA Pro]]></title>
            <link>https://medium.com/@meto0x01/lab-5-ida-pro-b8252a87281e?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8252a87281e</guid>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Tue, 24 Dec 2024 16:51:40 GMT</pubDate>
            <atom:updated>2024-12-24T18:43:30.156Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab 5-1 IDA Pro</h3><h3>Lab 5–1</h3><p>This lab analyses the malware found in the file Lab05–01.dll, and is a longer lab designed to demonstrate features of IDA Pro and give hands-on experience.</p><blockquote><em>1. What is the address of DllMain?<br>2. Use the Imports window to browse to gethostbyname. Where is the import located?<br>3. How many functions call gethostbyname?<br>4. Focusing on the call to gethostbyname located at 0x10001757, can you figure out which DNS request will be made?<br>5. How many local variables has IDA Pro recognized for the subroutine at 0x10001656?<br>6. How many parameters has IDA Pro recognized for the subroutine at 0x10001656?<br>7. Use the Strings window to locate the string \cmd.exe /c in the disassembly. Where is it located?<br>8. What is happening in the area of code that references \cmd.exe /c?<br>9. In the same area, at 0x100101C8, it looks like dword_1008E5C4 is a global variable that helps decide which path to take. How does the malware set dword_1008E5C4? (Hint: Use dword_1008E5C4’s cross-references.)<br>10. A few hundred lines into the subroutine at 0x1000FF58, a series of comparisons use memcmp to compare strings. What happens if the string comparison to robotwork is successful (when memcmp returns 0)?<br>11. What does the export PSLIST do?<br>12. Use the graph mode to graph the cross-references from sub_10004E79. Which API functions could be called by entering this function? Based on the API functions alone, what could you rename this function?<br>13. How many Windows API functions does DllMain call directly? How many at a depth of 2?<br>14. At 0x10001358, there is a call to Sleep (an API function that takes one parameter containing the number of milliseconds to sleep). Looking backward through the code, how long will the program sleep if this code executes?<br>15. At 0x10001701 is a call to socket. What are the three parameters?<br>16. Using the MSDN page for socket and the named symbolic constants functionality in IDA Pro, can you make the parameters more meaningful? What are the parameters after you apply changes?<br>17. Search for usage of the in instruction (opcode 0xED). This instruction is used with a magic string VMXh to perform VMware detection. Is that in use in this malware? Using the cross-references to the function that executes the in instruction, is there further evidence of VMware detection?<br>18. Jump your cursor to 0x1001D988. What do you find?<br>19. If you have the IDA Python plug-in installed (included with the commercial version of IDA Pro), run Lab05–01.py, an IDA Pro Python script provided with the malware for this book. (Make sure the cursor is at 0x1001D988.) What happens after you run the script?<br>20. With the cursor in the same location, how do you turn this data into a single ASCII string?<br>21. Open the script with a text editor. How does it work?</em></blockquote><p>This lab designed for Training on how to use IDA-Pro</p><p>So come behind me and get ready but we need to do some changes in our program no doubt it help us when we analyze the sample. First <strong>enable Line Prefixes</strong>, <strong>set Opcode bytes to 6</strong>, and <strong>enable Auto Comments</strong>. This will provide some clarity to the assembly. The windows will likely be present by default, but can be switched to with the shortcuts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qNZqVwjjDn_WIg52ou8kQ.png" /></figure><p><strong>Solution for Lab 5 — IDA Pro</strong></p><ol><li><strong>What is the address of DllMain?</strong></li></ol><p>Frist we search in DllMain in Functions and select it by two clicks and you will see the address 0x1000D02E</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgccvIXT9P02e5VxZj5q2w.png" /></figure><p><strong>2. Use the Imports window to browse to gethostbyname. Where is the import located?</strong></p><p>gethostbyname is located at 0x100163CC after we search in imports tap and also after two clicks in function we go in data section also takes a single parameter something like a string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qAXgBI5rxweDpf0Smd9FoQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZY150SyTum8fhH024pUgUA.png" /></figure><p><strong>3. How many functions call gethostbyname?</strong></p><p>We will use x-refrance to see from where this function is call frist selcet the function in this case we was in data section and press X botton in your keyboard it’s make us see the list refrances its <strong>18</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mo9q0HrNZT5QpoTWnjsyiw.png" /></figure><p><strong>4. Focusing on the call to gethostbyname located at 0x10001757, can you figure out which DNS request will be made?</strong></p><p>Frist press G and write the address that we wanna to go in this case is <strong>0x10001757</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*92vxl-zunlHm4hk8lJ324Q.png" /></figure><p>Now we see the function <strong>gethostbyname and as we know it takes 1 one </strong>parameter is eax this register is load some of content loaded from offset_10019040</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9sP4qyb9_FSPYpgZdqH8A.png" /></figure><p>when we click in it we see off_10019040 points to a variable aThisIsRdoPicsP which contains string. And when we back to the function we see0Dh is added to eax, which moves the pointer along the current Contents. 0Dh can be converted in IDA to 13. This means the points to 13 characters inside of its current contents . So the DNS made “pics.practicalmalwareanalysis.com”</p><p><strong>5 &amp; 6. How many parameters and local variables are recognized for the subroutine at 0x10001656?</strong></p><p>Like every time we need to go for specific address we press G and gives him the address location</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*0PIQhWWvbs1B0bK-i25ISw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Y3swbc-9u3DgpgoSC5Ocg.png" /></figure><p>Local variables correspond to negative offsets .Each line like var_xxx or explicitly named variables corresponds to a stack variable declared within the function. These are usually local variables or function arguments stored relative to the stack pointer.</p><h4>Local Variables</h4><ul><li>var_675: 1 byte</li><li>var_674: 4 bytes</li><li>hModule: 4 bytes</li><li>timeout: size of timeval (platform-dependent, typically 8or more bytes)</li><li>name: size of sockaddr (platform-dependent, typically 16 bytes)</li><li>var_654: 2 bytes</li><li>in: size of in_addr (platform-dependent, typically 4 bytes)</li><li>Str1, var_640, CommandLine, Str, var_638, var_637: all 1 byte each</li><li>var_544: 1 byte</li><li>var_50C: 4 bytes</li><li>var_500: 1 byte</li><li>Buf2: 1 byte</li><li>readfds: size of fd_set (platform-dependent, often 128 bytes)</li><li>buf: 1 byte</li><li>var_3B0, var_1A4, var_194: all 4 bytes each</li><li>WSAData: size of WSAData (platform-dependent, typically 400 bytes)</li></ul><h4>Function Argument</h4><ul><li>lpThreadParameter: 4 bytes (offset 4 from esp)</li></ul><h3>Total Variables</h3><p>Counting each distinct stack variable and function argument:</p><ul><li><strong>Local Variables:</strong> 24 (listed above)</li><li><strong>Function Arguments:</strong> 1</li></ul><p><strong>7. Use the Strings window to locate the string \cmd.exe /c in the disassembly. Where is it located?</strong></p><p>Press Alt+T to perform a string search for \cmd.exe /c, which is stored as aCmdExeC, found within sub_1000FF58 at offset 0x100101D0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrlmG9ib6wDcmGLOmlHaug.png" /></figure><p><strong>8. What is happening in the area of code that references \cmd.exe /c?</strong></p><p>The command cmd.exe /c opens a new instance of cmd.exe and the /c parameter instructs it to execute the command then terminate. This suggests that there is likely a construct of something to execute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIAuah_Q3Ie4V1PjlMv_jQ.png" /></figure><p>Towards the top of the function, we see an address that is quite telling of what is happening. The offset aHiMasterDDDDDD called at 0x1001009Dcontains a long message which includes several strings relating to system time information (actually initialised just before), but more notably reference to a Remote Shell Session</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*duRbJTdU4dcm-UWaQzZNLA.png" /></figure><p>Further on throughout the function, there are more interesting offset addresses with strings that may provide an indication of activity.</p><ol><li><strong>Get ServiceName-&gt;&#39;%s&#39;</strong></li></ol><ul><li>Extracted from offset xdoors_d:10095A16</li><li>Likely used to fetch a service name.</li></ul><ol><li><strong>Get ProcessName-&gt;&#39;%s&#39;</strong></li></ol><ul><li>Found at xdoors_d:10095A2C</li><li>Used to obtain a process name.</li></ul><ol><li><strong>Get ModuleName-&gt;&#39;%s&#39;</strong></li></ol><ul><li>Located at xdoors_d:10095A44</li><li>Retrieves a module’s name.</li></ul><ol><li><strong>Get ModulePath-&gt;&#39;%s&#39;</strong></li></ol><ul><li>At xdoors_d:10095A5C</li><li>Likely fetches a module’s file path.</li></ul><ol><li><strong>CreateProcess() GetLastError reports %d</strong></li></ol><ul><li>Found at xdoors_d:10095A74</li><li>Indicates an error from CreateProcess()</li></ul><ol><li><strong>Commands/Keywords:</strong></li></ol><ul><li><strong>inject</strong> (xdoors_d:10095AA0)</li><li><strong>minstall</strong> (xdoors_d:10095AA8)</li><li><strong>mmodule</strong> (xdoors_d:10095AB4)</li><li><strong>mhost</strong> (xdoors_d:10095ABC)</li><li><strong>mbase</strong> (xdoors_d:10095AC4)</li><li><strong>robotwork</strong> (xdoors_d:10095ACC)</li><li><strong>language</strong> (xdoors_d:10095AD8)</li><li><strong>uptime</strong> (xdoors_d:10095AE4)</li><li><strong>idle</strong> (xdoors_d:10095AEC)</li></ul><ol><li><strong>Miscellaneous:</strong></li></ol><ul><li><strong>enmagic</strong> (xdoors_d:10095B04)</li><li><strong>cd</strong> (xdoors_d:10095B0C)</li><li><strong>exit</strong> (xdoors_d:10095B10)</li><li><strong>quit</strong> (xdoors_d:10095B18)</li></ul><p><strong>9. In the same area, at 0x100101C8, it looks like dword_1008E5C4 is a global variable that helps decide which path to take. How does the malware set dword_1008E5C4?</strong></p><p>The comparison of dword_1008E5C4 and ebx will determine whether \cmd.exe /c or \command.exe /c is pushed; likey based upon the Operating System version to utilise the correct command prompt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcMkFcq6_7ar82puhNPigg.png" /></figure><p>After following xrefs dword_1008E5C4.We see it’s written in sub_10001656</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNUS_7DH6sjS4vbyvvx_sQ.png" /></figure><p>And there is a preceding call to sub_10003695, where the function takes a look at the system’s Version Information using API call GetVersionExA</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vf__aPmqqop9NdSSg-1D-g.png" /></figure><p>Also we see compare to operands between VersionInformation.dwPlatformId and 2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*6yJgmV-2Ek4JmxmiMzYsDg.png" /></figure><p>and when we used Microsoft PlatformID Enum we see that it is looking to see if ‘The operating system is Windows NT or later.’ If it is, then \cmd.exe /c is pushed. If not, then it is \command.exe /c</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HcFPeRmL0IS6iCCAqOkXIw.png" /></figure><p><strong>10. A few hundred lines into the subroutine at 0x1000FF58, a series of comparisons use memcmp to compare strings. What happens if the string comparison to robotwork is successful (when memcmp returns 0)?</strong></p><p>The robotwork string comparison is completed using the function memcmp, which returns 0 if the two strings have same value. The JNZ branch jumps if the result Is Not Zero. This means, if the robotwork comparison is successful, returning 0, then the jump does not execute (the red path). If the memcmp was unsuccessful, then some other non-zero value would be returned and the jump (green path)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOI-Leam3X9g85fj6ft5FQ.png" /></figure><p>Not jumping, (and following the red path), leads to a new function sub_100052A2 which includes registry keys SOFTWARE\Microsoft\Windows\CurrentVersion WorkTime and WorkTimes. The function is looking for values within the WorkTime and WorkTimes RegQueryValueExA and if so, are displayed as part of the relevant aRobotWorktime offset addresses via %d</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMzFXFsf55uboBJQcWIgiQ.png" /></figure><p>The start of the function takes in a parameter for SOCKET as s , which is then passed through to a new function (sub_100038EE) along with the registry values (ebp)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jI9oT3LaomdkhlKN.png" /></figure><p>Therefore, if the string comparison for robotwork is successful, the registry keys SOFTWARE\Microsoft\Windows\CurrentVersion WorkTime and WorkTimes are queried and the values passed through (likely) the remote shell connection.</p><p><strong>11. What does the export PSLIST do?</strong></p><p>We see there are three subroutines. One of which queries OS version information we see this function before so it’s check if dwMajorVersion is 5 for more specific OS footprinting (<a href="https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa#remarks">dwMajorVersions</a>)), and depending on the outcome, will call either sub_10006518 or sub_1000664C</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pcydU77YmOgP1eLJ.png" /></figure><p>Both sub_10006518 and sub_1000664C utilise CreateToolhelp32Snapshot to take a snapshot of the specified processes and associated information, and then execute appropriate commands to query the running processes IDs, names, and the number of threads. sub_1000664C also includes the SOCKET (s) to send the output out thair</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4BO8AeyJTdiWEXIA.png" /></figure><p>It’s using CreateToolhelp32Snapshot, quering running processes, and sending to socket</p><p><strong>12. Use the graph mode to graph the cross-references from sub_10004E79. Which API functions could be called by entering this function? Based on the API functions alone, what could you rename this function?</strong></p><p>We use certain subroutine is through the Proximity Brower viewWhich API functions could be called by entering this function by xref graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XG-E_z9PZOoLiuvMaWDYfw.png" /></figure><p>The functions called from sub_10004E79 indicate that the functionality is to identify the language used on the system, It might make sense to rename sub_10004E79 to something like getSystemLanguage. While we’re at it, we might aswell rename sub_100038EE to something like <strong>process_default_language</strong></p><p><strong>13. How many Windows API functions does DllMain call directly, and how many at a depth of 2?</strong></p><p>nother way to view the API functions called from somewhere, is through View -&gt; Graphs -&gt; User XRef Chart. Set start and end addresses to DllMain and the Recursion depth to 1 to see four API functions called becuse if Recursion depth to -1 like you will find it’s make graph It is not possible to read it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*tAS-6Ki4c7Jo--e-SMKh7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhT7xc0zyKOZ6y_Bgp2cXg.png" /></figure><p>The API calls which may provide indication of functionality are: sleep winexec gethostbyname inet_nota CreateThread WSAStartup inet_addr recv send socket connect LoadLibraryA</p><p><strong>14. How long will the Sleep API function at 0x10001358 execute for?</strong></p><p>At first glance, one might think that the value passed to the sleep is 3E8h (1000)in hexadecimal, equating to 1 second the code callimul which means the value at eax is getting multiplied by 1000. Looking up, we see that offset_10019020 move the string 30 fromaThisIsCti30 to eax register so this meen when <a href="https://www.felixcloutier.com/x86/imul">Multiply</a> 1000 in hexadecimal * eax and pop eax the sleep function will sleep 30 seconds</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-qEi_KXlECIxTC995yYhQ.png" /></figure><p><strong>15 . What are the three parameters for the call to socket at 0x10001701?</strong></p><p>The three values pushed to the stack, labeled as protocol, type, and af, and are 6, 1, 2 respectively, are the three parameters used for the call to socket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2dIevozTGWRdtdTaam5BA.png" /></figure><p><strong>16. Using the MSDN page for socket and the named symbolic constants functionality in IDA Pro, can you make the parameters more meaningful? What are the parameters after you apply changes?</strong></p><p><strong>AF (Address Family)</strong>:</p><ul><li>The value 2 corresponds to AF_INET, which is the address family for IPv4.</li><li><strong>type (Socket Type)</strong>:</li><li>The value 1 corresponds to SOCK_STREAM, which is used for TCP sockets (providing reliable, connection-oriented communication).</li><li><strong>protocol</strong>:</li><li>The value 6 corresponds to IPPROTO_TCP, which specifies the TCP protocol.</li></ul><p><strong>17. Search for usage of the in instruction (opcode 0xED). This instruction is used with a magic string VMXh to perform VMware detection. Is that in use in this malware? Using the cross-references to the function that executes the in instruction, is there further evidence of VMware detection?</strong></p><p>0xED can be searched (alt+B) and look for the in instruction</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WBAfpLRV7UpRfbJi3k4tQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnwIvMfA4MhT1WLb5NBE8w.png" /></figure><p>VMXH (converted from original hex value) we found that string in this malware it might be use in <strong>VMware detection </strong>technique let’s search If we look at the other xrefs of sub_10006196 we see three occurrences, each of which contains aFoundVirtualMa, indicating the install is canceling if a Virtual Machine is found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8fUKplTNMttrMmEnBsea1A.png" /></figure><p><strong>18&amp;19&amp;20. Jump your cursor to 0x1001D988. What do you find?</strong></p><p>I find obfuscated strings when i go to this location <strong>0x1001D988</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9kp9cq9pDVztDJFtmNo1A.png" /></figure><p>But we know something we have been provided a python script with the lab lab05–01.py which is to be used as an IDA plugin for a simple script make XOR of 0x55, and prints out the resulting bytes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*ZpvFFufkisPdpIndg4o1PQ.png" /></figure><p>So we will not use this plugen but the something we will do is use cyberchef it’s amazing online tool we know the script will xor with 0x55 so let’s do it with cyberchef</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aK-MxPMip5nrkA9hjOhylA.png" /></figure><p>door is this backdoor, string decoded for `ractical arec )1234</p><p><strong>21. Open the script with a text editor. How does it work?</strong></p><ol><li>Starts from the current address in IDA Pro (ScreenEA()).</li><li>Reads 80 bytes (0x50) from this address.</li><li>Decodes each byte by XORing it with 0x55.</li><li>Writes the decoded byte back to the same memory location.</li></ol><p>________________*R*_______________</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8252a87281e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anlalysis Malicious PDF]]></title>
            <link>https://medium.com/@meto0x01/anlalysis-malicious-pdf-7e09803e570e?source=rss-ae6982da45dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e09803e570e</guid>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Mohamed atiaa]]></dc:creator>
            <pubDate>Mon, 04 Nov 2024 16:43:54 GMT</pubDate>
            <atom:updated>2024-11-04T16:43:54.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ctu3gY04Pu9MVJu135Yjew.png" /></figure><h3>Hashes</h3><h4>MD5</h4><p>6d6399e5e98164e365029a9b141e1646</p><h4>SHA-1</h4><p>64f8b386000ed34f7b9f22a8144328d0e61ed31c</p><h4>SHA-256</h4><p>cd9421c332a2b90b26152f0e85a7db621306cd1daa70f30af3210895d2aeb577</p><h3>virustotal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9hBHglCXAknCCDLzKsFew.png" /></figure><p>35 Security Vendors Detected this file</p><p>lets try to open it with <strong>pdfid</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*46JP6xwO06C0DurubDSPgA.png" /></figure><p>Now we see Its contain Opject JavaScript (2) ; and JS (1) Its probably contain malicious Script<br>Let’s dive into the file together we will use <strong>pdfparser -a</strong></p><p><em>pdf-parser -a C:\Users\win10user\Downloads\cd9421c332a2b90b26152f0e85a7db621306cd1daa70f30af3210895d2aeb577.pdf</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*veHfAjeOtiqvus41Tf9pIg.png" /></figure><p>As we can see Javascript have 2 opject It is represented in Id <strong>48 </strong>and <strong>51 . </strong>after we Know the opjects it is probably contain<strong> </strong>malicious Script</p><p>Now we will use opition <strong>-o</strong> to see what this opject contains</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*roV9qNvaQMTLVbDw7VjLPQ.png" /></figure><p>Opj <strong>51 </strong>Referencing Opj <strong>52 we </strong>will follow this Opj</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1khgbH0ffvChduJr9P8tXQ.png" /></figure><p>As we see it is contain Stream encoded and not refrance any code let’s use -f -d {Output file name}To flate decode this stream and Dump this code in file .js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c4tXAeQ4X42v0ND1PqqDVQ.png" /></figure><p>the result is ugly code in the smae line and very hard to read it but we want to Beautfi This code use online service like <strong>js-beautify</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGYJLA-514M3TSCEay4IUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*99JPMlWBFBa-pxRqwVwFkA.png" /></figure><p>Now we can read this code and analysis it</p><p>lts’s open it with <strong>cscript .</strong> we use command cscript /x File name.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFERl-TCbK98yrNBXl32hg.png" /></figure><p>we will set brakepoint in <strong>return o ; </strong>and run the code untill the brakepoint and step into to watch what happen to variables <strong>o</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PZiioIpOkXrcj2ZwhWD6zQ.png" /></figure><p>As we see variables o contain string its look like new script let’s copy this value and beautify it by <strong>js-beautify</strong></p><p>it is like a expolit but it’s will be hard to analysis it .So we will do some research by using string from this code to see if any one make any report for this sample pefore</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EsdVNn6KgNGOncRY7bmV4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vPZpp-0fMol7XgO4AyVyg.png" /></figure><p>We actually found an article written by APT group possibly from North Korea targeting people via malicious pdf file droped java script code and The JavaScript code which creates the vulnerability uses the API ‘this.createDataObject’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h7-fmFquikZPhXbatWukGA.png" /></figure><p>But APT Group find target uses the paid programs such as<strong> Acrobat Pro DC,</strong> it appears that the group made the vulnerability code can use it to hack the targets.</p><h3>Detection and IOC Info</h3><p>File Detection<br>Exploit/PDF.FakeDocu (2021.08.03.03)<br>Exploit/PDF.FakeDocu.S1627 (2021.08.06.03)<br>Exploit/PDF.FakeDocu.S1628 (2021.08.06.03)<br>Trojan/BIN.EncPE (2021.08.03.03)<br>Trojan/Win.Agent (2021.08.03.03)<br>Trojan/Win.Akdoor (2021.08.04.00)</p><p>Behavior Detection<br>Fileless/MDP.Thallium.M3808 (2021.08.06.03)<br>Exploit/MDP.CVE-2020–9715.M3809 (2021.08.06.03)</p><h3><strong>IOCs</strong></h3><p>70294ac8b61bfb936334bcb6e6e8cc50<br>ffe39eb91e0247fb13bd8fd8152f61a3<br>de2a8a728f81d44562bfd3e91c95f002<br>df2ea74328ad43c4225cb6c8aa56f340<br>a0c7e9dc69e439cb431e6dea9f0d5930<br>a67b0c89812e9517178b8581ff830a38<br>906b43cb893e0a57404c8f17085a1f24<br>be4daa6400a6e417270e17b67a44ca97<br>aa5a3f19e5f7d15b6af37a4f2c8215ee<br>8b1606f4f2df5d95e00411b4057b3da1<br>29b28e79d86e4395e223d44d60b14ff4<br>c9c7d70174e8be8b2cebfeb125be2672<br>b31aaabc8b39f2854ace7680b34322fe<br>http://tksRpdl.atwebpages.com<br>http://dktkglrkshqhfn.atwebpages.com<br>http://dkekftks.atwebpages.com<br>http://tktlal2.atwebpages.com<br>http://tktlal3.atwebpages.com<br>hxxp://rhwkdlaktm[.]atwebpages[.]com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e09803e570e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>