pt0 002 13
pt0 002 13
Exam PT0-002
Lesson 13
Web Application-Based Attacks
Topic 13A
Recognize Web Vulnerabilities
5
Exposing Sensitive Data
• Security measurements for web resources may leave gaps that leave
data exposed and vulnerable.
• Vulnerabilities include insecure default configurations, open cloud
storage, misconfigured HTTP headers, and verbose error messages
• This exposure could provide the attacker with further details to
research and other vectors to analyze and possibly exploit
• This is referenced as OWASP Top Ten A6:2017-Security Misconfiguration.
6
Improperly Handling Errors
• Developers add code to handle errors, ensure continuity, and
provide informative error output.
• However, error output can provide the team with key details about
the underlying technology.
• Other times the error contains references to the location of files
related to the web application
• This is referenced as OWASP Top Ten A3:2017-Sensitive Data Exposure.
7
Missing Input Validation
• When user-supplied data is processed by the web application
without proper validation, this can leave the system exposed
• Missing input validation can lead to injection attacks, such as SQL,
NoSQL, OS, and LDAP injection
• This can then allow a malicious actor to execute commands or
access data without authorization
• This is referenced as OWASP Top Ten A1:2017-Injection.
8
Signing and Verifying Code
• In order to confirm that a script or executable has not been
tampered with, developers create digital signature
• Using the developer's private key
9
Causing a Race Condition
• Race conditions occur when the outcome from execution processes
is directly dependent on the order and timing of certain events.
• Issues can arise if these events fail to execute in the order and
timing intended by the developer.
• For example, an app can check that a file exists and then use it later.
• You may be able to replace the file after it is checked but hasn’t been used.
• This can then trigger app instability or privilege escalation.
10
Review Activity: Recognize Web Vulnerabilities
• Outline the significance of the OWASP Top 10
• List ways developers can inadvertently expose sensitive data
• Review the consequences of improperly handling errors
• Discuss what could happen when there is a lack of input validation
• Explain why it’s good practice to sign and verify code, scripts and
executables
• Describe what happens in a race condition
11
Lesson 13
Topic 13B
Launch Session Attacks
13
Crafting Request Forgery Attacks (XSRF/CSRF)
• A XSRF/CSRF attack takes advantage the trust that remote sites have
in a user’s system to execute commands on the user’s behalf.
• Takes advantage of the saved authentication data stored inside the cookie to
gain access to a web browser's sensitive data.
• For example, the target page has a form with a Remember Me check
box, which then creates a stored cookie
• The cookie is then used for authentication when they access the site.
• You can exploit this trust and leverage the user's privileges
14
Escalating Privilege
• Horizontal Privilege Escalation - gaining access to an account with
different access or permissions than the one currently in use.
• This approach reduces the risk of raising suspicion
15
Upgrading a Non-Interactive Shell
• A non-interactive (or restricted) shell is limited in use, in that, unlike
an interactive shell, has minimal functionality:
• You can’t press the up-arrow key to display prior commands; or when
pressing TAB, the command does not auto-complete
• You can’t move through the system, discover directories, or redirect
output.
16
Exploiting Business Logic Flaws
• Business logic flaws are vulnerabilities that arise from faulty design
and implementation issues that can lead to unintended behavior.
• For example, a poorly implemented method to lock accounts after successive
failures to authenticate.
• Common types of services that are exploited due to business logic flaws are
APIs, that include RESTful, XML-RPC and SOAP
17
Review Activity: Launch Session Attacks
• Compare the different forms of session hijacking
• Provide an overview of Request Forgery Attacks
• Discuss ways the team can escalate privilege
• Outline why the team would need to upgrade a non-interactive
shell
• Explain why it’s essential to identify and mitigate business logic
flaws
18
Lab Activity
Assisted Lab: Exploiting Web • Lab types
Authentication • Assisted labs guide you step-by-step through tasks
• Save lab
• Select the hamburger menu and select “Save”
19
Lesson 13
Topic 13C
Plan Injection Attacks
• Certain web app APIs allow you to stack multiple queries in the
same call.
• You can use this to obtain data from other tables that might not be directly
exposed by the app.
• It’s most effective when you're able to navigate all the way back to the root
and execute any command or program in any folder on the computer.
22
Injecting Code
• Injection attacks can compromise an app in several ways:
• Cause a DoS, escalate privileges, deface a website
23
Executing a Cross-Site Scripting (XSS) Attack
• A XSS attack is an attack which injects JavaScript that executes on
the client's browser, and can result in the following:
• Change the contents of a page, steal session cookies, read sensitive
information or inject malware that can execute on the user's computer.
• The client never has direct contact with the server, which improves security
• Advanced proxy servers today can include firewall and web filters,
along with web caching and helps protect against attacks
• As a result, if the customer is using a web proxy, the team need to
adjust the PenTest accordingly.
25
Review Activity: Plan Injection Attacks
• Outline why the team should test for SQLi vulnerabilities
• Review how to traverse files using invalid input
• Discuss how injection attacks can compromise an app
• Describe some of the types of XSS attacks
• Explain why the team may need to adjust the PenTest if the
customer is using a web proxy
26
Lab Activity
Assisted Lab: Exploiting Weaknesses • Lab types
in a Database • Assisted labs guide you step-by-step through tasks
• Save lab
• Select the hamburger menu and select “Save”
27
Lesson 13
Topic 13D
Identify Tools
• Credential lookup tools and proxies that allow you to manipulate and fine-
tune requests
• Examples include:
• WPScan - Automatically gathers data about a WordPress site and compares
findings such as plugins against a database of known vulnerabilities.
• CrackMapExec - Post-exploitation tool to identify vulnerabilities in active
directory environments.
29
Exploring the Browser Exploit Framework (BeEF)
• BeEF is a tool designed to exploit some functionality within a
browser to launch XSS and injection attacks against a website.
• The goal is to gain access, gather information, use a proxy, and other utilities
for the PenTester.
30
Exploiting a Browser with BeEF
• On the left side BeEF’s main window, you will see a list of Hooked
Browsers. Within the section, there are two folders displayed:
• Online informs you that the device is available and awaiting instructions.
31
Displaying Information in BeEF
• Selecting an IP address is selected will display tabs on the right:
• Details, Logs and Commands.
• BeEF will indicate which modules will work against the target by
using different colors.
32
Review Activity: Identify Tools
• Compare differences in web testing tools and list some examples
• Discuss how Browser Exploit Framework (BeEF) can be used to test
web browsers
• Explain how the team will move through exploiting a browser with
BeEF
• Describe how BeEF displays information on hooked browsers
33
Lab Activity
Assisted Lab: Performing an AitM • Lab types
Attack • Assisted labs guide you step-by-step through tasks
• Complete lab
• Submit all items for grading and check each progress box
• Save lab
• Select the hamburger menu and select “Save”
34
Lesson 13
Summary