Lab 5: HTTP Redirect Protection

Connect to the lab environment

  1. From the jumphost, launch Chrome, click the BIG-IP bookmark and login to TMUI. admin/password
  2. Open a second tab for use with the Hackazon App

Test HTTP Redirection Behavior

  1. Browse to http://hackazon.local/user/login
  2. Login as ‘f5student’ with the proper password using the “Sign-in” link in the top right.
  3. You are logged in normally and now see your account.
  4. Click the “Logout” button in the top right.
  5. Browse to http://hackazon.local/user/login?return_url=http://webgoat.local/WebGoat/login and login again as ‘f5student’ with the proper password.

Note

Upon successful login you are taken to the WebGoat site. Any URL can be placed in the “return_url” parameter and the Hackazon site will redirect the user to it after they login. This is commonly used in phishing attacks to get the user to visit malicious sites.


Edit the hackazon_asm241 Security Policy

  1. On the BIG-IP TMUI Go to Security > Application Security > Headers > Redirection Protection.
  2. Verify that the “Current edited security policy” says “hackazon_asm241 (blocking)”.
  3. The policy currently allows for redirection to any domain.

../../../_images/httpredir.png

Note

This is the default behavior for a fundamental security policy and should always be adjusted for your Application


  1. Add redirection protection to the policy by only allowing the site domain name. In the Domain Name field, type “hackazon.local” and click “Add”.
  2. Click the checkbox next to “*” and click the Delete button.

../../../_images/httprediradd.png

  1. Click Save, then click Apply Policy and OK

Test HTTP Redirection Protection

  1. Browse again to http://hackazon.local/user/login?return_url=http://webgoat.local/WebGoat/login

Note

you may have to logout first and then go to the URL again. Even though you were redirected to the other site, you were still logged in to Hackazon.


  1. Login again as ‘f5student’ with the proper password.
  2. You should get a block page.

../../../_images/blocked.png

  1. On the BIG-IP, go to Security > Event Logs > Application > Requests.
  2. You should see the HTTP redirect event, “Illegal redirection attempt”, blocked and logged.

../../../_images/redir_illegal.png