2. Content
╸ Introduction to Hacking Web Applications
╸ Cross-Site Scripting (XSS)
╸ Cross-Site Request Forgery (CSRF)
╸ XML External Entity (XXE)
╸ Injections: SQL Injection& Code Injection
╸ Denial of Service (DoS)
╸ Exploiting Third-Party Dependencies
╸ Web Application Security: Securing Modern Web Applications
╸ Secure Application Architecture
╸ OWASP Top 10 Web Application Security Risks and Tools
3. Introduction to Hacking Web Applications
╸ A web application is a program or software
that runs on a web browser to perform
specific tasks. Any web application has
several layers – the web server, the content
of the application that is hosted on the web
server, and the backend interface layer that
integrates with other applications. Web
application architecture is scalable and has
components that have high availability.
4. Introduction to Hacking Web Applications
╸ Ethical Hacking is the process of appropriating the web
application from its actual use by tinkering in various
ways. The web application hacker needs to have deep
knowledge of the web application architecture to
successfully hack it. To be a master, the hacker needs to
practice, learn and also tinker with the application.
╸ Web application hacking requires tenacity, focus,
attention to detail, observation and interfacing. There
are many types of web application hacking, and many
defense mechanisms available to counter and to
protect the application from being hacked.
5. Web Application Types
╸ Single Page Applications (SPAs)
╸ Web applications have changed a bit in the last
decade or two. Many modern web applications
today are Single Page Applications (SPAs).
Single page applications look like this. All
dynamic data on the page is dynamically
gathered and loaded by client-side JavaScript.
6. Web Application Types
╸ Traditional Web Applications
╸ More traditional web applications typically
look like this: entire pages are refreshed
every time data needs to be updated. The full
responses are typically prepared server-side
and sent to the browser in one big lump:
8. Cross-site Scripting (XSS)
Cross-site scripting (also known as XSS) is a web security vulnerability that allows an
attacker to compromise the interactions that users have with a vulnerable application. It
allows an attacker to circumvent the same origin policy, which is designed to segregate
different websites from each other. Cross-site scripting vulnerabilities normally allow an
attacker to masquerade as a victim user, to carry out any actions that the user is able to
perform and to access any of the user's data. If the victim user has privileged access within
the application, then the attacker might be able to gain full control over all of the
application's functionality and data.
9. Cross-site Scripting (XSS)
How does XSS work?
Cross-site scripting works by
manipulating a vulnerable website so
that it returns malicious JavaScript to
users. When the malicious code
executes inside a victim's browser, the
attacker can fully compromise their
interaction with the application.
11. How to prevent XSS attacks
Preventing cross-site scripting is trivial in some cases but can be much harder depending on the complexity of the application
and the ways it handles user-controllable data.
In general, effectively preventing XSS vulnerabilities is likely to involve a combination of the following measures:
•Filter input on arrival. At the point where user input is received, filter as strictly as possible based on what is expected or valid
input.
•Encode data on output. At the point where user-controllable data is output in HTTP responses, encode the output to prevent it
from being interpreted as active content. Depending on the output context, this might require applying combinations of HTML,
URL, JavaScript, and CSS encoding.
•Use appropriate response headers. To prevent XSS in HTTP responses that aren't intended to contain any HTML or
JavaScript, you can use the Content-Type and X-Content-Type-Options headers to ensure that browsers interpret the responses in
the way you intend.
•Content Security Policy. As a last line of defense, you can use a Content Security Policy (CSP) to reduce the severity of any XSS
vulnerabilities that still occur.