Invalid URI Redirection with Apache mod_rewrite Logo

Invalid URI Redirection with Apache mod_rewrite

0
Free
Updated 11 March 2025
Visit Website

There have been times when a curious phish recipient or a zealous help desk staff has loaded the phishing link in their browser and decided to take a peek at a higher directory or the root domain. Of course, most times there isn’t much else site to see. In those cases, the chances of being reported to IR went up significantly, sometimes leading to a phishing campaign being blocked. This is where invalid URI redirection comes in handy. We can whitelist resources the Apache server will proxy for the targets and redirect any other requests to the target’s real domain or another page of our choosing. In the demo below, the user navigates to spoofdomain.com/really/long/url.html and is served a page; however, when the user navigates to spoofdomain.com/really/ the browser is redirected to google.com. RewriteEngine On RewriteCond %{REQUEST_URI} ^/(profiler|payload)/?$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://SPOOFED-DOMAIN.com [NC] RewriteRule ^.*$ http://TEAMSERVER-IP%{REQUEST_URI} [P] RewriteRule ^.*$ http://REDIRECTION-URL.com/? [L,R=302] Line by line explanation: Enable the rewrite engine If the request's URI is either '/profiler' or '/payload' (with an optional trailing slash), ignoring case; OR If the request's referer starts with 'http://SPOOFED-DOMAIN.com', ignoring case;

FEATURES

SIMILAR TOOLS

Dynamic application security testing tool for identifying and fixing web application vulnerabilities.

A tool for identifying potential security vulnerabilities in dependency configurations by checking for lingering free namespaces for private package names.

Yara Based Detection for web browsers

DOMPurify is a fast XSS sanitizer for HTML, MathML, and SVG.

A set of 48 practical programming exercises in cryptography and application security

An IDE-integrated AI security solution that detects, remediates, and educates about code vulnerabilities in real-time as developers write code.

A browser with XSS detection capabilities

A static code analysis tool for parsing common data formats to detect hardcoded credentials and dangerous functions.

A web application firewall and API security platform that combines API discovery, runtime protection, vulnerability testing, and security posture management.

CyberSecTools logoCyberSecTools

Explore the largest curated directory of cybersecurity tools and resources to enhance your security practices. Find the right solution for your domain.

Operated by:

Mandos Cyber • KVK: 97994448

Netherlands • contact@mandos.io

VAT: NL005301434B12

Copyright © 2025 - All rights reserved