This article describes how to configure protection policy to prevent Man-in-the-Browser (MiTB) attacks. Man-in-the-Browser (MiTB) attacks utilize a Trojan horse that infects a web browser and manipulates calls between the browser and its security mechanisms by taking advantage of browser vulnerabilities to modify web pages, changing content or inserting additional data to ongoing transactions.
FortiWeb 7.0.3, 6.4.2, 6.3.20.
FortiWeb implements security rules including obfuscation, encryption, anti-keylogger, and an AJAX request whitelist.
Step 1: Navigate to Web Protection > Advanced Protection > Man in the Browser Protection in the GUI.
Step 2: Select the Man in the Browser Protection Rule tab
Step 3: Select Create New.
Step 4: Configure the following settings:
- Name: Enter a name that other parts of the configuration can reference.
- Host Status: Enable checking the hostname of the protected website. The rule will only apply when the hostname matches (optional).
- Host: Set the hostname of the protected application. For example, ‘www.example.com’.
- URL Type: Choose from one of the following options.
- Simple String: The field is a string that the request URL must match exactly.
- Regular Expression: The field is a regular expression that defines a set of matching URLs.
- Request URL: The URL that hosts the web page containing the user input fields you want to protect. In this example, the request URL (login URL) is /dvwa/login.php.
- Post URL: This is the URL when the user inputs (e.g. username, password) posted to the web server. In this example, POST URL is same with Request URL.
- Action: Select an action for FortiWeb to take when it detects a violation of the rule.
Step 5: Configure the Protected Parameter Table. Add the ‘Parameter Names’ that should be obfuscated and/or encrypted from the HTML page:
The username/password parameter names can be identified from the Elements view of the developer tools in the browser of the protected application login web page. See the example from the DVWA application below:
Step 6: Create the (MiTB) Protection Policy. Navigate to Web Protection > Advanced Protection > Man in the Browser Protection, select the Man in the Browser Protection Policy tab, then select Create New.
Step 7: In the new Man in the Browser Rule pane, select the MiTB rule created in the previous steps. Multiple MiTB protection rules can be added to one MiTB policy.
Step 8: Assign the MiTB Protection Policy to the Web Protection Profile. This will apply the MiTB Protection Policy rules.