<?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 Mohammad Nour Al Murie on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Nour Al Murie on Medium]]></description>
        <link>https://medium.com/@m7mad?source=rss-6287256bcb4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6Gc9spdmoL-Be_dZzGOucQ.jpeg</url>
            <title>Stories by Mohammad Nour Al Murie on Medium</title>
            <link>https://medium.com/@m7mad?source=rss-6287256bcb4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:41:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@m7mad/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[NCSC 2025 Reverse Writeup]]></title>
            <link>https://medium.com/@m7mad/ncsc-2025-reverse-writeup-1262d4c3b763?source=rss-6287256bcb4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1262d4c3b763</guid>
            <category><![CDATA[malware-analysis-tools]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Mohammad Nour Al Murie]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 15:24:06 GMT</pubDate>
            <atom:updated>2025-08-07T16:23:41.484Z</atom:updated>
            <content:encoded><![CDATA[<h3>&lt;قُلْ إِنَّ الْفَضْلَ بِيَدِ اللَّهِ يُؤْتِيهِ مَن يَشَاءُ ۗ وَاللَّهُ وَاسِعٌ عَلِيمٌ&gt;</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*HhodATyJjhHkl0I5-f0dtQ.png" /></figure><h3>The process of my work for every challange :</h3><h3>Basic Static :</h3><h3>File Command ( Type in windows )</h3><h3>Detect it easy → Check the Language and if it Packed</h3><h3>Strings and “floss”</h3><h3>Check The PE ( PE properties ) → CFF explorer , PE total</h3><h3>Use capa -vvv or just to see the overview capa only</h3><h3>Advanced Static :</h3><h3>IDA or Ghidra or Recaf for Apk or Dnspy for Dotnet</h3><h3>Basic Dynamic :</h3><h3>Process Hacker , Task Viewer , Process Monitor , “””Api Monitor””””</h3><h3>Advanced Dynamic :</h3><h3>X64dbg or Ida ( windows ) , gdb or r2 or edb ( elf )</h3><h3>Study The Codeeeeeeeeeeeeeeeeeeeeeeeeee</h3><h3>Leave ChatGpttttttttttttttttttttttttttttttttttttttt</h3><h3>Use GOOOOOOOOOOOOOOOOOGLEEEEEEEE</h3><h3><strong>Casp3rTheGhost :</strong></h3><p>First we need to Identify the type of this file using DIE(Detect it easy) :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*quFgLTamX2u51_sNZKrCUg.png" /><figcaption>DIE(Detect it easy)</figcaption></figure><p>So its PE( protable executable ) and C lang used on it</p><p>lets try strings if we can caught anything usefull :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*40RTAC3qlP3DL71DimzxAA.png" /><figcaption>Floss</figcaption></figure><p>Nothing useful as expected because its an Packed PE</p><p>Keep going to IDA to see if its can help us :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiV1f1Pnz4ViwFWZS5oL9g.png" /><figcaption>IDA</figcaption></figure><p>Even Ida was not helpfull so what now ? “i skipped the basic dynamic”</p><p>Lets use a debugger like x64dbg to see where it drop the pack or unpack it</p><p>After some instruction moving in x64dbg was not usefull</p><p>So decide to attach the PE on the x64dbg while running and see the memory map to moniter the unpacked memory that he used :</p><p>On the memory map on the :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*b8RZ5AT9Gl4Xf3HkKj61sA.png" /><figcaption>Memory map 0x64dbg</figcaption></figure><p>We can see that there’s a memory Rw</p><p>Why Rw ?</p><p>ER → The programe Now begin executed</p><p>Rw -&gt; Code being unpacked or modified ( Not always )</p><p>RX -&gt; Code being executed (after unpacking)</p><p>R → Passive data/code, less useful for unpacking phase</p><p>So now its obvious right ? i think we found it</p><p>Lets see the memory dump :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*KacfJgOjT2HENsq8Q-pc4A.png" /><figcaption>Memory Dump of RW</figcaption></figure><p>YESSSS!! we Found it :</p><p>NCSC{FXQ!#X0302365b9909e1e07……}</p><h3>NCSC Agent (QA) :</h3><p>As perivous lets run DIE(Detect it easy) on it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*VEKkEPM9RB667_KUI6dJeg.png" /><figcaption>DIE(Detect it easy)</figcaption></figure><p>Just running DIE we got that its a python exe so let unpacke it using :</p><p>pyinstxtractor.py : <a href="https://github.com/extremecoders-re/pyinstxtractor/blob/master/pyinstxtractor.py">https://github.com/extremecoders-re/pyinstxtractor/blob/master/pyinstxtractor.py</a></p><p>This tool try to give you the PYC file that was used to compile the file :</p><p>after instxtract that files got this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*JNWCHdxmnTCN2dCvLuXRkw.png" /><figcaption>PYC’s</figcaption></figure><p>Now let’s turn these files to python files using ( <a href="https://pylingual.io/">https://pylingual.io/</a> )</p><p>Got this py :</p><pre># Decompiled with PyLingual (https://pylingual.io)<br># Internal filename: NCSC_Agent.py<br># Bytecode version: 3.13.0rc3 (3571)<br># Source timestamp: 1970-01-01 00:00:00 UTC (0)<br><br>import socket as s0c<br>import random as r4n<br>import string<br>import argparse<br>import pickle<br>import time<br>from Crypto.Cipher import AES<br>from Crypto.Util.Padding import pad, unpad<br>BLOCK_SIZE = 16<br>_0 = &#39;cyberwarriors-challenges.skidz.io&#39;<br>_1 = 1235<br>r4n.seed(1337)<br>_k3y = &#39;&#39;.join(r4n.choices(string.ascii_letters + string.digits, k=16))<br>_d0 = {&#39;send_log&#39;: &#39;Sends logs back to server&#39;, &#39;sys_info&#39;: &#39;prints system info&#39;, &#39;health&#39;: &#39;Check EDR server health&#39;, &#39;help&#39;: &#39;Show this help message&#39;}<br><br>class INFO:<br><br>    def __init__(self, username, privileges, cmd, data):<br>        self.username = username<br>        self.privileges = privileges<br>        self.cmd = cmd<br>        self.data = data<br><br>def encrypt(serialized_data: bytes, key: bytes) -&gt; bytes:<br>    cipher = AES.new(key, AES.MODE_ECB)<br>    padded_data = pad(serialized_data, BLOCK_SIZE)<br>    encrypted = cipher.encrypt(padded_data)<br>    return encrypted<br><br>def _sh(debug: bool=False):<br>    with s0c.socket(s0c.AF_INET, s0c.SOCK_STREAM) as _s:<br>        _s.connect((_0, _1))<br>        _s.sendall(_k3y.encode())<br>        _r = _s.recv(1024).decode().strip()<br>        if &#39;Unauthorized&#39; in _r:<br>            print(&#39;[!] Failed to auth&#39;)<br>            pass<br>        return None<br>if __name__ == &#39;__main__&#39;:<br>    parser = argparse.ArgumentParser(description=&#39;Custom NCSC EDR Agent&#39;)<br>    parser.add_argument(&#39;-d&#39;, &#39;--debug&#39;, action=&#39;store_true&#39;, help=&#39;Enable debug mode.&#39;)<br>    args = parser.parse_args()<br>    _sh(args.debug)</pre><p>So after analysis it , it takes a key as input and produce an output then you should send some command from “ _d0 “ to get the flag :</p><p>i tried “ pull_log “ maybe and i got the flag “ I can’t access the machine :) “</p><p>To get the flag you need to connect to</p><pre>HOST = &#39;cyberwarriors-challenges.skidz.io&#39;<br>PORT = 1235<br>INITIAL_KEY = &#39;MHwKkZxW5t9mO4gY&#39;</pre><p>using pwntools or socket or what ever you want and the flag will appear</p><h3>Notes ( First Blood )</h3><p>As perivous lets run DIE(Detect it easy) on it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*M0oOaAe4FGVgXCYdPO5i4w.png" /><figcaption>DIE</figcaption></figure><p>Its look like its obfuscated or packed with themida and its a PE</p><p>so lets try strings :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*Y0MogSYvvOD2U7SoQKhtoA.png" /><figcaption>Floss</figcaption></figure><p>Nothing benfit but i know it DotNet from some Strings like Assembly Verison ( Maybe )</p><p>So i tried Ida and i did’nt got anything also dnspy ,.. ghidra Nothing</p><p>So decide to go dynamic analysis …. I skipped Basic dynamic ( For a while)</p><p>So yes X64 didn’t help me so i tried Windbg also the same so i know it use an anti-debug so i decide not to deep on it and try to see the memory maybe something usefull will appear…</p><p>so Yes I have back to Basic dynamic using “ Task Explorer and Process hacker “ and suspend the program while running then inspect the memory with “ permission RW ( Read Write ) as we talk about it before “</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*fGHcxTihgBa8L_uCk4SuHA.png" /><figcaption>Basic Dynamic using Task explorer</figcaption></figure><p>I used Task explorer to freeze the process that terminated and get its values like thread was running or memory dump ….</p><p>So after a while of search i found a Base64 on a dump that contain a Rar file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*Xs-UKWXnNTN29b2ty-QpJw.png" /><figcaption>Rar and flag.txt</figcaption></figure><p>So i extracted that base64 from the hex using “CyberChef”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_exZmEskNf8ez-U3-VeP2Q.png" /><figcaption>Cyber Chef</figcaption></figure><p>Then debase64 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CI38NkTUJ0Yud50m2dthYw.png" /><figcaption>Cyber Chef</figcaption></figure><pre>UmFyIRoHAQAzkrXlCgEFBgAFAQGAgABbpmONVQIDPMAABKYAIFoIuVuAAwAIRmxhZy50eHQwAQADD+5TyknYt2g1Mg8D/WEHpuHAP29x35uUiEAIJ42my3smG5JyEHPnw1gZudIQCgMCAGEflt/92wGHp/SA/FMu30sSxIPBQ4dbb7n0iKdmrRsGXMdZo5UTwCDqdTZKxe3aSd+dp28CVgrNd6lcMwG+l2eaLluPjhK2HXdWUQMFBAA=</pre><p>And yepppp we found the rar that has the flag.txt so lets unrar it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33slIULES_CtH_zjP-_ySA.png" /></figure><p>But wait wee need a password ……</p><p>So my teammate Mustafa decide to do a John the ripper to get the password ( What an idea ;) )</p><pre>┌──(kali㉿kali)-[~]<br>└─$ john --format=RAR5 --wordlist=/usr/share/wordlists/rockyou.txt rar.hash<br><br>Using default input encoding: UTF-8<br>Loaded 1 password hash (RAR5 [PBKDF2-SHA256 512/512 AVX512BW 16x])<br>Cost 1 (iteration count) is 32768 for all loaded hashes<br>Will run 8 OpenMP threads<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>5201314          (download (1).rar)     <br>1g 0:00:00:00 DONE (2025-08-07 11:19) 9.090g/s 4654p/s 4654c/s 4654C/s 123456..letmein<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed.</pre><p>We found the password “5201314” now lets get the flaaaaaaaag!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*yqdgChA_9EcRz7asFe03Nw.png" /><figcaption>Kali</figcaption></figure><p>And we found itttttttttt :</p><p>“NCSC{0h_y0u_607_my_5u……..}”</p><p>Thank you for reading ❤</p><p>NCSC Agent (QA) : <a href="https://www.mediafire.com/file/6u2n4q15a3nir7p/NCSC_Agent/file">https://www.mediafire.com/file/6u2n4q15a3nir7p/NCSC_Agent/file</a></p><p>Casp3rTheGhost : <a href="https://www.mediafire.com/file/2pddxyylgn1b2xm/Casp3rTheGhost_protected.exe/file">https://www.mediafire.com/file/2pddxyylgn1b2xm/Casp3rTheGhost_protected.exe/file</a></p><p>Notes : <a href="https://www.mediafire.com/file/7unzbt2099parxc/Note_protected.exe/file">https://www.mediafire.com/file/7unzbt2099parxc/Note_protected.exe/file</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1262d4c3b763" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DVCTF Reverse Writeup]]></title>
            <link>https://medium.com/@m7mad/dvctf-reverse-writeup-707ec691f77c?source=rss-6287256bcb4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/707ec691f77c</guid>
            <dc:creator><![CDATA[Mohammad Nour Al Murie]]></dc:creator>
            <pubDate>Mon, 26 May 2025 12:03:20 GMT</pubDate>
            <atom:updated>2025-05-26T17:30:32.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AH8If8rm4vyFABtcE9PcMg.jpeg" /></figure><h3>Da Vinici CTF Reverse Writeup</h3><p>In this CTF i solved 3 reverse challanges out of 4 and got top 17</p><p>First thing we should do for any file use [detect it easy] to identify the type of the file and language that the binary written</p><h3>1 — Davinci Click</h3><p>In this challange we have unity based game so we just can drop the “Assembly-CSharp.dll” in Dnspy to see the source code :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*CbkMGFhOyufBgzUteeqE8w.png" /><figcaption><strong>Functions on the game</strong></figcaption></figure><p>We have these functions so we should navigate to see the main function [ without running the game i thought it was about clicks counter so i search for any function has click counter ] and found this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*zpn712N9vVKPVkuZPqqmdg.png" /><figcaption><strong>Check counter</strong></figcaption></figure><p>Yes, CheckCounter .. lets open it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHz1q1azUYMZcKSIiJep9w.png" /></figure><p>And here we go this is the flag :</p><blockquote>DVCTF{82716TRDUO8EZY98DFJ09QSEZ9RIE378TOIU34Y890UDFJI93Y4}</blockquote><h3><strong>2 - VinciVault</strong></h3><p>First thing we should unzip the file then we see a payload file enter it we have a binary and multiply images so lets go to detect it easy for this binary :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*OqXAzGdtSBRCV0OBGkczJQ.png" /></figure><p>The type of the file is ios so i tried to open it using IDA :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*awItNQ8tA1FxAtASMSZ2yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*xu7G98ndiW2tKkZ6y7tsYQ.png" /></figure><p>I found a decreyption flag function and it has encrypted values using Xor and there is a missing value of the flag :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*TBy4qSfddxSonvHGEdNs0w.png" /></figure><p>When i open it i used ARM64 but then used ARM64e to see if it will differ :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*iQSmxtW-n9ixdBvvOthYTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pBM-Oh9c1F6Kuwd6xRIMw.png" /><figcaption>The key Used is : SherbetLemon</figcaption></figure><p>And yes it gives me the full flag and key , now time for decryption :</p><pre># flag decryption<br>x = [23, 62, 38, 38, 36, 30, 61, 19, 9, 93, 25, 93, 12, 42, 86, 65, 16, 24]<br>key = &quot;SherbetLemon&quot;<br>flag = &quot;&quot;<br>for i in range(len(x)):<br>flag += chr(x[i] ^ ord(key[i % len(key)]))<br>print(flag)</pre><p>The flag : DVCTF{I_l0v3_B33r}</p><h3>3-Infected Brick</h3><p>The third challange was an andriod challange i know through the apk file :)</p><p>so first thing we should in this file put it in bytecode viewer you can use any apk viewer</p><p>by using Bytecode Viewer I found multiple Files :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*mI881UNhRKbcfi2rb3EW4g.png" /></figure><p>So , i tried to search the MainActivity andi found it in the dvctf file :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*jU1IoGrZpXqI8yD2tdCGeA.png" /></figure><p>And with that main i found a libary usage within that file :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Yi1VVfYEqpSijHakA_CchA.png" /></figure><p>Now its all obvious the libary take to parameter var 1 and 2 lets decompile the libary by first unzip the apk file to get the “lib” folder and decompile that libary :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9J36fvuwb08ZO6S8WX3ELg.png" /></figure><p>Within the libary i found an AES enc/decryption and a function that make all the game more interest “ Java_com_ctf_dvctf_Tetris_1lib_tetris_1job “</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xg8k4RFTnJfOL1uCL6GKw.png" /></figure><p>within the function its read from an input file and using the b64 decoded as key to decrypte the flag so first we search for the input file so i searched in the assets file i found multiple files so i tried the lowest file with KB and i wrote a script for that function using that file as input :</p><pre>from Crypto.Cipher import AES<br>import base64<br>import os<br><br>def remove_padding(data):<br>    pad_len = data[-1]<br>    if pad_len &lt; 1 or pad_len &gt; 16:<br>        raise ValueError(&quot;Invalid padding length&quot;)<br>    if data[-pad_len:] != bytes([pad_len]) * pad_len:<br>        raise ValueError(&quot;Invalid PKCS#7 padding&quot;)<br>    return data[:-pad_len]<br><br>def decrypt_prof_file(filename):<br>    try:<br>        <br>        with open(filename, &quot;rb&quot;) as f:<br>            iv = f.read(16)           <br>            ciphertext = f.read()    <br><br>        if len(iv) != 16:<br>            raise ValueError(&quot;IV length is not 16 bytes&quot;)<br><br>        <br>        b64_key = &quot;yhHGxfkU/BuWxsnID/GxNVA/g6UwXOygO79AT0sEOAg=&quot;<br>        key = base64.b64decode(b64_key)<br><br>        <br>        cipher = AES.new(key, AES.MODE_CBC, iv)<br>        decrypted = cipher.decrypt(ciphertext)<br><br>       <br>        unpadded = remove_padding(decrypted)<br><br>        <br>        dex_filename = os.path.splitext(filename)[0] + &quot;.dex&quot;<br>        with open(dex_filename, &quot;wb&quot;) as dex_file:<br>            dex_file.write(unpadded)<br><br>        print(f&quot;[+] Decryption successful! Output saved to: {dex_filename}&quot;)<br>        return unpadded<br><br>    except FileNotFoundError:<br>        print(f&quot;File not found: {filename}&quot;)<br>    except ValueError as ve:<br>        print(f&quot;Value error: {ve}&quot;)<br>    except Exception as e:<br>        print(f&quot;An error occurred: {e}&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    decrypt_prof_file(r&quot;C:\Users\&lt;USER&gt;\Desktop\tetris\assets\acca3789580d7df462935a3c&quot;)</pre><p>after the decryption i found it convert the file to dex file so i decompile it using ByteCode viewer :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*e3W0RReWgf4MAzOOzQ36BA.png" /></figure><p>I found multiple function to do that decryption so i scripted one to simulate these functions that uses RC4 encryption :</p><pre>import base64<br><br>class RC4:<br>    def __init__(self, key):<br>        self.s = list(range(256))<br>        j = 0<br>        key = list(key)<br>        for i in range(256):<br>            j = (j + self.s[i] + key[i % len(key)]) &amp; 0xFF<br>            self.s[i], self.s[j] = self.s[j], self.s[i]<br>        self.i = 0<br>        self.j = 0<br><br>    def process(self, data):<br>        out = bytearray(len(data))<br>        for k in range(len(data)):<br>            self.i = (self.i + 1) &amp; 0xFF<br>            self.j = (self.j + self.s[self.i]) &amp; 0xFF<br>            self.s[self.i], self.s[self.j] = self.s[self.j], self.s[self.i]<br>            idx = (self.s[self.i] + self.s[self.j]) &amp; 0xFF<br>            out[k] = data[k] ^ self.s[idx]<br>        return bytes(out)<br><br>def decrypt_custom():<br>    key1 = b&quot;ShrekIsLove&quot;<br>    key2 = b&quot;ShrekIsLife&quot;<br>    data_b64 = &quot;wDGZgLiPBV8EtU5AjF9nYM1fmaqE&quot;<br><br>    data = base64.b64decode(data_b64)<br>    rc4 = RC4(key1)<br>    step1 = rc4.process(data)<br><br>    # XOR with key2 repeated<br>    result = bytes([step1[i] ^ key2[i % len(key2)] for i in range(len(step1))])<br>    return result.decode(&#39;utf-8&#39;)<br><br>if __name__ == &quot;__main__&quot;:<br>    print(decrypt_custom())</pre><p>After running that script i found this flaaaaaag :<br>DVCTF{I_Lov3_4nDr01d}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=707ec691f77c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>