<?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 Sohankharel on Medium]]></title>
        <description><![CDATA[Stories by Sohankharel on Medium]]></description>
        <link>https://medium.com/@sohansec?source=rss-1c4407a35442------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6pkFX410Pr_jZ4-roS28tw.png</url>
            <title>Stories by Sohankharel on Medium</title>
            <link>https://medium.com/@sohansec?source=rss-1c4407a35442------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:15:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sohansec/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[Wireless Encryption Security: WEP and WPA/WPA2 Auditing Concepts]]></title>
            <link>https://sohansec.medium.com/wireless-encryption-security-wep-and-wpa-wpa2-auditing-concepts-0135938ea0bd?source=rss-1c4407a35442------2</link>
            <guid isPermaLink="false">https://medium.com/p/0135938ea0bd</guid>
            <category><![CDATA[wireless-security]]></category>
            <category><![CDATA[pew]]></category>
            <category><![CDATA[wpa3]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[wpa2]]></category>
            <dc:creator><![CDATA[Sohankharel]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 04:40:58 GMT</pubDate>
            <atom:updated>2026-11-30T04:40:58.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xwvdzSMjXP7mQMF1lZ5gEg.png" /></figure><h3>Introduction</h3><p>Wireless security protocols have evolved significantly since early Wi-Fi deployments because radio transmissions can be captured passively by any receiver within range. Knowing why older encryption schemes fail — and how modern standards protect wireless handshakes and management frames — helps security professionals evaluate wireless configurations accurately and recommend practical remediation.</p><p>This guide examines the structural weaknesses of Wired Equivalent Privacy (WEP), how WPA/WPA2 Personal authentication and four-way handshakes operate, why Wi-Fi Protected Setup (WPS) introduces risk, and how modern controls such as WPA2-AES (CCMP), WPA3, and Protected Management Frames (802.11w) strengthen wireless networks.</p><p><em>(Note: Because the WEP and WPA/WPA2 course folders in the Drive repository consist of video/subtitle files, the technical explanations below combine general wireless security principles with official standards and tool documentation.)</em></p><h3>Fundamentals</h3><p>Evaluating wireless encryption requires familiarity with several key terms:</p><ul><li><strong>Initialization Vector (IV):</strong> A nonce or cryptographic number combined with a secret key so encrypting identical plaintext blocks produces different ciphertext outputs.</li><li><strong>RC4:</strong> A legacy stream cipher used in WEP that generates a pseudo-random keystream XORed with plaintext data.</li><li><strong>PSK (Pre-Shared Key):</strong> A shared secret passphrase or key used in Personal (home/small-office) WPA/WPA2 deployments to derive session encryption keys.</li><li><strong>4-Way Handshake (EAPOL):</strong> The cryptographic exchange between a client station and an Access Point in WPA/WPA2 that proves knowledge of the shared credential and derives unique per-session encryption keys without transmitting the passphrase over the air.</li><li><strong>WPS (Wi-Fi Protected Setup):</strong> A convenience feature designed to simplify pairing wireless clients to an Access Point using a PIN or push button.</li></ul><h3>Technical Explanation</h3><h3>Why WEP Fails Cryptographically</h3><p>Wired Equivalent Privacy (WEP), introduced in the original IEEE 802.11 standard, combines a static secret key with a <strong>24-bit Initialization Vector</strong> to seed the RC4 stream cipher. Two design flaws undermine its security:</p><ol><li><strong>Small IV Space and Reuse:</strong> A 24-bit field supports only 2^{24} (16,777,216) distinct values. On busy networks—or when traffic is artificially generated—IVs repeat frequently. When two frames are encrypted with the same RC4 keystream, statistical analysis and known-plaintext techniques can recover key material.</li><li><strong>Weak Integrity Check:</strong> WEP uses a non-cryptographic CRC-32 checksum rather than a message authentication code (MAC), allowing bit-flipping modifications in ciphertext without detection.</li></ol><p>Because of these flaws, WEP is considered cryptographically broken and obsolete.</p><h3>How WPA and WPA2 Personal Work</h3><p>Wi-Fi Protected Access (WPA) and WPA2 replaced WEP by introducing stronger cipher suites — <strong>TKIP</strong> (Temporal Key Integrity Protocol, later deprecated due to weaknesses) and <strong>AES-CCMP</strong> (Counter Mode with Cipher Block Chaining Message Authentication Code Protocol, standard in WPA2) — alongside a <strong>four-way handshake</strong> using EAPOL (Extensible Authentication Protocol over LAN) frames.</p><p>In WPA2-PSK:</p><ul><li>The Pre-Shared Key and network SSID are used to derive a Pairwise Master Key (PMK).</li><li>During the four-way handshake, the Access Point and client exchange nonces (ANonce and SNonce) and Message Integrity Codes (MICs) to derive a <strong>Pairwise Transient Key (PTK)</strong> used to encrypt unicast traffic for that session.</li><li>Because the passphrase itself is never sent in plaintext during the handshake, offline auditing of a captured handshake relies on testing candidate passphrases against the captured handshake parameters rather than decrypting traffic directly via IV statistical recovery.</li></ul><h3>WPS PIN Vulnerabilities</h3><p>WPS was intended to make connecting devices easier, often using an 8-digit numeric PIN. Historical implementations divided PIN verification into two halves (the first four digits and the next three digits, with the eighth digit acting as a checksum), drastically reducing the search space compared to a single 8-digit secret and making WPS vulnerable to brute-force PIN guessing if rate limiting or lockouts are weak or absent.</p><h3>Practical Application</h3><blockquote><strong><em>Scope Reminder:</em></strong><em> Only capture frames or audit wireless networks that you own or have explicit written permission to test.</em></blockquote><h3>1. Capturing Handshake Traffic on a Dedicated Channel</h3><p>When auditing an authorized WPA2 test network in Monitor Mode, locking airodump-ng to the target AP&#39;s BSSID and channel ensures you record relevant beacon and EAPOL handshake frames into a capture file:</p><pre># Capture frames on a single authorized AP BSSID and channel to disk<br>sudo airodump-ng --bssid AA:BB:CC:DD:EE:FF --channel 11 --write wpa_audit wlan0mon</pre><ul><li>--bssid AA:BB:CC:DD:EE:FF: Restricts recorded network/station entries to the target Access Point.</li><li>--channel 11: Keeps the wireless card tuned to channel 11 instead of hopping across unrelated channels.</li><li>--write wpa_audit: Writes captured frames to wpa_audit-01.cap.</li></ul><h3>2. Offline Dictionary Auditing Concepts (aircrack-ng)</h3><p>In authorized security assessments, aircrack-ng can test candidate passphrases from a wordlist against a captured WPA/WPA2 handshake file:</p><pre># Test passphrases from a wordlist against a captured handshake file<br>aircrack-ng -w /usr/share/wordlists/rockyou.txt -b AA:BB:CC:DD:EE:FF wpa_audit-01.cap</pre><ul><li>-w &lt;wordlist&gt;: Specifies the file containing candidate passphrases to evaluate.</li><li>-b &lt;BSSID&gt;: Filters the capture to the specified Access Point MAC address.</li><li>wpa_audit-01.cap: The packet capture file containing the EAPOL handshake exchange.</li></ul><p><em>(Note: Offline cracking speed depends heavily on hardware compute power and passphrase complexity; long, high-entropy passphrases resist dictionary attacks.)</em></p><h3>Examples</h3><h3>Evaluating Passphrase Strength and Auditing Exposure</h3><p>During a wireless security review, weak passphrases (such as dictionary words, default router passwords, or short numeric strings) represent the primary risk in PSK deployments. Organizations audit their own pre-shared keys against password policies and rotate weak credentials immediately across both the Access Point and connected clients.</p><h3>Security Perspective</h3><ul><li><strong>Migrate Away from WEP and TKIP:</strong> Any network still running WEP or WPA-TKIP should be upgraded to <strong>WPA2-AES (CCMP)</strong> or <strong>WPA3-SAE</strong> (Simultaneous Authentication of Equals), which provides stronger resistance against offline dictionary attacks on passwords.</li><li><strong>Disable WPS:</strong> Turn off WPS on wireless routers and Access Points unless strictly required and properly locked down, as PIN-based authentication weakens overall wireless access security.</li><li><strong>Enable Protected Management Frames (802.11w):</strong> Enabling 802.11w protects management frames (such as deauthentication and disassociation frames) against spoofing, helping prevent denial-of-service disruption.</li><li><strong>Use WPA2/WPA3-Enterprise for Organizations:</strong> Instead of a single shared PSK known to everyone on the network, enterprise environments should use 802.1X authentication with unique user or device credentials so compromising one user’s credential does not expose the entire network’s encryption key material.</li></ul><h3>Common Mistakes and Misconceptions</h3><ul><li><strong>Thinking a Hidden SSID Provides Strong Security:</strong> Disabling SSID broadcast (“hidden network”) merely omits the network name from beacon frames; clients actively probe for hidden SSIDs and the name appears in probe/association frames. Treat hidden SSIDs as basic hygiene, never as encryption.</li><li><strong>Believing WPA2-PSK Is Immune to Weak Passwords:</strong> Even when the handshake and AES-CCMP encryption are sound, a short or predictable pre-shared key remains vulnerable to offline guessing if a handshake is captured.</li><li><strong>Leaving WPS Enabled on Consumer/SOHO Routers:</strong> Many routers ship with WPS enabled by default; leaving it active adds an unnecessary authentication vector.</li></ul><h3>Best Practices</h3><ol><li><strong>Use WPA3-SAE or WPA2-AES (CCMP):</strong> Disable WEP and TKIP completely.</li><li><strong>Enforce Long, Random Passphrases:</strong> Require strong, non-dictionary passphrases for PSK networks, or deploy 802.1X/RADIUS authentication.</li><li><strong>Disable WPS and Enable 802.11w:</strong> Reduce management-frame spoofing and eliminate PIN-based weaknesses.</li><li><strong>Segment Guest Networks:</strong> Isolate guest wireless traffic onto a separate VLAN with client isolation and no access to internal corporate subnets.</li></ol><h3>Conclusion</h3><p>Weak wireless protocols fail because of cryptographic or design shortcuts — such as WEP’s short IV and RC4 reuse, WPS’s reduced PIN verification space, or reliance on easily guessed pre-shared keys. Upgrading to WPA2-AES or WPA3, enabling 802.11w, disabling WPS, and using strong authentication mechanisms form the baseline for secure wireless networking.</p><h3>References</h3><ul><li>Wi-Fi Alliance — Security and WPA3 Overview: <a href="https://www.wi-fi.org/discover-wi-fi/security">https://www.wi-fi.org/discover-wi-fi/security</a></li><li>IEEE Standards Association — IEEE 802.11 Wireless LAN Standards: <a href="https://standards.ieee.org/ieee/802.11/7028/">https://standards.ieee.org/ieee/802.11/7028/</a></li><li>Aircrack-ng Documentation — WPA/WPA2 and Aircrack-ng Usage: <a href="https://www.aircrack-ng.org/doku.php">https://www.aircrack-ng.org/doku.php</a></li><li>NIST Special Publication 800–153 — Guidelines for Securing Wireless Local Area Networks (WLANs): <a href="https://csrc.nist.gov/publications/detail/sp/800-153/final">https://csrc.nist.gov/publications/detail/sp/800-153/final</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0135938ea0bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Application Security Testing: Reconnaissance, SQLi, and XSS]]></title>
            <link>https://sohansec.medium.com/web-application-security-testing-reconnaissance-sqli-and-xss-343c1d6e9e15?source=rss-1c4407a35442------2</link>
            <guid isPermaLink="false">https://medium.com/p/343c1d6e9e15</guid>
            <category><![CDATA[dvwa]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[xs]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Sohankharel]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 05:17:25 GMT</pubDate>
            <atom:updated>2026-11-29T05:17:25.616Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web Application Security Testing: Reconnaissance, Injection Flaws, and XSS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Os_l-IxIC5a-9xgocPfqXQ.png" /></figure><h3>Introduction</h3><p>Web applications expose business logic, authentication workflows, and backend databases over HTTP and HTTPS, making them prime targets in security assessments and a major focus of defensive engineering. Unlike network-layer issues that center on open ports or packet routing, web vulnerabilities often stem from how an application parses user input, resolves file paths, constructs database queries, or renders untrusted data inside a user’s browser.</p><p>By the end of this guide, you will understand how web reconnaissance maps hidden endpoints and application behavior, how file inclusion, file upload, SQL injection, and Cross-Site Scripting (XSS) arise, how to validate findings safely on local lab targets such as DVWA, and how developers remediate each flaw at its root cause.</p><h3>Fundamentals</h3><p>Assessing web application security requires clarity on several core concepts:</p><ul><li><strong>HTTP Request and Response Cycle:</strong> A client (such as a browser or CLI tool) sends an HTTP request containing a method (GET, POST), target path/query string, headers, and optional body to a web server, which returns a status code (200, 301, 403, 404, 500), response headers, and response body.</li><li><strong>Input Validation vs. Output Encoding:</strong> <strong>Input validation</strong> checks whether incoming data conforms to expected types, lengths, or allow-listed formats before processing. <strong>Output encoding</strong> converts special characters (such as &lt;, &gt;, &amp;, &quot;, &#39;) into safe representations (such as HTML entities) when rendering data in a specific output context so a browser treats them as text rather than executable code.</li><li><strong>SQL Injection (SQLi):</strong> A vulnerability that occurs when untrusted user input is concatenated directly into a database query string rather than bound as a parameterized value, allowing an attacker to alter the query’s structure or logic.</li><li><strong>Cross-Site Scripting (XSS):</strong> A vulnerability where an application includes untrusted data in a web response or DOM context without proper context-aware encoding or sanitization, causing malicious scripts to execute in a victim’s browser session.</li><li><strong>File Inclusion and File Upload Flaws:</strong> Weaknesses that arise when file paths passed to server-side file operations (include, require, path joins) are not restricted against traversal/remote loading, or when uploaded files are accepted and served without strict type, storage, and execution controls.</li></ul><h3>Technical Explanation</h3><h3>Web Reconnaissance and Attack Surface Mapping</h3><p>Before testing specific vulnerability classes, practitioners map the visible and hidden surface of a web application:</p><ul><li><strong>Endpoints, Directories, and Parameters:</strong> Applications often expose administrative panels, backup files, API routes, or hidden query/POST parameters not directly linked from the main navigation bar.</li><li><strong>Technology Fingerprinting:</strong> HTTP response headers (Server, X-Powered-By), cookies, URL conventions, and error pages often reveal the web server (such as Apache or Nginx), runtime language (such as PHP, Python, or Java), and framework or database backend.</li></ul><h3>Injection and File Handling Mechanics</h3><ol><li><strong>SQL Injection:</strong> When a backend query is built via string concatenation — for example, selecting a user record by ID — special characters such as single quotes (&#39;) or SQL keywords can break out of the data literal and modify the SQL statement&#39;s WHERE clause or UNION structure. Parameterized queries (prepared statements) separate query structure from data values so user input is never interpreted as SQL syntax.</li><li><strong>File Inclusion &amp; File Upload:</strong></li></ol><ul><li><em>Local/Remote File Inclusion (LFI/RFI):</em> If a script passes a user-controlled parameter directly into a file-inclusion routine without strict allow-listing and path canonicalization, attackers may traverse directories (../) to read sensitive local files or attempt to load external resources if remote inclusion is enabled.</li><li><em>Unrestricted File Upload:</em> Accepting arbitrary file extensions, trusting client-supplied Content-Type headers alone, or storing uploaded files inside a web-executable directory can allow attackers to upload scripts or other unintended files.</li></ul><ol><li><strong>Cross-Site Scripting (XSS):</strong></li></ol><ul><li><em>Reflected XSS:</em> Untrusted input from an HTTP request (such as a search term or URL parameter) is echoed immediately in the server’s response without safe encoding.</li><li><em>Stored XSS:</em> Untrusted input is persisted in a database or backend store and later rendered to multiple users viewing that content.</li><li><em>DOM-Based XSS:</em> Client-side JavaScript reads untrusted data from browser sources (such as location.hash, location.search, or document.referrer) and writes it unsafely into dangerous sinks (such as innerHTML or document.write).</li></ul><h3>Automated Scanners vs. Manual Verification</h3><p>Automated vulnerability scanners can speed up discovery of common patterns, misconfigurations, or known signatures, but they also produce <strong>false positives</strong> (flagging benign behavior as a vulnerability) and <strong>false negatives</strong> (missing complex business-logic flaws or authenticated workflows). Validating findings manually — and confirming whether a finding is genuinely exploitable within authorized scope — prevents wasted remediation effort and inaccurate reporting.</p><h3>Practical Application</h3><blockquote><strong><em>Lab Environment Note:</em></strong><em> Run all web testing commands below strictly against local lab applications (such as DVWA running inside a local virtual machine) or explicitly authorized targets.</em></blockquote><h3>1. Directory and Path Enumeration (gobuster)</h3><p>When auditing a local web target, directory enumeration helps identify accessible paths and hidden directories:</p><pre># Enumerate directories and files on a local lab web server using a wordlist<br>gobuster dir -u http://127.0.0.1/dvwa/ -w /usr/share/wordlists/dirb/common.txt</pre><ul><li>dir: Instructs gobuster to run in directory/file enumeration mode.</li><li>-u http://127.0.0.1/dvwa/: Specifies the base target URL in the local lab.</li><li>-w /usr/share/wordlists/dirb/common.txt: Provides the wordlist of candidate directory and file names to test.</li></ul><h3>2. Testing Parameterized Endpoints with sqlmap</h3><p>In authorized testing of a parameter-driven endpoint, sqlmap automates detection and exploitation checks for SQL injection:</p><pre># Test a lab URL parameter for SQL injection using non-interactive defaults<br>sqlmap -u &quot;http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=1&amp;Submit=Submit&quot; --cookie=&quot;security=low; PHPSESSID=replace_with_session_id&quot; --batch</pre><ul><li>-u &quot;&lt;URL&gt;&quot;: Targets the URL containing injectable query parameters.</li><li>--cookie=&quot;&lt;COOKIE&gt;&quot;: Supplies session and application state cookies (such as the DVWA security level and session ID) required to access authenticated pages.</li><li>--batch: Runs non-interactively by selecting default prompts automatically.</li></ul><h3>Examples</h3><h3>Safe Input Allow-Listing and Parameterized Query Pattern (Python)</h3><p>To illustrate how applications prevent injection and unsafe file path selection on the server side, compare unsafe string interpolation against safe parameterization and path allow-listing:</p><pre>import sqlite3<br>from pathlib import Path<br></pre><pre>ALLOWED_REPORTS = {<br>    &quot;summary&quot;: Path(&quot;/var/app/reports/summary.txt&quot;),<br>    &quot;audit&quot;: Path(&quot;/var/app/reports/audit.txt&quot;),<br>}<br></pre><pre>def get_user_by_id(db_path: str, user_id: int):<br>    &quot;&quot;&quot;Fetch a user record safely using a parameterized SQL query.&quot;&quot;&quot;<br>    with sqlite3.connect(db_path) as conn:<br>        cursor = conn.cursor()<br>        cursor.execute(<br>            &quot;SELECT id, username, role FROM users WHERE id = ?&quot;,<br>            (user_id,),<br>        )<br>        return cursor.fetchone()<br></pre><pre>def read_allowed_report(report_key: str) -&gt; str:<br>    &quot;&quot;&quot;Resolve a report strictly from an explicit allow-list rather than raw paths.&quot;&quot;&quot;<br>    if report_key not in ALLOWED_REPORTS:<br>        raise ValueError(&quot;Invalid report identifier&quot;)<br>    target_path = ALLOWED_REPORTS[report_key].resolve()<br>    return target_path.read_text(encoding=&quot;utf-8&quot;)</pre><h3>Security Perspective</h3><ul><li><strong>SQL Injection Remediation:</strong> Always use parameterized queries (prepared statements) for database access, enforce least-privilege database accounts (avoiding root or sa for web apps), and avoid echoing raw SQL error messages to end users.</li><li><strong>XSS Remediation:</strong> Apply context-aware output encoding when rendering untrusted data into HTML bodies, attributes, or JavaScript contexts, prefer safe DOM APIs (such as textContent instead of innerHTML when inserting plain text), and deploy a strong <strong>Content Security Policy (CSP)</strong> as defense in depth.</li><li><strong>File Inclusion and File Upload Hardening:</strong> Never pass raw user input directly into filesystem or inclusion functions; map requests to an explicit allow-list of identifiers, validate file types on the server side (not just by client headers), store uploaded files outside the web root or disable script execution in upload directories, and generate random non-predictable filenames.</li><li><strong>Verifying Scanner Findings:</strong> Treat automated scanner output as a starting lead rather than final proof. Reproduce and verify each issue carefully so engineering teams prioritize real, high-impact vulnerabilities.</li></ul><h3>Common Mistakes and Misconceptions</h3><ul><li><strong>Relying on Blacklists Alone for SQLi or XSS:</strong> Blocking a few strings (such as SELECT or &lt;script&gt;) is often bypassed through case variations, alternative encodings, or different syntax. Parameterized queries and proper context-aware output encoding address the root cause.</li><li><strong>Trusting Client-Side Controls or </strong><strong>Content-Type Headers:</strong> Attackers can modify form inputs, cookies, hidden fields, or HTTP headers directly. All security enforcement—authentication, authorization, validation, and file checks—must occur server-side.</li><li><strong>Treating Every Scanner Alert as Critical:</strong> Automated tools frequently report informational headers, low-risk items, or false positives alongside genuine vulnerabilities; manual triage keeps remediation focused on real risk.</li></ul><h3>Best Practices</h3><ol><li><strong>Use Parameterized Queries Everywhere:</strong> Eliminate string concatenation when constructing SQL queries.</li><li><strong>Encode Output by Context and Set a CSP:</strong> Protect browsers against XSS with proper encoding, safe DOM methods, and Content Security Policy headers.</li><li><strong>Strict File Allow-Lists and Isolated Upload Storage:</strong> Restrict file access to explicit allow-lists and store uploads outside executable web directories.</li><li><strong>Validate Automated Scan Results Manually:</strong> Confirm reproducibility, assess true business impact, and document clear remediation steps before closing findings.</li></ol><h3>Conclusion</h3><p>Web application security comes down to how carefully an application separates untrusted data from executable commands, queries, file paths, and browser scripts. Combining structured reconnaissance, careful manual validation of scanner findings, and foundational defenses — parameterized queries, context-aware output encoding, and strict file/upload controls — protects web applications against the most common classes of web flaws.</p><h3>References</h3><ul><li>OWASP Top Ten — Web Application Security Risks: <a href="https://owasp.org/www-project-top-ten/">https://owasp.org/www-project-top-ten/</a></li><li>OWASP SQL Injection Prevention Cheat Sheet: <a href="https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html</a></li><li>OWASP Cross Site Scripting Prevention Cheat Sheet: <a href="https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html</a></li><li>OWASP File Upload Cheat Sheet: <a href="https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=343c1d6e9e15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Exploitation Architecture and Post-Exploitation Workflows]]></title>
            <link>https://sohansec.medium.com/system-exploitation-architecture-and-post-exploitation-workflows-abafe20bfd66?source=rss-1c4407a35442------2</link>
            <guid isPermaLink="false">https://medium.com/p/abafe20bfd66</guid>
            <category><![CDATA[ognl-injection]]></category>
            <category><![CDATA[vulnerability-research]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[defensive-security]]></category>
            <category><![CDATA[post-exploitation]]></category>
            <dc:creator><![CDATA[Sohankharel]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 05:05:39 GMT</pubDate>
            <atom:updated>2026-11-29T05:05:39.054Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKOFSXD06GHzSGdQDNGXbg.png" /></figure><h3>Introduction</h3><p>Gaining unauthorized or authorized access to a computer system is rarely a single isolated action. In real-world assessments and defensive security reviews, compromise depends on how a target service or application processes untrusted input, how network boundaries route traffic across local and wide-area networks, and how defenders monitor behavior once code executes on a host.</p><p>By the end of this guide, you will understand the distinction between server-side and client-side exploitation models, how expression-language injection (such as OGNL injection) works inside a proof-of-concept HTTP request, how NAT and port forwarding affect external connectivity, and how post-exploitation activities map to detection and hardening controls.</p><h3>Fundamentals</h3><p>Understanding system exploitation requires clear definitions of several foundational concepts:</p><ul><li><strong>Vulnerability vs. Exploit:</strong> A <strong>vulnerability</strong> is a weakness or flaw in software design, implementation, or configuration (such as unsanitized input parsing or an unpatched service). An <strong>exploit</strong> is a technique, script, or payload crafted to take advantage of that weakness to trigger unintended behavior.</li><li><strong>Server-Side Attack:</strong> An attack targeting a network service or application listening on a reachable port (such as a web server, file transfer daemon, or enterprise application) that processes input sent by a remote client.</li><li><strong>Client-Side Attack:</strong> An attack where a user or client application initiates interaction — such as browsing to a malicious or compromised resource, opening a crafted file, or clicking a link — resulting in unintended execution or data exposure on the client side.</li><li><strong>Reverse Connection vs. Bind Connection:</strong></li><li>In a <strong>bind</strong> model, a target host listens on a port and waits for an incoming connection.</li><li>In a <strong>reverse</strong> model, the target host initiates an outbound connection back to a listening endpoint controlled by the testing operator.</li><li><strong>Post-Exploitation:</strong> The phase after initial code execution or access is achieved, focused on evaluating system privileges, understanding lateral exposure, collecting forensic evidence in incident response, and hardening affected hosts.</li></ul><h3>Technical Explanation</h3><h3>Server-Side vs. Client-Side Attack Surfaces</h3><p>Whether a server-side or client-side approach applies in an engagement depends heavily on network exposure and application design:</p><p>Dimension Server-Side Exploitation Client-Side Exploitation <strong>Primary Target</strong> Listening network services, APIs, web/enterprise servers User endpoints, browsers, desktop applications, client software <strong>Connection Direction</strong> Request sent directly to an exposed service endpoint Often relies on user interaction and outbound connections <strong>Firewall / NAT Impact</strong> Blocked if service ports are firewalled or not forwarded Outbound traffic often passes NAT/egress filters unless restricted <strong>Primary Defense</strong> Patching, input validation, least privilege, network segmentation Patching, application allow-listing, egress filtering, browser/OS hardening</p><h3>How Expression Injection and ProcessBuilder Execution Work</h3><p>Modern web frameworks and enterprise applications frequently evaluate dynamic expressions to bind templates, queries, or object graphs. When untrusted input reaches an expression parser without strict sandboxing or allow-listing, an attacker may inject expressions that traverse runtime objects and invoke system execution APIs.</p><p>In Java-based web frameworks that support <strong>OGNL (Object-Graph Notation Language)</strong>, improper handling of user-supplied parameters or request paths can allow expressions to access runtime classes such as java.lang.ProcessBuilder. Once ProcessBuilder is invoked with shell arguments (for example, invoking /bin/bash or a command interpreter), the underlying operating system executes the specified command in the context of the service account running the application.</p><p>Because proof-of-concept (PoC) HTTP requests frequently contain URL percent-encoding (such as %20, %2f, or encoded symbols), inspecting a PoC safely starts with <strong>decoding the encoded segments</strong> to read the exact expression and command parameters before modifying any target IP address, listener address, or port.</p><h3>Network Reachability Across Local Networks and the Internet (WAN)</h3><p>Most home and corporate networks use private IPv4 address ranges (defined in RFC 1918, such as 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8) behind <strong>Network Address Translation (NAT)</strong>. Private IP addresses are not routable across the public internet.</p><p>When testing scenarios outside a local subnet:</p><ul><li>A listener running on a private IP address cannot be reached directly from an external network unless traffic is routed through a public IP or forwarded through an edge gateway/port-forwarding rule.</li><li>Outbound connections from an internal host toward an external IP address must traverse egress firewall policies, which enterprises often restrict to approved destinations and ports.</li></ul><h3>Practical Application</h3><blockquote><strong><em>Authorization Requirement:</em></strong><em> Only execute commands, </em><em>curl requests, or exploitation tests against lab systems you own or have explicit written permission to assess.</em></blockquote><h3>1. Inspecting and Adapting a curl Proof-of-Concept Request</h3><p>When reviewing a published curl proof-of-concept for a vulnerability (such as CVE-2022-26134 in Confluence lab environments), follow a disciplined review process:</p><ol><li><strong>Decode URL-encoded segments</strong> so you can verify every character in the request path and command string.</li><li><strong>Identify target and callback parameters</strong>, such as the target host/port (http://192.168.50.63:8090 in a lab) and the listener IP/port receiving a reverse shell connection.</li><li><strong>Preserve required unencoded characters</strong> in the HTTP request path so the web server and expression parser interpret the URL structure as intended without breaking encoding.</li></ol><pre># Example structure of a customized curl command against an authorized lab target<br>curl -k -s &quot;http://192.168.50.63:8090/&lt;decoded_or_adjusted_path&gt;&quot;</pre><ul><li>curl: Sends an HTTP/HTTPS request from the command line to inspect server responses.</li><li>-k (--insecure): Allows TLS connections to lab servers using self-signed certificates when testing HTTPS endpoints.</li><li>-s (--silent): Suppresses progress meters and transfer statistics so output stays focused on the response.</li></ul><h3>2. Checking Local Network Interfaces and Listening Ports</h3><p>During lab verification, confirm local IP addresses and verify that expected local listeners or services are bound properly:</p><pre># Display local IP addresses and active TCP listening sockets<br>ip -4 addr show<br>ss -tulpn</pre><ul><li>ip -4 addr show: Lists IPv4 addresses assigned to local network interfaces.</li><li>ss -tulpn: Displays listening TCP (-t) and UDP (-u) sockets, listening-only state (-l), numeric ports/addresses (-n), and associated process names/PIDs (-p).</li></ul><h3>Examples</h3><h3>Decoding URL-Encoded Strings Safely in Python</h3><p>Before modifying a URL-encoded exploit string or HTTP query/path parameter in a lab, decoding it in a controlled script lets you read the exact characters being transmitted:</p><pre>import urllib.parse<br></pre><pre>def decode_url_payload(encoded_value: str) -&gt; str:<br>    &quot;&quot;&quot;Decode percent-encoded URL characters into readable text.&quot;&quot;&quot;<br>    return urllib.parse.unquote(encoded_value)<br></pre><pre>if __name__ == &quot;__main__&quot;:<br>    sample_encoded = &quot;http%3A%2F%2F192.168.50.63%3A8090%2Ftest%3Fcmd%3Did&quot;<br>    print(&quot;Decoded:&quot;, decode_url_payload(sample_encoded))</pre><h3>Security Perspective</h3><ul><li><strong>Why Blind Payload Execution Is Risky:</strong> Running unexamined copy-pasted payloads can fail silently due to wrong IP addresses, ports, or encoding — or worse, execute unexpected commands, crash critical production services, or trigger security controls prematurely. Reading and decoding the payload first reveals its exact behavior and dependencies.</li><li><strong>Least Privilege for Application Services:</strong> If a vulnerable web or enterprise application runs as root or SYSTEM, successful command execution grants broad administrative control over the host. Running services under dedicated, low-privilege service accounts limits blast radius.</li><li><strong>Egress Filtering and Network Segmentation:</strong> Restricting outbound traffic from servers (especially application servers and DMZ hosts) to only required external repositories or APIs — and blocking arbitrary outbound shells — significantly impedes reverse-shell connections and data exfiltration.</li><li><strong>Detection and Telemetry:</strong> Defenders detect exploitation and post-exploitation activity by monitoring anomalous child processes spawned by web/application daemons (for example, java spawning /bin/sh or /bin/bash), unusual outbound network connections from server subnets, and unexpected changes to system binaries or scheduled tasks.</li></ul><p><em>(Note: Advanced post-exploitation tooling such as Meterpreter modules, credential dumping, persistence mechanisms, and network pivoting are referenced in course outlines and are covered here at a conceptual and defensive level alongside official documentation.)</em></p><h3>Common Mistakes and Misconceptions</h3><ul><li><strong>Copying PoC Commands Without Updating Target and Callback Values:</strong> Leaving example IP addresses or ports unchanged from a reference write-up causes connections to fail or point to the wrong host.</li><li><strong>Accidentally Re-Encoding or Stripping Required Path Characters:</strong> Over-sanitizing or re-encoding characters inside a crafted HTTP request path can alter how the target server routes or parses the request.</li><li><strong>Assuming Internal Network Access Equals External Reachability:</strong> A payload configured with a private RFC 1918 IP address will not connect back across the internet without proper routing or port forwarding configured in an authorized test environment.</li></ul><h3>Best Practices</h3><ol><li><strong>Decode and Audit Every PoC First:</strong> Always inspect the decoded request, parameters, and execution logic before running it in a lab.</li><li><strong>Patch Promptly and Monitor Advisories:</strong> Keep internet-facing and internal software (such as web servers, frameworks, and enterprise platforms) updated against known CVEs.</li><li><strong>Run Services Under Least Privilege:</strong> Never run web applications or middleware daemons as root when a restricted service account suffices.</li><li><strong>Enforce Egress Controls and Process Monitoring:</strong> Alert on unexpected shell processes spawned by server applications and restrict unauthorized outbound connections.</li></ol><h3>Conclusion</h3><p>Effective system security requires understanding both how applications process untrusted input and how network boundaries shape reachability. By decoding and analyzing proof-of-concept requests before execution, verifying network configurations, and enforcing least privilege alongside egress monitoring and timely patching, organizations can reduce both initial exploitation risk and post-compromise impact.</p><h3>References</h3><ul><li>MITRE ATT&amp;CK — Enterprise Matrix (Execution, Command and Scripting Interpreter, Application Layer Protocol): <a href="https://attack.mitre.org/matrices/enterprise/">https://attack.mitre.org/matrices/enterprise/</a></li><li>curl Official Documentation and Man Page: <a href="https://curl.se/docs/manpage.html">https://curl.se/docs/manpage.html</a></li><li>OWASP Foundation — Injection Prevention Cheat Sheet: <a href="https://cheatsheetseries.owasp.org/cheatsheets/Injection_Prevention_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/Injection_Prevention_Cheat_Sheet.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abafe20bfd66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Command-Line Fundamentals for Security Practitioners]]></title>
            <link>https://sohansec.medium.com/linux-command-line-fundamentals-for-security-practitioners-fee53a7fe8d9?source=rss-1c4407a35442------2</link>
            <guid isPermaLink="false">https://medium.com/p/fee53a7fe8d9</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[kali-linux]]></category>
            <dc:creator><![CDATA[Sohankharel]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 04:57:34 GMT</pubDate>
            <atom:updated>2026-11-29T04:57:34.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olDFs8QdDGoNj6UtQJghug.png" /></figure><h3>Introduction</h3><p>Most offensive security utilities, network scanners, server infrastructure, and cloud workloads run on Linux. Unlike graphical interfaces that abstract system behavior behind menus, the Linux command-line interface (CLI) exposes direct control over processes, network sockets, file permissions, and raw data streams.</p><p>By the end of this guide, you will understand the structure of the Linux filesystem, how to navigate directories and inspect command documentation, how to locate binaries and filter noisy output using pipelines and redirection, and how Linux permission bits govern file execution and access control.</p><h3>Fundamentals</h3><p>Working effectively in a Linux shell requires familiarity with three foundational concepts:</p><ul><li><strong>Single-Root Filesystem Hierarchy:</strong> Unlike Windows, which separates storage into drive letters (C:\, D:\), Linux organizes all files, directories, and hardware devices under a single root directory denoted by /.</li><li><strong>Standard Data Streams:</strong> Every Linux command communicates through three default file descriptors:</li><li><strong>Standard Input (</strong><strong>stdin — FD </strong><strong>0):</strong> Data fed into a program (typically from the keyboard or a pipe).</li><li><strong>Standard Output (</strong><strong>stdout — FD </strong><strong>1):</strong> Normal output produced by a command.</li><li><strong>Standard Error (</strong><strong>stderr — FD </strong><strong>2):</strong> Diagnostic and error messages emitted separately from normal output.</li><li><strong>Privilege Separation:</strong> Standard user accounts operate with restricted permissions, whereas the root account (UID 0) holds unrestricted administrative authority over the kernel and filesystem. Prepending sudo executes a single command with elevated privileges while maintaining an audit log.</li></ul><h3>Technical Explanation</h3><h3>The Linux Filesystem Hierarchy Standard (FHS)</h3><p>Understanding where configuration files, logs, and security wordlists reside saves substantial time during system enumeration and administration:</p><p>Directory Purpose Security &amp; Operational Relevance / Root directory Top-level anchor of the entire directory tree. /bin &amp; /usr/bin User binaries Core executables (ls, cp, grep, nmap). /sbin &amp; /usr/sbin System binaries Administrative and network utilities (ifconfig, ip, iptables). /etc Host configuration Plaintext system configs (/etc/passwd, /etc/shadow, /etc/hosts). /var/log Variable log files Authentication, web server, and system logs (auth.log, syslog). /tmp Temporary storage World-writable directory cleared on reboot; common staging area. /usr/share Shared application data Houses documentation and wordlists (/usr/share/wordlists).</p><h3>Pipelines and Redirection Architecture</h3><p>Because Linux commands follow the design philosophy of performing one task well and emitting plain text, complex workflows are built by chaining simple tools together:</p><ul><li><strong>Pipes (</strong><strong>|):</strong> Connects the stdout of the left-hand command directly to the stdin of the right-hand command in memory without creating temporary files.</li><li><strong>Output Redirection (</strong><strong>&gt; and </strong><strong>&gt;&gt;):</strong> Writes stdout to a file, where &gt; overwrites the target file and &gt;&gt; appends to the end of it.</li><li><strong>Error Suppression (</strong><strong>2&gt;/dev/null):</strong> Redirects stderr (file descriptor 2) to /dev/null, a virtual character device that discards all data written to it.</li></ul><h3>Practical Application</h3><h3>1. Context Verification and Navigation</h3><p>Before modifying files or executing scripts, verify your current user context and directory location:</p><pre># Display the active username and current working directory<br>whoami<br>pwd</pre><pre># List all directory contents (including hidden dotfiles) with permissions and sizes<br>ls -la /etc</pre><ul><li>whoami: Prints the effective username of the current shell session.</li><li>pwd (Print Working Directory): Outputs the full canonical path of your current location.</li><li>ls -la /etc: Lists every entry in /etc, where -l displays long-format metadata (permissions, owner, size, timestamp) and -a includes hidden entries beginning with ..</li></ul><h3>2. Built-In Documentation (man and --help)</h3><p>Rather than memorizing every flag, query built-in manual pages directly from the terminal:</p><pre># Open the manual page for grep and search for concise flag summaries<br>man grep<br>nmap --help | head -n 25</pre><ul><li>man &lt;command&gt;: Opens the structured manual page detailing synopsis, options, exit statuses, and examples (press / inside man to search keywords, q to quit).</li><li>--help | head -n 25: Prints a command&#39;s quick usage summary and displays only the first 25 lines.</li></ul><h3>3. Locating Binaries and Searching the Filesystem</h3><p>Linux provides specialized search tools depending on whether you are looking for an executable in your PATH, a database-indexed filename, or live filesystem attributes:</p><pre># Locate an executable within the user&#39;s PATH environment variable<br>which python3</pre><pre># Search the filesystem in real time for files ending in .conf under /etc<br>find /etc -type f -name &quot;*.conf&quot; 2&gt;/dev/null</pre><ul><li>which python3: Prints the exact path of the python3 binary that executes when invoked without a path.</li><li>find /etc -type f -name &quot;*.conf&quot; 2&gt;/dev/null: Traverses /etc for regular files (-type f) matching *.conf while discarding Permission denied errors (2&gt;/dev/null).</li></ul><h3>4. Text Filtering with grep</h3><p>grep searches input streams or files for lines matching a string or regular expression:</p><pre># Case-insensitive recursive search for &quot;password&quot; in a configuration directory<br>grep -rnwi &quot;/etc/apache2&quot; -e &quot;ServerName&quot;</pre><ul><li>-r: Searches directories recursively.</li><li>-n: Prefixes each matching line with its line number.</li><li>-w: Matches whole words only.</li><li>-i: Ignores uppercase/lowercase distinctions.</li></ul><h3>5. File Manipulation and Permission Management</h3><p>Linux controls read (r = 4), write (w = 2), and execute (x = 1) permissions across three scopes: <strong>Owner (</strong><strong>u)</strong>, <strong>Group (</strong><strong>g)</strong>, and <strong>Others (</strong><strong>o)</strong>.</p><pre># Create a script, grant execute permission to the owner, and restrict an SSH key<br>touch recon.sh<br>chmod u+x recon.sh<br>chmod 600 ~/.ssh/id_rsa</pre><ul><li>chmod u+x recon.sh: Adds execute (+x) permission for the file owner (u) so the script can be run directly via ./recon.sh.</li><li>chmod 600 ~/.ssh/id_rsa: Sets numeric permissions to rw------- (6 = 4+2 for owner, 0 for group and others), preventing unauthorized local users from reading sensitive private keys.</li></ul><h3>Examples</h3><h3>Progressive Log Inspection Pipeline</h3><p>Suppose you are reviewing an authentication log (/var/log/auth.log) to identify failed SSH login attempts and rank the source IP addresses by frequency. Combining grep, awk, sort, and uniq accomplishes this in a single pipeline:</p><pre># Extract failed SSH login lines, isolate IPv4 addresses, and count unique occurrences<br>sudo grep &quot;Failed password&quot; /var/log/auth.log | grep -oE &quot;\b([0-9]{1,3}\.){3}[0-9]{1,3}\b&quot; | sort | uniq -c | sort -nr</pre><ol><li>sudo grep &quot;Failed password&quot; /var/log/auth.log: Filters only lines recording failed authentication attempts.</li><li>grep -oE &quot;\b([0-9]{1,3}\.){3}[0-9]{1,3}\b&quot;: Uses extended regular expressions (-E) to print only (-o) the IPv4 address portion of each line.</li><li>sort | uniq -c: Sorts identical IP addresses adjacently so uniq -c can count consecutive duplicates.</li><li>sort -nr: Sorts the final counts numerically (-n) in descending reverse order (-r), placing the highest-volume source at the top.</li></ol><h3>Security Perspective</h3><ul><li><strong>SUID/SGID Privilege Boundaries:</strong> When a binary has the <strong>Set User ID (SUID)</strong> bit set (chmod 4755), it executes with the privileges of the file&#39;s owner (often root) rather than the user who launched it. Auditing SUID binaries is a standard step in Linux privilege escalation assessments:</li><li># Enumerate all SUID-enabled binaries across the filesystem find / -perm -4000 -type f 2&gt;/dev/null</li><li><strong>World-Writable Files and Directories:</strong> Misconfigured permissions such as chmod 777 allow any local user to modify scripts or configuration files executed by privileged cron jobs or services.</li><li><strong>Credential Exposure in History and Configs:</strong> Shell history files (~/.bash_history, ~/.zsh_history) and world-readable application configs frequently retain plaintext passwords or API tokens passed as command-line arguments.</li></ul><h3>Common Mistakes and Misconceptions</h3><ul><li><strong>Overusing </strong><strong>chmod 777 to Fix Permission Errors:</strong> Granting read, write, and execute rights to every user (777) creates severe local privilege escalation and tampering risks. Always assign the minimum required permission (such as 750 for directories/scripts or 600 for secrets).</li><li><strong>Forgetting That </strong><strong>locate Relies on a Scheduled Database:</strong> locate queries a pre-built index updated periodically by updatedb. Newly created files will not appear in locate results until sudo updatedb runs, whereas find inspects the live filesystem immediately.</li><li><strong>Running Entire Interactive Sessions as </strong><strong>root:</strong> Operating continuously as root increases the blast radius of typographical errors (such as a misplaced rm -rf). Use a standard account and invoke sudo only for privileged commands.</li></ul><h3>Best Practices</h3><ol><li><strong>Follow Least Privilege:</strong> Apply restrictive umask defaults and avoid 777 permissions on scripts, logs, and web roots.</li><li><strong>Filter Noisy Enumeration with </strong><strong>2&gt;/dev/null:</strong> Redirect stderr when running filesystem-wide find queries as a non-root user so genuine results are not buried under permission errors.</li><li><strong>Verify Before Destructive Operations:</strong> Run ls on wildcard patterns before executing rm -rf to verify exact file matches.</li><li><strong>Keep Packages Patched:</strong> Regularly run sudo apt update &amp;&amp; sudo apt upgrade to remediate known kernel and user-space vulnerabilities.</li></ol><h3>Conclusion</h3><p>Proficiency in the Linux command line transforms how security practitioners interact with operating systems. Mastering filesystem layout, stream redirection, find and grep filtering pipelines, and granular permission controls provides the operational foundation required for network auditing, scripting, and system hardening.</p><h3>References</h3><ul><li>Linux Foundation — Filesystem Hierarchy Standard (FHS 3.0): <a href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html">https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html</a></li><li>GNU Coreutils Manual (chmod, ls, sort, uniq): <a href="https://www.gnu.org/software/coreutils/manual/">https://www.gnu.org/software/coreutils/manual/</a></li><li>GNU Grep Manual: <a href="https://www.gnu.org/software/grep/manual/">https://www.gnu.org/software/grep/manual/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fee53a7fe8d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internal Network Reconnaissance and MITM Mechanics]]></title>
            <link>https://sohansec.medium.com/internal-network-reconnaissance-and-mitm-mechanics-b40ec6d8dca1?source=rss-1c4407a35442------2</link>
            <guid isPermaLink="false">https://medium.com/p/b40ec6d8dca1</guid>
            <category><![CDATA[mitm]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[rap]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Sohankharel]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 04:44:44 GMT</pubDate>
            <atom:updated>2026-11-29T04:52:52.168Z</atom:updated>
            <content:encoded><![CDATA[<h3>Internal Network Reconnaissance and Man-in-the-Middle Mechanics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gozu5IqTykxwMWlShBH52g.png" /></figure><h3>Introduction</h3><p>Once a security practitioner has access to a local area network (LAN) segment either through a wired lab switch or an authorized wireless connection the assessment shifts from physical and link-layer framing to host enumeration, service identification, and local traffic flows. Understanding how devices locate one another on a subnet and how Layer 2 resolution works is essential for both offensive auditing and defensive monitoring.</p><p>This guide covers how local IP networks resolve addresses, how active host and port scanning map reachable services, how Address Resolution Protocol (ARP) cache poisoning creates a Man-in-the-Middle (MITM) position on a LAN, and how defenders detect and mitigate local spoofing attacks.</p><h3>Fundamentals</h3><p>Working effectively on an IPv4 local network requires clarity on several core concepts:</p><ul><li><strong>IPv4 Address and Subnet Mask:</strong> An IPv4 address identifies a network interface at Layer 3 (for example, 192.168.56.10), while a subnet mask or CIDR prefix (such as /24, representing 255.255.255.0) defines which addresses belong to the local broadcast domain versus remote networks reached via a default gateway.</li><li><strong>ARP (Address Resolution Protocol):</strong> A Layer 2/Layer 3 resolution protocol (RFC 826) used in IPv4 networks to map a known IPv4 address to its corresponding 48-bit MAC address on the local link.</li><li><strong>Port and Service:</strong> Network services listen on transport-layer ports (TCP or UDP ports 0–65535). Well-known ports (such as 22 for SSH, 80 for HTTP, and 443 for HTTPS) often indicate expected roles, though services can run on non-standard ports.</li><li><strong>Man-in-the-Middle (MITM):</strong> A position on a communication path where an intermediate node can observe, forward, drop, or modify traffic between two communicating endpoints.</li></ul><h3>Technical Explanation</h3><h3>How ARP Resolves Local Addresses</h3><p>When Host A wants to send an IP packet to Host B on the same subnet and knows Host B’s IP address (192.168.56.20) but not its MAC address, Host A checks its local ARP cache. If no entry exists, Host A broadcasts an <strong>ARP Request</strong> (Who has 192.168.56.20? Tell 192.168.56.10) to the Layer 2 broadcast address (ff:ff:ff:ff:ff:ff). Host B replies with a unicast <strong>ARP Reply</strong> containing its MAC address, and both hosts cache the IP-to-MAC binding for a limited time.</p><p>Because standard ARP has no cryptographic authentication mechanism, hosts accept unsolicited or updated ARP replies to refresh their cache entries.</p><h3>ARP Cache Poisoning Mechanics</h3><p>In a typical LAN topology, client traffic destined for external networks or other subnets traverses a <strong>Default Gateway</strong> (router). In an ARP cache poisoning scenario on an authorized test subnet:</p><ol><li>The testing host sends forged ARP replies to the <strong>Target Client</strong>, associating the <strong>Gateway IP</strong> with the <strong>Testing Host’s MAC address</strong>.</li><li>Simultaneously, the testing host sends forged ARP replies to the <strong>Gateway</strong>, associating the <strong>Target Client’s IP</strong> with the <strong>Testing Host’s MAC address</strong>.</li><li>If <strong>IP forwarding</strong> is enabled in the operating system kernel, incoming packets arriving at the testing host’s MAC address are routed onward to their real destination rather than dropped, keeping network connectivity alive while traffic passes through the testing host.</li></ol><pre>Normal LAN Flow:<br>[ Client ] &lt;================ IP / Ethernet Frames ================&gt; [ Gateway ]</pre><pre>ARP Cache Poisoned Path:<br>[ Client ] ===(thinks Gateway MAC = Attacker MAC)===&gt; [ Attacker ] ===(thinks Client MAC = Attacker MAC)===&gt; [ Gateway ]</pre><p><em>(Note: Specific ARP spoofing and packet-inspection modules referenced in the course index — such as </em><em>arpspoof, </em><em>bettercap, </em><em>sslstrip, </em><em>Wireshark, and </em><em>XArp—are summarized here as general security concepts alongside official documentation.)</em></p><h3>Practical Application</h3><h3>1. Inspecting Local Interfaces, ARP Cache, and Routes</h3><p>Before scanning or analyzing traffic, verify your own IP addressing, gateway, and existing ARP table entries:</p><pre># Display IP addresses, routing table, and current ARP/neighbor entries<br>ip addr show<br>ip route show<br>ip neigh show</pre><ul><li>ip addr show: Lists network interfaces, link states, IPv4/IPv6 addresses, and MAC addresses.</li><li>ip route show: Shows the default gateway and subnet routes used for packet forwarding.</li><li>ip neigh show: Displays cached IP-to-MAC mappings and neighbor reachability states (REACHABLE, STALE, DELAY).</li></ul><h3>2. Host Discovery and Service Enumeration with Nmap</h3><p>Nmap is widely used for network discovery and service auditing. Always restrict scans strictly to authorized lab subnets or targets.</p><pre># Perform a ping/ARP host discovery scan across a lab subnet<br>nmap -sn 192.168.56.0/24</pre><pre># Enumerate open TCP ports, service versions, and default safe scripts on a target host<br>nmap -sS -sV -sC -oA lab_target_scan 192.168.56.20</pre><ul><li>-sn: Disables port scanning and performs host discovery only (using ARP requests on local Ethernet subnets).</li><li>-sS: Performs a TCP SYN (&quot;stealth&quot;) scan by sending SYN packets and inspecting SYN-ACK or RST responses without completing full three-way handshakes for closed ports.</li><li>-sV: Probes open ports to determine service names and version banners.</li><li>-sC: Runs Nmap&#39;s default set of safe NSE (Nmap Scripting Engine) enumeration scripts.</li><li>-oA lab_target_scan: Saves scan results in normal (.nmap), grepable (.gnmap), and XML (.xml) formats.</li></ul><h3>3. Checking and Toggling Kernel IP Forwarding</h3><p>In Linux, packet forwarding between network interfaces is governed by the net.ipv4.ip_forward kernel parameter:</p><pre># Check current IPv4 forwarding status and enable it temporarily<br>cat /proc/sys/net/ipv4/ip_forward<br>sudo sysctl -w net.ipv4.ip_forward=1</pre><ul><li>/proc/sys/net/ipv4/ip_forward: A kernel interface where 0 disables IPv4 forwarding and 1 enables forwarding between interfaces.</li><li>sysctl -w net.ipv4.ip_forward=1: Dynamically updates the kernel parameter at runtime.</li></ul><h3>Examples</h3><h3>Python TCP Socket Banner/Port Check</h3><p>When building custom network checks or verifying reachability from a script (drawing on socket programming concepts from Python Ethical Hacking with Python A practical guide.pdf), Python&#39;s standard socket library provides direct control over TCP connections:</p><pre>import socket<br></pre><pre>def check_tcp_port(host: str, port: int, timeout: float = 1.0) -&gt; bool:<br>    &quot;&quot;&quot;Return True if a TCP connection to host:port succeeds within timeout.&quot;&quot;&quot;<br>    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:<br>        sock.settimeout(timeout)<br>        return sock.connect_ex((host, port)) == 0<br></pre><pre>def scan_common_ports(target: str, ports: list[int]) -&gt; list[int]:<br>    open_ports = []<br>    for port in ports:<br>        if check_tcp_port(target, port):<br>            open_ports.append(port)<br>    return open_ports<br></pre><pre>if __name__ == &quot;__main__&quot;:<br>    lab_target = &quot;192.168.56.20&quot;<br>    candidate_ports = [21, 22, 23, 80, 139, 443, 445, 3306, 8080]<br>    found = scan_common_ports(lab_target, candidate_ports)<br>    print(f&quot;Reachable ports on {lab_target}: {found}&quot;)</pre><h3>Security Perspective</h3><ul><li><strong>Cleartext vs. Encrypted Protocols:</strong> On an untrusted or compromised local segment, unencrypted protocols (such as plain HTTP, FTP, Telnet, or unauthenticated DNS) expose credentials, session identifiers, and payloads to anyone able to intercept link-layer traffic. Modern TLS (HTTPS) protects confidentiality and integrity against passive eavesdropping, provided clients validate certificates properly and enforce <strong>HSTS (HTTP Strict Transport Security)</strong> to resist protocol downgrade attempts.</li><li><strong>Detecting ARP Spoofing:</strong> Defenders monitor for ARP anomalies such as a single MAC address claiming multiple IP addresses rapidly, frequent changes to a gateway’s MAC binding, or unexpected spikes in gratuitous/unsolicited ARP replies.</li><li><strong>Switch-Layer Mitigations:</strong> On managed enterprise switches, pairing <strong>DHCP Snooping</strong> (which builds a trusted IP-to-MAC-to-port binding table) with <strong>Dynamic ARP Inspection (DAI)</strong> drops forged ARP packets that violate legitimate DHCP lease bindings.</li></ul><h3>Common Mistakes and Misconceptions</h3><ul><li><strong>Assuming Encryption Eliminates All MITM Risk:</strong> TLS encrypts application payloads between endpoints, but weak certificate validation, misconfigured proxies, or lack of HSTS on initial requests can still create risk if users click through certificate warnings or connect over plain HTTP first.</li><li><strong>Forgetting to Restore ARP Tables or Disable Forwarding:</strong> Leaving IP forwarding enabled or leaving stale routing changes active on a test workstation can cause unintended traffic routing behavior after an exercise ends.</li><li><strong>Scanning Outside Authorized Scope:</strong> Running active port scans (nmap) against external IP ranges without explicit authorization can trigger security alerts, ISP abuse notices, or legal action.</li></ul><h3>Best Practices</h3><ol><li><strong>Enforce TLS and HSTS Everywhere:</strong> Serve web and administrative interfaces over HTTPS with valid certificates and enable HSTS so browsers refuse insecure HTTP fallback.</li><li><strong>Enable Dynamic ARP Inspection on Access Switches:</strong> Use DHCP Snooping and DAI on managed switches to prevent unauthorized hosts from forging ARP replies.</li><li><strong>Segment Sensitive Infrastructure:</strong> Isolate management interfaces, databases, and critical servers onto dedicated VLANs with strict firewall rules.</li><li><strong>Verify Target Scope Before Every Scan:</strong> Double-check subnet CIDRs and IP addresses against your authorized lab topology before executing active probes.</li></ol><h3>Conclusion</h3><p>Local network security depends on how endpoints discover one another and how transport services expose functionality. Understanding subnet boundaries, ARP resolution, Nmap service discovery, and Layer 2 spoofing mechanics equips both penetration testers and defenders to identify exposed services and harden local networks against traffic interception.</p><h3>References</h3><ul><li>RFC 826 — An Ethernet Address Resolution Protocol (ARP): <a href="https://www.rfc-editor.org/rfc/rfc826.html">https://www.rfc-editor.org/rfc/rfc826.html</a></li><li>Nmap Network Scanning Official Reference Guide: <a href="https://nmap.org/book/man.html">https://nmap.org/book/man.html</a></li><li>Wireshark Official Documentation: <a href="https://www.wireshark.org/docs/">https://www.wireshark.org/docs/</a></li><li>Python socket Module Documentation: <a href="https://docs.python.org/3/library/socket.html">https://docs.python.org/3/library/socket.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b40ec6d8dca1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Isolated Cybersecurity Lab with Virtualization]]></title>
            <link>https://sohansec.medium.com/building-an-isolated-cybersecurity-lab-with-virtualization-5917f294265e?source=rss-1c4407a35442------2</link>
            <guid isPermaLink="false">https://medium.com/p/5917f294265e</guid>
            <category><![CDATA[hacking-lab]]></category>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[security-testing]]></category>
            <category><![CDATA[virtualbox]]></category>
            <category><![CDATA[virtualization]]></category>
            <dc:creator><![CDATA[Sohankharel]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 04:08:15 GMT</pubDate>
            <atom:updated>2026-11-29T04:08:15.898Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3U51D8La0AJrU24Avks6Q.jpeg" /></figure><h3>Introduction</h3><p>Practicing offensive security techniques, analyzing malware behavior, or testing web application vulnerabilities requires an environment where mistakes carry zero operational risk. Running scanning tools, exploit payloads, or misconfigured services on a primary workstation or an external network can disrupt production systems, expose sensitive host data, and violate legal boundaries.</p><p>A <strong>cybersecurity lab</strong> solves this problem by providing a self-contained network of attacker and target machines inside a single physical computer. By the end of this guide, you will understand how Type-2 virtualization isolates guest operating systems, how to structure network interfaces for controlled lab traffic, how to configure Python virtual environments for security tooling, and how to use snapshots to maintain clean testing baselines.</p><h3>Fundamentals</h3><p>A functional security testing lab replicates the core components of a real network in miniature:</p><ul><li><strong>Host Operating System:</strong> The physical computer (Windows, macOS, or Linux) providing underlying CPU, RAM, storage, and network hardware.</li><li><strong>Hypervisor:</strong> Software (such as Oracle VM VirtualBox or VMware Workstation) that abstracts physical hardware and allocates virtualized resources to independent guest operating systems.</li><li><strong>Attacker Workstation:</strong> A security-focused Linux distribution — most commonly <strong>Kali Linux</strong> — pre-equipped with network analyzers, exploitation frameworks, and scripting runtimes.</li><li><strong>Target Systems:</strong> Deliberately vulnerable operating systems and applications used to validate attack and defense mechanics, including <strong>Metasploitable</strong> (an intentionally insecure Linux server), <strong>Windows</strong> client machines, and vulnerable web stacks such as <strong>Damn Vulnerable Web Application (DVWA)</strong>.</li></ul><h3>Technical Explanation</h3><h3>Why Virtualization Enables Safe Security Testing</h3><p>Virtualization runs multiple guest operating systems concurrently on one physical host, assigning each virtual machine (VM) dedicated virtual CPU cores, memory, and virtual network interface cards (vNICs). This architecture provides three operational advantages:</p><ol><li><strong>Containment and Isolation:</strong> Guest machines execute inside hypervisor-managed boundaries. Using virtual internal networks prevents broadcast traffic, ARP spoofing, or exploit payloads from leaking onto the host’s physical LAN.</li><li><strong>State Reversibility:</strong> Virtual disk states can be frozen via <strong>snapshots</strong>. If a kernel exploit crashes a target service or a configuration change breaks networking, the VM reverts to its pre-test state in seconds.</li><li><strong>Resource Efficiency:</strong> Instead of purchasing and cabling separate physical servers, routers, and workstations, an entire multi-subnet testbed runs on a single laptop or workstation.</li></ol><h3>Dual-Network Lab Topology</h3><p>A common architectural mistake is bridging all lab VMs directly onto a home or corporate Wi-Fi network. Instead, attach two virtual network adapters to the attacker VM while keeping vulnerable targets strictly off external networks:</p><pre>+-------------------------------------------------------------------+<br>|                         PHYSICAL HOST OS                          |<br>|  +-------------------------------------------------------------+  |<br>|  |                  HYPERVISOR (VirtualBox)                    |  |<br>|  |                                                             |  |<br>|  |  +-------------------+        +--------------------------+  |  |<br>|  |  |    Kali Linux     |        |    Target Machines       |  |  |<br>|  |  |   (Attacker VM)   |        |  - Metasploitable        |  |  |<br>|  |  |                   |        |  - Windows Client        |  |  |<br>|  |  |  eth0: NAT -------+--&gt; Internet (Updates/Packages)    |  |  |<br>|  |  |  eth1: Internal --+---+                               |  |  |<br>|  |  +-------------------+   |    |  eth0: Internal Only     |  |  |<br>|  |                          |    +------------+-------------+  |  |<br>|  |                          |                 |                |  |<br>|  |                 [ Virtual Internal Switch ]                 |  |<br>|  +-------------------------------------------------------------+  |<br>+-------------------------------------------------------------------+</pre><ul><li><strong>Adapter 1 (</strong><strong>NAT or </strong><strong>NAT Network):</strong> Gives Kali Linux outbound internet access for apt package updates without exposing its ports to the physical LAN.</li><li><strong>Adapter 2 (</strong><strong>Internal Network / </strong><strong>Host-Only):</strong> Connects Kali Linux and all vulnerable target VMs (Metasploitable, Windows, DVWA) to a private virtual switch with no external routing.</li></ul><h3>Practical Application</h3><h3>1. Updating Kali Linux and Preparing a Python Workspace</h3><p>After importing or installing Kali Linux inside your hypervisor, update the system repositories and create an isolated Python virtual environment (venv) so third-party security libraries do not conflict with system-managed Python packages.</p><pre># Refresh package lists, upgrade installed packages, and install Python tooling<br>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt install python3 python3-pip python3-venv -y</pre><ul><li>sudo apt update: Synchronizes local package metadata with Kali repositories.</li><li>sudo apt upgrade -y: Installs available security and tool updates non-interactively.</li><li>python3-venv: Provides the standard library module required to build isolated Python environments.</li></ul><p>Next, create a dedicated project workspace and activate a virtual environment:</p><pre># Create a workspace directory and activate an isolated Python environment<br>mkdir -p ~/ethical_hacking<br>cd ~/ethical_hacking<br>python3 -m venv env<br>source env/bin/activate</pre><ul><li>python3 -m venv env: Creates a self-contained directory (env/) holding a local Python interpreter and pip binary.</li><li>source env/bin/activate: Modifies the active shell&#39;s PATH variable so subsequent pip install commands install packages strictly inside env/.</li></ul><h3>2. Deploying a Local Web Application Target (DVWA)</h3><p>When testing web vulnerabilities locally, services such as Apache and MariaDB should remain bound to localhost (127.0.0.1) or the isolated internal lab interface rather than exposed externally.</p><pre># Start local web and database services on a Debian/Kali lab host<br>sudo systemctl start apache2<br>sudo systemctl start mariadb<br>sudo systemctl status apache2 --no-pager</pre><ul><li>systemctl start apache2: Launches the Apache HTTP daemon to serve local PHP web applications.</li><li>systemctl start mariadb: Starts the relational database backend required by applications like DVWA.</li><li>systemctl status apache2 --no-pager: Verifies that the web service entered an active (running) state without errors.</li></ul><h3>3. Managing VM Snapshots from the Command Line</h3><p>Before starting an assessment exercise, capture a clean baseline snapshot. Using VirtualBox’s VBoxManage CLI allows repeatable state management:</p><pre># Capture and restore a clean baseline snapshot in VirtualBox<br>VBoxManage snapshot &quot;Kali-Linux&quot; take &quot;Clean-Baseline&quot;<br>VBoxManage snapshot &quot;Kali-Linux&quot; restore &quot;Clean-Baseline&quot;</pre><ul><li>snapshot &quot;&lt;VM_Name&gt;&quot; take &quot;&lt;Snapshot_Name&gt;&quot;: Saves the current virtual disk and hardware configuration state under a descriptive label.</li><li>snapshot &quot;&lt;VM_Name&gt;&quot; restore &quot;&lt;Snapshot_Name&gt;&quot;: Discards post-test changes and rolls the VM back to the exact saved state.</li></ul><h3>Examples</h3><h3>Automated Lab Environment Documentation Script</h3><p>Maintaining accurate records of IP assignments, hostnames, and installed library versions prevents configuration drift across multi-VM labs. The following Python script inspects the local lab node and writes a structured lab_setup.json inventory file:</p><pre>import json<br>import socket<br>import subprocess<br></pre><pre>def get_primary_ip() -&gt; str:<br>    &quot;&quot;&quot;Determine the outbound interface IP without transmitting payload data.&quot;&quot;&quot;<br>    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<br>    try:<br>        sock.connect((&quot;8.8.8.8&quot;, 80))<br>        return sock.getsockname()[0]<br>    except OSError:<br>        return &quot;127.0.0.1&quot;<br>    finally:<br>        sock.close()<br></pre><pre>def get_installed_packages() -&gt; list:<br>    &quot;&quot;&quot;Query installed Python packages in JSON format.&quot;&quot;&quot;<br>    result = subprocess.run(<br>        [&quot;pip&quot;, &quot;list&quot;, &quot;--format=json&quot;],<br>        capture_output=True,<br>        text=True,<br>        check=True,<br>    )<br>    return json.loads(result.stdout)<br></pre><pre>def document_lab_setup(output_file: str = &quot;lab_setup.json&quot;) -&gt; None:<br>    lab_info = {<br>        &quot;hostname&quot;: socket.gethostname(),<br>        &quot;ip_address&quot;: get_primary_ip(),<br>        &quot;python_version&quot;: subprocess.run(<br>            [&quot;python3&quot;, &quot;--version&quot;], capture_output=True, text=True, check=True<br>        ).stdout.strip(),<br>        &quot;installed_packages&quot;: get_installed_packages(),<br>    }<br>    with open(output_file, &quot;w&quot;, encoding=&quot;utf-8&quot;) as handle:<br>        json.dump(lab_info, handle, indent=2)<br>    print(f&quot;Lab inventory written to {output_file}&quot;)<br></pre><pre>if __name__ == &quot;__main__&quot;:<br>    document_lab_setup()</pre><h3>Security Perspective</h3><ul><li><strong>Attack Surface Containment:</strong> Intentionally vulnerable VMs such as Metasploitable contain hard-coded default credentials, unpatched network daemons, and remote code execution flaws by design. Attaching them to a Bridged network adapter exposes those vulnerabilities to everyone on the physical LAN.</li><li><strong>Host-Guest Boundary Hygiene:</strong> Disable bidirectional shared clipboards and unnecessary shared host folders on VMs used to analyze untrusted binaries or unknown scripts.</li><li><strong>Troubleshooting Boot Failures:</strong> When starting a newly imported Kali VM results in a blank screen, the underlying cause is typically disabled hardware virtualization (Intel VT-x or AMD-V) in the host BIOS/UEFI firmware, insufficient video memory (&lt; 128 MB), or a conflict with Windows Hyper-V/Virtual Machine Platform services.</li></ul><h3>Common Mistakes and Misconceptions</h3><ul><li><strong>Using Bridged Networking for Vulnerable Targets:</strong> Beginners frequently select “Bridged Adapter” because it immediately assigns an IP from their router. Doing so places deliberately insecure systems directly onto a live network. Always use Internal Network or Host-Only adapters for target VMs.</li><li><strong>Working Without Snapshots:</strong> Skipping snapshots forces a complete OS reinstallation if a system file is corrupted or an exploit leaves a target service unstable.</li><li><strong>Installing Packages Globally with </strong><strong>sudo pip:</strong> Running sudo pip install outside a virtual environment can overwrite Debian/Kali system dependencies and break pre-installed security tools.</li></ul><h3>Best Practices</h3><ol><li><strong>Enforce Strict Network Segmentation:</strong> Place all vulnerable targets on an isolated virtual switch with no direct route to physical networks.</li><li><strong>Snapshot Before Every Major Change:</strong> Take labeled snapshots immediately after initial updates and before testing unfamiliar tools or exploits.</li><li><strong>Restrict Local Web Targets:</strong> Ensure local vulnerable web apps (such as DVWA) listen only on internal lab interfaces and never on public-facing interfaces.</li><li><strong>Document Lab Topology:</strong> Record IP addresses, credentials, and active services for every VM in a central markdown or JSON file.</li></ol><h3>Conclusion</h3><p>A well-architected virtual lab provides the isolated, reversible environment necessary to study offensive and defensive security safely. Combining hypervisor network segmentation, Python virtual environments, and disciplined snapshot management ensures that every experiment remains reproducible and completely contained from production networks.</p><h3>References</h3><ul><li>Oracle VM VirtualBox User Manual — Virtual Networking &amp; Snapshots: <a href="https://www.virtualbox.org/manual/">https://www.virtualbox.org/manual/</a></li><li>Kali Linux Official Documentation — Virtualization &amp; Installation: <a href="https://www.kali.org/docs/">https://www.kali.org/docs/</a></li><li>Python Standard Library Documentation — venv Creation of Virtual Environments: <a href="https://docs.python.org/3/library/venv.html">https://docs.python.org/3/library/venv.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5917f294265e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>