<?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 Khaled Alkhatib on Medium]]></title>
        <description><![CDATA[Stories by Khaled Alkhatib on Medium]]></description>
        <link>https://medium.com/@khaledalkhatib?source=rss-983be9dbacff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SW1ieTz5vCIo7zPTxG4u-w.png</url>
            <title>Stories by Khaled Alkhatib on Medium</title>
            <link>https://medium.com/@khaledalkhatib?source=rss-983be9dbacff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:35:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khaledalkhatib/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[Cybersecurity Home Lab — Phase 5: Malware VM Isolation + VPN-Only Routing]]></title>
            <link>https://medium.com/@khaledalkhatib/cybersecurity-home-lab-phase-5-malware-vm-isolation-vpn-only-routing-583d4130cfbd?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/583d4130cfbd</guid>
            <category><![CDATA[tor]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[firewall]]></category>
            <category><![CDATA[homelab]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Mon, 12 May 2025 13:40:44 GMT</pubDate>
            <atom:updated>2025-05-12T13:40:44.575Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cybersecurity Home Lab — Phase 5: Malware VM Isolation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DcaH_TL3AeCwjhySoWxfJQ.png" /></figure><p>In this final phase of my cybersecurity home lab series, I focus on isolating a Malware VM using pfSense and tightly controlled firewall rules. The goal is to enable realistic outbound traffic (HTTP, HTTPS, DNS, etc.) for malware detonation and analysis, without exposing the host machine, internal networks, or router. This guide walks through the exact steps I took to create a safely contained environment suitable for hands-on experimentation.</p><p><strong>🔐 Disclaimer:</strong><br> The original plan included routing the Malware VM through a dedicated VPN for added anonymity. However, due to persistent certificate verification issues within pfSense, the VPN setup was postponed. All testing and isolation measures described in this phase were implemented <strong>without</strong> a VPN, relying solely on pfSense for segmentation and containment. The current setup still provides strong isolation for safe malware experimentation, and VPN integration can be revisited in the future.</p><h3>✅ Step 1: Create the Windows-Malware VM in VirtualBox</h3><h4>🧠 Why this matters:</h4><p>This VM will simulate malware activity in a <strong>controlled, isolated network</strong>. It won’t have access to your host, other VMs, or the general internet unless you explicitly allow it via pfSense (VPN was originally planned but later omitted; see disclaimer).</p><h4>🛠️ What to Do:</h4><ol><li>Open <strong>VirtualBox</strong></li><li>Click <strong>New</strong></li></ol><h4>Name &amp; Type:</h4><ul><li><strong>Name</strong>: Windows-Malware</li><li><strong>Type</strong>: Microsoft Windows</li><li><strong>Version</strong>: Windows 10 (64-bit)</li><li>Select the <strong>ISO Windows image </strong>(same one you used for Windows-Victim)</li><li><strong>Check</strong>: “Skip Unattended Installation”</li></ul><p>Click <strong>Next</strong></p><h4>Memory:</h4><ul><li><strong>RAM</strong>: 3 GB (3072 MB) minimum; 4 GB recommended if you have the resources</li></ul><h4>CPU:</h4><ul><li><strong>Processors</strong>: 2 cores (1 works if you’re resource-constrained)</li></ul><h4>Hard Disk:</h4><ul><li>Choose: <strong>Create a virtual hard disk now</strong></li><li>Type: <strong>VDI</strong></li><li>Size: <strong>40 GB</strong></li></ul><p>Click <strong>Create</strong></p><h4>Before Starting the VM:</h4><p>We now configure its network so it will create and join MalwareNet.</p><ol><li>Select the Windows-Malware VM</li><li>Click <strong>Settings → Network</strong></li><li>Under <strong>Adapter 1</strong>, set:</li></ol><ul><li><strong>Enable Network Adapter</strong></li><li><strong>Attached to</strong>: Internal Network</li><li><strong>Name</strong>: type exactly: MalwareNet ← this <em>creates</em> the isolated network</li><li><strong>Promiscuous Mode</strong>: Deny</li><li><strong>Cable Connected</strong>: Checked</li></ul><p>💡 Now only pfSense can communicate with it (after we configure that).</p><h4>Disable Host Integration (Important for Isolation)</h4><p>In <strong>Settings → General → Advanced</strong>:</p><ul><li><strong>Shared Clipboard</strong>: Disabled</li><li><strong>Drag and Drop</strong>: Disabled</li></ul><p>In <strong>Settings → Shared Folders</strong>:</p><ul><li>Remove or make sure none are shared.</li></ul><p>In <strong>Settings → Display → Screen</strong>:</p><ul><li>Optionally <strong>disable 3D Acceleration<br></strong><em>This prevents interaction between host and guest and minimizes escape surface.</em></li></ul><p>Once done, click <strong>OK</strong></p><p>Now you’re ready to <strong>boot and install Windows</strong> on this VM.</p><h3>✅ Step 2: Install Windows on the Malware VM</h3><p>Start the Windows-Malware VM, and:</p><ol><li>It will boot from the ISO</li><li>Follow standard Windows installation steps:</li></ol><ul><li><strong>Region</strong>: Your location</li><li><strong>Language</strong>: English</li><li><strong>Install now</strong></li><li>When asked for product key: click <strong>“I don’t have a product key”</strong></li><li>Choose: <strong>Windows 10 Pro</strong></li><li>Custom Install → Select the virtual hard disk → Click Next</li></ul><p>Installation will begin.</p><h4>Post-Install Setup:</h4><ol><li><strong>Set up for personal use</strong></li><li><strong>Create offline account</strong> → Use any name like malware</li><li><strong>Set password</strong> (e.g., Malware2024!)</li><li><strong>Disable all privacy options</strong></li><li><strong>Skip Cortana and personalization</strong></li></ol><p>You’ll land on the Windows desktop.</p><h4>Quick Checks After Installation:</h4><ol><li>Open <strong>Command Prompt</strong></li><li>Type: ipconfig</li><li>You should <strong>not</strong> see any internet access yet.</li></ol><h3>✅ Step 3 — Add MalwareNet as a New Interface in pfSense</h3><h4>Add Third Adapter to pfSense VM</h4><ol><li><strong>Shut down the pfSense VM</strong> (in the console, choose option 6 to halt system)</li><li>In <strong>VirtualBox Manager</strong>:</li></ol><ul><li>Select the pfSense VM → Click <strong>Settings → Network</strong></li><li>Go to <strong>Adapter 3</strong> tab</li><li>Check: <strong>Enable Network Adapter</strong></li><li>Attached to: Internal Network</li><li><strong>Name</strong>: type exactly: MalwareNet</li><li>Promiscuous Mode: <strong>Deny</strong></li><li>Check: Cable Connected</li></ul><ol><li>Click <strong>OK</strong> to save</li></ol><p>This gives pfSense visibility into MalwareNet.</p><h4>Next: Boot pfSense &amp; Assign the New Interface</h4><ol><li>Start pfSense again</li></ol><p>2. Once it reaches the console (menu with options 1–16), choose:</p><ul><li>1) Assign Interfaces</li></ul><p>3. When it asks:</p><ul><li>Do VLANs need to be set up first? → Type n</li></ul><p>4. You’ll now see:<br>Available interfaces: em0 - existing (NAT / WAN) em1 - existing (LabNet / LAN) em2 - NEW one (MalwareNet)</p><p>You should be able to assign:</p><ul><li>em0 = WAN</li><li>em1 = LAN</li><li>em2 = OPT1 (MalwareNet)</li></ul><p>5. Confirm with y when asked if you want to proceed</p><h3>✅ <strong>Step 4: Configure the MalwareNet Interface in pfSense Web GUI</strong></h3><h4>🧠 Goal:</h4><ul><li>Enable the OPT1 interface (em2)</li><li>Rename it to MalwareNet</li><li>Assign it a static IP (e.g., 192.168.60.1/24)</li><li>Enable DHCP for that subnet</li></ul><h4>What to Do:</h4><ol><li>In your <strong>Ubuntu Admin VM</strong>, open Firefox</li><li>Visit: <a href="http://192.168.50.1/">http://192.168.50.1</a></li><li>(That’s pfSense’s LAN IP — from LabNet)</li><li>Log in with:</li></ol><ul><li><strong>Username</strong>: admin</li><li><strong>Password</strong>: (whatever you set in Phase 2)</li></ul><h4>In pfSense Web GUI:</h4><h4>1. Assign Interface</h4><ul><li>Go to <strong>Interfaces → Assignments</strong></li><li>You should see a third interface listed under <strong>Available network ports</strong> (e.g., em2)</li><li>Click <strong>Add</strong> → It appears as OPT1</li></ul><h4>2. Enable and Rename OPT1 → MalwareNet</h4><ul><li>Click <strong>OPT1</strong> to edit it</li><li>Check <strong>“Enable Interface”</strong></li><li>Name: MalwareNet</li><li>IPv4 Configuration Type: <strong>Static IPv4</strong></li><li>Static IP Address: 192.168.60.1</li><li>Subnet mask: 24 (which means /24 or 255.255.255.0)</li></ul><p>Click <strong>Save</strong>, then <strong>Apply Changes</strong></p><h4>3. Set Up DHCP for MalwareNet</h4><ul><li>Go to <strong>Services → DHCP Server</strong></li><li>Click the <strong>MalwareNet</strong> tab</li><li>Check ✅ <strong>Enable DHCP Server</strong></li><li>Range:</li><li>Start: 192.168.60.10</li><li>End: 192.168.60.100</li></ul><p>Click <strong>Save</strong></p><p>✅ That’s it! You’ve now:</p><ul><li>Fully configured MalwareNet</li><li>Assigned a subnet</li><li>Enabled DHCP</li></ul><h4>🔄 Next Step:</h4><p>Restart the <strong>Windows-Malware VM</strong>, and check its IP:</p><p>Open <strong>Command Prompt</strong> and run: <em>ipconfig</em></p><p>You should now see an IP like: 192.168.60.X<br> 🎯 That confirms it’s connected to MalwareNet and talking to pfSense!</p><h3>🔧Step 5: MalwareNet Firewall Rules (on pfSense)</h3><h4>Rule 1: Allow DNS (so the Malware VM can resolve domains)</h4><p><strong>Why?</strong> DNS is essential for domain resolution (e.g., turning google.com into an IP). Without it, browsing and C2 lookups won’t work — which may be necessary for malware detonation or observation.</p><ul><li><strong>Action</strong>: Pass</li><li><strong>Interface</strong>: MalwareNet</li><li><strong>Protocol</strong>: UDP</li><li><strong>Source</strong>: MalwareNet net</li><li><strong>Destination</strong>: any</li><li><strong>Destination Port</strong>: 53 (DNS)</li><li><strong>Description</strong>: Allow DNS from MalwareNet</li></ul><p>⚠️ If you configured pfSense to act as a DNS forwarder, you can change destination to MalwareNet address.</p><h4>Rule 2: Allow NTP (optional but recommended)</h4><p><strong>Why?</strong> Time synchronization is useful for accurate logs, and some malware refuses to run if the system clock is too far off.</p><ul><li><strong>Action</strong>: Pass</li><li><strong>Protocol</strong>: UDP</li><li><strong>Source</strong>: MalwareNet net</li><li><strong>Destination Port</strong>: 123 (NTP)</li><li><strong>Destination</strong>: any</li><li><strong>Description</strong>: Allow NTP for time sync</li></ul><h4>Rule 3: Allow HTTP/HTTPS (for malware internet access)</h4><p><strong>Why?</strong> To let the Malware VM reach the web (e.g., download payloads or contact C2 servers), but only via ports 80 and 443.</p><ul><li><strong>Action</strong>: Pass</li><li><strong>Protocol</strong>: TCP</li><li><strong>Source</strong>: MalwareNet net</li><li><strong>Destination Port</strong>: 80 (HTTP)</li><li><strong>Destination</strong>: any</li><li><strong>Description</strong>: Allow HTTP from MalwareNet</li></ul><p>— and —</p><ul><li><strong>Action</strong>: Pass</li><li><strong>Protocol</strong>: TCP</li><li><strong>Source</strong>: MalwareNet net</li><li><strong>Destination Port</strong>: 443 (HTTPS)</li><li><strong>Destination</strong>: any</li><li><strong>Description</strong>: Allow HTTPS from MalwareNet</li></ul><h4>🚫 Rule 4: Block Access to Host Router</h4><p><strong>Why? </strong>To prevent malware from accessing your router dashboard.</p><ul><li><strong>Action</strong>: Block</li><li><strong>Interface</strong>: Malwarenet</li><li><strong>Source</strong>: Malwarenet net</li><li><strong>Destination</strong>: WAN net or specifically your router’s IP</li><li><strong>Protocol</strong>: Any</li><li><strong>Position</strong>: Must be <strong>above</strong> any “Allow” rules</li></ul><blockquote><strong><em>💡 Tip</em></strong><em>: If you’re unsure of your router IP, run </em><em>ipconfig or </em><em>ip route on the host machine.</em></blockquote><h4>🚫 Rule 5: Block Access to pfSense Web UI</h4><p><strong>Why?</strong> Prevent malware from accessing the firewall’s login page at 10.0.40.1.</p><ul><li><strong>Action</strong>: Block</li><li><strong>Protocol</strong>: <em>any</em></li><li><strong>Source</strong>: MalwareNet net</li><li><strong>Destination</strong>: MalwareNet address</li><li><strong>Description</strong>: Block access to pfSense interface</li></ul><h4>🚫 Rule 6: Block Access to Other Internal Subnets</h4><p><strong>Why?</strong> Prevent lateral movement to other segments like LabNet, AdminNet, or your LAN.</p><p>You’ll need one rule for <strong>each</strong> internal subnet. Example:</p><ul><li><strong>Action</strong>: Block</li><li><strong>Protocol</strong>: <em>any</em></li><li><strong>Source</strong>: MalwareNet net</li><li><strong>Destination</strong>: LAN subnet</li><li><strong>Description</strong>: Block access to AdminNet</li></ul><p>Repeat for other internal interfaces.</p><h4>⚠️ Optional Rule: Logging</h4><p>You can <strong>enable logging</strong> on block rules for better visibility in logs (e.g., to see if malware is trying to reach pfSense or other segments).</p><h4>📋 Final Rule Order (drag to arrange in pfSense — rules to block should be on top)</h4><ol><li>Block router access</li><li>Block pfSense Web UI</li><li>Block other subnets</li><li>Allow DNS</li><li>Allow NTP</li><li>Allow HTTP</li><li>Allow HTTPS</li><li>(Implicit default deny everything else)</li></ol><p><strong>Note:<br></strong>Why choose subnet and not address?</p><ul><li>subnet = all IPs in that subnet</li><li>address = just the IP of the interface</li></ul><h3>FIREWALL RULE TESTS (MalwareNet)</h3><h4>1. Block access to pfSense GUI</h4><ul><li><strong>Test</strong>: Open a browser in the malware VM and go to https://192.168.60.1 (or whatever your pfSense IP is on MalwareNet).</li><li><strong>Expected Result</strong>: The page should <strong>not load</strong> or <strong>connection should time out</strong>.</li></ul><h4>2. Block access to LabNet (Admin/Ubuntu/Splunk VM)</h4><ul><li><strong>Test</strong>: In malware VM, run: ping 192.168.50.1</li><li>Or try SSH (if you installed it): ssh user@192.168.50.1</li><li><strong>Expected Result</strong>: Ping should <strong>fail</strong> (timeout or unreachable). SSH should <strong>not connect</strong>.</li></ul><h4>3. Allow DNS</h4><ul><li><strong>Test</strong>: ping google.com<br><strong>Expected Result</strong>: DNS resolution should <strong>succeed</strong>. (You should get IPs back even if ping is blocked.)</li></ul><h4>4. Allow NTP</h4><ul><li><strong>Test</strong>: timedatectl status<br>(Or manually try ntpdate if installed.)</li><li><strong>Expected Result</strong>: Time sync should be active or at least not error out.</li><li>You can also monitor pfSense logs or NTP status to confirm NTP requests from malware VM.</li></ul><h4>5. Allow HTTP</h4><ul><li><strong>Test</strong>: Open a browser in the malware VM and try a plain HTTP site:<br><a href="http://neverssl.com/">http://neverssl.com</a></li><li><strong>Expected Result</strong>: Page should load.</li></ul><h4>6. Allow HTTPS</h4><ul><li><strong>Test</strong>: Open a browser in the malware VM and visit: <a href="https://google.com/">https://google.com</a></li><li><strong>Expected Result</strong>: Pages should load normally over HTTPS.</li></ul><h4>🔐 BONUS TESTS: CONTAINMENT</h4><h4>7. Can Malware VM access your host system?</h4><ul><li><strong>Test</strong>: Find your host machine’s IP (e.g., ipconfig or ifconfig) and try pinging it from the malware VM. <br>ping &lt;host-ip&gt;</li><li><strong>Expected Result</strong>: <strong>Ping should fail</strong>. If it succeeds, your VM network isolation needs adjustment.</li></ul><p><strong>If all the tests listed above show the expected results, this means the Malware VM:</strong></p><ul><li>❌ Can’t reach pfSense GUI</li><li>❌ Can’t reach internal Admin/LabNet machines</li><li>✅ Can reach DNS, HTTP, HTTPS, and NTP services</li><li>✅ Has outbound internet access (with DNS resolution and HTTP/HTTPS connectivity)</li></ul><p><strong>Note:<br></strong>The <strong>“no internet access” icon</strong> you <strong>might</strong> see in the Malware VM’s status bar (especially on Windows) usually appears when:</p><ul><li>Windows <strong>Network Connectivity Status Indicator (NCSI)</strong> probes fail.</li><li>These probes try to reach Microsoft services like http://www.msftconnecttest.com/connecttest.txt or DNS like dns.msftncsi.com.</li><li>But your pfSense firewall rules <strong>do not allow unrestricted internet access</strong>, and you may not be allowing traffic to Microsoft-specific endpoints.</li></ul><p>Since we intentionally restricted access in malwarenet — and DNS/HTTP/HTTPS work in general — this icon is just a <strong>false negative</strong>.</p><p>✅ <strong>Your connectivity is fine.</strong><br> ❌ The system tray icon just can’t verify it the Microsoft way.</p><h3>✅ Step 6: Installing Tor on Windows (Malware VM)</h3><h4>1. Download the Tor Browser</h4><p>The Tor Browser includes everything you need to connect to the Tor network securely and easily — no manual setup, no need to install separate software.</p><p><strong>How:</strong></p><ol><li>Open the browser inside your Malware VM.</li><li>Go to the official site: <a href="https://www.torproject.org/download/">https://www.torproject.org/download/</a></li><li>Click <strong>“Download for Windows”</strong>.</li><li>Save the .exe file and run the installer.</li><li>Choose the default install path and complete the installation.<br><em>Downloading from the official site ensures authenticity. Avoid third-party sites — they may include modified or malicious versions.</em></li></ol><h4>2. Launch Tor Browser</h4><p>This initializes your first connection to the Tor network.</p><p><strong>How:</strong></p><ol><li>After installation, open the <strong>Tor Browser</strong>.</li><li>On the first launch, click <strong>“Connect”</strong> (default settings).</li><li>Wait a few seconds while it establishes a connection.<br><em>The browser builds a 3-hop encrypted Tor circuit. Your real IP is hidden from the destination site, and pfSense masks your host/router IP as well.</em></li></ol><h4>3. Confirm It Works</h4><p>We want to validate that:</p><ul><li>You’re connected to Tor</li><li>Your IP is hidden</li></ul><p><strong>How:</strong></p><ol><li>Inside the Tor Browser, go to: <a href="https://check.torproject.org/">https://check.torproject.org</a></li><li>It should say: “Congratulations. This browser is configured to use Tor.”</li><li>It will also show your <strong>Tor exit node IP</strong> and country.<em><br> This proves your traffic is now flowing through the Tor network. Because you’re routing through pfSense, your host IP remains protected.</em></li></ol><h4>4. Check DNS Leak Protection</h4><p>Even though you’re using Tor, a misconfigured system might still use your normal DNS resolver — leaking your DNS queries.</p><p><strong>How:</strong></p><ol><li>Visit: <a href="https://dnsleaktest.com/">https://dnsleaktest.com</a></li><li>Click <strong>Standard Test</strong>.</li><li>Confirm that <strong>none of the servers listed belong to your ISP</strong>.<em><br> If all IPs are from unrelated regions (e.g., different countries), you’re safe. If you see your ISP, there’s a DNS leak.</em></li></ol><h4>5. Harden Browser Settings (Optional but Recommended)</h4><p>Tor Browser is privacy-focused, but you can reduce fingerprinting risks further.</p><p><strong>How:</strong></p><ol><li>Click the <strong>shield icon (left of address bar)</strong>.</li><li>Set <strong>Security Level</strong> to “Safer” or “Safest”.</li><li>This disables JavaScript and some media types.<em><br> JavaScript can be used to fingerprint you or break anonymity, especially on malicious sites.</em></li></ol><h3><strong>Conclusion</strong></h3><p>With the Malware VM now fully isolated and verified through rigorous firewall testing, the cybersecurity home lab is complete. This setup allows for safe exploration of malware behavior while preserving the security and integrity of the rest of the lab. It’s a solid foundation for anyone looking to build practical, real-world cybersecurity skills from the ground up.</p><p><strong>🧭 Where It Can Go From Here:</strong><br> Now that the Malware VM is isolated and functional, this setup opens the door to deeper exploration. You can begin simulating malware infections, observing indicators of compromise (IOCs), and forwarding logs to Splunk for real-time detection. The lab also provides a safe way to explore anonymous network behavior using tools like Tor — from DNS leak testing to traffic analysis — all within a segmented, secure environment. Whether you’re experimenting with SIEM dashboards or studying evasive malware techniques, this lab now gives you the control and safety to dive deeper.</p><p>📬 Feel free to reach out on <a href="https://www.linkedin.com/in/khaledalkhatib/">LinkedIn</a> or explore my <a href="https://www.khaledalkhatib.com/">portfolio</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=583d4130cfbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity Home Lab — Phase 4: Splunk Setup & Log Forwarding]]></title>
            <link>https://medium.com/@khaledalkhatib/cybersecurity-home-lab-phase-4-splunk-setup-log-forwarding-a188ba6ea15d?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/a188ba6ea15d</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[segmentation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Mon, 05 May 2025 13:05:16 GMT</pubDate>
            <atom:updated>2025-05-05T13:05:16.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cybersecurity Home Lab — Phase 4: Splunk Setup &amp; Log Forwarding</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pfbj0vxDWG8n9TKce5V1Jw.png" /></figure><p>After establishing our segmented networks and virtual machines in the earlier phases, it’s time to bring the lab to life with log visibility. Phase 4 focuses on centralizing logs in Splunk — our chosen SIEM — laying the groundwork for detection, investigation, and future automation.</p><p>We’ll install and configure Splunk Enterprise on the Admin VM (Ubuntu), set up Splunk Universal Forwarder on the Windows-Victim machine, and confirm logs are successfully ingested.</p><h3>🖥️ Install Splunk on Ubuntu Admin VM</h3><h4>✅ Step 1: Download Splunk</h4><ul><li>Open Firefox inside Ubuntu</li><li>Go to: <a href="https://www.splunk.com/en_us/download/splunk-enterprise.html">https://www.splunk.com/en_us/download/splunk-enterprise.html</a></li><li>Select the <strong>.deb (64-bit)</strong> version for Ubuntu</li><li>You may be asked to create an account (you can use a 60 days free trial)<br><em>After 60 Days:<br>- </em><strong><em>The trial license expires</em></strong><em>, and Splunk switches to a </em><strong><em>Free license</em></strong><em> (if you allow it).<br>- Under the </em><strong><em>Free license</em></strong><em>, </em><strong><em>functionality becomes limited</em></strong><em>, but </em><strong><em>your data and configuration are not lost</em></strong><em>.<br>For a </em><strong><em>home lab with light log volumes</em></strong><em>, the </em><strong><em>Free license is usually enough</em></strong><em> to:<br>- Monitor a few machines (like your victim and attacker VMs)<br>- Run searches<br>- Visualize dashboards<br>But if you start forwarding </em><strong><em>too many logs</em></strong><em> (especially noisy ones like firewall or web server logs), you’ll hit the </em><strong><em>500 MB/day limit quickly</em></strong><em>.</em></li></ul><h4>✅ Step 2: Extract and Install Splunk</h4><ul><li><strong>Open Terminal</strong></li><li><strong>Navigate to your Downloads folder </strong>(or wherever you saved the file):<br>cd ~/Downloads</li><li><strong>Install the </strong><strong>.deb package using dpkg: </strong>sudo dpkg -i splunk-9.4.1-*.deb<br><em>This command installs the </em><em>.deb package for Splunk.<br></em><em>sudo: Runs the command with administrative privileges.<br></em><em>dpkg: Debian package manager (used to install </em><em>.deb files manually).<br></em><em>-i: Means “install.”<br></em><em>splunk-9.4.1-*.deb: The </em><em>* is a wildcard that matches the rest of the filename (e.g., </em><em>splunk-9.4.1-abc123.deb). It&#39;s used so you don’t have to type the whole exact file name.</em></li></ul><p><strong>Note:</strong></p><ul><li>During installation, you might get this<strong>:<br></strong><em>/var/lib/dpkg/info/splunk.postinst: line 123: curl: command not found<br></em>This is a <strong>warning</strong>, not an error.</li><li>During installation, Splunk tried to run a post-installation script that includes a curl (short for client URL)command (probably to ping a Splunk server or check for updates).</li><li>But curl isn’t installed on your system, so that command failed.</li><li>However, it doesn’t stop Splunk from being installed.</li></ul><h4>✅ Step 3: Start Splunk for the First Time</h4><p>If you haven’t already done this, run the following command:<br><em>sudo /opt/splunk/bin/splunk start --accept-license</em></p><p>This command:</p><ol><li><strong>Starts the Splunk service</strong> for the first time.</li><li><strong>Accepts the license agreement</strong> automatically (otherwise, you’d have to scroll through it and type “yes”).</li><li><strong>Prompts you to create admin credentials</strong> the first time you run it.</li></ol><p>Essentially, it boots up Splunk for initial setup and lets you access the web GUI at <a href="http://localhost:8000.">http://localhost:8000</a></p><h4>Enable Splunk to Start on Boot (Optional)</h4><p>If you want Splunk to run automatically when the VM boots (Recommended for real or persistent labs):<br><em>sudo /opt/splunk/bin/splunk enable boot-start</em></p><h4>Access the Splunk Web Interface</h4><p>Once it’s running, open <strong>Firefox</strong> inside your Ubuntu VM and go to:<br><em>http://localhost:8000</em></p><p>Or you can use the Ubuntu VM’s IP address in the browser:<br><em>http://192.168.50.X:8000</em></p><p>Use the credentials you created earlier to log in.</p><h3>Begin Log Forwarding from Windows-Victim VM</h3><p>Let’s start with <strong>Windows-Victim log forwarding</strong> using:</p><ul><li><strong>Splunk Universal Forwarder</strong></li><li><strong>Sysmon</strong> (Optional - for detailed process/network logging)</li></ul><h4>🛠️ Step 1: Install <strong>Splunk Universal Forwarder </strong>on Windows-Victim</h4><ol><li>Go to the <a href="https://www.splunk.com/en_us/download/universal-forwarder.html?utm_campaign=google_amer_en_search_brand&amp;utm_source=google&amp;utm_medium=cpc&amp;utm_content=Uni_Forwarder_Demo&amp;utm_term=splunk%20universal%20forwarder&amp;device=c&amp;_bt=570870011889&amp;_bm=p&amp;_bn=g&amp;gad_source=1&amp;gbraid=0AAAAAD8kDz2AheTFkjafxx-7eDQxt3s23&amp;gclid=Cj0KCQjwtpLABhC7ARIsALBOCVoUmgu16CxceOVyClgxmvIGGqil6g_YlOaIWGWzr5YWo2ldotLOkEIaAuZhEALw_wcB">Splunk Universal Forwarder downloads page</a> on your <strong>Windows VM browser</strong>.</li><li>Choose:</li></ol><ul><li><strong>Windows 64-bit</strong></li><li>Version: Preferably the same version as your Splunk Enterprise on Ubuntu (e.g., 9.x)</li></ul><ol><li>Download the <strong>MSI installer</strong>.</li><li>Double-click the installer and during the setup:</li></ol><ul><li>Accept the license.</li><li>Choose an <strong>on-premises Splunk Enterprise instance</strong></li><li><strong>Leave the Deployment Server field blank</strong> and just click <strong>Next</strong>.</li><li>Select <strong>“Forward logs to a Splunk instance”</strong>, and input your Ubuntu Splunk IP and receiving port (we’ll set that up shortly).</li><li>At the <strong>Receiving Indexer</strong> step:</li><li>Choose <strong>“Forward logs directly to a Splunk instance”</strong><br> Then enter your <strong>Ubuntu VM’s IP address</strong> and <strong>port 9997</strong> (this is the default Splunk TCP receiving port).</li><li><strong>Hostname/IP</strong>: 192.168.50.10<strong> Port</strong>: 9997<br><em>🧠 Double-check that port 9997 is open in your Ubuntu VM’s firewall and that your Splunk instance is listening for data on that port</em></li><li>Provide the <strong>admin credentials</strong> for the forwarder (you’ll need these later).</li><li>Finish the installation.</li></ul><h4>🔌 Step 2: Enable Receiving in Splunk (Ubuntu VM)</h4><p>On your <strong>Ubuntu Splunk instance</strong>, do the following:</p><ol><li>Log in to your Splunk web interface (http://localhost:8000 or http://&lt;Ubuntu IP&gt;:8000).</li><li>Go to: Settings → Forwarding and receiving → Configure receiving</li><li>Click <strong>“Add new”</strong> under <strong>Receive data</strong>.</li><li>Set the <strong>port to </strong><strong>9997</strong> (default for forwarders).</li><li>Click <strong>Save</strong>.</li></ol><h4>🛠️ Step 3: Configure Inputs on the Forwarder (Windows VM)</h4><ol><li>Open <strong>PowerShell as Administrator</strong> on the Windows VM.</li><li>Navigate to the forwarder bin:<br>cd &quot;C:\Program Files\SplunkUniversalForwarder\bin&quot;</li><li>Run the following commands to monitor logs:</li></ol><pre>.\splunk.exe add monitor &quot;C:\Windows\System32\winevt\Logs\Application.evtx&quot; -sourcetype WinEventLog:Application<br>.\splunk.exe add monitor &quot;C:\Windows\System32\winevt\Logs\Security.evtx&quot; -sourcetype WinEventLog:Security<br>.\splunk.exe add monitor &quot;C:\Windows\System32\winevt\Logs\System.evtx&quot; -sourcetype WinEventLog:System</pre><p><em>When it asks for username and password, when you installed the Splunk Universal Forwarder, it asked you to set up a username and password — that’s what it’s prompting for now.</em></p><p>4. Then set the receiving Splunk host:<br><em>.\splunk.exe add forward-server 192.168.50.10:9997</em></p><p>5. Start the forwarder service:<br><em>.\splunk.exe enable boot-start<br>.\splunk.exe start</em></p><p>If you get:<br><em>Service SplunkForwarder install error (CreateService): The specified service already exists.<br></em>That message just means that the Splunk Universal Forwarder service is <strong>already installed</strong> on your system.</p><h4>✅ Step 4: Confirm It’s Working</h4><p>On your <strong>Ubuntu Splunk Web UI</strong>:</p><ol><li>Go to <strong>Search &amp; Reporting</strong> app.</li><li>Use this search to see incoming logs:<br>index=* host=&quot;&lt;Windows-VM-hostname&gt;&quot;<br><em>If you&#39;re not sure what the host name is, open a Command Prompt in the Windows VM and type </em><em>hostname.</em></li></ol><p>Your <strong>Windows VM should be successfully forwarding logs to Splunk</strong> on your Ubuntu VM</p><h4>🛠️ Install Sysmon on Windows-Victim (Optional)</h4><p><strong>Sysmon</strong> is a Windows system service and device driver that logs system activity to the Windows event log. It’s commonly used for security monitoring.</p><p><strong>If you’re interested in advanced event logging</strong> (e.g., process creation, network connections, file creation time, registry access), then <strong>keep Sysmon</strong>. It gives you deeper telemetry that standard Windows event logs don’t capture.</p><p><strong>If you’re just interested in basic Windows event logs</strong> like Application, Security, and System (which is what the Splunk Universal Forwarder is monitoring by default), then <strong>you can uninstall Sysmon</strong>.</p><h4>✅ What to Do:</h4><ol><li><strong>Download Sysmon</strong> from Microsoft Sysinternals:<br><a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon">https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon</a></li><li>Extract the contents of the ZIP file.</li><li>Open <strong>Command Prompt as Administrator</strong>.</li><li>Run this to install with a default configuration:<br>sysmon -accepteula -i<br><em>You need to be in the location where you </em><strong><em>extracted</em></strong><em> Sysmon for this to work!</em></li><li>You should see a message like:<br> &quot;Sysmon installed and started.&quot;</li></ol><h3>Coming Soon: Phase 5 — Locking Down the Malware VM</h3><p>With logs from the Windows-Victim VM now streaming into Splunk, our SIEM setup is functioning in a way that closely resembles real-world environments. It’s worth noting that <strong>logs from attacker machines are almost never forwarded</strong> in production — this mirrors reality, where attackers don’t willingly hand over logs. Instead, defenders must rely on logs from victims, endpoints, firewalls, and network infrastructure to detect and respond to threats.</p><p>🔁 Later on, after finishing the Cybersecurity Home Lab series, we’ll revisit Splunk to create dashboards, detection rules, and alerting mechanisms — bringing full visibility and analytics to our home lab.</p><p>In Phase 5, we’ll isolate a new Windows-Malware VM on a segmented network (<strong>MalwareNet</strong>) and apply <strong>firewall rules</strong> using pfSense.</p><p>📬 Feel free to reach out on <a href="https://www.linkedin.com/in/khaledalkhatib/">LinkedIn</a> or explore my <a href="https://www.khaledalkhatib.com/">portfolio</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a188ba6ea15d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Tor in a Cybersecurity Home Lab: Privacy, Risks, and Real-World Use Cases]]></title>
            <link>https://medium.com/@khaledalkhatib/exploring-tor-in-a-cybersecurity-home-lab-privacy-risks-and-real-world-use-cases-22172c729087?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/22172c729087</guid>
            <category><![CDATA[tor]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[anonymity]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Thu, 01 May 2025 13:09:21 GMT</pubDate>
            <atom:updated>2025-05-01T13:09:21.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NpUiNCRm69a7oC8wrJYbIg.png" /></figure><p><strong>Tor </strong>(The Onion Router) is one of the most well-known tools for online anonymity. This article breaks down the core concepts behind Tor, what each part of the Tor circuit can see, how HTTPS changes the game, and how I considered implementing it in a controlled malware analysis environment within my cybersecurity home lab.</p><p>Feel free to check out the <a href="https://medium.com/@khaledkhatib91/building-a-realistic-cybersecurity-home-lab-architecture-tools-and-purpose-c7b18c4e3c15"><strong>Cybersecurity Home Lab</strong></a> I am working on and follow along.</p><h3>What Is Tor and How Does It Work?</h3><p>Tor anonymizes your internet traffic by routing it through a series of three volunteer-operated servers called <strong>nodes</strong>:</p><ul><li><strong>Entry Node (Guard)</strong>: Sees your IP address and knows you’re connecting to Tor, but not what you’re doing.</li><li><strong>Middle (Relay) Node</strong>: Passes encrypted traffic along the chain. It knows only the previous and next node.</li><li><strong>Exit Node</strong>: Sends your traffic to the final destination. It knows the destination but <em>not</em> who you are (unless the traffic is unencrypted).</li></ul><p>Each step adds a layer of encryption like layers of an onion. This design makes it hard for any single node to deanonymize a user.</p><h3>What Each Node Can See</h3><p>In the Tor network, each node (relay) plays a role in handling your traffic, and each can see different parts of your connection. The <strong>entry node</strong> (first hop) knows your IP address and that you’re using Tor, but it doesn’t know what website you’re visiting or the content you’re accessing. The <strong>middle node</strong> only knows which nodes your traffic is going between — it doesn’t know your IP or your destination. The <strong>exit node</strong> sees the destination website and any unencrypted traffic (such as HTTP), but it cannot see your IP address. However, if you’re accessing a site over <strong>HTTPS</strong>, the exit node can see the domain name but not the specific data exchanged, as it’s encrypted. This layered model ensures no single node knows both who you are and what you’re doing, which is central to Tor’s anonymity design.</p><h3>HTTPS vs HTTP Inside Tor</h3><ul><li><strong>HTTPS (Secure)</strong>: The exit node cannot read the contents. You still get end-to-end encryption beyond Tor.</li><li><strong>HTTP (Insecure)</strong>: The exit node can read everything: login forms, cookies, and more. It’s the biggest weakness when using Tor.</li></ul><h4>How to Check if HTTPS is Used</h4><ol><li>Look for the padlock icon in the browser address bar.</li><li>Click it to view certificate info.</li><li>URL should start with https://</li></ol><h3>Who Runs the Nodes?</h3><p>Tor nodes are often run by volunteers. That means <strong>some may be malicious</strong> or compromised by threat actors or surveillance bodies. Especially the <strong>exit nodes</strong>, which are attractive to attackers who want to sniff unencrypted traffic.</p><p>That’s why you should:</p><ul><li>Use HTTPS whenever possible</li><li>Never log into sensitive accounts over HTTP on Tor</li><li>Avoid transmitting personal info</li></ul><h3>Can You Choose the Exit Node?</h3><p>Yes, but not easily in the standard Tor browser. You can tweak the torrc config file or use custom tools to select specific countries or exit IPs. In general:</p><ul><li>The default setup randomizes the path.</li><li>You can <em>prefer</em> certain exits, but not force them in the browser UI.</li></ul><h3>General Risks of Using Tor</h3><p><strong>1. Malicious Exit Nodes</strong></p><ul><li>Some exit nodes are operated by attackers or surveillance entities.</li><li>If you visit <strong>non-HTTPS websites</strong>, these nodes can <strong>read, modify, or inject</strong> content into your traffic.</li></ul><p><strong>2. Fingerprinting &amp; Tracking</strong></p><p>Even though Tor hides your IP, sites can still fingerprint your browser using:</p><ul><li>Screen resolution</li><li>Timezone</li><li>Fonts and plugins</li><li>JavaScript behavior</li></ul><p>This can reduce your anonymity if you’re not careful.</p><p><strong>3. ISP &amp; Network Suspicion</strong></p><ul><li>Your ISP can see you’re using Tor, even if they can’t see what for.</li><li>This might flag you for extra scrutiny in some countries or organizations.</li></ul><p><strong>4. Misuse Leads to False Confidence</strong></p><ul><li>People sometimes assume Tor = total invisibility.</li><li>If you log into personal accounts (email, social media), you can still <strong>deanonymize yourself</strong>.</li></ul><p><strong>5. Slow Speeds</strong></p><ul><li>Tor routes traffic through 3 relays, which slows performance.</li><li>Not ideal for video, large downloads, or VoIP.</li></ul><p><strong>6. Exit Node Surveillance or Censorship</strong></p><ul><li>Some countries block known Tor exit nodes.</li><li>Others monitor connections to known guard/entry nodes.</li></ul><h3>How to Mitigate These Risks</h3><ul><li>Always use <strong>HTTPS</strong> (look for the padlock 🔒).</li><li>Don’t log into <strong>identifiable accounts</strong> while on Tor.</li><li>Use the <strong>official Tor Browser</strong> — it’s hardened for privacy.</li><li>Avoid installing extensions or modifying browser settings.</li><li>Disable scripts when possible using built-in protections (or NoScript).</li></ul><h3>Tor in My Malware VM: Security Considerations</h3><p>In my cybersecurity home lab, I isolated a <strong>malware analysis VM</strong> using pfSense and an internal network. Here’s how it works:</p><ul><li>The <strong>Malware VM</strong> connects only through <strong>pfSense</strong>, which controls its access.</li><li>If I were to install <strong>Tor inside the Malware VM</strong>, it would route through pfSense.</li></ul><h4>Key Security Insight</h4><p>Even if malware on the VM tries to leak your public IP, it only sees the IP of <strong>pfSense</strong>, not the host or the real external IP.</p><p>However, adding a VPN <strong>on top of Tor</strong> or <strong>as a middle layer</strong> can:</p><ul><li>Reduce the chance of real IP leakage</li><li>Provide better logging and alerting from the VPN side</li><li>Reduce the chance of real IP leakage</li><li>Provide better logging and alerting from the VPN side</li></ul><h3>📊 Summary</h3><p>Tor is a powerful tool for privacy, but it’s not bulletproof. In a cybersecurity home lab, it can be a safe way to simulate anonymous malware behavior if network segmentation is properly configured.</p><p><strong>Key takeaways:</strong></p><ul><li>Always use HTTPS inside Tor.</li><li>Never trust exit nodes.</li><li>pfSense adds a solid layer of protection.</li><li>Understand what data each node can and can’t see.</li><li>Use Tor carefully in malware testing to reduce exposure.</li></ul><p>📬 Feel free to reach out on <a href="https://www.linkedin.com/in/khaledalkhatib/"><strong>LinkedIn</strong></a> or explore my <a href="https://www.khaledalkhatib.com/"><strong>portfolio</strong></a>!</p><p><strong>Disclaimer: </strong>This article is intended for educational and research purposes only. Tor is a legal privacy tool used by individuals, journalists, researchers, and cybersecurity professionals around the world. This content does not promote or condone any illegal activity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22172c729087" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity Home Lab — Phase 3: Create & Connect All Lab VMs]]></title>
            <link>https://medium.com/@khaledalkhatib/cybersecurity-home-lab-phase-3-create-connect-all-lab-vms-542f1c56bb0e?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/542f1c56bb0e</guid>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[segmentation]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 13:30:29 GMT</pubDate>
            <atom:updated>2025-04-29T13:30:29.191Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cybersecurity Home Lab — Phase 3: Create &amp; Connect All Lab VMs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ac4MWNMpzoyjWZ6ZJQYnhA.png" /></figure><p>In <a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-1-setting-up-the-virtual-environment-bd4cb6751e8c">Phase 1</a>, I set up the virtual environment and configured BIOS settings and ISOs. Then, in <a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-2-setting-up-pfsense-and-internal-segmentation-7d7a9e9fc1eb">Phase 2</a>, I installed <strong>pfSense </strong>as a virtual firewall and established internal segmentation via <strong>LabNet</strong>.</p><p>Now, in <strong>Phase 3</strong>, it’s time to build out the actual machines that bring the lab to life — including:</p><ul><li>A Kali Linux attacker machine</li><li>A Windows victim endpoint</li></ul><p>This guide walks through creating each VM, assigning it to the right virtual network, and confirming everything is segmented and connected exactly as intended. Let’s get into it!</p><h3>🖥️ Step 1: Create Kali Linux (Attacker) VM</h3><h4>💡 Specs:</h4><ul><li><strong>OS</strong>: Kali Linux Installer ISO</li><li><strong>RAM</strong>: 2–4 GB</li><li><strong>CPU</strong>: 2 cores</li><li><strong>Disk</strong>: 25–40 GB (VDI, dynamically allocated)</li></ul><h4>🛠️ What to do:</h4><ol><li>In VirtualBox, click <strong>New</strong></li><li>Name: Kali-Attacker</li><li>Type: Linux</li><li>Version: Debian (64-bit)</li><li>Choose ISO: Kali Linux installer ISO</li><li>Uncheck <strong>“Enable unattended install”</strong></li><li>After creation, go to <strong>Settings &gt; Network</strong>:</li></ol><ul><li><strong>Adapter 1</strong>: Attached to Internal Network</li><li><strong>Name</strong>: LabNet</li><li>Promiscuous Mode: <strong>Allow All</strong></li><li>Cable Connected: ✅</li></ul><h4>✅ Install Kali Linux (Attacker VM)</h4><h4>🧠 Recommendation:</h4><p>➡️ <strong>Start pfSense VM first</strong>, wait until it’s fully booted, then start Kali as this ensures:</p><ul><li>DNS works properly</li><li>Updates and tools can install</li><li>Kali gets a DHCP IP via pfSense (192.168.50.x)</li></ul><h4>🛠️ What to Do:</h4><ol><li><strong>Start the Kali VM</strong> from VirtualBox<br> It should boot into the ISO.</li><li>On the boot screen, choose: <strong>Graphical Install</strong></li></ol><h4>🧭 Installer Steps (GUI):</h4><h4>1. Select Language &amp; Region</h4><ul><li>Language: English</li><li>Location: Your actual region (e.g., Canada)</li></ul><h4>2. Keyboard Layout</h4><ul><li>Choose: English (US) or whatever you’re using</li></ul><h4>3. Configure Network</h4><ul><li>Hostname: kali</li><li>Domain: (Leave blank or set to lab.local)</li></ul><h4>4. Set Up User</h4><ul><li>Full name: Kali User (or anything you want)</li><li>Username: kali</li><li>Password: Set something strong but memorable</li></ul><h4>5. Set Clock/Timezone</h4><ul><li>Choose your time zone</li></ul><h4>6. Partition Disks</h4><ul><li>Choose: <strong>Guided — use entire disk</strong></li><li>Select: your virtual hard disk (likely /dev/sda)</li><li>Choose: <strong>All files in one partition</strong></li><li>Confirm and continue to write changes</li></ul><h4>7. Software Selection</h4><p>Leave the defaults checked:</p><ul><li>Kali desktop environment (GNOME or XFCE)</li><li>Large collection of tools<br><em>You don’t need every tool, but the defaults are great for red team labs.</em></li></ul><h4>8. Install GRUB Bootloader</h4><ul><li>Yes → Install to /dev/sda<br><em>Don’t worry, installing GRUB in your Kali VM has no effect on your host or other VMs. VirtualBox VMs are sandboxed by default; each GRUB installation is scoped only to its own virtual disk.</em></li></ul><h4>✅ After Reboot:</h4><ul><li>Login with the username/password you created</li><li>Open a terminal and run: ip a</li><li>You should see an IP like 192.168.50.X — that confirms you&#39;re connected to <strong>LabNet via pfSense</strong>.</li></ul><p>That <strong>confirms </strong>everything is working exactly as planned:</p><ul><li>Kali is now fully installed</li><li>It’s connected to <strong>LabNet</strong></li><li>It got its IP from <strong>pfSense</strong> (via DHCP)</li><li>Network segmentation is working smoothly</li></ul><h4>Quick Check (Optional)</h4><p>You can confirm the gateway and DNS used by Kali with: ip route<br>You should see something like: <em>Gateway: </em><em>192.168.50.1 (your pfSense LAN IP)</em></p><h3>🖥️ Step 2: Create the Windows-Victim VM in VirtualBox</h3><p>🛠️ <strong>In VirtualBox:</strong></p><ol><li>Click <strong>New</strong></li><li>Set:</li></ol><ul><li><strong>Name</strong>: Windows-Victim</li><li><strong>Choose ISO</strong>: Windows.iso</li><li><strong>Type</strong>: Microsoft Windows</li><li><strong>Check: </strong>Skip Unattended Installation</li><li><strong>Version</strong>: Windows 10 (64-bit)</li></ul><ol><li>Click <strong>Next</strong></li></ol><p>💾 <strong>Memory (RAM)</strong>:</p><ul><li>Set to <strong>3 GB (3072 MB)</strong> — more if you have room (up to 4 GB is nice for responsiveness)</li></ul><p>🧠 <strong>CPU</strong>:</p><ul><li>2 CPU cores is ideal, but 1 works if you’re tight on resources</li></ul><p>💽 <strong>Hard Disk</strong>:</p><ul><li>Choose: <strong>Create a virtual hard disk now</strong></li><li>Type: VDI</li><li>Storage: Fixed size or dynamically allocated (either works, but fixed gives better performance)</li><li>Size: <strong>40 GB</strong></li></ul><p>Click <strong>Create</strong> to finish.</p><h4>Set Up the Network Adapter</h4><p>We want this VM on <strong>LabNet</strong> (same as pfSense, Kali, and Ubuntu Admin):</p><p>🛠️ Go to <strong>Settings → Network</strong></p><ul><li><strong>Adapter 1</strong>:</li><li>Enable Network Adapter ✅</li><li>Attached to: <strong>Internal Network</strong></li><li>Name: LabNet</li><li>Promiscuous Mode: <strong>Allow All</strong></li><li>Cable Connected: ✅ Checked</li></ul><p>Click OK.</p><h4>🧭 Installer Steps (GUI):</h4><h4>Start the VM and Begin Installation</h4><ol><li>Start the Windows-Victim VM</li><li>It should boot into the Windows installer</li></ol><p>📌 Choose:</p><ul><li>Language: English</li><li>Keyboard: US</li><li>Time/Region: as preferred</li></ul><p>Continue through the installer. If asked for a product key:</p><ul><li>Click <strong>“I don’t have a product key”</strong></li><li>Choose <strong>Windows 10 Pro</strong> or Home (Pro preferred)<br><em>Windows 10 </em><strong><em>Pro</em></strong><em> offers advanced features that are useful (and sometimes necessary) for realistic enterprise simulations and blue team practice.<br>The </em><strong><em>“N” versions</em></strong><em> of Windows are versions </em><strong><em>without multimedia features</em></strong><em>, designed for the European market due to antitrust laws.</em></li></ul><p>🧱 When asked:</p><ul><li>Installation type → Choose <strong>Custom</strong></li><li>Select the disk you created earlier → Click <strong>Next</strong></li></ul><p>Windows will now install.</p><h4>Windows Setup (Post-Install Screens)</h4><p><strong>Region</strong></p><ul><li>Choose your country (e.g., Canada) → Click <strong>Yes</strong></li></ul><p><strong>Keyboard layout</strong></p><ul><li>Default: <strong>US</strong> → Click <strong>Yes</strong></li><li>When asked for a second layout → Click <strong>Skip</strong></li></ul><p><strong>Set up for personal use</strong></p><p>In a lab environment, <strong>“Set up for personal use”</strong> is the best option because:</p><ul><li>It <strong>skips</strong> any requirement for organization-linked accounts</li><li>Keeps the setup <strong>simple and local</strong></li><li>Avoids <strong>automatic policy enforcement</strong> or syncing with Microsoft Intune or Azure AD</li><li>It’s perfect for a <strong>victim VM</strong> where we want control over every setting</li></ul><p><strong>Offline Account</strong></p><p>Why choose Offline account?</p><ul><li>It lets you create a <strong>local user</strong> without connecting to Microsoft</li><li>Perfect for lab use (victim systems in real orgs often use local accounts)</li><li>Avoids syncing or account protection that could interfere with your testing</li></ul><p>After choosing <strong>offline account</strong>, click on “<strong>Limited Experience</strong>”<br><em>This skips Microsoft account login and keeps it local.</em></p><h4>Create a Local User Account</h4><p><strong>Who’s going to use this PC?</strong></p><ul><li>Enter: victim</li></ul><p><strong>Create a password</strong></p><ul><li>Optional, but recommended (e.g., Victim2024!)</li><li>Add hint if needed</li></ul><p><strong>Privacy Settings</strong></p><ul><li>You can disable everything for privacy or leave defaults</li><li>I suggest turning off all options for now: Location, Diagnostics, Ads ID, etc.<br><em>You might not be able to fully opt out from sending diagnostics anymore so choose the least invasive option — </em><strong><em>Send required diagnostic data</em></strong></li></ul><p><strong>Customize Experience / Cortana</strong></p><ul><li>Skip personalization</li><li>Disable or decline Cortana</li></ul><h4>💡 After Login</h4><p>Once you land on the Windows desktop:</p><ul><li>Open Command Prompt → run ipconfig<br> You should see an IP like 192.168.50.X — that confirms it&#39;s on LabNet and got it from pfSense!</li></ul><p>That <strong>confirms</strong>:</p><ul><li>You’re connected to <strong>LabNet</strong></li><li>You received a DHCP lease from <strong>pfSense</strong></li><li>The segmentation is working perfectly</li></ul><h4>🔒 Now Let’s Do Some Quick Hardening (Basic Victim Prep)</h4><p>Let’s disable some VirtualBox integration features that could pose a risk in a malware test scenario:</p><h4>🛠️ Step 1: Disable Shared Clipboard and Drag &amp; Drop</h4><p>They are disabled by default but to confirm:</p><ol><li>In VirtualBox Manager (not inside the VM), <strong>select the Windows VM</strong></li><li>Go to <strong>Settings → General → Advanced</strong></li><li>Set both:</li></ol><ul><li><strong>Shared Clipboard</strong>: <strong>Disabled</strong></li><li><strong>Drag and Drop</strong>: <strong>Disabled</strong></li></ul><h4>💾 Step 2: Take a Snapshot (Optional but Recommended)</h4><p>Once you’re happy with the base Windows setup (before adding tools or malware):</p><ol><li><strong>Shut down the VM</strong> cleanly</li><li>In VirtualBox Manager → Right-click the Windows VM → <strong>Take Snapshot</strong></li><li>Name it:<br> Phase 3 - Windows Victim (Clean Baseline)<br> Add a note like: “Fresh Windows install, connected to LabNet”</li></ol><p>You’ve officially added your <strong>Windows-Victim</strong> to the lab!</p><h3>🦠 What About the Windows-Malware VM?</h3><p>We <strong>intentionally saved that for later </strong>Because it needs <strong>strict isolation</strong> via <strong>MalwareNet.</strong></p><h4>🔐 Why Not Create It Now?</h4><p>Creating it <strong>too early</strong> could:</p><ul><li>Complicate your routing configs</li><li>Accidentally allow leaks or connection overlap</li><li>Introduce malware testing before logging and detection are operational</li></ul><p>We’ll only spin up the <strong>Windows-Malware VM</strong> <em>after</em>:</p><ul><li>The main lab (LabNet) is complete</li><li>Splunk and logging are in place</li><li>MalwareNet segmentation is ready</li></ul><h3>Up Next: Phase 4 — Splunk Setup &amp; Log Forwarding</h3><p>With the attacker and victim VMs now active on LabNet, the next step is to bring real visibility into the environment. <strong>Phase 4</strong> will focus on blue team operations by walking through:</p><ul><li>Installing and configuring <strong>Splunk</strong> on the Ubuntu Admin VM</li><li>Setting up <strong>log forwarding</strong> from the Windows-Victim</li><li>Laying the groundwork for network-based monitoring and detection</li></ul><p>If you’re working on something similar or exploring how blue teams detect threats in segmented networks, feel free to follow along — insights, questions, and feedback are always welcome!</p><p>📬 Feel free to reach out on <a href="https://www.linkedin.com/in/khaledalkhatib/">LinkedIn</a> or explore my <a href="https://www.khaledalkhatib.com/">portfolio</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=542f1c56bb0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity Home Lab — Phase 2: Setting Up pfSense and Internal Segmentation]]></title>
            <link>https://medium.com/@khaledalkhatib/cybersecurity-home-lab-phase-2-setting-up-pfsense-and-internal-segmentation-7d7a9e9fc1eb?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d7a9e9fc1eb</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[segmentation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Thu, 24 Apr 2025 14:15:30 GMT</pubDate>
            <atom:updated>2025-04-24T14:15:30.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cybersecurity Home Lab — Phase 2: Setting Up pfSense and Internal Segmentation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJMhG-wpll1ja_5j1dPu9w.png" /></figure><p>This is Phase 2 of my cybersecurity home lab series — focused on building network segmentation using pfSense and preparing your internal lab environment.</p><p>If you haven’t completed Phase 1 yet (which covers setting up the hypervisor, ISO files, and BIOS settings), you can check it out here:</p><p><a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-1-setting-up-the-virtual-environment-bd4cb6751e8c"><strong>Cybersecurity Home Lab — Phase 1: Setting Up the Virtual Environment</strong></a></p><p>The full architecture breakdown and design rationale is also included in the main overview article linked there.</p><h3>✅ Step 1: Create the pfSense VM in VirtualBox</h3><h4>🛠️ What to do:</h4><ol><li><strong>Open VirtualBox</strong> and click <strong>“New”</strong></li><li><strong>Name:</strong> pfSense</li><li><strong>Type:</strong> BSD</li><li><strong>Version:</strong> FreeBSD (64-bit)<br><em>🧠 pfSense is based on FreeBSD, so selecting this ensures compatibility.</em></li><li><strong>Select the ISO image:</strong></li></ol><ul><li>If you see a button like <strong>“Choose a disk file…”</strong> — select your pfSense-CE-2.7.2-RELEASE-amd64.iso.</li><li>This will <strong>automatically mount the ISO</strong> under the VM’s storage when it finishes creating the machine.</li><li>If you skip it now, you can always add it later (in the Storage tab), but doing it here is a nice shortcut.</li></ul><h4><strong>Base Memory (RAM):</strong> Allocate <strong>512MB to 1GB</strong></h4><ul><li>Enough for routing + VPN + DHCP</li></ul><h4><strong>CPU Core:</strong> 1</h4><ul><li>One CPU core is enough for pfSense in a home lab</li><li>pfSense is <strong>lightweight</strong>, especially for basic routing, firewalling, and even VPN with one or two VMs.</li><li>It doesn’t need parallel processing unless you’re pushing heavy traffic or running advanced packages (like Snort or Suricata later on).</li></ul><h4><strong>Hard Disk:</strong> Create a virtual hard disk now</h4><ul><li>Type: VDI</li><li>Size: 10–20 GB is plenty</li></ul><p>Note: In the name and operating system tab of the wizard, you can <strong>change the folder to wherever you want</strong>. It does <strong>not</strong> have to stay in C:</p><p><strong>📂 What That Folder Is?</strong><br>That’s the location where VirtualBox will store:</p><ul><li>The <strong>VM configuration file</strong></li><li>The <strong>virtual hard disk (VDI)</strong></li><li>Any <strong>snapshots</strong> or related data</li></ul><p><strong>Pro Tip:</strong> Just make sure the folder path you choose:</p><ul><li>Has enough free space</li><li>Doesn’t get synced to the cloud (e.g., OneDrive) to avoid conflicts</li></ul><p>✅ Once done, don’t start it yet — we need to set up the network adapters first.</p><h3>✅ Step 2: Set Up pfSense Network Adapters (2 NICs)</h3><p>We’re giving pfSense <strong>two virtual network cards (NICs)</strong>:</p><ul><li><strong>NIC 1</strong> → Connected to the <strong>Internet (via NAT)</strong></li><li><strong>NIC 2</strong> → Connected to your <strong>internal lab network</strong> (LabNet and MalwareNet will connect here later)</li></ul><h4>🛠️ What to Do:</h4><ol><li>Go to <strong>VirtualBox</strong> → select your pfSense VM → click <strong>Settings</strong></li><li>Go to the <strong>Network</strong> tab</li></ol><h4>🔌 Adapter 1 (WAN / Internet)</h4><ul><li><strong>Enable Network Adapter:</strong> Yes (should be enabled by default)</li><li><strong>Attached to:</strong> NAT</li><li><strong>Name:</strong> (leave default)</li><li><strong>Adapter Type:</strong> Leave as-is</li><li><strong>Promiscuous Mode:</strong> Deny<br>Promiscuous Mode tells a <strong>network adapter</strong> to: <em>“Accept all network traffic it sees — even if it’s not addressed to me.”<br></em>It is useful for: <br>- <strong>Packet sniffing</strong> (e.g., using Wireshark)<br>- <strong>Intrusion detection systems (IDS)<br>- </strong>Debugging and analyzing internal traffic<br>- Monitoring devices talking on the same internal network</li><li><strong>Cable Connected:</strong> Checked</li></ul><blockquote><em>🧠 This allows pfSense to access the internet like your host machine.</em></blockquote><h4>🔌 Adapter 2 (LAN / Internal Lab)</h4><ol><li>Switch to <strong>Adapter 2</strong> tab</li><li><strong>Enable Network Adapter:</strong> Yes</li><li><strong>Attached to:</strong> Internal Network</li><li><strong>Name:</strong> Type exactly:<br> LabNet</li><li><strong>Promiscuous Mode:</strong> Allow All</li><li><strong>Cable Connected:</strong> Checked</li></ol><blockquote><em>🧠 This adapter will be used to connect all your internal VMs (Kali, Victim, SIEM) to pfSense.</em></blockquote><p>We’ll create MalwareNet later, when you set up the <strong>Windows-Malware VM</strong> in Phase 3. That way:</p><ul><li>pfSense can keep LabNet and MalwareNet <strong>separate</strong></li><li>You’ll route traffic from <strong>MalwareNet → VPN → Internet</strong></li><li>But keep it <strong>isolated from everything else</strong>, including the SIEM and other lab VMs</li></ul><p>So right now:</p><ul><li><strong>Adapter 1:</strong> NAT (for WAN access)</li><li><strong>Adapter 2:</strong> Internal Network → Name it<strong> </strong><strong>LabNet </strong>(this is for Victim, SIEM, Kali)</li></ul><h3>✅ Step 3: Boot pfSense and Begin Installation</h3><h4>🛠️ What to do:</h4><ol><li>In VirtualBox, select your pfSense VM</li><li>Click <strong>Start</strong></li></ol><p>💡 Since you already mounted the ISO earlier, it should boot into the <strong>pfSense installer</strong>.</p><h4>⏳ What You’ll See:</h4><ul><li>A boot menu with options like:<br> Boot Multi user [Enter]<br> Boot Single user<br> ...</li></ul><p>Just <strong>press </strong>Enter or wait — it will auto-boot into the installer.</p><h4>🔧 Installation Flow:</h4><p>Follow these screens:</p><ol><li><strong>Welcome Screen</strong> → Press Enter to continue</li><li><strong>Keymap Selection</strong> → Choose <strong>Default / Continue with default keymap</strong></li><li><strong>Install pfSense</strong> → Select it and press Enter</li><li><strong>Partitioning</strong> → Choose <strong>Auto (UFS)</strong> (or ZFS if you’re feeling adventurous — but UFS is simpler)</li></ol><ul><li>If you’re just getting started or setting this up for learning/lab:<br> <strong>Auto (UFS)</strong> is the safe and simple option</li><li>If you’re experimenting with advanced storage features later:<br> You can explore <strong>ZFS</strong>, but it’s not necessary right now</li></ul><ol><li>Let it install — it will format the virtual disk and write files</li><li>Once you reach the reboot screen, <strong>don’t hit Enter yet</strong> — I’ll help you <strong>unmount the ISO first</strong> so it doesn’t boot back into the installer (step 4).</li></ol><p><strong>Notes:</strong></p><p>1- When it asks if you want to use this entire disk (ada0) for pfsense or partition it? Use this entire disk (ada0) for pfSense.</p><ul><li>The disk labeled ada0 is the <strong>virtual hard disk</strong> you created for the pfSense VM — it exists <strong>only inside VirtualBox</strong>.</li><li>It’s like a file stored on your host (e.g., pfSense.vdi) that acts as a fake hard drive for the VM.</li><li>The pfSense installer only sees this virtual disk — it has <strong>zero access</strong> to your host OS, host files, or physical drives.</li></ul><p>2- When it asks to select a partition scheme: APM, BSD, GPT or MBR!</p><p>Choose MBR (Master Boot Record)</p><ul><li><strong>Simple and compatible</strong> with VirtualBox</li><li>Works perfectly with pfSense and UFS</li><li>No EFI/UEFI complications</li><li>Uses legacy BIOS boot mode (which we are using)</li></ul><p>3- If you get an error: <em>No root partition was found. The root pfsense partition must have a mountpoint of ‘/’</em>, reboot the VM and start the installer again.</p><h3>✅ Step 4: Unmount the pfSense ISO Before Reboot</h3><ol><li>In <strong>VirtualBox</strong>, go to the top menu of the running VM window</li><li>Click <strong>Devices → Optical Drives → Remove disk from virtual drive</strong></li><li>You might get a message like “Force unmount?” — click <strong>Yes</strong></li></ol><p>✅ Done — the ISO is now detached.</p><p>Now go back to the VM screen and:</p><blockquote><em>🔁 </em><strong><em>Press Enter</em></strong><em> to reboot the VM</em></blockquote><p>It will now boot into your newly installed pfSense system, where we’ll configure the interfaces.</p><p>When it’s booted and shows a <strong>black screen with a numbered menu</strong> (usually options 1–16) — that means pfSense is ready to configure!</p><h3>✅ Step 5: Assign WAN and LAN Interfaces</h3><p><strong>Note:</strong> This part might have already been set up, that means pfSense <strong>auto-detected and assigned the interfaces correctly</strong>, which saves us a step — awesome!</p><p>You should see a prompt like this:</p><blockquote><strong><em>Do you want to set up VLANs now?</em></strong><em><br> (usually appears the first time pfSense boots)</em></blockquote><h4>🛠️ What to Do:</h4><ol><li><strong>VLANs?</strong> → Type n and press <strong>Enter</strong></li></ol><ul><li>You don’t need VLANs for now — we’re using VirtualBox’s internal networks</li></ul><ol><li><strong>Enter the WAN interface name:</strong></li></ol><ul><li>Type: em0 and press Enter<br> (pfSense typically assigns <strong>Adapter 1 (NAT)</strong> to em0)</li></ul><ol><li><strong>Enter the LAN interface name:</strong></li></ol><ul><li>Type: em1 and press Enter<br> (Adapter 2, your internal LabNet, is usually em1)</li></ul><blockquote><em>If you’re not sure which is which, pfSense will briefly list their MAC addresses — and you can cross-check them in VirtualBox under </em><strong><em>Settings → Network → Adapter → Advanced</em></strong><em>.</em></blockquote><ol><li>When asked to proceed → Type y and press Enter</li></ol><p>Once that’s done, you’ll return to the main pfSense menu (1–16), and you should see:</p><ul><li>WAN (em0): [some IP from NAT]</li><li>LAN (em1): 192.168.1.1 (default)</li></ul><h4>✅ What’s Next?</h4><p>To access pfSense’s GUI, we’ll create a <strong>new VM</strong> that:</p><ul><li>Is connected to LabNet</li><li>Gets an IP from pfSense via DHCP</li><li>Can open http://192.168.1.1 to configure the firewall</li></ul><p>The best VM for this is your upcoming <strong>Ubuntu Admin + Splunk VM</strong> (the SIEM box). From there, you’ll:</p><ul><li>Access pfSense GUI</li><li>Configure static IPs, firewall rules, DHCP ranges, etc.</li><li>Later: install Splunk to collect logs</li></ul><h3>🧭 Step 6: Create the Ubuntu Admin VM (connected to LabNet)</h3><h4>✅ Step-by-Step: Create the Ubuntu Admin VM</h4><h4>🛠️ In VirtualBox, click New</h4><ul><li><strong>Name:</strong> Ubuntu-Admin</li><li><strong>Machine Folder:</strong> (same location as your pfSense VM is fine)</li><li><strong>Type:</strong> Linux</li><li><strong>Version:</strong> Ubuntu (64-bit)</li><li><strong>Select the ISO image: </strong>Ubuntu 24.04.2 LTS ISO</li></ul><p>Click <strong>Next</strong></p><h4>1. Memory (Base Memory)</h4><ul><li>Set to <strong>4096 MB (4 GB)<br></strong><em>Splunk can be memory-hungry. If you plan to run it smoothly, 4 GB is the sweet spot.</em></li></ul><h4>2. CPU Core: 2</h4><ul><li>Splunk benefits from more than 1 core, especially when parsing logs or running searches</li><li>2 cores keeps performance smooth without overloading your system</li></ul><h4>4. Create a Virtual Hard Disk</h4><ul><li><strong>Choose:</strong> Create a virtual hard disk now</li><li><strong>Type: </strong>VDI</li><li><strong>Size:</strong> 25–40 GB<br> (30 GB is ideal for light Splunk usage)</li></ul><p>Click <strong>Create</strong></p><p>✅ That creates the base VM. Next, we’ll:</p><ol><li>Mount the Ubuntu ISO</li><li>Set up the <strong>network adapter</strong> to connect to LabNet</li></ol><p><strong>Note: </strong>If you see an exclamation mark at the unattended install tab, this is part of VirtualBox’s “convenience feature” to automatically install the OS without you doing anything manually but you want full manual control so:</p><ul><li><strong>Uncheck</strong> the box that says <strong>“Enable unattended install”</strong></li></ul><h4>✅ Next Step: Connect the Ubuntu VM to LabNet</h4><p>We need to switch the VM’s network adapter so it’s on the same internal network as pfSense’s LAN interface.</p><h4>🛠️ What to Do:</h4><ol><li>In <strong>VirtualBox</strong>, select your Ubuntu-Admin VM (don’t start it yet)</li><li>Click <strong>Settings → Network</strong></li><li>Go to the <strong>Adapter 1</strong> tab</li></ol><p>Then set:</p><ul><li><strong>Enable Network Adapter:</strong> Checked</li><li><strong>Attached to:</strong> Internal Network</li><li><strong>Name:</strong> LabNet</li><li><strong>Promiscuous Mode:</strong> Allow All</li><li><strong>Cable Connected:</strong> Checked</li></ul><p>Click <strong>OK</strong> to save</p><p>This puts the Ubuntu VM on the same network as pfSense’s LAN interface (192.168.1.1) — so once you install Ubuntu, it will:</p><ul><li>Get an IP via DHCP from pfSense</li><li>Be able to access the pfSense web GUI</li><li>Later act as your SIEM/logging station</li></ul><h3>✅ Step 7: Boot and Install Ubuntu</h3><h4>🛠️ What to Do:</h4><ol><li>In VirtualBox, <strong>select your </strong><strong>Ubuntu-Admin VM</strong></li><li>Click <strong>Start</strong></li></ol><p>Since you’ve already mounted the ISO during creation, it should boot into the <strong>Ubuntu installer</strong> automatically.</p><h4>🧭 Follow the Installer Steps:</h4><p>1. <strong>Language:</strong> Choose your preferred language → Click <strong>“Install Ubuntu”</strong></p><p>2.<strong> Keyboard Layout:</strong> Default is fine (English US) → Continue</p><p>3. <strong>Updates and Other Software:</strong></p><ul><li>✅ <em>Normal installation</em></li><li>✅ <em>Download updates while installing Ubuntu</em></li><li>✅ <em>Install third-party software</em> → Continue</li></ul><p>4.<strong> Installation Type:</strong></p><ul><li><strong>Choose:</strong> <em>Erase disk and install Ubuntu</em></li><li><strong>Don’t worry!</strong> This erases the <em>virtual disk only</em>, not your host OS.</li></ul><p>5. <strong>Timezone:</strong> Choose your region → Continue</p><p>6.<strong> User Info:</strong></p><ul><li><strong>Name:</strong> Admin or SIEM</li><li><strong>Username:</strong> admin</li><li><strong>Password:</strong> anything secure like admin123</li></ul><p>7. Click <strong>Continue</strong> — and let the installation run!</p><p><strong>Notes:</strong></p><ul><li>Allow it to connect to the internet during installation if prompted</li><li>Choose “Interactive Installation”<br>You <strong>unchecked “Unattended install”</strong> earlier — so you’re going the <strong>manual route. Interactive</strong> lets you:<br>- Choose your partitioning<br>- Set up your username/password<br>- See each step in case something needs troubleshooting later</li><li>Regarding apps you want to install, go with the <strong>Default Selection </strong>because:</li></ul><p><strong>Default Selection:<br>- </strong>Gives you the core apps (like Firefox, Files, Terminal, etc.)<br>- Keeps your VM <strong>lightweight</strong> and fast<br> -You’ll install only what you <strong>actually need</strong> later (like Splunk, Wireshark, etc.)</p><p><strong>Extended Selection<br>- </strong>Adds things like office apps, games, image editors, etc.<br>- Not necessary for a focused lab environment<br>- Just takes up disk space and RAM</p><ul><li>Regarding recommended proprietary software, Check only Option 1:<br><strong>Install third-party software for graphics and Wi-Fi hardware</strong></li><li>When prompted to add your username, computer name, password, etc. fill them accordingly.</li></ul><p>Go ahead and click <strong>“Restart Now”</strong> once the installation finishes.</p><h4>After you click Restart:</h4><ol><li>If it says “Please remove installation media and press Enter” — <br> Just press <strong>Enter</strong><br> (If it hangs, close → go to <strong>Settings &gt; Storage &gt; remove ISO</strong>, then Start again)</li><li>Ubuntu will boot into the login screen</li><li>Log in with:</li></ol><ul><li><strong>Username: </strong>(whatever you chose)</li><li><strong>Password:</strong> (whatever you chose)</li></ul><h4>📍 Let’s Check What IP Ubuntu Got:</h4><ol><li>Open <strong>Terminal</strong> in Ubuntu</li><li>Run: ip a</li><li>Look for an IP on something like enp0s3 or eth0<br> You should see something like: 192.168.1.100/24<br><em>That IP came directly from pfSense!</em></li></ol><h4>🌐 Next Step: Log into the pfSense Web GUI</h4><ol><li>Open <strong>Firefox</strong> in Ubuntu</li><li><strong>Visit: </strong><a href="http://192.168.1.1/">http://192.168.1.1</a></li><li>You’ll see a <strong>warning about an insecure connection</strong> — this is normal for pfSense’s self-signed certificate</li></ol><ul><li>Click <strong>Advanced</strong> → <strong>Accept the Risk and Continue</strong></li></ul><p>You’ll reach the pfSense login page!</p><h4>🔐 Login Credentials:</h4><ul><li><strong>Username:</strong> admin</li><li><strong>Password:</strong> pfsense (default)</li></ul><h3>✅ Step 8: pfSense Initial Setup Wizard</h3><h4>🛠️ What to Do:</h4><p>When you first log in, pfSense should launch the setup wizard. If it doesn’t, you can start it from: <strong>System → Setup Wizard</strong></p><p>Here’s what to do at each step:</p><h4>1. Welcome Page → Click Next</h4><h4>2. General Information</h4><ul><li><strong>Hostname:</strong> pfsense.lab (or leave as default)</li><li><strong>Domain:</strong> lab.local (or default)</li><li><strong>Primary DNS:</strong> 1.1.1.1 or 8.8.8.8</li><li><strong>Secondary DNS:</strong> Optional (you can use both)</li><li>Check <strong>“Override DNS”</strong> to allow pfSense to use these directly</li></ul><p>Click <strong>Next</strong></p><h4>3. Time Server Information</h4><ul><li>Timezone: Pick your local timezone</li><li>Leave the NTP server as default unless you have another preference</li></ul><p>Click <strong>Next</strong></p><h4>4. WAN Configuration</h4><ul><li>Leave everything at <strong>default (DHCP)</strong> — pfSense uses NAT to reach the internet</li></ul><p>Click <strong>Next</strong></p><h4>5. LAN Configuration</h4><p>Here you can customize your internal network.</p><p>You can:</p><ul><li>Leave it as 192.168.1.1/24</li><li>Or set something unique like 192.168.50.1/24</li></ul><p><strong>🧠 My Recommendation:<em><br></em></strong>Since we’ve already planned for segmentation in future VMs:<br><strong>Set the LAN IP to </strong><strong>192.168.50.1/24 now</strong><br><em> It keeps things organized and prevents overlap with any home network using </em><em>192.168.1.x</em></p><p>🧠 If you change this, your Ubuntu VM will get a new IP after rebooting or renewing DHCP.</p><p>Click <strong>Next</strong></p><h4>6. Set Admin Password</h4><ul><li>Enter a <strong>strong password</strong> you’ll remember (or save in a secure password manager)</li><li>Avoid using the default (pfsense)</li><li>Example: LabFirewall2024! or BlueTeam$Gate50<br><em>This is the password you’ll use to log into the pfSense Web GUI going forward.</em></li></ul><p>Click <strong>Next</strong></p><h4>Final Page</h4><p>Click <strong>Reload</strong> to apply all settings!</p><p>pfSense will then:</p><ul><li>Save your config</li><li>Restart internal services</li><li>Take you back to the login page at the <strong>new IP</strong> → <a href="http://192.168.50.1/">http://192.168.50.1</a></li></ul><p>Log back in with:</p><ul><li><strong>Username:</strong> admin</li><li><strong>Password:</strong> your new password</li></ul><p><strong>Note:</strong></p><ul><li>Sometimes you need to force IP renewal. This can be done by going to terminal and typing: <em>sudo netplan apply<br></em>This should trigger a DHCP request and reconfigure the interface using pfSense’s new 192.168.50.x network.<br>Then check your IP again by typing <em>ip a</em> in the terminal and it should show the new IP</li></ul><h4>You’ve now:</h4><p>✅ Set up <strong>pfSense</strong><br>✅ Configured your custom LAN subnet (192.168.50.0/24)<br>✅ Verified <strong>DHCP and routing</strong> are working<br>✅ Logged into the <strong>pfSense web GUI</strong> from your segmented <strong>Ubuntu Admin VM</strong></p><p>This means your <strong>LabNet</strong> zone is now fully operational 🧱💻🌐</p><h4>Important note:</h4><p><strong>pfSense must stay powered on</strong> any time you want Ubuntu (or any LabNet VM) to:</p><ul><li>Access the internet</li><li>Talk to other VMs</li><li>Log traffic, send data, etc.</li></ul><p>It’s doing the job of a real-world <strong>gateway firewall/router</strong>, just like in an enterprise network.</p><h3>✅ Step-by-Step: Take a Snapshot in VirtualBox</h3><h4>📦 1. pfSense VM</h4><ol><li>In VirtualBox, <strong>shut down the pfSense VM</strong> properly (Option 6 in console: Halt system)</li><li>Go to <strong>VirtualBox Manager</strong> (main screen)</li><li>Right-click the pfSense VM → <strong>Snapshots</strong></li><li>Click <strong>Take</strong></li><li>Name it something like: Phase 2 - pfSense configured (192.168.50.1)</li><li>Add optional description (e.g., “Completed initial setup, DHCP and GUI confirmed”)</li><li>Click <strong>OK</strong></li></ol><h4>2. Ubuntu Admin VM</h4><ol><li>Shut down the Ubuntu VM</li><li>In VirtualBox Manager → Right-click Ubuntu VM → <strong>Snapshots</strong></li><li>Click <strong>Take</strong></li><li>Name: Phase 2 - Ubuntu Admin Ready</li><li>Description: “Has working network, access to pfSense, ready for Splunk installation”</li><li>Click <strong>OK</strong></li></ol><h3>Onward to Phase 3</h3><p>✅ That wraps up Phase 2! Next, I’ll install Splunk on the Ubuntu Admin VM and expand the lab with an attacker machine (Kali Linux) and a victim machine (Windows). Follow along for Phase 3, and feel free to share your own lab setup or ask questions!</p><p>📬 Feel free to reach out on <a href="https://www.linkedin.com/in/khaledalkhatib/">LinkedIn</a> or explore my <a href="https://www.khaledalkhatib.com/">portfolio</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d7a9e9fc1eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity Home Lab — Phase 1: Setting Up the Virtual Environment]]></title>
            <link>https://medium.com/@khaledalkhatib/cybersecurity-home-lab-phase-1-setting-up-the-virtual-environment-bd4cb6751e8c?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd4cb6751e8c</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[virtualbox]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[homelab]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 13:03:20 GMT</pubDate>
            <atom:updated>2025-04-21T13:03:20.991Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cybersecurity Home Lab — Phase 1: Setting Up the Virtual Environment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zD_30LS6_oquMYAEpx3tjg.png" /></figure><p>This is <strong>Phase 1</strong> of my cybersecurity home lab series — focused on setting up the virtual environment. This guide walks through installing your hypervisor, downloading the right ISOs, and configuring your system’s BIOS for virtualization. These steps form the foundation for building a safe, segmented, and realistic lab.</p><p>If you haven’t seen the full architecture and reasoning behind the lab, check out the <strong>overview article here</strong>:</p><p><a href="https://medium.com/@khaledkhatib91/building-a-realistic-cybersecurity-home-lab-architecture-tools-and-purpose-c7b18c4e3c15">Building a Realistic Cybersecurity Home Lab: Architecture, Tools, and Purpose</a></p><h3>✅ Step 1: Install VirtualBox</h3><h4>🛠️ What to do:</h4><ol><li>Go to the official VirtualBox website: <a href="https://www.virtualbox.org/">https://www.virtualbox.org/</a></li><li>Download VirtualBox for <strong>Windows Hosts</strong></li><li>Run the installer and go with the default settings</li><li>Once installed, launch VirtualBox</li></ol><h4>🧠 Why it matters:</h4><p>VirtualBox is your <strong>hypervisor</strong> — the base platform that will run all your virtual machines. It allows us to set up <strong>isolated networks</strong>, control internet access, and configure custom firewall rules using pfSense. It’s free, stable, and perfect for home labs.</p><p><strong>⚠️ Note on Python Dependency Warning</strong></p><p>During installation, you may see a warning about:</p><blockquote>Missing dependencies: Python core / win32api</blockquote><p>This is <strong>completely normal</strong> and safe to ignore.</p><p><strong>🛠️ Why it happens:</strong></p><ul><li>You may have selected to install <strong>VirtualBox Python bindings</strong> (an optional feature)</li><li>Your system might not have the optional pywin32 libraries used for scripting and automation</li></ul><p><strong>✅ You can safely ignore this warning.</strong></p><p>It does <strong>not</strong> affect your ability to:</p><ul><li>Create and run VMs</li><li>Install pfSense, Splunk, Kali, Ubuntu, or Windows</li><li>Set up internal networks and simulate segmentation</li></ul><h3>✅ Step 2: Download Required ISO Files</h3><h4><strong>🛠️ What to do:</strong></h4><p>Download the ISO installation files for the operating systems you’ll use in your lab. These are bootable files you’ll mount when creating each VM in VirtualBox.</p><p>Here’s what to download and why:</p><p><strong>1- pfSense (Firewall + Router)</strong></p><ul><li><strong>Download from</strong>: <a href="https://repo.ialab.dsu.edu/pfsense/">https://repo.ialab.dsu.edu/pfsense/</a></li><li><strong>Choose</strong>: pfSense-CE-2.7.2-RELEASE-amd64.iso.gz</li><li>This will act as your virtual firewall, routing traffic between networks and enforcing segmentation.</li></ul><p><strong>2- Windows 10 ISO (Victim and Malware VMs)</strong></p><ul><li>If the ISO isn’t directly available, use the <a href="https://www.microsoft.com/software-download/windows10"><strong>Media Creation Tool</strong></a></li><li>Select “<strong>Create installation media</strong>” → Choose ISO file</li><li>Used for both your Windows-Victim and Windows-Malware VMs</li></ul><p><strong>3- Ubuntu Desktop LTS (SIEM / Admin VM)</strong></p><ul><li><strong>Download from</strong>: <a href="https://ubuntu.com/download/desktop">https://ubuntu.com/download/desktop</a></li><li><strong>Choose</strong>: <em>Ubuntu 24.04.2 LTS</em>, Intel or AMD 64-bit architecture</li><li>This will run Splunk for log analysis and simulate your blue team admin box</li></ul><p><strong>4- Kali Linux (Attacker VM)</strong></p><ul><li><strong>Download from</strong>: <a href="https://www.kali.org/get-kali/#kali-installer-images">https://www.kali.org/get-kali/#kali-installer-images</a></li><li><strong>Choose</strong>: <em>64-bit Installer ISO</em></li><li>Comes with preloaded penetration testing tools for red team simulations</li></ul><p><strong>💡 Pro Tip:</strong><br>Create a folder like C:\CyberLab\ISOs and store all your ISO files there. It keeps everything organized and easy to find when creating VMs later.</p><h3>🔧 Step 3: Enable Virtualization (VT-x / AMD-V / SVM) in BIOS</h3><h4>🛠️ What to Do (Step-by-Step)</h4><h4>1. Restart your computer</h4><ul><li>Click Restart (not Shutdown)</li><li>During the boot process (before Windows starts), you’ll need to <strong>enter your BIOS/UEFI menu</strong></li></ul><h4>2. Enter BIOS/UEFI Setup</h4><ul><li>On most PCs, press one of the following <strong>right after your PC powers on</strong>:</li><li>Del or Delete</li><li>F2, F10, F12, or Esc</li><li>If you’re not sure, your screen might briefly show the correct key (like “Press F2 for Setup”)</li></ul><h4>3. Find the Virtualization Setting</h4><p>Once inside BIOS/UEFI, look under tabs like:</p><ul><li><strong>Advanced</strong>, <strong>CPU Configuration</strong>, or <strong>Security</strong></li></ul><p>You’re looking for:</p><ul><li>✅ <strong>Intel VT-x</strong> (if you have an Intel CPU)</li><li>✅ <strong>AMD-V</strong> or <strong>SVM</strong> (if you have an AMD CPU)<br> <em>(SVM stands for Secure Virtual Machine — it’s AMD’s name for virtualization)</em></li><li>Sometimes called <strong>“Virtualization Technology” </strong>especially on Intel systems</li></ul><blockquote><em>🟢 </em><strong><em>Enable it</em></strong><em> (set it to “Enabled”)</em></blockquote><h4>🧠 Why This Matters</h4><p>Your CPU has a built-in feature called <strong>hardware virtualization</strong> that allows VirtualBox to run 64-bit virtual machines (like pfSense, Ubuntu, Windows, etc.) <strong>with better performance and isolation</strong>.</p><p>Without enabling it:</p><ul><li>You may not see 64-bit options when creating VMs</li><li>VMs may run slower or not start at all</li><li>Features like nested virtualization (e.g., pfSense routing) may not work properly</li></ul><h4>💬 This is just the beginning</h4><p>Phase 2 will walk through setting up pfSense as the virtual gateway and enforcing segmentation between lab zones.</p><p>If you found this helpful, feel free to follow here or connect with me on <a href="https://www.linkedin.com/in/khaledalkhatib/">LinkedIn</a> to catch the next part.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd4cb6751e8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Realistic Cybersecurity Home Lab: Architecture, Tools, and Purpose]]></title>
            <link>https://medium.com/@khaledalkhatib/building-a-realistic-cybersecurity-home-lab-architecture-tools-and-purpose-c7b18c4e3c15?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7b18c4e3c15</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 14:36:16 GMT</pubDate>
            <atom:updated>2025-05-12T13:44:24.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kaWFyBkAt1ze0riusrL0w.png" /></figure><p><em>A full breakdown of my cybersecurity home lab architecture — designed to safely simulate malware attacks, log analysis, and enterprise-level segmentation.</em></p><p>I’ve been planning and designing a professional-grade cybersecurity home lab to mirror the kind of environments you’d find in enterprise SOCs and security teams. In this post, I’ll walk through the full architecture I’ve mapped out, the tools I’m using, and — most importantly — the reasoning behind each decision. Whether you’re building your own lab or simply exploring how others structure realistic network simulations, this guide lays it all out.</p><h4>🔧 Lab Phases</h4><p>This cybersecurity home lab was built in five clearly defined phases, each focused on a key aspect of network security and analysis. The full series is now complete, and each phase is linked below for easy navigation:</p><ul><li>Phase 1 —<strong> </strong><a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-1-setting-up-the-virtual-environment-bd4cb6751e8c?source=your_stories_page--------------------------------------------"><strong>Setting Up the Virtual Environment</strong></a></li><li>Phase 2 — <a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-2-setting-up-pfsense-and-internal-segmentation-7d7a9e9fc1eb?source=your_stories_page--------------------------------------------"><strong>Setting Up pfSense and Internal Segmentation</strong></a></li><li>Phase 3 — <a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-3-create-connect-all-lab-vms-542f1c56bb0e?source=your_stories_page--------------------------------------------"><strong>Create &amp; Connect All Lab VMs</strong></a></li><li>Phase 4 —<strong> </strong><a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-4-splunk-setup-log-forwarding-a188ba6ea15d?source=your_stories_page--------------------------------------------"><strong>Splunk Setup &amp; Log Forwarding</strong></a></li><li>Phase 5 — <a href="https://medium.com/@khaledkhatib91/cybersecurity-home-lab-phase-5-malware-vm-isolation-vpn-only-routing-583d4130cfbd"><strong>Malware VM Isolation</strong></a></li></ul><h3>🎯 The Goal</h3><p>To create a safe, segmented, and realistic environment where I can:</p><ul><li>Test malware behavior without risking my host OS</li><li>Simulate red team attacks and blue team detection</li><li>Practice log forwarding and SIEM monitoring</li><li>Experiment with OPSEC techniques like VPN routing and Tor-based traffic</li><li>Study how attacks unfold in controlled, observable conditions</li></ul><p>This is more than a test environment. It’s a training ground to build real, job-ready skills.</p><h3>🧱 The Core Components</h3><h4>🛡️ pfSense (Virtual Firewall &amp; Router)</h4><p><strong>Why I chose it:</strong> pfSense allows me to act as my own network architect. It enables segmentation, firewall rule creation, NAT, VPN integration, and DHCP management — all critical for simulating enterprise security perimeters.</p><ul><li>Acts as the central gateway between internal VMs and the internet</li><li>Routes traffic differently based on policy</li><li>Enforces firewall rules to isolate VMs</li><li>Hosts the VPN client that masks selected traffic</li></ul><h4>🌐 ProtonVPN (inside pfSense)</h4><p><strong>Why I chose it:</strong> To simulate anonymized traffic and explore secure routing configurations within a segmented lab environment. Only the malware VM uses this VPN via policy-based routing.</p><ul><li>Configured inside pfSense as a VPN client</li><li>Only the Malware VM’s traffic is routed through it</li><li>Internet kill switch is enforced — if the VPN fails, the Malware VM loses internet access</li></ul><h4>🔲 VirtualBox</h4><p><strong>Why I chose it:</strong> A stable and free hypervisor that works perfectly on my Windows host. It lets me set up internal networks, assign multiple NICs to pfSense, and keep VMs fully segmented.</p><h3>🧭 Network Architecture</h3><p>The lab is split into two internal virtual networks:</p><h4>🔹 LabNet</h4><ul><li>Hosts: Kali Linux (Attacker), Windows-Victim, Ubuntu Admin (Splunk)</li><li>Can communicate with each other</li><li>Accesses the internet through pfSense (without VPN)</li><li>Forward logs to the SIEM (Splunk)</li></ul><h4>🔸 MalwareNet</h4><ul><li>Hosts only the Isolated Windows VM (for malware testing)</li><li>No communication with LabNet or SIEM</li><li>Internet access only through pfSense via VPN</li><li>Designed to mimic a malware-infected endpoint that operates in isolation</li></ul><h3>💻 Virtual Machines</h3><h4>🖥️ Windows-Victim</h4><ul><li>Simulates a real endpoint with potential vulnerabilities</li><li>Uses Sysmon + Winlogbeat to forward logs to Splunk</li></ul><h4>💀 Kali Linux</h4><ul><li>Simulates attacker behavior (e.g., port scanning, lateral movement)</li><li>Optional log forwarding to Splunk for visibility</li></ul><h4>📊 Ubuntu Admin + Splunk SIEM</h4><ul><li>Collects logs from other VMs (except malware VM)</li><li>Dashboards and alerts for PowerShell, netconn, brute-force attempts</li><li>Provides hands-on blue team experience</li></ul><h4>⚠️ Isolated Windows VM (Malware Sandbox)</h4><ul><li>Fully air-gapped except for VPN-filtered internet access</li><li>Tor Browser installed to simulate modern C2 traffic</li><li>No logs forwarded, no connection to other internal networks</li><li>Snapshot-enabled for quick reverts after malware detonation</li></ul><h3>🔐 Security Controls</h3><p>The security of this lab relies on multiple layers of control. Network segmentation ensures that internal systems like the malware VM are fully isolated from others, preventing any lateral movement. pfSense firewall rules further enforce this separation, managing who can communicate with what. The Malware VM is routed exclusively through a VPN tunnel using policy-based routing, ensuring all traffic is anonymized and isolated.</p><p>A kill switch is enabled so that if the VPN disconnects, internet access is cut off entirely for that VM. There are no shared folders or clipboard sharing enabled between any VM and the host, which eliminates a common malware escape vector. Finally, log forwarding is intentionally disabled on the Malware VM to reflect realistic malware behavior and ensure containment.</p><h3>🧠 What This Setup Teaches</h3><ul><li>Designing secure architectures from scratch</li><li>Creating segmentation with real firewall tools</li><li>Detecting attacker behavior through logs</li><li>Observing malware behavior in isolation</li><li>Understanding VPN traffic, Tor flow, and policy routing</li><li>Building SIEM dashboards and alerts from real data</li></ul><h3>➕ Optional Additions</h3><ul><li>Integrate Wireshark to observe packet flow from outside the MalwareNet</li><li>Experiment with Suricata or Snort for inline detection</li><li>Write custom Splunk queries to trigger alerts based on attack behavior</li></ul><h3>💬 Final Thoughts</h3><p>This lab is not just an academic exercise — it’s an evolving platform for professional-grade security research, detection, and skill building. If you’re working on something similar, I’d love to connect. This lab will serve as a focused platform to deepen my hands-on experience in blue team practices and analyst workflows.</p><p>📬 Feel free to reach out on <a href="https://www.linkedin.com/in/khaledalkhatib/">LinkedIn</a> or explore my <a href="https://www.khaledalkhatib.com/">portfolio</a>!</p><p>Thanks for reading — and stay secure 🛡️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7b18c4e3c15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stack Data Structures and Call Stack]]></title>
            <link>https://medium.com/@khaledalkhatib/stack-data-structures-and-call-stack-46946385ed81?source=rss-983be9dbacff------2</link>
            <guid isPermaLink="false">https://medium.com/p/46946385ed81</guid>
            <dc:creator><![CDATA[Khaled Alkhatib]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 16:21:44 GMT</pubDate>
            <atom:updated>2023-01-12T16:21:44.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*WLxQxp9s_VRZleGSruhjdg.jpeg" /></figure><p>In this article, we will talk about the basics of stack data structure and the implementation of “call stack” in Javascript.</p><h4><strong>What is Stack data?</strong></h4><p>To start off, we should know what stack actually means. Stack is an abstract data type (<strong>ADT</strong>) with a predefined capacity. It is a simple structure that permits adding and removing elements in a specific order. Those elements are stacked on top of each other and the only accessible element is the last one added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*0Sv_qr6d6FjOYaQClQbUqQ.png" /></figure><h4><strong>Operations of stack</strong></h4><p>Think about coins piled (stacked) on top of each other. Now if you want the first coin, you can easily take it. However, if you want the second coin, you will need to remove the first coin to gain “access” to the second one.</p><p>Data stacks work in a similar way and they have several main operations:</p><ul><li>push() — This will add a new element to the top of the stack.</li><li>pull() — This will remove and return the element at the top of the stack.</li><li>top() OR peek() — This will check the stack and return the last element pushed (the element at the very top). Unlike push() and pull(), top() OR peek() only returns the element and does not actually alter the stack.</li><li>isEmpty() — This checks if the stack is empty.</li><li>isFull() — This checks if the stack is full.</li></ul><p>It is worth mentioning that stacks have a limited size, which means that at some point the user will no longer be able to push more elements and this is called stack overflow which we will come to later in this article. The same applies to when the stack is empty; the user can’t make pull requests to an empty stack and that is called stack underflow.</p><h4><strong>LIFO stack principle</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*-J_xachhccO_30oio0uimg.png" /></figure><p>The above image explains the principle of <strong>LIFO</strong> (<strong>L</strong>ast <strong>I</strong>n <strong>F</strong>irst <strong>O</strong>ut) which is the order of which elements are removed from the stack. Although item 3 was the last to be pushed to the the stack, it is the first one to be popped.</p><p>Stack implementations can be applied to any programming language and the specifications are pretty much the same.</p><h4><strong>Algorithms</strong></h4><p><strong><em>Algorithm for push():</em></strong><br>1- Check whether the stack is <strong>full</strong> or not.<br>2- If the stack is full, return an error of overflow and exit the app.<br>3- If the stack is not full, increment the top and add the element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*dDdLRj7z_-bh-MIks4jerQ.jpeg" /></figure><p><strong><em>Algorithm for pull():</em></strong><br>1- Check whether the stack is <strong>empty</strong> or not.<br>2- If the stack is empty, return an error of underflow and exit the app.<br>3- If the stack is not empty, print the element at the top and decrement the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*3MtqW8HN_kLv8nXtuXkxDg.jpeg" /></figure><pre><strong><em>Below is a descriptive code showing how push(), pop(), and isEmpty() are implemented.</em></strong></pre><pre><strong><em>/* This program is written in C++ language */</em></strong></pre><pre># include&lt;iostream&gt;</pre><pre>using namespace std;</pre><pre><strong><em>/* Below, we assign a stack and set its max &quot;capacity&quot; to be 10 */</em></strong><br>class Stack<br>{<br> int top;<br> public:<br> int a[10]; //Maximum size of Stack<br> Stack()<br> {<br> top = -1;<br> }<br> <br> <strong><em>// declaring all the function</em></strong><br> void push(int x);<br> int pop();<br> void isEmpty();<br>};</pre><pre><strong><em>// function to insert data into stack</em></strong><br>void Stack::push(int x)<br>{<br> if(top &gt;= 10)<br> {<br> cout &lt;&lt; “Stack Overflow \n”;<br> }<br> else<br> {<br> a[++top] = x;<br> cout &lt;&lt; “Element Inserted \n”;<br> }<br>}</pre><pre><strong><em>// function to remove data from the top of the stack</em></strong><br>int Stack::pop()<br>{<br> if(top &lt; 0)<br> {<br> cout &lt;&lt; “Stack Underflow \n”;<br> return 0;<br> }<br> else<br> {<br> int d = a[top — ];<br> return d;<br> }<br>}</pre><pre><strong><em>// function to check if stack is empty</em></strong><br>void Stack::isEmpty()<br>{<br> if(top &lt; 0)<br> {<br> cout &lt;&lt; “Stack is empty \n”;<br> }<br> else<br> {<br> cout &lt;&lt; “Stack is not empty \n”;<br> }<br>}</pre><p>In addition to the above code, there are few things to keep in mind:<br>1- When top = -1, this means that the stack is empty.<br>2- When top = 0, this means there is only one element in the stack.<br>3- When top = N-1, this means that the stack is full.<br>4- When top = N, this means that the stack is in an overflow state.</p><h3>Javascript Call Stack</h3><p>By now, we should be comfortable with the concept of stack data structure and it’s time to take a step forward and talk about Javascript call stack.</p><p>Javascript engine uses call stack to manage execution contexts. In other words, javascript uses call stack to keep track of multiple function calls.</p><p>Remember the <strong>LIFO</strong> stack principle (<strong>L</strong>ast <strong>I</strong>n <strong>F</strong>irst <strong>O</strong>ut) we discussed earlier? Call stack is used to keep record of which function is running now and follows the LIFO principle .</p><p>Call stack is single threaded which means it can only do one thing at a time thus making code execution synchronous.</p><h4>How does call stack handle function calls?</h4><p>The best way to explain how call stack handle function calls following the <strong>LIFO</strong> principle is to walkthrough this code.</p><pre>function firstFunction(){<br> console.log(&quot;Hello from firstFunction&quot;);<br>}<br><br>function secondFunction(){<br> firstFunction();<br> console.log(&quot;The end from secondFunction&quot;);<br>}<br><br>secondFunction();</pre><p>When the above code runs, this will be the output in the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QK1E2o-artpDiToiPz6Ocg.png" /></figure><p>Lets talk about what happens step by step:<br>1- The secondFunction() gets executed which results in an empty stack frame being created. This is the main() or origin() entry point of the program.<br>2- The secondFunction() then calls the firstFunction() which is pushed into the stack.<br>3- The firstFunction() returns and prints “Hello from firstFunction” to the console.<br>4- After that, the firstFunction() is popped of the the stack.<br>5- The execution order then moves to the secondFunction() and returns and prints “The end from secondFunction” to the console. <br>6- Finally, the secondFunction() is popped of the stack, clearing the memory.</p><h4><strong>Stack overflow</strong></h4><p>Stack overflow occurs when a function calls itself without an exit point, also know as a recursive function.</p><p>Here is an example:</p><pre>function callMyself(){<br>  callMyself();<br>}<br><br>callMyself();</pre><p>The callMyself function above will keep running until the browser (host environment) can no longer accommodate the stacks and will throw an error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*7PBx9dCYXnGmSQFfViAjLw.png" /></figure><h4>References</h4><ul><li><a href="https://www.studytonight.com/data-structures/stack-data-structure">https://www.studytonight.com/data-structures/stack-data-structure</a></li><li><a href="https://www.tutorialspoint.com/data_structures_algorithms/stack_algorithm.htm">https://www.tutorialspoint.com/data_structures_algorithms/stack_algorithm.htm</a></li><li><a href="https://www.freecodecamp.org/news/understanding-the-javascript-call-stack-861e41ae61d4/">https://www.freecodecamp.org/news/understanding-the-javascript-call-stack-861e41ae61d4/</a></li><li><a href="https://www.geeksforgeeks.org/what-is-the-call-stack-in-javascript/">https://www.geeksforgeeks.org/what-is-the-call-stack-in-javascript/</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Glossary/Call_stack">https://developer.mozilla.org/en-US/docs/Glossary/Call_stack</a></li><li><a href="https://www.javascripttutorial.net/javascript-call-stack/">https://www.javascripttutorial.net/javascript-call-stack/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46946385ed81" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>