<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CyberJson</title>
    <description>The latest articles on DEV Community by CyberJson (@cyberjson).</description>
    <link>https://dev.to/cyberjson</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3189965%2Fc776c304-5344-4d7b-8894-17a203dcf413.jpg</url>
      <title>DEV Community: CyberJson</title>
      <link>https://dev.to/cyberjson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cyberjson"/>
    <language>en</language>
    <item>
      <title>Hunting for Web Cache Deception Vulnerabilities with a Custom Bash Script</title>
      <dc:creator>CyberJson</dc:creator>
      <pubDate>Wed, 21 May 2025 12:21:19 +0000</pubDate>
      <link>https://dev.to/cyberjson/hunting-for-web-cache-deception-vulnerabilities-with-a-custom-bash-script-3ccp</link>
      <guid>https://dev.to/cyberjson/hunting-for-web-cache-deception-vulnerabilities-with-a-custom-bash-script-3ccp</guid>
      <description>&lt;p&gt;Author:&lt;a href="https://instagram.com/m0x_mw4_d" rel="noopener noreferrer"&gt;@m0x_mw4_d&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 Introduction&lt;/p&gt;

&lt;p&gt;In the ever-evolving world of web application security, Web Cache Deception (WCD) remains an underrated but impactful vulnerability. Discovered by Omer Gil in 2017, this class of bugs can expose sensitive information by tricking caching mechanisms into storing and serving private data.&lt;/p&gt;

&lt;p&gt;While many tools exist for automated scanning, they often lack customization, scalability, or OS-specific handling for bug bounty hunters and penetration testers. That’s why I built a multi-threaded, Bash-powered Web Cache Deception scanner under my personal toolkit banner — CyberJsonTools.&lt;/p&gt;

&lt;p&gt;In this article, I’ll break down the script, explain how it works, and show you how to use it for effective cache deception testing on your targets.&lt;br&gt;
⚡️ What Is Web Cache Deception?&lt;/p&gt;

&lt;p&gt;A Web Cache Deception vulnerability occurs when a public cache stores private or user-specific content, usually because an attacker manipulates the URL or request headers in a way that bypasses cache exclusion rules. Once cached, this sensitive content might become accessible to other users or attackers.&lt;/p&gt;

&lt;p&gt;Example Scenario:&lt;br&gt;
A URL like &lt;code&gt;https://target.com/profile&lt;/code&gt; is meant for authenticated users only. However, accessing &lt;code&gt;https://target.com/profile.jpg&lt;/code&gt; might return a cached response due to the &lt;code&gt;.jpg&lt;/code&gt; extension — potentially exposing private user data.&lt;br&gt;
🛠️ Script Features&lt;/p&gt;

&lt;p&gt;✅ Bash 4+ compatibility check with auto-install via Homebrew (on macOS)&lt;br&gt;
✅ GNU parallel dependency check and installation&lt;br&gt;
✅ Multi-threaded URL testing with customizable concurrency&lt;br&gt;
✅ 45+ common file extensions and 45+ query parameters tested for cache deception behavior&lt;br&gt;
✅ 40+ custom headers and header values sent with each request&lt;br&gt;
✅ 20 top User-Agents for rotation in requests&lt;br&gt;
✅ Detects Cache-Control: public and cache HIT responses via X-Cache or CF-Cache-Status headers&lt;br&gt;
✅ Results logged to a clean, timestamped log file&lt;br&gt;
📦 Dependencies&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`Bash 4+
GNU parallel
curl`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The script auto-installs Bash and GNU parallel on macOS if missing.&lt;br&gt;
📑 How It Works&lt;/p&gt;

&lt;p&gt;1️⃣ Environment Setup&lt;br&gt;
The script ensures the environment is suitable by verifying Bash version and GNU parallel installation.&lt;/p&gt;

&lt;p&gt;2️⃣ URL and Payload Generation&lt;br&gt;
It takes a list of base URLs and appends 45+ file extensions and 45+ parameters commonly used to trigger caching mechanisms.&lt;/p&gt;

&lt;p&gt;3️⃣ Request Execution with Multi-threading&lt;br&gt;
Each generated URL is tested concurrently using parallel with:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`Random User-Agent from a list of 20
Standard request
Requests with 45+ different HTTP headers and values`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;4️⃣ Response Analysis&lt;br&gt;
The response headers are checked for:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`Cache-Control: public
X-Cache: HIT
CF-Cache-Status: HIT`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;If found, the endpoint is flagged as potentially vulnerable.&lt;/p&gt;

&lt;p&gt;5️⃣ Reporting&lt;br&gt;
Results are neatly logged to a file named &lt;code&gt;cyberjson_wcd_results.log&lt;/code&gt;, including request headers, response headers, and vulnerability status.&lt;br&gt;
🔥 How to Use It&lt;/p&gt;

&lt;p&gt;1️⃣ Prepare a file with target base URLs:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://target.com/&lt;br&gt;
https://target.com/private/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2️⃣ Run the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash cyberjson_web_cache_tester.sh &amp;lt; urls.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3️⃣ Review the results:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Check `cyberjson_wcd_results.log`
Look for [!!!] markers indicating vulnerabilities.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;📊 Sample Log Output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[+] URL: https://target.com/private/profile.jpg
Cache-Control: public
X-Cache: HIT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[!!!] &lt;a href="https://target.com/private/profile.jpg" rel="noopener noreferrer"&gt;https://target.com/private/profile.jpg&lt;/a&gt; is VULNERABLE to Web Cache Deception!&lt;/p&gt;

&lt;p&gt;🎯 Why Build This Tool?&lt;/p&gt;

&lt;p&gt;I built this script to address limitations I found in existing WCD scanners:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Lack of header manipulation tests
No User-Agent rotation
Inability to run multi-threaded scans via Bash
Poor OS support detection, especially for macOS setups in bug bounty workflows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This tool can be a reliable companion for hunters on platforms like HackerOne, Bugcrowd, or Intigriti.&lt;br&gt;
📌 Conclusion&lt;/p&gt;

&lt;p&gt;Web Cache Deception vulnerabilities are easy to overlook but can lead to serious data leaks. With the CyberJsonTools Web Cache Deception scanner, you can efficiently test for these issues across multiple endpoints using a fast, multi-threaded Bash workflow.&lt;br&gt;
📬 Get the Script&lt;/p&gt;

&lt;p&gt;📖 Full code &amp;amp; updates: [GitHub Repository — &lt;a href="https://github.com/cyberjsonp" rel="noopener noreferrer"&gt;CyberJsonP&lt;/a&gt;]&lt;br&gt;
🖥️ Follow me on &lt;a href="https://x.com/m0x_mw4_d" rel="noopener noreferrer"&gt;X (Twitter)&lt;/a&gt; for bug bounty tips and tools.&lt;br&gt;
🔗 Related Resources&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Web Cache Deception Research by Omer Gil
HackerOne — WCD Reports
Burp Suite Web Cache Deception Cheat Sheet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;📣 Feedback &amp;amp; Collaboration&lt;/p&gt;

&lt;p&gt;I’d love to hear your thoughts or ideas for improving this tool!&lt;br&gt;
Feel free to reach out on &lt;a href="https://x.com/m0x_mw4_d" rel="noopener noreferrer"&gt;X (Twitter)&lt;/a&gt; or comment on this post.&lt;/p&gt;

</description>
      <category>webcachedeception</category>
      <category>bashscript</category>
      <category>hackertools</category>
      <category>huntertools</category>
    </item>
  </channel>
</rss>
