Was-Unit 5 Notes
Was-Unit 5 Notes
UNIT-V
1. SOCIAL ENGINEERING
Definition
• Scams based on social engineering are built around how people think and act. As
such, social engineering attacks are especially useful for manipulating a user’s
behavior. Once an attacker understands what motivates a user’s actions, they can
deceive and manipulate the user effectively.
• In addition, hackers try to exploit a user's lack of knowledge. Thanks to the speed of
technology, many consumers and employees aren’t aware of certain threats like drive-
by downloads. Users also may not realize the full value of personal data, like their
phone number. As a result, many users are unsure how to best protect themselves and
their information.
• Most social engineering attacks rely on actual communication between attackers and
victims. The attacker tends to motivate the user into compromising themselves, rather
than using brute force methods to breach your data.
• The attack cycle gives these criminals a reliable process for deceiving you. Steps for
the social engineering attack cycle are usually as follows:
▪ Prepare by gathering background information on you or a larger group you
are a part of.
▪ Infiltrate by establishing a relationship or initiating an interaction, started
by building trust.
▪ Exploit the victim once trust and a weakness are established to advance the
attack.
▪ Disengage once the user has taken the desired action.
Traits of Social Engineering Attacks
• Social engineering attacks center around the attacker’s use of persuasion and
confidence. When exposed to these tactics, you are more likely to take actions you
otherwise wouldn’t.
Among most attacks, you’ll find yourself being misled into the following behaviors:
Heightened emotions: Emotional manipulation gives attackers the upper hand in an any
interaction. You are far more likely to take irrational or risky actions when in an enhanced
emotional state. The following emotions are all used in equal measure to convince you.
• Fear
• Excitement
• Curiosity
• Anger
• Guilt
• Sadness
Urgency: Time-sensitive opportunities or requests are another reliable tool in an attacker’s
arsenal. You may be motivated to compromise yourself under the guise of a serious problem
that needs immediate attention. Alternatively, you may be exposed to a prize or reward that
may disappear if you do not act quickly. Either approach overrides your critical thinking
ability.
Trust: Believability is invaluable and essential to a social engineering attack. Since the
attacker is ultimately lying to you, confidence plays an important role here. They’ve done
enough research on you to craft a narrative that’s easy to believe and unlikely to rouse
suspicion.
Types of Social Engineering Attacks
Almost every type of cybersecurity attack contains some kind of social engineering.
For example, the classic email and virus scams are laden with social overtones.
Social engineering can impact you digitally through mobile attacks in addition to
desktop devices. However, you can just as easily be faced with a threat in-person. These
attacks can overlap and layer onto each other to create a scam.
1. Phishing Attacks
1. Spam phishing, or mass phishing, is a widespread attack aimed at many users. These attacks
are non-personalized and try to catch any unsuspecting person.
2. Spear phishing and by extension, whaling , use personalized info to target particular users.
Whaling attacks specifically aim at high-value targets like celebrities, upper management,
and high government officials.
Examples of Social Engineering Attacks
2. Worm Attacks
The cybercriminal will aim to attract the user’s attention to the link or infected file – and
then get the user to click on it.
• The LoveLetter worm that overloaded many companies’ email servers in 2000. Victims
received an email that invited them to open the attached love letter. When they opened the
attached file, the worm copied itself to all of the contacts in the victim’s address book. This
worm is still regarded as one of the most devastating, in terms of the financial damage that it
inflicted.
• The Mydoom email worm — which appeared on the Internet in January 2004 — used texts
that imitated technical messages issued by the mail server.
• The Swen worm passed itself off as a message that had been sent from Microsoft. It claimed
that the attachment was a patch that would remove Windows vulnerabilities. It’s hardly
surprising that many people took the claim seriously and tried to install the bogus security
patch — even though it was really a worm.
2. INJECTION
• One of the most commonly known types of attacks against a web application is SQL
Injection. SQL injection is a type of injection attack that specifically targets SQL
databases, allowing a malicious user to either provide their own parameters to an
existing SQL query, or to escape an SQL query and provide their own query.
• Naturally, this typically results in a compromised database because of the escalated
permissions the SQL interpreter is given by default. SQL injection is the most
common form of injection, but not the only form. Injection attacks have two major
components: an interpreter and a payload from a user that is somehow read into the
interpreter. This means that injection attacks can occur against command-line utilities
like FFMPEG (a video compressor) as well as against databases (like the traditional
SQL injection case).
• Let’s take a look at several forms of injection attacks so that we can get a good
understanding of what type of application architecture is required for such an attack to
work, and how a payload against a vulnerable API could be formed and delivered.
SQL Injection
SQL injection is the most classically referenced form of injection (see Figure 13-1).
An SQL string is escaped in an HTTP payload, leading to custom SQL queries being
executed on behalf of the end user.
3.Cross-Site Scripting(XSS)
• Cross-Site Scripting (XSS) vulnerabilities are some of the most common
vulnerabilities throughout the internet, and have appeared as a direct response to the
increasing amount of user interaction in today’s web applications.
• At its core, an XSS attack functions by taking advantage of the fact that web
applications execute scripts on users’ browsers. Any type of dynamically created
script that is executed puts a web application at risk if the script being executed can be
contaminated or modified in any way—in particular by an end user. XXS attacks are
categorized a number of ways, with the big three being:
1. Stored (the code is stored on a database prior to execution)
2. Reflected (the code is not stored in a database, but reflected by a server)
3. DOM-based (code is both stored and executed in the browser)
• There are indeed categorical variations beyond this, but these three encompass the
types of XSS that most modern web applications need to look out for on a regular
basis. These three types of XSS attacks have been designated by committees like the
Open Web Application Security Project (OWASP) as the most common XSS attack
vectors on the web.
XSS Discovery and Exploitation
• Imagine you are unhappy with the level of service provided by mega-bank.com.
Fortunately for you, mega-bank.com offers a customer support portal, support.
Megabank.Com, where you can write feedback and hopefully hear back from a
customer support representative.
You write a comment in the support portal, with the following text:
I am not happy with the service provided by your bank.
I have waited 12 hours for my deposit to show up in the web application.
Please improve your web application.
Other banks will show deposits instantly.
—Unhappy Customer, support.mega-bank.com
• Now, in order to emphasize how unhappy you are with this fictional bank, you decide
you want to bold a few words. Unfortunately the UI for submitting support requests
does not support bolding text.
Because you are a little bit tech savvy, you try to add in some HTML bold tags:
I am not happy with the service provided by your bank.
I have waited 12 hours for my deposit to show up in the web application.
<strong>Please improve your web application.</strong>
Other banks will show deposits instantly.
—Unhappy Customer, support.mega-bank.com
After you press Enter, your support request is shown to you. The text inside the
<strong></strong> tags has been bolded.
A customer support representative soon messages you back:
Hello, I am Sam with MegaBank support.
I am sorry you are unhappy with our application.
We have a scheduled update next month on the fourth that should increase the speed
at which deposits are reflected in our app.
By the way, how did you bold that text?
—Sam from Customer Support, support.mega-bank.com
What is happening here is actually pretty common in many web applications. Here we have a
very simple architectural mistake that can be deadly to a company if left alone until a hacker
finds it.
user submits comment via web form ->
user comment is stored in database ->
comment is requested via HTTP request by one or more users ->
comment is injected into the page ->
injected comment is interpreted as DOM rather than text
Usually this happens as a result of a developer literally applying the result of the
HTTP request to the DOM. Frequently this is done by a script like the following:
/*
* Create a DOM node of type 'div.
* Append to this div a string to be interpreted as DOM rather than text.
*/
const comment = 'my <strong>comment</strong>';
const div = document.createElement('div');
div.innerHTML = comment;
/*
* Append the div to the DOM, with it the innerHTML DOM from the comment.
* Because the comment is interpreted as DOM, it will be parsed
* and translated into DOM elements upon load.
*/
const wrapper = document.querySelector('#commentArea');
wrapper.appendChild(div);
Because the text is appended literally to the DOM, it is interpreted as DOM markup
rather than text. Our customer support request included a <strong></strong> tag in this case.
Stored XSS
• Stored XSS attacks are probably the most common type of XSS attack. Stored XSS
attacks are interesting because they are the easiest type of XSS to detect, but often one
of the most dangerous because many times they can affect the most users (see Figure
10-1).
Figure 10-2. In reflected XSS, a user performs an action against the local web
application resulting in script execution of an unstored (linked) on their own device
• As a result of not being stored on the server, reflected XSS can be a bit hard to
understand compared to stored XSS. Let’s start out with an example. We are once
again a customer of a fictional bank with a web application located at mega-
bank.com.
• This time, we are trying to look up support documentation for how to open a new
savings account to complement our existing checking account. Fortunately, mega-
bank.com’s support portal, support.mega-bank.com, has a search bar we can use to
look up common support requests and their solutions.
• The first thing we try is a search for “open savings account.” This search redirects us
to a new URL at support.mega-bank.com/search?query=open+savings+account. On
this search results page we see the heading: 3 results for “open savings account.” Next
we try adjusting the URL to support.mega-bank.com/search?query=open+checking+
account. The heading on the results page now becomes: 4 results for “open checking
account.”
DOM-Based XSS
• The final major categorization for XSS attacks is DOM-based XSS, illustrated in
Figure 10-3. DOM XSS can be either reflected or stored, but makes use of browser
DOM sinks and sources for execution. Due to differences in browser DOM
implementation, some browsers might be vulnerable while others are not.
• These XSS attacks are much more difficult to find and take advantage of than
traditional reflected or stored XSS, as they require deep knowledge of the browser
DOM and JavaScript.
• CSRF attacks take advantage of the way browsers operate and the trust relationship
between a website and the browser. By finding API calls that rely on this relationship
to ensure security—but yield too much trust to the browser—we can craft links and
forms that with a little bit of effort can cause a user to make requests on his or her
own behalf—unknown to the user generating the request.
• Oftentimes CSRF attacks will go unnoticed by the user that is being attacked—as
requests in the browser occur behind the scenes.
Query Parameter Tampering
• Let’s consider the most basic form of CSRF attack—parameter tampering via a
hyperlink. Most forms of hyperlink on the web correspond with HTTP GET requests.
The most common of which is simply an <a href="https://my-site.com"></a>
embedded in an HTML snippet.
• The anatomy of an HTTP GET request is simple and consistent regardless of where it
is sent from, read from, or how it travels over the network. For an HTTP GET to be
valid, it must follow a supported version of the HTTP specification—so we can rest
assured that the structure of a GET request is the same across applications.
Figure 11-2. CSRF IMG—inside of the target application, an <img> tag is posted that
forces an HTTP GET when loaded
Likewise, most other HTML tags that allow a URL parameter can also be used to
make malicious GET requests. Consider the HTML5 <video></video> tag:
<!-- Videos typically load into the DOM immediately, depending on the browser's
configuration. Some mobile browsers will not load until the element is interacted
with. -->
<video width="1280" height="720" controls>
<source src="https://www.mega-bank.com/transfer?
to_user=<hacker's account>&amount=10000" type="video/mp4">
</video>
• The preceding video functions identically to the image tag used. As such, it’s
important to be on the lookout for any type of tag that requests data from a server via
an src attribute. Most of these can be used to launch a CSRF attack against an
unsuspecting end user.
CSRF Against POST Endpoints
• Typically CSRF attacks take place against GET endpoints, as it is much easier to
distribute a CSRF via a hyperlink, image, or other HTML tag that initiates an HTTP
GET request automatically.
• However, it is still possible to deliver a CSRF payload that targets a POST, PUT, or
DELETE endpoint. Delivery of a POST payload just requires a bit more work as well
as some mandatory user interaction (see Figure 11-3).
Typically CSRF attacks delivered by POST requests are created via browser forms, as
the <form></form> object is one of the few HTML objects that can initiate a POST
request without any script required.
<form action="https://www.mega-bank.com/transfer" method="POST">
<input type="hidden" name="to_user" value="hacker">
<input type="hidden" name="amount" value="10000">
<input type="submit" value="Submit">
</form>
In the case of CSRF via POST form, we can make use of the “hidden” type attribute
on form inputs in order to seed data that will not be rendered inside of the browser.
Figure 11-3. CSRF POST—A form is submitted targeting another server that is not
accessible to the creator of the form but is to the submitter of the form
We can further manipulate the user by offering legitimate form fields in addition to
the hidden fields that are required to design the CSRF payload:
<form action="https://www.mega-bank.com/transfer" method="POST">
<input type="hidden" name="to_user" value="hacker">
<input type="hidden" name="amount" value="10000">
<input type="text" name="username" value="username">
<input type="password" name="password" value="password">
<input type="submit" value="Submit">
</form>
• In this example, the user will see a login form—perhaps to a legitimate website. But
when the form is filled out, a request will actually be made against MegaBank—no
login attempt to anything will be initiated.
• This is an example of how legitimate-looking HTML components can be used to send
requests taking advantage of the user’s current application state in the browser. In this
case, the user is signed into MegaBank, and although they are interacting with an
entirely different website, we are able to take advantage of their current session in
MegaBank to perform elevated operations on their behalf.
• This technique can also be used to make requests on behalf of a user who has access
to an internal network. The creator of a form cannot make requests to servers on an
internal network, but if a user who is on the internal network fills out and submits the
form, the request will be made against the internal server as a result of the target
user’s elevated network access.
• Naturally, this type of CSRF (POST) is more complex than seeding a CSRF GET
request via an <a></a> tag—but sometimes you must make an elevated request
against a POST endpoint in which case forms are the easiest way of successfully
making an attack.
5. BROKEN AUTHENTICATION AND SESSION MANAGEMENT
Broken authentication is often the result of weaknesses in access controls and session
management. Some common weaknesses include weak password policies, unencrypted
traffic, and poor logout mechanisms and timeouts.
Factors of authentication
Before we can talk about weak passwords, we should mention factors of authentication. A
password, for example, is one kind of authentication factor.
• Forgotten passwords can actually be a major risk for user account authentication.
Even though many users and businesses rely on this feature, it isn’t always secure.
Attackers can actually benefit from weak “forgot username” or “forgot password”
features on an otherwise secure website.
• In this example, an attacker uses a “Forgot Password” page and enters the username
of their target. The “Forgot Password” page then sends a 6-digit secret code to the
account owner that expires in 15 minutes.
• Even though the feature makes sure the secret code expires, there are no limits on the
number of attempts someone can enter the code. The attacker could easily brute force
the code by entering all possibilities for the 6 digits within those 15 minutes.
• HTTP is the language we use to talk on the web and is important to understand before
we discuss session management. There are different versions of HTTP, but in general,
you can think of HTTP as working through requests and responses.
• HTTP requests contain a lot of information that helps applications track state and user
session management. Each HTTP request contains a goldmine of information that can
be traced like a trail of breadcrumbs if unprotected.
• This information is stored in cookies on the client-side, and in session IDs, also called
session tokens, on the server-side. Session cookies, one of many types of cookies,
contain a session ID.
• Session cookies and session IDs have the same goal, and help to keep state. They
store information about your interaction with a web site, but cookies are stored in
your browser, whereas a session ID is a string of random numbers and letters that
must be sent on every request. Cookies don’t expire until you close the browser, but
session IDs can time out.
• Session IDs are a representation of the user and their actions on the web. For instance,
session IDs can have data about whether a user is logged in, has items in a shopping
cart, or has timed-out their session. In fact, the only defining feature of what identifies
a user on the web is their session ID.
• Unencrypted or clear-text traffic is any web traffic sent through an insecure channel
that isn’t encrypted. Clear-text traffic is highly vulnerable to man-in-the-middle
attacks because it isn’t protected and can be read by anyone who intercepts it using
various techniques.
• If a hacker comes along and intercepts unencrypted web traffic, then they could steal
session ID and impersonate a user. Remember, the session ID is the only thing that
identifies users, so if a hacker steals this, the webserver can no longer tell the
difference between a legitimate user and the hacker.
• We all know about insecure WiFi and using an unsecured public WiFi connection,
Let’s look at an example of how session hijacking can work.
• ‘Vijay Kumar’ is a sales executive and browsing his recent sales transactions on a
local coffee shop’s free wireless connection. Vijay’s connection on the public WiFi is
over HTTP, which doesn’t use encryption.
• Meanwhile, a mischievous computer expert is also sitting at the coffee shop and
intercept Vijay’s network traffic using special tools and successfully retrieve its
session ID from unencrypted network traffic.
• The hacker simply copies the session ID into his/her own browser, and since Vijay
has already authenticated, he is able to log in. Since, they are both using the same
session ID, as long as Vijay doesn’t log out, the hacker will have access using the
same session ID.
Session fixation
• Sessions can also be vulnerable to session fixation attacks. This happens when an
attacker fixes, or forces, a session they already know onto an unsuspecting user. If the
user authenticates with the fixed session, the attacker can then use it with all of the
same privileges as that user.
• For example, rather than attempting to hijack a user’s session, an attacker can
purposely expose a link with their session identifier to a known administrator. When
the administrator logs in, the session becomes active with administrator privileges.
• However, the attacker also has access to the fixed session ID, so the attacker’s session
is also active.
Countermeasures against Broken Authentication
• As we learned about factors of authentication in the above sections of this article and
by combining different factors of authentication, the web application can overcome
from unique weaknesses.
• For example, the Administrator can combine knowledge with possession-based
authentication to overcome a weakness in a password being guessed or a token being
lost.
• Using two different factors of authentication together is called 2-factor authentication,
and many organizations are improving their security by using two or more factors for
their authentication.
• While implementing the forgot password feature, considering some of the above-
mentioned countermeasures can help by adding layers of defense against hackers.
• Treat the forgot password feature with the same importance as authentication by
adding aspects such as complexity to any secret challenges or even 2 Factor
Authentication.
Session timeout
• Setting a reasonable session timeout can help ensure that attackers who steal session
IDs have a limited timeframe to use them in.
• A session timeout can depend on the security profile of the application. 5-10 minutes
may be reasonable, but the organization should decide based on risk.
• Another option is to implement an absolute timeout so that even if a session is stolen,
forcing a logoff after a fixed time ensures that all sessions eventually expire.
• Finally, before any new user session is authorized, any existing session IDs should be
invalidated. This prevents session fixation.
Network encryption
• Encrypting traffic using SSLJTLS is another way to protect user information and is
becoming more common. In a previous example, we saw how a hacker could
intercept web traffic and steal session data, but if traffic is encrypted, this is no longer
possible, or at least very difficult.
Encryption is a good first defense against session hijacking.
Account lockout
• Finally, account lockout is a good defense against password attacks. Limiting the
number of attempts users have to enter their passwords can help ensure that hackers
can’t use brute force techniques by trying passwords until they gain access.
• However, the account lockout can cause problems. Attackers cause a denial of service
if they try to lock out all of the accounts of a system. In this case, consider using a
policy that increasingly delays the time between password attempts each time they fail
to enter incorrectly, rather than locking out the account.
• SessionlDs are how users are identified in web applications and so disclosing this
session ID is dangerous as users can be impersonated.
• Encryption is a good first defense against traffic sniffing and can help protect clear-
text traffic on the Internet. Account lockouts or increasing time delays can help deter
hackers from automated attacks against your web application.
• Implementing session timeouts can also help ensure that if a session is stolen, by the
time it is used it has already expired.
6.Security Misconfiguration
• Security misconfiguration occurs when security settings are put in place poorly, or
not implemented at all. Cloud misconfiguration and identity service
misconfiguration both stem from improper security configuration.
There are several types of security misconfiguration that can affect a business.
Any aspect of an application or code that should have security measures is susceptible to
security misconfiguration.
Security misconfiguration can occur in many ways. Some of the common causes include:
• Using default credentials or default passwords provided by a vendor
• Installing unused features
• Directory traversal
• Accidental security-lax coding
• When sensitive data is leaked or stolen by an attacker, the result can mean
potential loss of customers, regulatory fines for failing to meet required security
measures, and harm to finances and reputation.
• In addition, any business-critical information gained by an attacker can put a
business at further risk. The access gained via security misconfiguration flaws can
also lead to complete system compromise.
• Any breach of data or applications can slow down a business and, in some cases,
bring production to a halt. The greater the protection needs of an application or
data that is exposed, the worse the impact on a business. That’s why preventing
security misconfiguration is vital.
Preventing Security Misconfiguration
• When you sign up for a mobile banking or any online account, you trust that the
application securely stores your username, password, bank account number, and all
other sensitive information.
• You may imagine your data getting encrypted or turned into random strings of
characters while stored in the company’s database. The only way to make sense of
them is by having the encryption key.
• Even if hackers manage to log in to the financial application’s database, they still
can’t decipher the data if they don’t have the key. But when the application has
insecure cryptographic storage, they may be able to crack the encryption and see the
actual user data. The video below shows how insecure cryptographic storage works.
How Can Insecure Cryptographic Storage Be Exploited?
• Outside attackers may exploit other vulnerabilities to gain unauthorized access to the
database. For instance, they can use brute force, a trial-and-error tactic to guess login
information.
• Failure to encrypt data: Companies usually encrypt data while in transit or traveling
from one user to another. However, some may fail to implement encryption
algorithms while the data is at rest or stored. When this happens, it only takes a hacker
to successfully access the company’s database to expose all sensitive data.
• Failure to encrypt the correct data: If your bank’s application security is designed to
encrypt usernames and passwords but not bank account details and phone numbers,
this is already a type of insecure cryptographic storage. Threat actors can perform a
social engineering attack by contacting the account owners over the phone.
• Using DIY encryption algorithms: Some developers may be brilliant enough to create
their encryption algorithm. While the process could be fun, it’s not very secure. For
one, the algorithm may not completely follow industry requirements.
• Using obsolete encryption algorithms: At present, Advanced Encryption Standard
(AES) is the algorithm standard used by large companies and government agencies. It
is one of the recommended algorithms, and using outdated ones may be risky.
• The data will remain gibberish and invaluable. However, if one type of sensitive data
is not encrypted, if the encryption used is weak, or if the encryption key is not stored
correctly, hackers may have a huge payday.
• The resulting data breach can have less quantifiable effects, such as loss of customer
trust and reputational damage to the company.
• To avoid exposing data to insecure cryptographic storage, it’s important to define data
security during the software development process. This process includes discussing
what data to encrypt, what encryption algorithm to use, and all other pertinent details
in securing sensitive information.
• Regularly scanning the application or software for vulnerabilities is also vital in early
insecure cryptographic storage detection and prevention.
8.Failure to Restrict URL Access
• Failure to Restrict URL Access (FTRE) is a security vulnerability that occurs when a
web application does not properly enforce restrictions on access to sensitive pages or
functionality by unauthenticated or unauthorized users.
• This can lead to the exposure of confidential data or the execution of unauthorized
actions by attackers. FTRE can arise due to a variety of reasons such as improper
access control mechanisms, insufficient authentication and authorization checks, or
incorrect configuration of server-side security controls.
• in Python:
@app.route('/admin')
def admin_panel():
if request.args.get('auth_token') == 'SECRET_TOKEN':
return render_template('admin.html')
else:
return redirect('/login')
• In this example, the web application checks for the presence of an “auth_token” query
parameter to determine if the user is authenticated to access the admin panel.
However, this code does not enforce any restrictions on who can access the admin
panel. An attacker could simply guess or brute-force the auth token and gain access to
sensitive functionality.
in PHP:
} else {
header('Location: /login.php');
exit();
• This PHP code checks for a session variable called “authenticated” to determine if the
user is authenticated. However, if the web application fails to properly destroy
sessions on logout or if an attacker can steal a valid session cookie, they can bypass
this check and access the sensitive content without being authenticated.
• in Java:
@RequestMapping("/admin")
if (authToken.equals("SECRET_TOKEN")) {
} else {
• This Java code uses the Spring Framework to check for the presence of an
“auth_token” query parameter to determine if the user is authenticated to access the
admin panel. However, this code does not enforce any restrictions on who can access
the admin panel. An attacker could simply guess or brute-force the auth token and
gain access to sensitive functionality.
• An attacker could guess or brute-force a valid URL or query parameter that grants
access to sensitive data, such as customer data or confidential business information.
For example, if a web application has a URL like “example.com/customer/123” to
display customer information, an attacker could try guessing different customer IDs
until they find a valid one that grants access to sensitive data.
• An attacker could guess or brute-force a valid URL or query parameter that grants
access to sensitive functionality, such as an administrative panel or a payment
processing page.
• For example, if a web application has an admin panel at “example.com/admin” with
no authentication checks, an attacker could simply guess or brute-force the URL and
gain access to the admin panel.
Session hijacking:
• An attacker could steal a valid session cookie from a logged-in user and use it to
bypass authentication checks and gain access to sensitive functionality or data. For
example, if a web application uses session cookies to authenticate users, an attacker
could steal a valid session cookie using techniques such as XSS or CSRF attacks and
use it to access sensitive functionality or data without needing to provide valid
authentication credentials.
• An attacker could manipulate the URL or query parameters to gain access to higher
levels of functionality or data. For example, if a web application has a URL like
“example.com/customer/123” that displays customer information, an attacker could
modify the URL to “example.com/customer/123/admin” to try and gain access to
administrative functionality related to the customer.
Session fixation:
An attacker could use session fixation to set a valid session ID for a victim user,
allowing the attacker to access the victim’s account and privileges. For example, if a web
application uses session cookies to authenticate users, an attacker could set a valid session ID
for a victim user using a URL that includes the session ID, and then wait for the victim to log
in with the same session ID.
An attacker could use an XSS vulnerability to inject malicious JavaScript into a web
page, allowing them to steal session cookies or other sensitive information. This could allow
the attacker to bypass authentication and gain higher levels of access to the system or
application.
An attacker could use a CSRF attack to force a victim user to perform actions on their
behalf, such as changing the victim’s password or making unauthorized purchases. This
could allow the attacker to gain higher levels of access to the system or application by
performing actions that are not authorized for their own account.
Methodology:
Identify the URLs and parameters: Identify the URLs and parameters associated with
the identified functionality.
Checklist:
Understand the web application’s functionality and identify the different user roles, such as
regular users, administrators, or moderators
• Identify the URLs and query parameters associated with the identified functionality,
and determine if they are properly restricted based on user roles.
• Test each URL and query parameter associated with the identified functionality to
determine if it can be accessed without proper authentication and authorization.
• Test each URL and query parameter associated with the identified functionality with
incorrect or invalid credentials to determine if it is possible to gain unauthorized
access.
• Test each URL and query parameter associated with the identified functionality with
valid credentials for different user roles, such as a regular user account or an
administrative account, to determine if proper authorization checks are in place.
• Attempt to bypass authentication and authorization checks by manipulating URLs or
query parameters, or by using other techniques such as session fixation, XSS or CSRF
attacks.
• If any vulnerabilities are found, test for privilege escalation techniques to gain higher
levels of access to the system or application.
• Document any vulnerabilities found, including the steps to reproduce them, and report
them to the development team for remediation.
• Verify that any reported vulnerabilities have been properly remediated before
considering the testing complete.
Manual Tools:
• Burp Suite – A comprehensive web application security testing tool that includes
features for intercepting and modifying HTTP/S traffic, testing for various
vulnerabilities, and reporting findings.
• ZAP (Zed Attack Proxy) – A free, open-source web application security testing tool
that includes features for actively testing for various vulnerabilities, such as FTRE,
and reporting findings.
• Postman – A popular tool for testing and debugging RESTful APIs, which can also be
used to manually test web applications for vulnerabilities such as FTRE.
Automated Tools:
• OWASP ZAP – A powerful automated security testing tool that includes features for
scanning web applications for various vulnerabilities, including FTRE.
• Nikto – An open-source web server scanner that can also be used to test web
applications for vulnerabilities, including FTRE.
• Arachni – A modular, open-source web application security testing tool that includes
features for scanning web applications for various vulnerabilities, including FTRE.
• Vega – An open-source web application security testing tool that includes features for
scanning web applications for various vulnerabilities, including FTRE.
OpenVAS
• OpenVAS, short for Open Vulnerability Assessment System, is an open-source
vulnerability scanning and vulnerability management tool designed to help
organizations identify security vulnerabilities in their networks, systems, and
applications. OpenVAS is similar in purpose to commercial vulnerability assessment
tools like Nessus.
1. Vulnerability Scanning: OpenVAS scans networks, hosts, and applications to identify known
vulnerabilities, misconfigurations, and potential security weaknesses.
2. Plugin-Based Architecture: OpenVAS utilizes a plugin-based system that allows it to support
a wide range of vulnerability checks and security tests. New plugins can be added and
updated to keep up with the latest vulnerabilities.
3. Compliance Auditing: It can be used to assess compliance with various security standards
and regulatory requirements, such as PCI DSS, HIPAA, and CIS benchmarks.
4. Network Discovery: OpenVAS helps organizations identify and catalog all devices and
systems connected to their network, helping maintain an up-to-date inventory.
5. Web Application Scanning: OpenVAS can scan web applications for common
vulnerabilities, including SQL injection, cross-site scripting (XSS), and insecure
authentication.
What are the feature of OpenVAS?
OpenVAS works by conducting scans on target systems and analyzing the results to identify
vulnerabilities and potential security issues. Here’s a simplified overview of how OpenVAS
works:
1. Scan Configuration: Users configure OpenVAS scans by defining target hosts, specifying
scan policies (e.g., which types of vulnerabilities to check), and setting other scan
parameters.
2. Scanning: OpenVAS performs scans on the target systems based on the configured policies.
It sends various probes and checks to detect vulnerabilities, misconfigurations, and potential
security risks.
3. Vulnerability Detection: During the scan, OpenVAS identifies vulnerabilities by comparing
its findings with a constantly updated database of vulnerability checks (plugins).
4. Data Analysis: OpenVAS analyzes the scan results and assigns severity levels to each
identified vulnerability, helping organizations prioritize remediation efforts.
5. Reporting: OpenVAS generates detailed reports that include a list of vulnerabilities, their
descriptions, severity ratings, and recommendations for mitigation.
OpenVAS Architecture:
OpenVAS typically consists of several components that work together to provide
vulnerability scanning and management capabilities:
1. OpenVAS Scanner: This component conducts the actual scanning of target hosts and collects
scan results. It communicates with the OpenVAS Manager to fetch scan configurations and
report results.
2. OpenVAS Manager: The manager coordinates the scanning process, manages scan policies,
and stores scan results. It acts as the central control point for managing and scheduling scans.
3. OpenVAS CLI and GUI: These are the user interfaces for interacting with OpenVAS. The
CLI provides a command-line interface, while the GUI offers a graphical user interface for
configuring scans, viewing results, and generating reports.
4. OpenVAS Greenbone Security Assistant (GSA): GSA is a web-based interface that allows
users to manage and configure OpenVAS scans through a web browser.
5. OpenVAS Knowledge Base (NVTs): The knowledge base contains a vast collection of
Network Vulnerability Tests (NVTs), which are plugins used to detect vulnerabilities.
6. OpenVAS OpenVAS Transfer Protocol (OTP): OTP is used for communication between
various components of OpenVAS.
OpenVAS can be deployed on a single server or in a distributed architecture for scalability.
Communication between these components is secured to protect sensitive scan data.
Features of Nexpose
• Nexpose works in mobile, virtual, physical and cloud environments to find assets and
scan for vulnerabilities within an organization's environment and then prioritize risk
according to the exploitability of those vulnerabilities.
• It also priorities vulnerability patching and schedule scan by enabling administrators
and configure security alerts. Nexpose has a special feature known as Live
monitoring, which collects the available data and then converts that data into action
plans. Vulnerabilities that are exploited first are found and prioritized by the advanced
exposure analytics feature of nexpose.
• Because of this, the security managers save from getting bogged down with too many
security alerts. The Liveboards feature is used to replace the result of a static
dashboard with visual reporting that is constantly updated. Rapid 7 introduces a new
feature for nexpose named as remediation workflow feature, which is used to track
and manage the security staff of the organization and analyze the progress of
addressing those vulnerabilities.
Product Version
Ultimate: It offers hardware appliances, managed services, virtual appliances, private cloud,
or software products. All features have a scan engine and an unlimited number of IP
addresses.
Express: It offers as a private cloud, virtual application or Software product. It can support
two scan engines and only one user. It is used only in small organizations. It can scan up to
1,024 IPs.
Nikto
• Nikto is an Open Source software written in Perl language that is used to scan a
web-server for the vulnerability that can be exploited and can compromise the
server. It can also check for outdated version details of 1200 server and can detect
problems with specific version details of over 200 servers.
• It can also fingerprint server using favicon.ico files present in the server. It is not
designed to be a particularly a stealth tool rather than it is designed to be fast and
time-efficient to achieve the task in very little time. Because of this, a web admin
can easily detect that its server is being scanned by looking into the log files.
It can also show some items that do not have security problem but are info only
which shows how to take full use of it to secure the web-server more properly.
Features:
• Full support for SSL
• Finds sub-domain
• Supports full HTTP Proxy
• Outdated component report
• Result saved in multiple format (xml, csv etc)
• Username guessing
• Gives details of installed software
• Takes Nmap file as input to scan port in a web-server.
• Able to perform dictionary attack.
• Updated easily
BURP SUITE
• Burp Suite software is the best toolbox for web security testing. In web security
testing, the incursion also protects engineer grace. Used to find and exploit search
flaws. Burp Suite is therefore designed to be used by point-and-click. Understanding
how systems are attacked is essential for everyone working in security, whether they
are developers or security professionals.
• Burp Suite is a platform and graphical tool that work together to do security testing on
online applications. It supports the whole testing process, from the initial mapping and
analysis of an application's attack surface through the discovery and exploitation of
security flaws.
• Burp Suite is a proxy program that enables us to track, examine, and alter requests
made by our browsers before they are forwarded to a distant server.
• Burp Suite is a prominent web application security solution. It gives us the ability to
manually test for vulnerabilities, intercepts HTTP messages, and change a message's
body and header.
• It was created by a business with the alias Portswigger, whose creator Dafydd
Stuttard also works there. BurpSuite is designed to be an all-in-one toolkit, and
BApps are add-ons that may be installed to expand its functionality.
• It is the most widely used tool among experts in online app security and bug bounty
hunters. It is a better option than free substitutes like OWASP ZAP because of how
simple it is to use. The community edition of Burp Suite is accessible for free,
whereas the professional edition and the enterprise edition need payment.
Burp Suite is a comprehensive framework that may be used to carry out several activities,
including:
• Web crawling.
• Web application testing, both manually and automatically.
• Analysis of web applications.
• Vulnerability detection
Burpsuite also has the advantage of being built into the Chrome browser.
• A web crawler or spider is employed to map the target web application. The
mapping's goal is to compile a list of endpoints so that their capabilities may be
examined and possible vulnerabilities can be discovered. Spidering is carried out
for the straightforward reason that more attack surfaces are available during real
testing if you collect more endpoints during recon.
• It is a web spider/crawler that is used to map the target web application. The
objective of the mapping is to get a list of endpoints so that their functionality
can be observed and potential vulnerabilities can be found.
• Spidering is done for a simple reason that the more endpoints you gather during
your recon process, the more attack surfaces you possess during your actual
testing
2. Proxy:
• BurpSuite contains an intercepting proxy that lets the user see and modify the
contents of requests and responses while they are in transit. It also lets the
user send the request/response under monitoring to another relevant tool in
BurpSuite, removing the burden of copy-paste.
• The proxy server can be adjusted to run on a specific loop-back ip and a port.
The proxy can also be configured to filter out specific types of request-
response pairs.
3. Intruder:
• It is a fuzzer. This is used to run a set of values through an input point. The values
are run and the output is observed for success/failure and content length. Usually, an
anomaly results in a change in response code or content length of the response.
BurpSuite allows brute-force, dictionary file and single values for its payload
position.
The intruder is used for:
• Brute-force attacks on password forms, pin forms, and other such forms.
• The dictionary attack on password forms, fields that are suspected of being
vulnerable to XSS or SQL injection.
• Testing and attacking rate limiting on the web-app.
4. Repeater: