Unit 5 - Hacking Engineering
Unit 5 - Hacking Engineering
Social networks are websites and apps that allow users and organizations to connect,
communicate, share information and form relationships. People can connect with others in
the same area, families, friends, and those with the same interests. Social networks are one of
the most important uses of the internet today.
Popular social networking sites -- such as Facebook, Yelp, Twitter, Instagram and TikTok --
enable individuals to maintain social connections, stay informed and access, as well as share
a wealth of information. These sites also enable marketers to reach their target audiences.
Social networking sites have come a long way since the first social networking site,
SixDegrees.com, was launched in 1997. Today, the world is rapidly adopting newer social
networking platforms. According to DataReportal, a Kepios analysis from January 2022
indicated that there are more than 4.74 billion social network users worldwide.
Online social networking is dependent on technology and internet connectivity. Users can
access social networking sites using their PCs, tablets or smartphones. Most social
networking sites run on a back end of searchable databases that use advanced programming
languages, such as Python, to organize, store and retrieve data in an easy-to-understand
format. For example, Tumblr uses such products and services in its daily operations as
Google Analytics, Google Workspace and WordPress.
Social networks
With the broad spectrum of websites, apps and services that exist online, there is no single
exact definition of a social network. Generally, though, social networks have a few common
attributes that set them apart.
A social network will focus on user-generated content. Users primarily view and
interact with content made by other users. They are encouraged to post text, status
updates or pictures for viewing by others.
Social networks allow the user or organization to create a profile. The profile contains
information about the person and a centralized page with the content posted by them.
Their profile may be associated with their real name.
A social network has a way to form a lasting connection with other users. These
connections are commonly called friending or following the other user. They allow
the users to find other users and form webs of relationships. Often an algorithm will
recommend other users and organizations they may want to form a connection with.
Although often used interchangeably, social network is different than social media. A social
network focuses on the connections and relationships between individuals. Social media is
more focused on an individual sharing with a large audience. In this case, media is used in the
same sense as in mass media. Most social networks can also be used as social media sites.
Sharing. Friends or family members who are geographically dispersed can connect
remotely and share information, updates, photos and videos. Social networking also
enables individuals to meet other people with similar interests or to expand their
current social networks.
Learning. Social networks serve as great learning platforms. Consumers can instantly
receive breaking news, get updates regarding friends and family, or learn about what's
happening in their community.
Interacting. Social networking enhances user interactions by breaking the barriers of
time and distance. With cloud-based video communication technologies such as
WhatsApp or Instagram Live, people can talk face to face with anyone in the world.
Marketing. Companies may tap into social networking services to enhance brand
awareness with the platform's users, improve customer retention and conversion rates,
and promote brand and voice identity.
Social connections. This is a type of social network where people stay in touch with
friends, family members, acquaintances or brands through online profiles and updates,
or find new friends through similar interests. Some examples are Facebook, Myspace
and Instagram.
Professional connections. Geared toward professionals, these social networks are
designed for business relationships. These sites can be used to make new professional
contacts, enhance existing business connections and explore job opportunities, for
example. They may include a general forum where professionals can connect with co-
workers or offer an exclusive platform based on specific occupations or interest
levels. Some examples are LinkedIn, Microsoft Yammer and Microsoft Viva.
Sharing of multimedia. Various social networks provide video- and photography-
sharing services, including YouTube and Flickr.
News or informational. This type of social networking allow users to post news
stories, informational or how-to content and can be general purpose or dedicated to a
single topic. These social networks include communities of people who are looking
for answers to everyday problems and they have much in common with web forums.
Fostering a sense of helping others, members provide answers to questions, conduct
discussion forums or teach others how to perform various tasks and projects. Popular
examples include Reddit, Stack Overflow or Digg.
Communication. Here, social networks focus on allowing the user to communicate
directly with each other in one-on-one or group chats. They have less focus on posts
or updates and are like instant messaging apps. Some examples are WhatsApp,
WeChat and Snapchat.
Educational. Educational social networks offer remote learning, enabling students and
teachers to collaborate on school projects, conduct research, and interact through
blogs and forums. Google Classroom, LinkedIn Learning and ePals are popular
examples.
Brand awareness. Social networking enables companies to reach out to new and
existing clients. This helps to make brands more relatable and promotes brand
awareness.
Instant reachability. By erasing the physical and spatial boundaries between people,
social networking websites can provide instant reachability.
Builds a following. Organizations and businesses can use social networking to build a
following and expand their reach globally.
Business success. Positive reviews and comments generated by customers on social
networking platforms can help improve business sales and profitability.
Increased website traffic. Businesses can use social networking profiles to boost and
direct inbound traffic to their websites. They can achieve this, for example, by adding
inspiring visuals, using plugins and shareable social media buttons, or encouraging
inbound linking.
Rumors and misinformation. Incorrect information can slip through the cracks of
social networking platforms, causing havoc and uncertainty among consumers. Often,
people take anything posted on social networking sites at face value instead of
verifying the sources.
Negative reviews and comments. A single negative review can adversely affect an
established business, especially if the comments are posted on a platform with a large
following. A tarnished business reputation can often cause irreparable damage.
Data security and privacy concerns. Social networking sites can inadvertently put
consumer data at risk. For instance, if a social networking site experiences a data
breach, the users of that platform automatically fall under the radar as well. According
to Business Insider, a data breach in April 2021 leaked the personal data of more than
500 million Facebook users.
Time-consuming process. Promoting a business on social media requires constant
upkeep and maintenance. Creating, updating, preparing and scheduling regular posts
can take a considerable amount of time. This can be especially cumbersome for small
businesses that may not have the extra staff and resources to dedicate to social media
marketing.
Social networks in business
There are many ways a business or organization can use social networks. Globally, the
average person spends over two hours a day using social networks. This represents a great
opportunity and market.
Most social networks are run as for-profit companies. They make most of their revenue from
selling ads or promoted content. Facebook's parent company Meta has an almost $300 billion
market cap.
Social networks can be used for customer research, engagement and marketing. They offer a
way to directly connect businesses and customers. Brands can build a community around
themselves. Social networks collect information about users' likes and dislikes, allowing for
extremely targeted advertising. Social media listening allows an organization to learn what
people are saying about their company.
Some businesses are implementing internal social networks. In very large organizations this
can increase employee engagement and satisfaction. Also, as teams become more
geographically diverse or have members working from home, private social networks can
promote collaboration and information sharing.
Some business are beginning to use social networks in their recruitment strategies.
5.2 – Injection
Injection attacks refer to any type of attack that targets injection vulnerabilities—a broad
category of cybersecurity weaknesses that includes several of the most serious application
security risks.
Despite the wide variety of attack vectors, the common denominator for injection attacks is
that attackers are able to insert payloads into executed application code via unvalidated user
input. Depending on the specific vulnerability and the attack target, injection may involve
database queries, JavaScript code, native application code, operating system commands, and
so on. When successful, injection attacks can have a wide variety of consequences, from
revealing less sensitive information to more serious data breaches, denial of service, privilege
elevation, authentication bypass, or even remote code execution and potentially full
compromise of a target system.
Most web applications are backed by databases of some sort, with many relying
on standard relational database management systems that use SQL as their data
access and query language. SQL injection attacks are performed by including an
SQL statement in data sent via a web form, comment field, query string,
parameter, or another input channel accessible to external users. The malicious
code can be an SQL query designed to extract sensitive data or an SQL
statement aimed at modifying database content by adding or deleting records or
even entire database tables. Malicious hackers often target user records to add a
privileged user or elevate privileges for an existing account.
While it doesn’t have “injection” in the name, cross-site scripting (XSS) is all
about exploiting script injection vulnerabilities. If a web application fails to
sanitize user-supplied inputs that include script code (usually JavaScript), it may
be vulnerable to XSS. To exploit an XSS vulnerability, the attacker supplies a
string that contains malicious code, typically by including it as a request
parameter value. Instead of processing that value as expected by application
logic, a vulnerable application executes the provided script payload in the
victim’s browser.
Because the consequences can be so serious, it’s good practice to avoid calling
system commands that include user-controllable data in your web applications.
When executing a system command is necessary, be sure to carefully validate
all its inputs and restrict them to specific permitted values.
While most code injection vulnerabilities are only exploitable as part of a longer
attack chain, RCE is considered the holy grail of application security testing
because if an attacker manages to get remote code execution, they can do more
or less anything they want, so the target system is considered fully
compromised. While the specific severity rating depends on the ease of
exploitation, RCE vulnerabilities are nearly always critical.
To round out this top five, let’s look at something slightly different: XML
external entity (XXE) injection. XML documents are used in all sorts of web
application requests and if an app that accepts XML inputs is configured to
support legacy document type definitions (DTDs) with weak XML parser
security, attackers can use specially crafted XML documents to perform XXE
injection. This breaks the XML parser and can be used for further cyberattacks
ranging from directory traversal to server-side request forgery (SSRF) or even
remote code execution.
While the first four injection attacks discussed here rely on failures in user input
validation, XXE takes advantage of inherently unsafe legacy functionality in
XML parsers. Because this is more a case of insecure configuration than
insecure code, XXE can sometimes evade detection, making it particularly
dangerous. If your application processes XML documents, the only way to
avoid XXE vulnerabilities is to disable support for DTDs or (if you have to use
them) at the very least disallow the use of external entities.
Attack vectors related to XML external entities fall under CWE-611: Improper
Restriction of XML External Entity Reference. XXE injection used to have its
own spot at #4 in the OWASP Top Ten for 2017 but was merged into the
Security Misconfiguration category for the 2021 edition. Invicti’s web
vulnerability scanner detects many XXE injection vulnerabilities, including out-
of-band XXE injection.
The top five above represents the most common injection vulnerabilities found
in applications and APIs today, but several less frequent injection attacks also
deserve a mention:
NoSQL injection attacks follow the same principle as SQL injection but
target databases that don’t use SQL queries, such as MongoDB,
Cassandra, or Elasticsearch. Because there is no standard query language
for NoSQL databases, NoSQL injection payloads are different for each
type of database server.
JSON injection attacks are closely related to XSS but instead of injecting
script code, attackers attempt to insert or modify JSON data sent or
received by the application. This injection technique is especially useful
when attacking REST APIs, where JSON is the dominant data format.
Server-side template injection (SSTI) attacks target server-side template
engines used to dynamically generate web page code. If attackers are able
to inject expressions in the relevant template language, their malicious
code will be included in the page HTML. Expression language
injection is a related risk, this time injecting expressions specific to a web
framework rather than a template engine.
HTTP header injection (CRLF injection) is possible when an application
accepts newline characters in input that then goes directly into an HTTP
header. HTTP requests use a newline to separate the request header and
body, so injecting newline characters may allow an attacker to replace the
legitimate response body with HTML data that includes malicious code
such as an XSS payload.
Developers should know and use secure input processing features in modern web
frameworks and languages. Most SQL injection attacks can be prevented by using
parameterized queries or server-side prepared statements (aka stored procedures),
while application frameworks such as React provide built-in constructs that make it
all but impossible to write code vulnerable to XSS (unless you deliberately bypass all
the built-in safeguards).
Vulnerabilities can always crop up both in new and updated code, and new ones
discovered on code previously considered safe, so it’s vital to consistently test your
entire exploitable attack surface. The recommended practice is to regularly and
automatically scan all your web applications and APIs with a high-quality dynamic
application security testing solution that is integrated both into your development
lifecycle and your security operations.
5.3 – Cross-site scripting XSS
In its initial days, it was called CSS and it was not exactly what it is today.
Initially, it was discovered that a malicious website could utilize JavaScript to
read data from other website’s responses by embedding them in an iframe, run
scripts and modify page contents. It was called CSS (Cross Site Scripting) then.
The definition changed when Netscape introduced the Same Origin Policy and
cross-site scripting was restricted from enabling cross-origin response reading.
Soon it was recommended to call this vulnerability as XSS to avoid confusion
with Cascading Style Sheets(CSS). The possibility of getting XSSed arises
when a website does not properly handle the input provided to it from a user
before inserting it into the response. In such a case, a crafted input can be given
that when embedded in the response acts as a JS code block and is executed by
the browser. Depending on the context, there are two types of XSS –
Reflected XSS: If the input has to be provided each time to execute, such XSS
is called reflected. These attacks are mostly carried out by delivering a payload
directly to the victim. Victim requests a page with a request containing the
payload and the payload comes embedded in the response as a script. An
example of reflected XSS is XSS in the search field.
Stored XSS: When the response containing the payload is stored on the server
in such a way that the script gets executed on every visit without submission of
payload, then it is identified as stored XSS. An example of stored XSS is XSS
in the comment thread.
There is another type of XSS called DOM based XSS and its instances are either
reflected or stored. DOM-based XSS arises when user-supplied data is provided
to the DOM objects without proper sanitizing. An example of code vulnerable
to XSS is below, notice the variables firstname and lastname :
<?php
$firstname = $_GET["firstname"];
$lastname = $_GET["lastname"];
else
?>
There are two aspects of XSS (and any security issue) –
Let’s talk about one of the most common types of vulnerabilities on the
OWASP Top 10: broken authentication and session management. Simply
stated, broken authentication and session management allows a cybercriminal to
steal a user’s login data or forge session data, such as cookies, to gain access to
websites.
The OWASP Top 10, short for Open Web Application Security Project, is a list
of the ten most dangerous web application security flaws today (including
broken authentication and session management). According to owasp.org, its
purpose is to drive visibility and evolution in the safety and security of the
world’s software. As of 2021, broken authentication is now referred to
as identification and authentication failures by OWASP.
Many websites require users to log in to access their accounts, make a purchase,
etc. More often than not, this is done using a username and password. With this
information, a site will assign and send each logged-in visitor a unique session
ID that serves as a key to the user’s identity on the server.
If not properly secured, a cybercriminal can impersonate a valid user and access
that user’s account, resulting in a broken authentication and session
management attack.
When a user logs onto a website, the site uses a proprietary algorithm to
generate a unique session ID. Their device then uses that session ID as a key to
their identity for the remainder of their user session.
All of this information has to be sent back and forth between the user and the
server. If that information is not encrypted and is sent as plain text instead, it
becomes an attack vector. Hackers can then intercept user credentials or session
IDs to impersonate that person. This is especially true when operating on a
public network (e.g. coffee shop wifi) or a public computer that anyone else can
access. The following are some broken authentication and session management
attack examples.
Credential stuffing
This type of cyberattack uses a single password against many user accounts
before moving on to another password to avoid triggering account lockouts.
This technique contrasts with brute force attacks, which try many passwords
against a single user account. Password spraying targets the common use of
weak passwords across multiple accounts and takes advantage of the fact that
many users opt for simplicity over security. By exploiting the likelihood that at
least some accounts will use common passwords, attackers can gain
unauthorized access without alerting the authentication mechanisms designed to
lock accounts after a few unsuccessful login attempts.
Make sure you are on top of any website vulnerabilities or issues by conducting
security audits on a regular basis. An automated website security plan is also
helpful in that it continuously monitors the site for issues.
CSRF is an attack that tricks the victim into submitting a malicious request. It
inherits the identity and privileges of the victim to perform an undesired
function on the victim’s behalf (though note that this is not true of login CSRF,
a special form of the attack described below). For most sites, browser requests
automatically include any credentials associated with the site, such as the user’s
session cookie, IP address, Windows domain credentials, and so forth.
Therefore, if the user is currently authenticated to the site, the site will have no
way to distinguish between the forged request sent by the victim and a
legitimate request sent by the victim.
CSRF attacks target functionality that causes a state change on the server, such
as changing the victim’s email address or password, or purchasing something.
Forcing the victim to retrieve data doesn’t benefit an attacker because the
attacker doesn’t receive the response, the victim does. As such, CSRF attacks
target state-changing requests.
An attacker can use CSRF to obtain the victim’s private data via a special form
of the attack, known as login CSRF. The attacker forces a non-authenticated
user to log in to an account the attacker controls. If the victim does not realize
this, they may add personal data—such as credit card information—to the
account. The attacker can then log back into the account to view this data, along
with the victim’s activity history on the web application.
It’s sometimes possible to store the CSRF attack on the vulnerable site itself.
Such vulnerabilities are called “stored CSRF flaws”. This can be accomplished
by simply storing an IMG or IFRAME tag in a field that accepts HTML, or by a
more complex cross-site scripting attack. If the attack can store a CSRF attack
in the site, the severity of the attack is amplified. In particular, the likelihood is
increased because the victim is more likely to view the page containing the
attack than some random page on the Internet. The likelihood is also increased
because the victim is sure to be authenticated to the site already.
Synonyms
CSRF attacks are also known by a number of other names, including XSRF,
“Sea Surf”, Session Riding, Cross-Site Reference Forgery, and Hostile Linking.
Microsoft refers to this type of attack as a One-Click attack in their threat
modeling process and many places in their online documentation.
Remember that all cookies, even the secret ones, will be submitted with every
request. All authentication tokens will be submitted regardless of whether or not
the end-user was tricked into submitting the request. Furthermore, session
identifiers are simply used by the application container to associate the request
with a specific session object. The session identifier does not verify that the
end-user intended to submit the request.
Applications can be developed to only accept POST requests for the execution
of business logic. The misconception is that since the attacker cannot construct
a malicious link, a CSRF attack cannot be executed. Unfortunately, this logic is
incorrect. There are numerous methods in which an attacker can trick a victim
into submitting a forged POST request, such as a simple form hosted in an
attacker’s Website with hidden values. This form can be triggered automatically
by JavaScript or can be triggered by the victim who thinks the form will do
something else.
Multi-Step Transactions
URL Rewriting
HTTPS
Examples
There are numerous ways in which an end user can be tricked into loading
information from or submitting information to a web application. In order to
execute an attack, we must first understand how to generate a valid malicious
request for our victim to execute. Let us consider the following example: Alice
wishes to transfer $100 to Bob using the bank.com web application that is
vulnerable to CSRF. Maria, an attacker, wants to trick Alice into sending the
money to Maria instead. The attack will comprise the following steps:
GET scenario
Maria now decides to exploit this web application vulnerability using Alice as
the victim. Maria first constructs the following exploit URL which will transfer
$100,000 from Alice’s account to Maria’s account. Maria takes the original
command URL and replaces the beneficiary name with herself, raising the
transfer amount significantly at the same time:
http://bank.com/transfer.do?acct=MARIA&amount=100000
The social engineering aspect of the attack tricks Alice into loading this URL
when Alice is logged into the bank application. This is usually done with one of
the following techniques:
The exploit URL can be disguised as an ordinary link, encouraging the victim to
click it:
<a href="http://bank.com/transfer.do?acct=MARIA&amount=100000">View
my Pictures!</a>
<img src="http://bank.com/transfer.do?acct=MARIA&amount=100000"
width="0" height="0" border="0">
If this image tag were included in the email, Alice wouldn’t see anything.
However, the browser will still submit the request to bank.com without any
visual indication that the transfer has taken place.
A real life example of CSRF attack on an application using GET was a uTorrent
exploit from 2008 that was used on a mass scale to download malware.
POST scenario
The only difference between GET and POST attacks is how the attack is being
executed by the victim. Let’s assume the bank now uses POST and the
vulnerable request looks like this:
acct=BOB&amount=100
Such a request cannot be delivered using standard A or IMG tags, but can be
delivered using a FORM tags:
This form will require the user to click on the submit button, but this can be also
executed automatically using JavaScript:
<body onload="document.forms[0].submit()">
<form...
Modern web application APIs frequently use other HTTP methods, such as PUT
or DELETE. Let’s assume the vulnerable bank uses PUT that takes a JSON
block as an argument:
{ "acct":"BOB", "amount":100 }
Such requests can be executed with JavaScript embedded into an exploit page:
<script>
function put() {
x.open("PUT","http://bank.com/transfer.do",true);
x.setRequestHeader("Content-Type", "application/json");
x.send(JSON.stringify({"acct":"BOB", "amount":100}));
</script>
<body onload="put()">
Fortunately, this request will not be executed by modern web browsers thanks
to same-origin policy restrictions. This restriction is enabled by default unless
the target web site explicitly opens up cross-origin requests from the attacker’s
(or everyone’s) origin by using CORS with the following header:
Access-Control-Allow-Origin: *
Related Attacks
As part of Cybersecurity Awareness Month, CISA has published a list of the top
10 network security misconfigurations found during red and blue team
assessments and in actual incident responses. To make sure application security
doesn’t get left out, we’ve decided to follow up with our own list of common
application security misconfigurations – but since top 10 lists have received
some bad press for being little more than clickbait, we’ll stick to just five of the
most important categories.
Any web application is merely the outermost layer of a technology stack that
goes right down to the operating system. Depending on its vintage and
architecture, a web tech stack may include a web server, application server,
database server, web framework, dynamic dependencies, and more. Unless all
the runtime components are properly maintained, a missing patch or security
update may provide attackers with an opening to exploit a known vulnerable
product version and potentially compromise your system without touching the
application itself (for instance, via remote code execution by the application
server).
Many data breaches happen not because an attacker broke in but because they
found something out in the open – exposed cloud storage buckets, sensitive
files, and forgotten APIs are all fair game. While ensuring proper access control
at multiple levels is a major requirement for secure application development, it
must also be a part of deployment and operations, especially as application
components become more and more distributed. For example, a misconfigured
web server may allow attackers to download the application source code,
revealing intellectual property and making it easier to find vulnerabilities by
directly analyzing the code.
We’ve written a lot about HTTP security headers in the past, and with good
reason, as they are one of the easiest ways to stop entire classes of web attacks
without touching a single line of application code. Among several common
headers, the two definite must-haves are Content Security Policy (CSP) headers
to minimize exposure to cross-site scripting and the HTTP Strict Transport
Security (HSTS) header to enforce encrypted communications and thus prevent
man-in-the-middle attacks. While setting them is a fundamental best practice,
misconfiguring your security headers can be a risk in itself – from a false sense
of security when your CSP rules don’t do what you expected, to making your
entire domain inaccessible due to a bad HSTS header.
Privilege escalation is usually the first goal of any attacker who manages to gain
an initial foothold on your server. In order to minimize the options available to
malicious actors, application hardening should include making sure that all the
processes in your stack are running with the minimum necessary privileges and
(if possible and appropriate) are separated to reduce the risk of lateral
movement. For example, for development on a local machine, it might be quick
and easy to run all your servers as root with full file system access – but if done
in a production environment, it would allow total system compromise from a
single successful command injection.
Architectural Design
The first step in designing any application is to consider the overall architecture
of the system, as this will have a huge impact on the technical implementation.
This process should begin with considering the threat model of the application
(i.e, who you are trying to protect that data against).
Which layer(s) are most appropriate will depend on the threat model. For
example, hardware level encryption is effective at protecting against the
physical theft of the server, but will provide no protection if an attacker is able
to compromise the server remotely.
The best way to protect sensitive information is to not store it in the first place.
Although this applies to all kinds of information, it is most often applicable to
credit card details, as they are highly desirable for attackers, and PCI DSS has
such stringent requirements for how they must be stored. Wherever possible, the
storage of sensitive information should be avoided.
Algorithms
For symmetric encryption AES with a key that's at least 128 bits (ideally 256
bits) and a secure mode should be used as the preferred algorithm.
Many other symmetric and asymmetric algorithms are available which have
their own pros and cons, and they may be better or worse than AES or
Curve25519 in specific use cases. When considering these, a number of factors
should be taken into account, including:
Key size.
Known attacks and weaknesses of the algorithm.
Maturity of the algorithm.
Approval by third parties such as NIST's algorithmic validation program.
Performance (both for encryption and decryption).
Quality of the libraries available.
Portability of the algorithm (i.e, how widely supported is it).
In some cases there may be regulatory requirements that limit the algorithms
that can be used, such as FIPS 140-2 or PCI DSS.
Custom Algorithms
Don't do this.
Cipher Modes
There are various modes that can be used to allow block ciphers (such as AES)
to encrypt arbitrary amounts of data, in the same way that a stream cipher
would. These modes have different security and performance characteristics,
and a full discussion of them is outside the scope of this cheat sheet. Some of
the modes have requirements to generate secure initialisation vectors (IVs) and
other attributes, but these should be handled automatically by the library.
If GCM or CCM are not available, then CTR mode or CBC mode should be
used. As these do not provide any guarantees about the authenticity of the data,
separate authentication should be implemented, such as using the Encrypt-then-
MAC technique. Care needs to be taken when using this method with variable
length messages
Random Padding
Random numbers (or strings) are needed for various security critical
functionality, such as generating encryption keys, IVs, session IDs, CSRF
tokens or password reset tokens. As such, it is important that these are generated
securely, and that it is not possible for an attacker to guess and predict them.
The table below shows the recommended algorithms for each language, as well
as insecure functions that should not be used.
. Random() RandomNumberGener
N
E
T
L Unsafe Functions Cryptographically Secu
a Functions
n
g
u
a
g
e
/
C
#
P random() secrets()
yt
h
o
n
R rand::prng::XorShiftRng rand::prng::chacha::Ch
u aRng and the rest of th
st Rust library CSPRNGs
L Unsafe Functions Cryptographically Secu
a Functions
n
g
u
a
g
e
N Math.random() crypto.randomBytes(),
o to.randomInt(), crypto.
d omUUID()
e.
js
Defence in Depth
Key Management
Processes
Formal processes should be implemented (and tested) to cover all aspects of key
management, including:
Key Generation
Where multiple keys are used (such as data separate data-encrypting and key-
encrypting keys), they should be fully independent from each other.
Once one of these criteria have been met, a new key should be generated and
used for encrypting any new data. There are two main approaches for how
existing data that was encrypted with the old key(s) should be handled:
It is important that the code and processes required to rotate a key are in
place before they are required, so that keys can be quickly rotated in the event
of a compromise. Additionally, processes should also be implemented to allow
the encryption algorithm or library to be changed, in case a new vulnerability is
found in the algorithm or implementation.
Key Storage
There are many advantages to using these types of secure storage over simply
putting keys in configuration files. The specifics of these will vary depending
on the solution used, but they include:
The Secrets Management Cheat Sheet provides more details on securely storing
secrets.
For this to be effective, the KEK must be stored separately from the DEK. The
encrypted DEK can be stored with the data, but will only be usable if an
attacker is able to also obtain the KEK, which is stored on another system.
The KEK should also be at least as strong as the DEK. The envelope
encryption guidance from Google contains further details on how to manage
DEKs and KEKs.
A key derivation function (KDF) could be used to generate a KEK from user-
supplied input (such a passphrase), which would then be used to encrypt a
randomly generated DEK. This allows the KEK to be easily changed (when the
user changes their passphrase), without needing to re-encrypt the data (as the
DEK remains the same).
Hacking is a term used to describe the process of gaining remote access to other
computers, most commonly through the internet. Ethical hacking refers to the
process of hacking with simply the intention of uncovering vulnerabilities that
may exist and then reporting them in order to help protect against future
incidents. This can be done by researching a vulnerability or by performing
penetration testing.
Main Content:
The phrase ‘failure to restrict URL access’ appears in the ethical hacking
glossary. The definition of failure to restrict URL access in Ethical hacking is
“A type of mistake in which a user can access data in a system that they do not
have permission to view, possibly resulting in data loss, fraud, or other
violations of security policies”.
The Scenario:
Jack has been hired by a company as an ethical hacker. The company has
provided him with a login and password, so he can test the strength of their
systems and see if there are any security flaws that need fixing. He is allowed to
access everything except for billing records, which he cannot access due to
company policy. Jack creates a program that creates fields within the billing
records and then submits them. He is, therefore, able to view all the company’s
customer credit card numbers, much to his delight. This is not something he
should have been able to do, but when the client told him not to go into the
billing section, they also did not tell him specifically that he could not modify
any data once he got there.
Drawbacks:
The company can lose a lot of money if its customer’s credit card
numbers are stolen.
Any negative publicity surrounding the incident may affect the company
to such an extent that they may suffer financially as a result.
Any penalties imposed will be costly and could cause the loss of
customers and staff, both of whom could be vital to the success of any
organization.
Professional hackers will use techniques like this without informing their
employer in order to gain privileged status.
They will use this in order to access areas of a network for which they
should not have permission, possibly gaining full access to all parts of a
system.
The company may be at risk of breaching the laws that are put in place to
protect people’s information, resulting in them being processed.
This is why it is so important to make sure that these steps are taken
correctly. If they are not, you could suffer many severe consequences and
end up doing more damage than good.
Conclusion:
While in some situations people may use this in order to look at private
information, it is significant to note that there are a lot of ways that this can be
used by hackers that are not malicious. Most don’t intentionally look for ways
to gain access without permission, but it is still a risky thing to do. In order to
carry out ethical hacking tasks effectively, you will typically need to perform
one or more of the following activities: penetration testing, vulnerability
scanning, and web application testing.
Comodo Antivirus with Premium Internet Security Software can prevent most
of the cyber attacks and malware which steal private data stored on your
computer, give hackers unauthorized access to your computer, and in turn,
your financial and personal information.
Malware arising from the internet can hold your system hostage and demand
money, secretly gather sensitive information about your computing habits,
internet activity, and keystrokes, etc.
You can protect yourself from all of these threats with the latest version
of Comodo Internet Security Software.
Comodo is a strong antivirus solution that offers many features like anti-
malware protection, full scans, quick scans, a firewall, gaming mode, and more.
Since it's been around for 25 years, you can expect Comodo to be sophisticated
enough to have seen changing cybersecurity needs.
OpenVAS:
Working of OpenVAS
OpenVAS consists of a server and various client-side tools for scanning and
reporting. It uses a regularly updated database of known vulnerabilities and
checks systems against these to detect potential weaknesses. The tool
performs a comprehensive scan of the specified targets, identifying potential
vulnerabilities such as outdated software, misconfigurations, and weak
passwords and generates comprehensive reports detailing the identified
vulnerabilities and provide recommendations for remediation.
OpenVAS Scanner:
OpenVAS Manager:
OpenVAS CLI:
OpenVAS Scanner:
OpenVAS Manager:
OpenVAS CLI:
OpenVAS Libraries:
Database:
Nexpose
To make a file work, you need to do a few things in Linux. Use a command
called chmod to change the file's permissions to make it executable. Just type
in "chmod +x" and then the file name, which in this case is Rapid7Setup-
Linux64.bin.
chmod +x Rapid7Setup-Linux64.bin
Step 2: Installation Steps
It will then ask you to agree to the terms. Click "Accept" and then click
"Next."
The setup will prompt you to specify the port for the database that
Nexpose will utilize.
The default port is set to 5432. If you do not need to modify it, proceed
by clicking on "Next."
Below, we are discussing the uses of nexpose vulnerability analysis tools, those
are following.
Vulnerability Identification
Risk Prioritization
Vulnerability Identification
Example:
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:
Finds sub-domain
Username guessing
Updated easily
Usages:-
Burp Suite
Burp or Burp Suite is a set of tools used for penetration testing of web
applications. It is developed by the company named Portswigger, which is also
the alias of its founder Dafydd Stuttard. BurpSuite aims to be an all in one set
of tools and its capabilities can be enhanced by installing add-ons that are
called BApps.
It is the most popular tool among professional web app security researchers
and bug bounty hunters. Its ease of use makes it a more suitable choice over
free alternatives like OWASP ZAP. Burp Suite is available as a community
edition which is free, professional edition that costs $399/year and an
enterprise edition that costs $3999/Year. This article gives a brief introduction
to the tools offered by BurpSuite. If you are a complete beginner in Web
Application Pentest/Web App Hacking/Bug Bounty, we would recommend you
to just read through without thinking too much about a term.
1. Spider:
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.
4. Repeater:
Repeater lets a user send requests repeatedly with manual modifications. It is
used for:
Among all the cookies present, which one is the actual session cookie.
5. Sequencer:
The sequencer is an entropy checker that checks for the randomness of tokens
generated by the webserver. These tokens are generally used for
authentication in sensitive operations: cookies and anti-CSRF tokens are
examples of such tokens. Ideally, these tokens must be generated in a fully
random manner so that the probability of appearance of each possible
character at a position is distributed uniformly. This should be achieved both
bit-wise and character-wise. An entropy analyzer tests this hypothesis for
being true. It works like this: initially, it is assumed that the tokens are random.
Then the tokens are tested on certain parameters for certain characteristics. A
term significance level is defined as a minimum value of probability that the
token will exhibit for a characteristic, such that if the token has a
characteristics probability below significance level, the hypothesis that the
token is random will be rejected. This tool can be used to find out the weak
tokens and enumerate their construction.
6. Decoder:
Decoder lists the common encoding methods like URL, HTML, Base64, Hex, etc.
This tool comes handy when looking for chunks of data in values of parameters
or headers. It is also used for payload construction for various vulnerability
classes. It is used to uncover primary cases of IDOR and session hijacking.
7. Extender:
BurpSuite supports external components to be integrated into the tools suite
to enhance its capabilities. These external components are called BApps. These
work just like browser extensions. These can be viewed, modified, installed,
uninstalled in the Extender window. Some of them are supported on the
community version, but some require the paid professional version.
8. Scanner:
The scanner is not available in the community edition. It scans the website
automatically for many common vulnerabilities and lists them with information
on confidence over each finding and their complexity of exploitation. It is
updated regularly to include new and less known vulnerabilities.