The Spanner is Back: Revisiting Classic Web Hacking Techniques

Listen to this Post

Gareth Heyes, a researcher at PortSwigger Web Security, has revived his blog, “The Spanner,” after transitioning from WordPress to a custom blogging system. The blog dives into the golden era of web hacking, revisiting classic techniques like mXSS, DOM Clobbering, and RPO, along with other vintage research gems. For those interested in cybersecurity, this is a treasure trove of knowledge.

Read the full article here: thespanner.co.uk

You Should Know:

1. mXSS (Mutation Cross-Site Scripting)

mXSS occurs when user input is mutated by the browser’s HTML parser, leading to unexpected XSS vulnerabilities. This often happens due to inconsistencies in how browsers handle HTML sanitization.

Practice Code:

<!-- Example of mXSS -->

<div>
<img src="x" onerror="alert(1)">
</div>

In some browsers, the above code might mutate and execute the `onerror` event, leading to XSS.

Prevention:

  • Use a robust HTML sanitizer like DOMPurify.
  • Always validate and sanitize user input on both client and server sides.

2. DOM Clobbering

DOM Clobbering is an attack where attackers inject HTML elements to overwrite JavaScript variables or functions in the DOM.

Practice Code:

<!-- Example of DOM Clobbering -->

<form id="settings">
<input name="action" value="evil">
</form>

<script>
if (settings.action) {
console.log(settings.action); // Outputs "evil"
}
</script>

Here, the `` element clobbers the `settings.action` property.

Prevention:

  • Avoid using global variables directly from the DOM.
  • Use `let` or `const` instead of `var` to limit variable scope.

3. RPO (Relative Path Overwrite)

RPO is a technique where an attacker manipulates relative URLs to load malicious resources.

Practice Code:

<!-- Example of RPO -->
<link rel="stylesheet" href="styles/main.css">

If the server misinterprets the URL, an attacker could inject malicious CSS.

Prevention:

  • Use absolute URLs for critical resources.
  • Ensure proper URL parsing and validation on the server.

Linux and Windows Commands for Web Security

Linux:

1. Check for open ports:

sudo netstat -tuln

2. Scan for vulnerabilities with Nmap:

nmap -sV --script=vuln target.com

3. Monitor HTTP traffic:

sudo tcpdump -i eth0 port 80

Windows:

1. Check active connections:

netstat -an

2. Scan for vulnerabilities with PowerShell:

Invoke-WebRequest -Uri "http://target.com" | Select-String "vulnerable"

3. Monitor network traffic:

netsh trace start capture=yes

What Undercode Say:

The revival of “The Spanner” is a significant event for the cybersecurity community. Revisiting classic web hacking techniques like mXSS, DOM Clobbering, and RPO provides valuable insights into the evolution of web security. These techniques, though old, are still relevant in modern web applications. By understanding and practicing these concepts, security professionals can better defend against sophisticated attacks. Always remember to validate, sanitize, and monitor your applications to stay ahead of attackers.

Expected Output:

  • The Spanner is Back: Revisiting Classic Web Hacking Techniques
  • URL: thespanner.co.uk
  • Key Techniques: mXSS, DOM Clobbering, RPO
  • Commands:
  • Linux: netstat, nmap, `tcpdump`
  • Windows: netstat, Invoke-WebRequest, `netsh`
  • Conclusion: Understanding classic web hacking techniques is crucial for modern cybersecurity. Practice and implement robust security measures to protect your applications.

References:

Reported By: Gareth Heyes – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image