<?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 Muneebahmedkhan on Medium]]></title>
        <description><![CDATA[Stories by Muneebahmedkhan on Medium]]></description>
        <link>https://medium.com/@muneebahmedkhan0903?source=rss-bbaf82a4ad7c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VxmTFUutAaqzQ5Uy</url>
            <title>Stories by Muneebahmedkhan on Medium</title>
            <link>https://medium.com/@muneebahmedkhan0903?source=rss-bbaf82a4ad7c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:22:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muneebahmedkhan0903/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[The Subdomain Recon Chain: subfinder → httpx → dnsx]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/the-subdomain-recon-chain-subfinder-httpx-dnsx-ac771e3ac04c?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac771e3ac04c</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[recon]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 15:25:58 GMT</pubDate>
            <atom:updated>2026-08-30T15:25:58.117Z</atom:updated>
            <content:encoded><![CDATA[<p>Turn a root domain into a short list of live hosts worth testing. subfinder finds candidate hosts, httpx keeps the ones answering on HTTP or HTTPS, dnsx confirms they resolve.</p><p><strong>Prerequisites</strong></p><ul><li>A Linux or macOS terminal (a VM is fine)</li><li>Go — if you don’t have it, sudo apt install golang-go on Debian/Ubuntu or brew install go on macOS. Distro packages often lag; when the error at step 3 names a recent version, get it from go.dev/dl.</li><li>Internet access</li><li>An in-scope root domain. Run this only against a domain you own or a program that explicitly authorizes subdomain enumeration. Examples use the placeholder target-program.com.</li></ul><p>subfinder queries third-party databases and never contacts the target. httpx contacts the target directly, sending an HTTP request to every host on the list. dnsx queries public resolvers, which reach the target’s nameservers only when the record isn’t already cached. Step 9 onward is what your authorization has to cover.</p><p><strong>Steps</strong></p><p><strong>1. Confirm the domain is in scope.</strong><br> Open the program’s policy page. Find the root domain in the in-scope list. Note any request-rate limit while you are there — step 9 and the verification need it. Do not continue without the domain in scope.</p><p><strong>2. Check for the three tools.</strong></p><pre>which subfinder httpx dnsx</pre><p>Expect: three paths. If any line is missing, continue to step 3. Otherwise skip to step 6.</p><p><strong>3. Check your Go version.</strong></p><pre>go version</pre><p>At step 4, Go either downloads a newer toolchain on its own and prints a switching to go1.xx line — carry on — or stops with go.mod requires go &gt;= 1.xx. That error names the version you need. Install at least that version from go.dev/dl and re-run step 4.</p><p><strong>4. Install the missing tools.</strong></p><pre>go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest<br>go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest<br>go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest</pre><p>Run only the lines you need. Reinstalling one you already have is harmless.</p><p><strong>5. Add the Go binary directory to your PATH.</strong></p><pre>export PATH=$PATH:$(go env GOPATH)/bin</pre><p>Re-run step 2. Expect: three paths. To make it permanent:</p><pre>echo &#39;export PATH=$PATH:$(go env GOPATH)/bin&#39; &gt;&gt; ~/.bashrc</pre><p>Use ~/.zshrc if your shell is zsh — check with echo $SHELL. The single quotes matter either way: they defer $(go env GOPATH) to shell start instead of expanding it once at write time.</p><p><strong>6. Generate the subfinder config file.</strong></p><pre>subfinder -d example.com -silent<br>subfinder -h 2&gt;&amp;1 | grep provider-config</pre><p>The config file does not exist until subfinder runs once. Expect: little or no output from the first command — the file is the point, not the results. The second prints the config path for your system: ~/.config/subfinder/ on Linux, ~/Library/Application Support/subfinder/ on macOS. Open that directory to confirm provider-config.yaml exists. This run queries public databases only and sends nothing to example.com.</p><p><strong>7. Add subfinder API keys.</strong><br> Open the provider-config.yaml at the path from step 6. Shodan, VirusTotal, and SecurityTrails are good starting points. Check each provider&#39;s current plans — free tiers exist but the quotas and terms change. Sign up with each provider separately.</p><p>To confirm a key took, re-run subfinder without -silent and with -v:</p><pre>subfinder -d example.com -v</pre><p>Verbose output names the sources queried, and a key that didn’t take shows as an auth or skip message against that source.</p><p>Every subfinder source is passive. Keys unlock the sources that require authentication, which is most of them — without keys you get a fraction of the hosts.</p><p>Never commit provider-config.yaml to a repository. It contains live API keys.</p><p><strong>8. Discover candidate hosts.</strong></p><pre>subfinder -d target-program.com -silent -o hosts-all.txt<br>echo target-program.com &gt;&gt; hosts-all.txt<br>sort -u hosts-all.txt -o hosts-all.txt<br>wc -l hosts-all.txt</pre><p>The apex domain is appended by hand — subfinder returns subdomains, not the root, and the apex is usually the highest-value host on the list. sort -u then removes it again if certificate-transparency sources already returned it, so the count stays honest. Expect: a flat list of bare hostnames, one per line. Allow up to a minute before assuming subfinder hung. Example run: about 20 hosts. Record the count.</p><p><strong>9. Filter to live hosts.</strong><br> Substitute the rate limit you noted at step 1 for the -rl value below; if the policy sets none, drop the flag.</p><pre>httpx -l hosts-all.txt -silent -rl 5 -o hosts-live-urls.txt<br>sed &#39;s|https\?://||&#39; hosts-live-urls.txt &gt; hosts-live.txt<br>wc -l hosts-live.txt</pre><p>On BSD sed (macOS), use sed -E &#39;s|https?://||&#39;. httpx probes HTTPS first and falls back to HTTP, and outputs live URLs. hosts-live-urls.txt keeps the scheme — a host that answers only over plain HTTP is worth noticing — and the stripped hosts-live.txt holds bare hostnames so step 10&#39;s prefixes match.</p><p>Expect: a shorter list. Example run: roughly half survive. Mail servers, nameservers, and hosts that time out drop off. Record this count — you need it for verification.</p><p><strong>10. Sort the live hosts into three tiers.</strong></p><ul><li><strong>Tier 1 — test first:</strong> the root domain, and any host starting api., admin., dev., staging., test., or internal.</li><li><strong>Tier 2 — read manually:</strong> docs., support., blog., status.</li><li><strong>Tier 3 — skip:</strong> mta-sts. and other mail-policy hosts that serve a policy file and nothing else</li></ul><p>Put any host whose purpose you cannot identify from its name in Tier 1.</p><p><strong>11. Confirm which hosts resolve.</strong></p><pre>dnsx -l hosts-all.txt -a -resp -o hosts-resolved.txt</pre><p>Expect: each resolving host printed with its A record beside it.</p><p><strong>12. Secure the output.</strong><br> You finish with four files. hosts-live.txt is the working list. Keep them all private — recon output for a live program is not yours to publish.</p><p><strong>Verification check</strong></p><pre>httpx -l hosts-all.txt -silent -rl 5 -status-code -title | wc -l</pre><p>Use the same -rl value as step 9, or drop the flag if you dropped it there. This repeats the step 9 requests. Expect: the same number you recorded at step 9. Drop the | wc -l to read the lines themselves — each carries a status code such as [200] and a page title.</p><p>A lower count on a re-run points at the network, not the host list: hosts-all.txt has not changed, so hosts that answered once and time out now were slow, not absent. Re-run before treating any host as dead.</p><p><strong>Troubleshooting</strong></p><p>subfinder: command not found<strong> right after a successful install.</strong><br> Re-run step 5. go install writes to $(go env GOPATH)/bin, which is not on PATH by default, and the export does not survive a new terminal until you add it to ~/.bashrc (or ~/.zshrc on zsh).</p><p><strong>subfinder returns only a handful of hosts, or nothing at all.</strong><br> Re-run step 7 and confirm the keys took. Most sources need an API key, and a key-less install returns a fraction of the hosts — on a small target, sometimes none. If the keys are good, run subfinder against a domain you own: results there mean the tool works and the target genuinely has little to find.</p><p><strong>httpx returns zero live hosts on a list that clearly has some.</strong><br> Three usual causes: a -rl set far too low starves the run, your network&#39;s egress filtering blocks outbound HTTP, or a WAF is dropping the probes. Raise -rl toward the program&#39;s actual limit, confirm plain curl https:// followed by a hostname from your list works from the same machine, and if a single host answers by hand but not through httpx, the block is rate- or WAF-based, not a tool fault.</p><p><strong>Every line in </strong>hosts-live.txt<strong> starts with </strong>http<strong>.</strong><br> The sed in step 9 was dropped or mistyped, or you are on BSD sed without -E. Regenerate the file — step 10&#39;s prefixes are read against bare hostnames.</p><p><strong>dnsx prints hostnames but no IP addresses.</strong><br> Add -resp to print the host and IP, or -resp-only to print the IP alone. -a queries the A record but prints only the input host. The flag is the cause, not the version — <strong>ignore any outdated version banner</strong>.</p><p><strong>A hostname appears wrapped as </strong>[www.host](https://host)<strong>.</strong><br> Strip the brackets before you reuse the hostname. Some editors and chat clients auto-link hostnames on paste. The tools emit bare hostnames; the rewriting happens after.</p><p><strong>Closing</strong></p><p>Each stage narrows the field: subfinder maximizes recall, httpx proves reachability, dnsx confirms the DNS layer underneath. Every live host resolves, but not every resolving host is live — expect hosts-resolved.txt to run closer to hosts-all.txt than to hosts-live.txt, because mail and DNS hosts resolve without serving anything.</p><p><strong>Drafted and revised with Claude; every command tested by me.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac771e3ac04c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Burp Repeater, Decoder, and Comparer: Resend, Re-encode, and Diff Requests]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/burp-repeater-decoder-and-comparer-resend-re-encode-and-diff-requests-2ee34d992aa8?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ee34d992aa8</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Sun, 23 Aug 2026 15:24:26 GMT</pubDate>
            <atom:updated>2026-08-23T15:24:26.730Z</atom:updated>
            <content:encoded><![CDATA[<p>Launch Burp, resend a request without touching the browser, decode a Basic Auth header and a URL-encoded string, and let Burp highlight the exact differences between two near-identical requests.</p><h3>Prerequisites</h3><ul><li>Burp Suite (Community is fine)</li><li>A browser you can route through Burp’s proxy — your own pointed at 127.0.0.1:8080, or Burp’s built-in browser</li><li>Basic familiarity with base64 and URL encoding as concepts</li><li>No terminal beyond launching Burp</li></ul><h3>Part 0 — Launch and intercept</h3><p><strong>1. Launch Burp.</strong></p><p>Start it, then choose <strong>Temporary project → Use Burp defaults → Start Burp</strong>.</p><p>Expect: the main window opens on the Dashboard.</p><p><strong>2. Turn on Intercept.</strong></p><p>Go to <strong>Proxy → Intercept</strong> and click <em>Intercept is off</em> so it reads <em>Intercept is on</em>.</p><p>Expect: requests will now pause in this tab.</p><p><strong>3. Route a browser through Burp.</strong></p><p>Set your own browser’s proxy to 127.0.0.1:8080, or click <strong>Open Browser</strong> in the Proxy tab for Burp’s built-in one.</p><p>Expect: a browser window that proxies through Burp. (For any https:// site you’ll first need Burp’s CA certificate installed, or the browser shows certificate errors — the http:// example below sidesteps that.)</p><p><strong>4. Visit the example site.</strong></p><p>Load <a href="http://example.com/">http://example.com</a> in that browser.</p><p>Expect: the request pauses in the Intercept tab instead of loading.</p><p><strong>5. Send it to Repeater, then release Intercept.</strong></p><p>Right-click the paused request → <strong>Send to Repeater</strong>. Then click <em>Intercept is on</em> to turn it back off — otherwise every following request in that browser keeps pausing and the browser appears frozen.</p><p>Expect: the request is now available in Repeater, and the browser flows normally again.</p><h3>Part 1 — Repeater</h3><p><strong>1. Resend an edited request.</strong></p><p>Switch to the Repeater tab. Click <strong>Send</strong> once and note the status code that comes back. Then change the request line from GET / to GET /nonexistent and Send again.</p><p>Expect: a response on the right for each Send. The point isn’t the specific code — it’s that you resent an edited request and got a fresh response without re-triggering anything from the browser. The edited path will typically return a different status from the original.</p><p><strong>2. Send the original path once more.</strong></p><p>Restore GET / and Send again.</p><p>Expect: the same response you saw on the first Send. Two responses now sit in Repeater’s history.</p><h3>Part 2 — Decoder</h3><p><strong>1. Decode a Basic Auth header.</strong></p><p>You won’t see one from example.com, so use this sample:</p><pre>Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=</pre><p>The Basic prefix marks it as HTTP Basic Authentication. Paste the part after Basic into Decoder and choose <strong>Decode as → Base64</strong>.</p><p>Expect: it resolves to admin:password123 — a username:password pair. Basic Auth isn’t encryption; it’s a reversible encoding, the same idea as a JWT’s header and payload segments.</p><p><strong>2. URL-encode a string, Burp’s default way.</strong></p><p>Type hello world &amp; more=1 into Decoder and choose <strong>Encode as → URL</strong>.</p><p>Expect:</p><pre>%68%65%6c%6c%6f%20%77%6f%72%6c%64%20%26%20%6d%6f%72%65%3d%31</pre><p>Burp’s default encodes every character — aggressive but valid.</p><p><strong>3. Compare to the minimal form.</strong></p><p>The real-world minimal encoding of the same string is:</p><pre>hello%20world%20%26%20more%3D1</pre><p>Only the space, &amp;, and = are converted; letters and digits stay untouched because they’re already URL-safe. Both decode to the identical string.</p><p><strong>4. Connect it to filter bypasses.</strong></p><p>A filter blocking the literal &lt;script&gt; but not decoding input first can be walked past with %3Cscript%3E, decoded later by the browser or server. Same lesson as the SSRF loopback-notation list: a filter checking one representation misses the equivalent ones.</p><h3>Part 3 — Comparer</h3><p><strong>1. Load two near-identical requests.</strong></p><p>Paste two request blocks into Comparer’s two boxes (or right-click a request → <strong>Send to Comparer</strong>). Make them differ in exactly two places:</p><p>Block one: GET / with Accept-Language: en-US,en;q=0.9 Block two: GET /nonexistent with Accept-Language: fr-FR,fr;q=0.9</p><p>Keep the Host and everything else identical.</p><p>Expect: both appear as selectable items.</p><p><strong>2. Diff them.</strong></p><p>Click <strong>Compare → Words</strong>.</p><p>Expect: Burp highlights exactly two differences — the path and the language value. Everything identical is left unmarked.</p><h3>Verification check</h3><p>In Repeater, send a request, then resend it with a single header value changed, and push both responses to <strong>Comparer → Words</strong>. Exactly the region you changed should light up. If nothing highlights, you compared two identical items — confirm you sent the modified version, not the same one twice.</p><h3>Troubleshooting</h3><p><strong>Burp’s URL-encode output encodes everything and looks wrong.</strong></p><p>Not a bug. The default “encode all characters” is valid, just more aggressive than typical. Use the option that encodes only special characters for the minimal form, or recognize both decode to the same string.</p><p><strong>A Basic Auth header looks like encryption because it’s base64.</strong></p><p>It isn’t — base64 is reversible, not a cipher. Anyone who intercepts that header decodes it in two clicks, which is exactly why Basic Auth should only ever be sent over HTTPS.</p><p><strong>Your browser hangs after the first request.</strong></p><p>Intercept is still on (Part 0, step 5). Every request is queued in the Intercept tab waiting for you. Turn it off, or forward the queued requests.</p><p><strong>Comparer highlights differences you didn’t intend to test.</strong></p><p>Your two inputs differ in more than the one variable you meant to change. Build the two blocks so they differ in exactly the field you’re testing and nothing else — the whole value of the diff is a clean comparison.</p><h3>Closing</h3><p>Repeater, Decoder, and Comparer split one workflow into three: change a request and resend it, transform a value into the encoding the target actually uses, and let the tool find the one meaningful difference in a wall of headers. Basic Auth is a good first Decoder target precisely because it shows how little “encoded” protects — and the discipline worth keeping from Comparer is building a clean comparison, one deliberate difference at a time.</p><p><em>Drafted and revised with Claude; every step tested by me.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ee34d992aa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[See HTTP/2 and a Live WebSocket Handshake in Your Browser’s Network Tab]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/see-http-2-and-a-live-websocket-handshake-in-your-browsers-network-tab-bc08c983f848?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc08c983f848</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[http2]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 09:58:18 GMT</pubDate>
            <atom:updated>2026-08-22T09:58:18.387Z</atom:updated>
            <content:encoded><![CDATA[<p>Confirm a request used HTTP/2, find a live WebSocket, and read its 101 Switching Protocols handshake header by header — including the one header that decides whether the socket is exposed to CSWSH.</p><p><strong>Prerequisites</strong></p><ul><li>Firefox with DevTools (built in; press F12)</li><li>Internet access</li><li>No terminal, VM, or tooling — this is all in the browser</li><li>A rough idea that WebSockets are a persistent, two-way connection opened by “upgrading” an HTTP request</li></ul><p><strong>Part 1 — Confirm HTTP/2</strong></p><p><strong>1. Open the Network tab and load a site.</strong><br> Press F12, select the Network tab, and load a major site — a large search engine or CDN-backed homepage.</p><p>Expect: the request list fills as the page loads.</p><p><strong>2. Show the Protocol column.</strong><br> Right-click the column headers and tick Protocol if it isn’t already shown.</p><p>Expect: a Protocol column appears in the request table.</p><p><strong>3. Read the Protocol value on a few requests.</strong><br> h2 means HTTP/2 was used for that request; http/1.1 means it wasn&#39;t. Most requests to a large modern site show h2.</p><p><strong>Part 2 — Find and open a WebSocket</strong></p><p><strong>4. Filter to WebSockets, then load a live page.</strong><br> Click the WS filter in the Network tab, then load or reload a page that streams live data — a live-price ticker or a live chat.</p><p><strong>DevTools must already be open before the socket opens, or the handshake won’t be captured.</strong> This is the single most common reason no WebSocket row appears — if you opened the page first and DevTools second, reload the page with DevTools open.</p><p>Expect: the list narrows to WebSocket connections. If none appear, see troubleshooting.</p><p><strong>5. Identify the WebSocket row by its scheme.</strong><br> It starts with wss:// — an encrypted WebSocket, the equivalent of https://. A plaintext or local page may show ws:// instead. Either is a distinct row from the .js requests around it.</p><p><strong>6. Click the row and read the Status.</strong><br> 101 Switching Protocols — the handshake completing. It&#39;s the status code specific to WebSockets: the server agreed to upgrade the connection from HTTP to a persistent socket.</p><p><strong>Part 3 — Read the upgrade handshake</strong></p><p><strong>7. Read Connection and Upgrade in the response headers.</strong><br> Connection: upgrade and Upgrade: websocket — both sides confirming the protocol switch.</p><p><em>8. Read the two Sec-WebSocket- headers.</em>*<br> Find Sec-WebSocket-Key in the request and Sec-WebSocket-Accept in the response. The Key is a random value the browser generated; the Accept is what the server derived from it with a fixed algorithm. A correct pairing proves the server genuinely spoke the WebSocket handshake rather than misreading a normal request.</p><p>If the headers panel is collapsed, expand the Request Headers and Response Headers sections — some Firefox versions show fewer handshake headers by default, and you may need to expand a “Raw” toggle to see the full set.</p><p><strong>9. Read the Origin request header.</strong><br> It names the page that opened the socket. This is the CSWSH-relevant header: if a server completes the upgrade without checking that Origin is one it trusts, a malicious page could open the same socket in a logged-in victim’s browser. On any real target, this is the header you inspect first.</p><p><strong>10. Note the Cookie header on the handshake.</strong><br> WebSocket upgrades carry the browser’s existing cookies automatically, with no separate auth step. That automatic credential-sending is exactly what makes CSWSH possible when Origin isn’t validated.</p><p><strong>Verification check</strong></p><p>Click the WebSocket row and open its Messages sub-tab. Leave it a few seconds on a live page. Expect: a stream of small messages ticking in continuously. If the row shows 101 but no frames ever arrive, the socket opened but isn’t streaming — pick a page with visibly live-updating content and retry.</p><p><strong>Troubleshooting</strong></p><p><strong>The WS filter shows script files, not WebSocket connections.</strong><br> The page hadn’t opened a socket yet, so the filter had nothing to isolate — it isn’t broken. Reload with the filter already applied and give the page a moment to establish its live connection, then look for the wss:// row. Not every live-looking page uses a WebSocket; if none appears, try a different streaming site.</p><p><strong>No WebSocket row appears at all, even on a page you know streams.</strong><br> DevTools was opened after the socket did. The handshake is a one-time event at connection setup — if DevTools wasn’t recording when it happened, it isn’t captured retroactively. Reload the page with DevTools already open.</p><p><strong>The WebSocket row’s Version reads HTTP/1.1, which looks wrong for a modern site.</strong><br> It’s correct. The upgrade handshake is an HTTP/1.1 request by design — that’s the mechanism WebSockets use to bootstrap, regardless of whether the rest of the page loaded over HTTP/2. Don’t read the HTTP/1.1 on the handshake as a misconfiguration.</p><p><em>No Sec-WebSocket- headers on a row you expected to be a socket.</em>*<br> Then it isn’t one — it’s an ordinary request that matched the filter or that you clicked by mistake. A real handshake always carries Sec-WebSocket-Key in the request and Sec-WebSocket-Accept in the response. Their absence is how you rule a row out. (If the row is a 101 but the headers look sparse, expand the collapsed header sections first — see step 8.)</p><p><strong>Closing</strong></p><p>HTTP/2 and WebSockets look like separate topics, but the Network tab shows they’re both negotiated upgrades over the same connection machinery — h2 in a column, 101 Switching Protocols in a handshake. The security takeaway is narrow and concrete: on a WebSocket, the Origin header is the trust boundary, and cookies crossing the handshake for free are why that boundary matters.</p><p><em>Written and revised with Claude; every step tested by me in the browser.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc08c983f848" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build, Run, and Exploit a CORS Misconfiguration in 15 Lines of Python]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/build-run-and-exploit-a-cors-misconfiguration-in-15-lines-of-python-25cbe2697bab?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/25cbe2697bab</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cors]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 09:55:00 GMT</pubDate>
            <atom:updated>2026-08-22T09:55:00.661Z</atom:updated>
            <content:encoded><![CDATA[<p>Stand up a deliberately broken API that reflects any Origin back, then prove the flaw with a single curl command — a full build-and-exploit cycle on your own machine, no accounts or external labs.</p><p><strong>Prerequisites</strong></p><ul><li>A Linux terminal (any distro; a VM is fine)</li><li>python3</li><li>curl</li><li>nano or any text editor</li><li>Two terminal windows — one runs the server, one sends the request</li><li>Localhost only. The server binds to 127.0.0.1, so nothing here is reachable from outside your machine and there’s no scope concern.</li></ul><p><strong>Steps</strong></p><p><strong>1. Create the server file.</strong></p><pre>nano vulnerable_server.py</pre><p>Expect: a blank editor with shortcut hints along the bottom (^O Write Out, ^X Exit).</p><p><strong>2. Paste in the server.</strong></p><pre>from http.server import HTTPServer, BaseHTTPRequestHandler<br>import json</pre><pre>class Handler(BaseHTTPRequestHandler):<br>    def do_GET(self):<br>        origin = self.headers.get(&#39;Origin&#39;, &#39;&#39;)<br>        self.send_response(200)<br>        self.send_header(&#39;Content-Type&#39;, &#39;application/json&#39;)<br>        # VULNERABLE: reflects whatever Origin was sent, with no allow-list<br>        self.send_header(&#39;Access-Control-Allow-Origin&#39;, origin)<br>        self.send_header(&#39;Access-Control-Allow-Credentials&#39;, &#39;true&#39;)<br>        self.end_headers()<br>        data = {&quot;secret&quot;: &quot;fake demo data, not real&quot;}<br>        self.wfile.write(json.dumps(data).encode())</pre><pre>HTTPServer((&#39;127.0.0.1&#39;, 8000), Handler).serve_forever()</pre><p>In a terminal, paste is usually Ctrl+Shift+V or right-click → Paste; plain Ctrl+V often does nothing.</p><p><strong>3. Save and exit.</strong><br> Ctrl+O, Enter, Ctrl+X. Back at the prompt, confirm the file isn’t empty:</p><pre>wc -l vulnerable_server.py</pre><p>Expect: 15 or 16 lines, not 0.</p><p><strong>4. Check port 8000 is free.</strong></p><pre>ss -ltn | grep -q &#39;:8000 &#39; &amp;&amp; echo &quot;IN USE&quot; || echo &quot;free&quot;</pre><p>Expect: free. If it prints IN USE, something else is listening on the port — stop it, or change 8000 to another port in the code and in every command below.</p><p><strong>5. Run the server.</strong></p><pre>python3 vulnerable_server.py</pre><p>Expect: nothing — no output, no returned prompt. That silence is success; the server is running and waiting. If the prompt comes straight back, the file didn’t save (see troubleshooting). If python3 isn’t found, try python.</p><p><strong>6. Send a request with a fake attacker origin.</strong><br> Leave the first terminal running. In a second one:</p><pre>curl -i -H &#39;Origin: https://evil.com&#39; http://localhost:8000</pre><p>Expect: a 200 OK status line, headers including Access-Control-Allow-Origin: https://evil.com and Access-Control-Allow-Credentials: true, then the JSON body. The status line reads HTTP/1.0 — that&#39;s the library&#39;s default version, not an error.</p><p><strong>7. Read the reflected origin.</strong><br> The Access-Control-Allow-Origin value is https://evil.com — the exact origin you supplied, reflected verbatim. The server trusts any origin that asks.</p><p><strong>8. Read it together with the credentials header.</strong><br> Access-Control-Allow-Credentials: true paired with a reflected origin is the critical combination: it tells a browser to let that origin&#39;s JavaScript read the response and send the victim&#39;s cookies. Reflection alone is bad; reflection plus credentials is the exploitable case.</p><p><strong>9. Confirm it’s true reflection, not a fixed value.</strong></p><pre>curl -i -H &#39;Origin: https://another-attacker.test&#39; http://localhost:8000</pre><p>Expect: Access-Control-Allow-Origin now echoes https://another-attacker.test. Whatever you send comes back; there&#39;s no allow-list at all.</p><p><strong>10. Stop the server.</strong><br> Return to the first terminal and press Ctrl+C. Leaving a deliberately vulnerable server running is a loose end even bound to localhost.</p><p><strong>Verification check</strong></p><pre>curl -i http://localhost:8000 | grep -i access-control-allow-origin</pre><p>Expect: the header present but empty — Access-Control-Allow-Origin: with nothing after it — because the code reflects an empty string when no Origin is sent. If the header is missing entirely, you&#39;re hitting a different server on port 8000; stop and check what&#39;s running.</p><p><strong>Troubleshooting</strong></p><p><strong>The server returns to the prompt instantly instead of hanging.</strong><br> The file is empty — the editor closed without saving, so Python ran nothing and exited. The paste never landed (terminal ignored Ctrl+V), or the save was skipped. Reopen, paste with Ctrl+Shift+V or right-click, save with Ctrl+O → Enter, exit with Ctrl+X, and confirm with wc -l before running. A running server produces no output — don&#39;t mistake the correct silent hang for the empty-file exit. The difference is whether your prompt came back.</p><p>Address already in use<strong> when starting the server.</strong><br> A previous run still holds port 8000. Stop it — Ctrl+C in the first terminal, or pkill -f vulnerable_server.py — then start again.</p><p>curl: connection refused<strong> on the second terminal.</strong><br> The server isn&#39;t running: it either never started (empty file, above) or was closed. Confirm the first terminal is still hanging on the python3 command before sending the curl.</p><p><strong>Closing</strong></p><p>Everything the exploit relies on is one design decision: the server echoes the Origin it’s given instead of checking it against a list of domains it trusts. curl doesn’t enforce the browser’s same-origin policy, so it always sees the body — the point of the request is the headers that come back, because those headers are the instruction a real browser would obey. A page at evil.com making this request in a logged-in victim’s browser would be told, by these two headers, that it may read the private response and send the victim’s cookies. The fix is a one-line change: from “reflect the origin” to “reflect it only if it’s on my allow-list.”</p><p><em>Drafted and revised with Claude; every command tested by me.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25cbe2697bab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cookies and JWTs by Hand: Reading Security Attributes and Watching a Signature Break]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/cookies-and-jwts-by-hand-reading-security-attributes-and-watching-a-signature-break-fd5db72caab8?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd5db72caab8</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 19:11:09 GMT</pubDate>
            <atom:updated>2026-08-20T19:11:09.294Z</atom:updated>
            <content:encoded><![CDATA[<p>Read the three attributes that decide whether a session cookie is hardened, then demonstrate both sides of JWT integrity — a valid token when the secret is known, and a broken one the instant the key changes.</p><h4>Prerequisites</h4><ul><li>A web browser with DevTools (Firefox or Chrome)</li><li>Familiarity with base64: JWT parts are base64url-encoded, not encrypted — anyone can read them</li><li>Internet access; the JWT half uses jwt.io, which signs and verifies entirely in your browser</li><li>No terminal or VM required</li></ul><p>A JWT is three dot-separated parts: header.payload.signature.</p><h4>Part 1 — Read cookie security attributes</h4><p><strong>1. Open DevTools on a site you’re logged into.</strong><br> Press F12. Look for the cookie inspector: under the <strong>Storage</strong> tab in Firefox, under the <strong>Application</strong> tab in Chrome — in both, find the <strong>Cookies</strong> section in the left panel and select the site’s origin. (Browser versions move these tabs occasionally; if you don’t see it, look for a Storage or Cookies entry in the panel.)</p><p>Expect: a table of cookies, each row showing name, value, and attribute columns.</p><p><strong>2. Read the </strong>HttpOnly<strong> attribute on a session cookie.</strong><br> Pick a session-related cookie. A checkmark or true means JavaScript cannot read it — the cookie is shielded from theft through XSS. Empty means script can read it.</p><p><strong>3. Read the </strong>Secure<strong> attribute on the same cookie.</strong><br> Set means the cookie is only ever sent over HTTPS. Empty means it can be sent over plain HTTP, where it can be intercepted.</p><p><strong>4. Read the </strong>SameSite<strong> attribute on the same cookie.</strong><br> Strict or Lax limits whether the cookie rides along on cross-site requests, which blunts CSRF. None sends it cross-site and is only valid alongside Secure.</p><p><strong>5. Compare across a few sites.</strong><br> Repeat on a social site, a shopping site, and an analytics-heavy news site. Expect a spread: a hardened auth cookie with all three set, next to a tracking cookie with few or none. “Properly configured” only means something measured against “loosely configured.”</p><h4>Part 2 — JWT: the known-secret forge</h4><p><strong>6. Open jwt.io and read the token.</strong><br> The encoded token sits on one side, the decoded header and payload on the other. If the page opens empty, load the sample token it offers.</p><p>Expect: a decoded payload with fields such as sub, name, and iat.</p><p><strong>7. Edit the payload.</strong><br> Change name to any other value. If the payload has an admin field, flip it to true; if it doesn&#39;t, add &quot;admin&quot;: true to it.</p><p>Expect: the encoded token updates and its signature segment changes. If jwt.io holds the sample secret, it re-signs automatically and the indicator stays green — that green is the point of step 8. If your version shows red instead, it isn’t re-signing for you; skip to Part 3, which makes the same point more directly by changing the key yourself.</p><p><strong>8. Read why it stayed valid.</strong><br> You did not defeat anything. jwt.io holds this token’s secret and re-signed your edited payload with it, in the browser. Green here means “re-signed with the known secret,” not “signature check bypassed.” That is the real-world attack when a server signs with a guessable or default secret: anyone who knows it can forge any payload — including the admin: true now in the payload, which a server trusting that token would act on.</p><p>Do this only with jwt.io’s sample token. Editing a real token from a service you use means tampering with a live credential — read those, don’t modify them.</p><h4>Part 3 — JWT: watching the signature break</h4><p><strong>9. Find the secret jwt.io is using and read it exactly.</strong><br> Locate the signature-verification field — the box holding the secret the token is checked against. Read the exact value shown. Don’t copy it from any tutorial, including this one: the site has changed its default before, and only the value in front of you is correct.</p><p><strong>10. Change one character of the secret.</strong><br> Edit the secret in that field — add or alter a single character. Leave the token itself untouched.</p><p>Expect: the verification indicator flips to red, “Invalid signature.” Nothing about the token changed; only the key did. The signature was computed under the original secret, so it no longer matches under the new one.</p><p><strong>11. Read what that proves.</strong><br> The payload is still perfectly readable — base64 is reversible by anyone. But the signature is only reproducible by someone holding the exact key. An attacker who edits a payload without the secret cannot produce a signature that verifies. That gap is the entire security guarantee of a signed JWT.</p><h4>Verification check</h4><p>Confirm you can tell the two failure modes apart. With the correct secret in place and the token green, edit a payload field as in step 7 — it stays green. Now change one character of the secret as in step 10 — it goes red. Same token, opposite results.</p><p>That side-by-side is the whole article: a payload edit is caught only when the key can’t be made to match it. If the payload edit turns the token red on its own, the secret field was already wrong — reset it before drawing any conclusion.</p><h4>Troubleshooting</h4><p><strong>Editing the payload shows “Verified” and looks like a broken check.</strong><br> It isn’t. jwt.io re-signs with the secret it holds, so a green result after an edit means “validly re-signed,” not “tampering accepted.” Real tamper detection shows up only when the signature and the key disagree — which is what changing the secret in Part 3 demonstrates.</p><p><strong>Firefox and Chrome label the cookie columns differently.</strong><br> Chrome renders HttpOnly and Secure as checkmarks; Firefox shows text. SameSite shows a value (Lax, Strict, None) in both. Read the meaning, not the format.</p><p><strong>The secret in your jwt.io doesn’t match older writeups.</strong><br> The site has changed its sample secret before, and it may again. Trust the value in your own verification field over any figure quoted in a tutorial, this one included.</p><p><strong>jwt.io looks different from these steps.</strong><br> The site has been redesigned more than once. The three pieces you need are always present: the decoded payload you can edit, an encoded token that updates as you type, and a field for the secret the signature is verified against. Find those three and the steps hold regardless of layout.</p><h4>Closing</h4><p>Both halves are about trust boundaries. A cookie’s attributes decide who may read it and when it’s sent; a JWT’s signature decides whether its contents can be trusted — but only as long as the secret stays secret. Neither protects anything if the configuration is loose or the key is guessable. base64 hides nothing; the signature is what does the work, and only while the key holds.</p><p>Drafted and revised with Claude; every command tested by me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd5db72caab8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing for Host Header Injection With curl]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/testing-for-host-header-injection-with-curl-cb50fd769df9?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb50fd769df9</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[curl]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 19:07:12 GMT</pubDate>
            <atom:updated>2026-08-20T19:07:12.268Z</atom:updated>
            <content:encoded><![CDATA[<p>Spoof a Host header at a site you’re authorized to test, read the routing error a hardened edge returns, and run the reflection check that would expose the actual vulnerability if it existed.</p><h4>Prerequisites</h4><ul><li>A Linux terminal (any distro; a VM is fine)</li><li>curl</li><li>Outbound TCP 443 permitted by your network</li><li>Internet access</li><li><strong>Scope.</strong> Examples target example.com, which is IANA-reserved for documentation and safe to send test requests to. Note that example.com sits behind a CDN, so these requests transit real edge infrastructure (Cloudflare) rather than a bare origin — harmless here, since the edge returns a clean error, but worth knowing the request isn&#39;t hitting the reserved domain in isolation. Separately: sending spoofed Host headers at a program&#39;s assets can be out of scope even when the program itself is in scope — check the rules before you point this anywhere real.</li></ul><h4>Steps</h4><p><strong>1. Check for curl.</strong></p><pre>curl --version</pre><p>Expect: a version banner. If you get command not found:</p><pre>sudo apt install curl     # Debian, Ubuntu<br>sudo dnf install curl     # Fedora, RHEL</pre><p><strong>2. Send a request claiming a fake internal host.</strong></p><pre>curl -H &#39;Host: internal.example.com&#39; https://example.com</pre><p>curl still connects to example.com over TLS — only the Host header inside the request is spoofed. That split is the whole test: the edge sees a request that arrived for one name but claims another.</p><p>Expect: an HTML error page citing a vendor code, such as error 1016 if the site sits behind Cloudflare, rather than a standard HTTP status. A target behind a different CDN, or none, will respond differently — read the shape of the response, not the specific number.</p><p><strong>3. Read what the code means.</strong><br> 1016 is a Cloudflare code, not an HTTP one: a DNS resolution failure at the edge. It took your spoofed Host, looked for an origin registered for internal.example.com, and found none. It routed by your Host value rather than blindly serving whatever backend sits behind the IP. That is the hardened behaviour — the request was evaluated, not trusted.</p><p><strong>4. Confirm the result reproduces.</strong></p><pre>curl -H &#39;Host: internal.example.com&#39; https://example.com</pre><p>Expect: the same code. One request is an observation; two matching requests are a result. A response that changes between identical requests means something upstream is inconsistent — note it and re-run until you understand why before drawing any conclusion.</p><p><strong>5. Run the reflection check.</strong><br> The routing error tells you the spoofed Host wasn’t served. The other half of the test is whether the application echoes your Host value back — the real injection vulnerability.</p><pre>curl -s -D - -o /dev/null -H &#39;Host: internal.example.com&#39; https://example.com | grep -i location</pre><p>This grep only covers redirect-based reflection; the body check below is the other half, so don’t stop here and conclude “no Location header, no vuln.” Expect: nothing, or a Location pointing at the site&#39;s own real domain. A finding looks like the opposite — your spoofed internal.example.com appearing inside the redirect target, meaning the app built a URL from a header an attacker controls.</p><p>Reflection isn’t limited to redirects. For a full check, drop the grep and read the body too — a spoofed host echoed into a canonical link, a meta refresh, or a form action is the same class of bug.</p><p><strong>6. Name what a vulnerability would look like.</strong><br> Two shapes: a 200 OK serving different content for the spoofed Host, or your Host value reflected into a link or redirect. Neither happened here — a negative result, and knowing the positive shape is what makes it worth recording.</p><h4>Verification check</h4><pre>curl -s -o /dev/null -w &#39;%{http_code}\n&#39; -H &#39;Host: internal.example.com&#39; https://example.com</pre><p>Expect: a non-200 status — 530 on Cloudflare, which pairs it with the 1016. Any non-200 is the clean result; the specific number depends on the edge. If you get 200, the spoofed Host is being served — stop and investigate, because that&#39;s a real finding rather than a clean result.</p><h4>Troubleshooting</h4><p><strong>A vendor error code instead of a normal HTTP status.</strong><br> Codes like 1016 belong to the provider, not HTTP. 1016 is a routing or DNS failure for the requested Host. Read it as &quot;the edge tried to route your Host and couldn&#39;t,&quot; not a server crash.</p><p><strong>Every request returns the same error, even without a spoofed Host.</strong><br> Send a clean request first: curl -s -o /dev/null -w &#39;%{http_code}\n&#39; https://example.com. If that also errors, the problem is between you and the site — a captive portal, a proxy, or a filtering network returning its own page. Fix your connection before reading anything into the spoofed results.</p><p><strong>A different status on every run.</strong><br> An edge network spread across many nodes can answer inconsistently while a config change propagates. Re-run several times; if it won’t settle, the instability itself is worth noting but isn’t a Host-injection finding.</p><h4>Closing</h4><p>A Host header injection test usually ends in a clean refusal, and the skill is reading which one you got — a 1016 means the edge never found your claimed host. The finding you&#39;re hunting is the opposite: a server that trusts the Host you hand it and builds a link or redirect from it. Test both halves every time — the routing response tells you what was served, the reflection check tells you what was echoed. And a clean refusal here is specific to a hardened edge; the same request against a bare origin with no such protection can succeed, which is exactly why the test is worth running.</p><p>Drafted and revised with Claude; every command tested by me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb50fd769df9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auditing a TLS Config With testssl and Reading the Grade]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/auditing-a-tls-config-with-testssl-and-reading-the-grade-34d372348d5b?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/34d372348d5b</guid>
            <category><![CDATA[cors]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 05:37:03 GMT</pubDate>
            <atom:updated>2026-08-19T05:37:03.286Z</atom:updated>
            <content:encoded><![CDATA[<p>Run a full TLS audit against a host you control, then trace its letter grade back to the specific findings that produced it. The grade is a summary; the report needs the lines underneath it.</p><h4>Prerequisites</h4><ul><li>A Linux terminal (any distro; a VM is fine)</li><li>Debian or Kali for the install step, or testssl installed another way</li><li>sudo rights</li><li>Outbound TCP 443 permitted by your network</li><li><strong>A TLS host you own or are explicitly authorized in writing to test.</strong> A default testssl run sends active vulnerability probes for Heartbleed, CCS injection, ROBOT, and other named flaws. This is vulnerability testing, not a passive handshake, and running it against a host you don’t own or have written authorization for may be a criminal offense in your jurisdiction. Convenience is not authorization. Point it only at a host you are cleared to probe.</li></ul><p>If you don’t have a host of your own, run it against a local TLS service — testssl localhost:443 against a container or a local nginx gives you a complete run on a target that is yours by definition. A local server usually serves a self-signed certificate, so the certificate checks in step 5 will fail and the grade in step 9 will be capped on trust rather than on protocols. That&#39;s the setup, not a finding — read the protocol and header sections for the lesson.</p><p>Findings below are from one run against one host. Yours will differ. Read for how to interpret each section, not for which values appear.</p><h4>Steps</h4><p><strong>1. Check for the tool.</strong></p><pre>which testssl</pre><p>Expect: a path such as /usr/bin/testssl. If nothing prints, continue to step 2. Otherwise skip to step 3.</p><p><strong>2. Install it (Debian, Kali).</strong></p><pre>sudo apt install testssl.sh</pre><p>The package is testssl.sh; the command it installs is testssl, with no extension. Re-run step 1. Expect: a path.</p><p><strong>3. Run the audit and save the output.</strong></p><pre>testssl --color 0 --logfile audit.log your-host.example</pre><p>Expect several minutes of output covering protocols, certificate, ciphers, HTTP headers, and named vulnerability tests, ending in a score and letter grade. Let it finish — long silent stretches are normal.</p><p>--logfile writes a plain-text copy to audit.log, which is what you&#39;ll quote from in a report. Use a distinct filename per run — audit-$(date +%F-%H%M).log if you&#39;ll run it more than once — or a second run will overwrite or mix with the first. --color 0 strips the markup; without it the log carries ANSI escape codes that make every quoted line unusable. The log also wraps to your terminal width at the time of the run, so widen the window before starting if you plan to paste long lines.</p><p><strong>4. Read the protocol section.</strong><br> Each protocol version from SSLv2 through TLS 1.3 gets a line. What matters is which deprecated versions are marked as offered. SSLv2, SSLv3, TLS 1.0, and TLS 1.1 are all deprecated; TLS 1.2 and 1.3 are current. Any deprecated version still offered on a production host is your first finding.</p><p><em>Worked example:</em> one run showed TLS 1.0 and 1.1 offered and flagged deprecated, with 1.2 and 1.3 OK.</p><p><strong>5. Read the certificate section.</strong><br> Check three things: key size, whether the chain validates to a real CA, and the expiry date. 2048-bit RSA is adequate and standard — not a weakness, just not a point worth highlighting; flag a key only if it’s smaller. A host may serve more than one certificate — an RSA and an ECDSA pair is normal, letting the server match the client rather than indicating a misconfiguration.</p><p><strong>6. Read the HTTP header section for Strict Transport Security.</strong><br> not offered means return visitors aren&#39;t forced onto HTTPS, leaving a window for an SSL-stripping downgrade. If it&#39;s present, note the max-age — a very short one weakens the protection without removing it.</p><p><strong>7. Read the vulnerability section.</strong><br> The named historical CVEs each get a verdict. Anything marked VULNERABLE is a candidate finding; most will come back not vulnerable on a maintained host.</p><p><strong>8. Connect cipher-based findings back to step 4.</strong><br> Some vulnerability results are consequences of the protocol configuration rather than separate issues. SWEET32 is the common one — it exists because 64-bit-block ciphers like 3DES are still enabled, and those typically ride along with the deprecated protocols. When that’s the case, report it as supporting evidence for the protocol finding, not as an independent bug.</p><p><strong>9. Read the score and the grade cap.</strong><br> testssl prints a numeric score and a letter grade, and states what capped the grade when something does. That line is the single most useful sentence in the output: it names the finding the tool considers most severe. An otherwise strong configuration can be held to a B by one deprecated protocol.</p><p><strong>10. Pull your evidence out of the log.</strong></p><pre>grep -iE &#39;deprecated|not offered|VULNERABLE|Overall Grade&#39; audit.log</pre><p>Expect: the lines you’d cite in a report, without the surrounding run. Confirm the grade label matches your version first — if Overall Grade returns nothing, run grep -i grade audit.log to find the exact wording your testssl used, since the pattern silently matches nothing if the string differs. Check each line against the full log before quoting it.</p><h4>Verification check</h4><pre>testssl -p your-host.example</pre><p>-p runs the protocol checks alone. Expect: the same protocol verdicts as step 4. If the two disagree, one run didn&#39;t complete — re-run before trusting either.</p><h4>Troubleshooting</h4><p>testssl.sh: command not found<strong> right after a successful install.</strong><br> The package name and the command differ. apt install testssl.sh installs an executable called testssl. Run that. Confirm the path with dpkg -L testssl.sh | grep bin.</p><p>No such file or directory<strong> when you run it by full path.</strong><br> Same cause, one layer down — the file on disk has no .sh extension. Drop it. If your shell cached the old lookup, hash -r clears it.</p><p><strong>The hostname can’t be resolved.</strong><br> You left your-host.example in the command. .example is a reserved TLD that never resolves — substitute the host you&#39;re authorized to test.</p><p><strong>A finding marked VULNERABLE that turns out to be moot.</strong><br> Read the annotation, not the capital-letter verdict. BEAST is often flagged with a note that modern clients avoid the vulnerable path; BREACH only matters on pages containing secrets, and testssl says so inline. “Offered but not reachable by current clients” is a different severity from “exploitable,” and reporting the first as the second costs you credibility with a triage team.</p><p><strong>The run appears to hang.</strong><br> Cipher enumeration is slow against some hosts. Give it several minutes before interrupting. If it never completes, re-run with -p to confirm basic connectivity first.</p><h4>Closing</h4><p>The grade is a summary, not the finding. What goes in a report is the specific line that caused the cap — deprecated protocols offered, HSTS missing — each traceable to a section of the raw output, with cipher-level results as corroboration rather than headlines. A tool that hands you a letter is only useful if you can reconstruct why it chose that letter.</p><p>Written and revised with Claude; every step tested by me in the browser.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34d372348d5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open, Closed, Filtered: Reading an Nmap Scan Properly]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/open-closed-filtered-reading-an-nmap-scan-properly-5512cc5429ed?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5512cc5429ed</guid>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 22:18:21 GMT</pubDate>
            <atom:updated>2026-08-17T22:18:21.471Z</atom:updated>
            <content:encoded><![CDATA[<p>Scan a legal practice host for eight specific services, tell a closed port apart from a filtered one, and pull an exact software version string off an open port — the same sequence you’d run against any authorized target.</p><h4>Prerequisites</h4><ul><li>A Linux terminal (any distro; a VM is fine)</li><li>Outbound TCP permitted on the ports you scan; some home and corporate networks block outbound scanning</li><li>Internet access</li><li><strong>Authorization.</strong> Every command here targets scanme.nmap.org, which the Nmap project maintains expressly so people can practice against it. Scanning hosts you don&#39;t own or have written permission to test is illegal in most jurisdictions. Do not substitute another domain.</li></ul><p>The project asks that you not hammer the server: a few scans a day is fine, but not dozens, and not to test brute-force tools. This article runs four scans. Work through it once, then move to a host you own if you want to repeat the exercises.</p><p>The exact ports, versions, and addresses below are whatever scanme is running the day you scan it. Read for the method, not the values.</p><h4>Steps</h4><p><strong>1. Check for nmap.</strong></p><pre>nmap --version</pre><p>Expect: a version banner such as Nmap version 7.9x. If you get command not found, continue to step 2. Otherwise skip to step 3.</p><p><strong>2. Install nmap.</strong></p><pre>sudo apt install nmap     # Debian, Ubuntu<br>sudo dnf install nmap     # Fedora, RHEL</pre><p>Re-run step 1. Expect: a version banner.</p><p><strong>3. Scan a targeted list of well-known service ports.</strong></p><pre>nmap -p 21,22,25,53,80,443,3306,6379 scanme.nmap.org</pre><p>Expect: a results table with a STATE column. On a typical day two ports come back open — 22 (ssh) and 80 (http) — and the rest come back closed. Your exact split may differ.</p><p><strong>4. Read the closed ports.</strong><br> closed is a positive result, not an absence of one. The host sent back a TCP RST, an active reply saying nothing is listening on that port. Nmap only reports closed when it gets that answer back.</p><p><strong>5. Note what closed is not.</strong><br> filtered means no useful reply arrived, because a firewall dropped the probe or replied with an ICMP error instead of a RST. closed tells you the port is genuinely unused; filtered tells you something is in the way and you can&#39;t see past it. Different findings, different next steps.</p><p><strong>6. Draw only the conclusion the scan supports.</strong><br> You scanned eight ports out of 65,535. What you know is bounded to those eight: which of them answered, which refused, and whether anything was filtered. You do not know what the host runs on the other 65,527.</p><p><strong>7. Prove that to yourself.</strong></p><pre>nmap scanme.nmap.org</pre><p>This one takes longer than the previous scans — let it finish. The default scan covers nmap’s top 1,000 ports rather than your eight. It often turns up a port your targeted scan missed — and whatever it shows, your step 6 conclusion couldn’t have accounted for it. Scope every claim to what you actually scanned.</p><p><strong>8. Run version detection against the open SSH port.</strong></p><pre>nmap -sV -p 22 scanme.nmap.org</pre><p>Expect: a VERSION column naming the SSH software, its release, and the distribution’s patch level, plus a Service Info line naming the operating system.</p><p><strong>9. Break the version string into its parts.</strong><br> In a string like OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.13, the first part is the upstream OpenSSH release and the Ubuntu 2ubuntu2.13 part is the distribution&#39;s patch level layered on top. If the output also reports a protocol version, 2.0 confirms SSHv2, not the obsolete and broken SSHv1.</p><p><strong>10. Search the exact version string for known vulnerabilities.</strong><br> Record the full string including the patch suffix. Distributions backport security fixes without changing the upstream number, so searching the upstream release alone overstates what’s exploitable — the patch level is what tells you whether a given CVE was already fixed.</p><p>Read only. Do not test anything you find against scanme; the authorization covers scanning, not exploitation.</p><p><strong>11. Read the line about addresses that weren’t scanned.</strong><br> Nmap often notes an IPv6 address it didn’t scan, alongside the IPv4 one it did. Your results describe one address family only.</p><h4>Verification check</h4><pre>nmap -p 22,3306 scanme.nmap.org</pre><p>Expect: 22 open, 3306 closed. If either shows filtered, your own network is dropping the probes, and none of the STATE values above are trustworthy — fix that before drawing conclusions from any scan.</p><h4>Troubleshooting</h4><p><strong>Nmap says the host seems down.</strong><br> Your network is blocking the discovery probes, not the scan itself. Re-run with -Pn, which skips host discovery and scans regardless:</p><pre>nmap -Pn -p 22,80 scanme.nmap.org</pre><p>If that returns a port table, the host was up the whole time.</p><p><strong>Every port reports filtered.</strong><br> Not a result about the target. Something between you and it — a home router, a corporate firewall, a VPN — is dropping the probes. Re-run from a different network before interpreting anything.</p><p><strong>IPv6 services are missing from your results.</strong><br> The default scan resolves to IPv4 and says plainly that the other address wasn’t scanned. A host can expose services on IPv6 that don’t appear here at all. Re-run with -6 to cover the second address. If that errors out, your own network has no IPv6 route — the target&#39;s IPv6 services are still there, you just can&#39;t reach them from where you are.</p><p><strong>A scan type refuses to run without root.</strong><br> SYN scans and OS detection need elevated privileges. Everything in this article runs unprivileged — but note that nmap’s default changes to a SYN scan when you run it as root, so your STATE values come from a different scan type than described here.</p><h4>Closing</h4><p>The skill here isn’t the command, it’s the reading. open invites a follow-up, closed closes a line of inquiry, and filtered means you learned about the network rather than the host. Version detection turns an open port into a specific string you can look up — the entire recon loop in miniature, bounded by the ports you thought to scan.</p><p>Drafted and revised with Claude; every command tested by me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5512cc5429ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything a Domain Will Tell a Stranger: DNS Enumeration With dig]]></title>
            <link>https://medium.com/@muneebahmedkhan0903/everything-a-domain-will-tell-a-stranger-dns-enumeration-with-dig-fdf34620380f?source=rss-bbaf82a4ad7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdf34620380f</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Muneebahmedkhan]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 21:43:04 GMT</pubDate>
            <atom:updated>2026-08-17T21:43:04.291Z</atom:updated>
            <content:encoded><![CDATA[<p>Query five record types for a domain, decode an SOA field by field, and attempt a zone transfer, so you know what a domain publishes to anyone who asks, and what a locked-down server refuses to hand over.</p><h4>Prerequisites</h4><ul><li>A Linux terminal (any distro; a VM is fine)</li><li>Outbound UDP and TCP on port 53 permitted by your network</li><li>Internet access</li></ul><p>Every command targets example.com, which is IANA-reserved for documentation. Queries for A, MX, TXT, NS, and SOA records read public data and are unremarkable anywhere. A zone transfer attempt is different: when you swap in a real domain, run step 9 only against one you own or a program that authorizes it. Against example.com it is harmless.</p><p>Your output will not match the samples below. Addresses, nameserver names, serials, and TTLs all change. Read for shape, not values.</p><h4>Steps</h4><p><strong>1. Check for dig.</strong></p><pre>dig -v</pre><p>Expect: a version string such as DiG 9.18.x. If you get command not found, continue to step 2. Otherwise skip to step 3.</p><p><strong>2. Install dig.</strong></p><pre>sudo apt install bind9-dnsutils     # Debian, Ubuntu<br>sudo dnf install bind-utils         # Fedora, RHEL</pre><p>On older releases the Debian package is dnsutils. Re-run step 1. Expect: a version string.</p><p><strong>3. Query the address records.</strong></p><pre>dig example.com A</pre><p>Records live in the block headed ;; ANSWER SECTION:. Everything above it is the query dig sent. At the bottom, ;; SERVER: names the resolver that answered, usually a local stub resolver, your router, or your ISP, and the thing caching everything below.</p><p>Expect: one or more IPv4 addresses, each with a TTL. More than one A record for a single name is normal; that is how traffic gets spread across servers.</p><p><strong>4. Query the mail records.</strong></p><pre>dig example.com MX</pre><p>Expect: a single record whose target is a bare dot, at priority 0. That is a null MX, the domain declaring it accepts no mail anywhere. A statement, not an empty answer.</p><p><strong>5. Query the text records.</strong></p><pre>dig example.com TXT</pre><p>Expect: quoted strings, among them an SPF policy beginning v=spf1. Note how it ends: -all is a hardfail, telling receivers to reject any mail from a sender the record doesn&#39;t list; ~all is a softfail, telling them to accept such mail but flag it as suspect.</p><p><strong>6. Read the two together.</strong></p><pre>dig +short example.com MX<br>dig +short example.com TXT</pre><p>+short strips everything but the answers. Expect: a null MX above an SPF ending in -all, one consistent policy, no mail in and no mail claimed out. Neither record alone tells you that.</p><p>The mismatch is what&#39;s worth finding elsewhere: no MX and no SPF, or a weak ~all. That means nobody sends mail from the domain officially, and nothing rejects anyone who spoofs it.</p><p><strong>7. Query the nameservers.</strong></p><pre>dig example.com NS</pre><p>Expect: two or more authoritative nameserver hostnames, typically at a much longer TTL than the A records.</p><p><strong>8. Query the start of authority.</strong></p><pre>dig example.com SOA</pre><p>Expect: one record with seven fields after the type, in order: primary nameserver, admin contact, serial, refresh, retry, expire, minimum TTL. The contact is an email address with the @ written as a dot: dns.example.com. means dns@example.com.</p><p><strong>9. Attempt a zone transfer.</strong></p><pre>NS=$(dig +short example.com SOA | awk &#39;{print $1}&#39;)<br>dig axfr @&quot;$NS&quot; example.com</pre><p>The first line pulls the primary nameserver out of the SOA so you don&#39;t retype it. Expect: a short header, then ; Transfer failed. No records, no reason. That is the correct result; a successful transfer would return every record in the zone.</p><p><strong>10. Watch a TTL count down.</strong></p><pre>dig +noall +answer example.com A<br>sleep 10<br>dig +noall +answer example.com A</pre><p>Expect: the same record twice, the TTL roughly ten lower the second time. You are reading the remaining life of a cached copy, not a fixed property of the record. If the second number is higher, the cache expired between queries and refilled. Let it reach zero and the next query resets it to the published value.</p><h4>Verification check</h4><pre>dig +short example.com NS</pre><p>Expect: the nameservers, one per line, with the primary from your step 8 SOA among them. If it isn&#39;t, either you queried a different name than you think, or the zone uses a hidden primary that it deliberately doesn&#39;t publish.</p><h4>Troubleshooting</h4><p>; Transfer failed.<strong> looks like a broken command.</strong><br> It isn&#39;t. The nameserver checked whether your address is an authorized secondary for the zone, found it wasn&#39;t, and refused without explaining. Every competently run provider does this.</p><p><strong>Step 9 times out instead of failing.</strong><br> A timeout or ;; communications error is not a refusal; you never reached the nameserver. AXFR runs over TCP, and your network is blocking outbound TCP 53. Confirm with dig +tcp example.com A; if that also times out, the block is yours, not theirs.</p><p><strong>A bare dot in the MX result looks like a missing record.</strong><br> The opposite. A record type that genuinely doesn&#39;t exist returns an empty ;; ANSWER SECTION: and the zone&#39;s SOA under ;; AUTHORITY SECTION: instead. Check which section your output landed in before concluding a query failed.</p><p><strong>The TTL is identical in both step 10 queries.</strong><br> Your resolver isn&#39;t caching, or you queried an authoritative server directly, which always returns the published value. Check the ;; SERVER: line from step 3: if it&#39;s a local address like 127.0.0.53, caching is happening and the countdown should appear. If it&#39;s the domain&#39;s own nameserver, drop the @ argument.</p><p><strong>Your output doesn&#39;t match the samples here.</strong><br> Expected. Addresses, nameservers, serials, and TTLs change over time and by resolver. The shapes hold; the values don&#39;t.</p><h4>Closing</h4><p>The SOA-then-AXFR sequence is the pattern worth keeping: the SOA names the primary nameserver, and that&#39;s the host you point the transfer attempt at. You&#39;ll get ; Transfer failed. almost every time. It stays in the routine for the occasional self-hosted or legacy server that answers with its entire infrastructure map.</p><p>Drafted and revised with Claude; every command tested by me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdf34620380f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>