[go: up one dir, main page]

0% found this document useful (0 votes)
20 views11 pages

Web Attacks Notes

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 11

COMPLETE NOTES

SLASH BY TE
SSC-BA NK
NOTES

SLASHBYTE | SSC-BANK
1 |
Web Application Attacks
Web Application Attacks
Active Attack: Involves attempting to alter or disrupt the system, such as
modifying data or injecting malicious code.
Passive Attack: Involves eavesdropping or monitoring communications without
altering the data, such as intercepting sensitive information.

1. XSS (Cross-Site Scripting)


What: Malicious scripts injected into websites to steal user data (e.g.,
cookies).

Prevention: Input validation, output encoding, Content Security Policy


(CSP).

2. CSRF (Cross-Site Request Forgery)


What: Tricks users into performing unauthorized actions on websites where
they are logged in.

Prevention: Anti-CSRF tokens, SameSite cookies, user confirmation.

3. Injection Attacks
What: Malicious code (SQL, XML, etc.) inserted into web applications to
manipulate data.

Prevention: Input sanitization, parameterized queries, secure coding.

Web Application Attacks 1


4. DDoS (Distributed Denial-of-Service)
What: Overloading a server with traffic to make it unavailable.

Prevention: Traffic filtering, DDoS protection services, load balancing.

5. Brute Force Attack


What: Trying multiple passwords or keys to gain unauthorized access.

Prevention: Strong passwords, account lockouts, multi-factor


authentication (MFA).

Each attack targets a different vulnerability, but they all pose significant
security risks.

Attack Type Description

An attack that injects malicious scripts into


Cross-Site Scripting (XSS)
webpages viewed by users.

Tricks users into performing unwanted


Cross-Site Request Forgery (CSRF) actions on a different site where they are
authenticated.

Exploits vulnerabilities to inject malicious


Injection Attacks
SQL, HTML, or code.

Overwhelms a server, service, or network


DDoS (Distributed Denial-of-Service)
with traffic to disrupt normal functioning.

Systematically checks all possible


Brute Force Attack
passwords to find the correct one.

Tree Traversal Strategies


Strategy Description

Explores as far down a branch as possible


Depth First Search (DFS)
before backtracking.

Explores all neighbor nodes at the present


Breadth First Search (BFS) depth before moving on to the next depth
level.

Digital Signatures

Web Application Attacks 2


Aspect Description

Verifying the authenticity and integrity of a


Use Case
message or document.

Provides non-repudiation; ensures that the


Importance sender cannot deny having sent the
message.

Encryption
Public-Private Key Encryption, also known as asymmetric encryption, is a
method of encrypting and decrypting data using two keys: one public and one
private. These keys are mathematically linked but cannot be derived from each
other. Here's a simplified explanation:

Type

Description

Asymmetric: Uses a pair of keys


Public-Private Key Encryption (public and private) for
encryption/decryption.

Symmetric: A single key for both


encryption and decryption.

OWASP Top 10 Web Security Risks : (Open Web Application


Security Project)

Rank Security Risk Description Example

1 Injection Attackers inject SQL Injection: An


malicious code attacker enters
(e.g., SQL injection) malicious SQL code
to manipulate a web into a form field to
application’s access or modify
backend. the database. For
example, entering
' OR '1'='1 into a

Web Application Attacks 3


login form might
bypass
authentication.

Credential
Stuffing: Attackers
Weaknesses in
use stolen
authentication
username and
mechanisms can
Broken password
2 lead to
Authentication combinations from
unauthorized
a previous data
access to user
breach to access
accounts.
accounts on other
websites.

Unencrypted data:
Improper protection A website
of sensitive data transmitting credit
(e.g., passwords, card details over
Sensitive Data
3 credit card HTTP instead of
Exposure
numbers) leading to HTTPS, making it
unauthorized easy for attackers
access. to intercept the
data.

XXE Attack: An
Vulnerabilities in attacker sends an
XML parsers XML file with
XML External allowing external external entity
4
Entities (XXE) entities to access references that
sensitive files or read local files on
perform attacks. the server, such as
/etc/passwd .

Privilege
Escalation: A
Insufficient normal user can
restrictions on what access the admin
Broken Access authenticated users panel because of
5
Control can do, leading to improper access
unauthorized control settings,
access. potentially exposing
sensitive admin
functions.

6 Security Improper Default


Misconfiguration configuration of Credentials: A web

Web Application Attacks 4


servers, databases, application left with
or applications, default admin
often exposing passwords (e.g.,
sensitive "admin:admin") that
information or can be easily
functionality. exploited by
attackers.

Stored XSS: An
Malicious scripts
attacker injects a
injected into
malicious script into
webpages, allowing
a comment section
Cross-Site Scripting attackers to steal
7 on a website, which
(XSS) cookies or perform
runs when other
other malicious
users view the
actions in users’
page, stealing their
browsers.
session cookies.

Remote Code
Deserialization of Execution: An
untrusted data attacker exploits a
Insecure leading to remote vulnerable
8
Deserialization code execution or deserialization
other malicious process to execute
activities. arbitrary code on a
server.

Outdated Library: A
web application
Using outdated or
uses an old version
vulnerable libraries
Using Components of the Apache
and components in
9 with Known Struts library with a
applications,
Vulnerabilities known vulnerability
exposing them to
that can be
known exploits.
exploited to gain
remote control.

No Logs: An
Lack of sufficient attacker carries out
logging and a brute force attack
monitoring to to guess
Insufficient Logging
10 detect and respond passwords, but the
& Monitoring
to security system does not
incidents in real- log these failed
time. attempts, so no
alert is generated.

Web Application Attacks 5


Database Concepts
SQL (Structured Query Language) is a domain-specific language used to
manage and manipulate relational databases. It is widely used for querying,
inserting, updating, and deleting data in databases. Here’s a detailed yet
concise overview of SQL:

1. SQL Components:
Data Definition Language (DDL): Defines the structure of the database.

Commands: CREATE , ALTER , DROP , TRUNCATE

Purpose: Create, modify, and remove tables and databases.

Data Manipulation Language (DML): Handles data manipulation within the


database.

Commands: SELECT , INSERT , UPDATE , DELETE

Purpose: Retrieve, add, modify, and remove data from tables.

Data Control Language (DCL): Manages permissions and access control.

Commands: GRANT , REVOKE

Purpose: Control access to data and database objects.

Transaction Control Language (TCL): Manages transactions in the


database.

Commands: COMMIT , ROLLBACK , SAVEPOINT

Purpose: Manage the changes made during a session.

2. Key SQL Operations:


SELECT: Retrieves data from one or more tables.

SELECT column1, column2 FROM table_name;

INSERT: Adds new data into a table.

INSERT INTO table_name (column1, column2) VALUES (value


1, value2);

UPDATE: Modifies existing data in a table.

Web Application Attacks 6


UPDATE table_name SET column1 = value1 WHERE condition;

DELETE: Removes data from a table.

DELETE FROM table_name WHERE condition;

CREATE: Defines a new database object (like a table or view).

CREATE TABLE table_name (column1 datatype, column2 datat


ype);

ALTER: Modifies the structure of an existing table.

ALTER TABLE table_name ADD column_name datatype;

DROP: Deletes an entire table or database.

DROP TABLE table_name;

3. SQL Clauses:
WHERE: Filters records based on specific conditions.

ORDER BY: Sorts data by one or more columns.

GROUP BY: Groups data based on column(s) for aggregate functions.

HAVING: Filters records after aggregation.

JOIN: Combines data from two or more tables.

Types: INNER JOIN , LEFT JOIN , RIGHT JOIN , FULL JOIN

4. SQL Functions:
Aggregate Functions: Used to perform calculations on multiple rows.

Examples: COUNT() , SUM() , AVG() , MIN() , MAX()

Scalar Functions: Perform operations on a single value.

Examples: UPPER() , LOWER() , LEN() , ROUND()

String Functions: Manipulate strings of text.

Web Application Attacks 7


Examples: CONCAT() , SUBSTRING() , TRIM()

Date Functions: Manipulate date and time data.

Examples: NOW() , DATEPART() , DATEDIFF()

5. SQL Joins:
SQL joins are used to combine data from multiple tables based on a related
column.

INNER JOIN: Returns rows when there is a match in both tables.

LEFT JOIN (OUTER): Returns all rows from the left table and matching rows
from the right table.

RIGHT JOIN (OUTER): Returns all rows from the right table and matching
rows from the left table.

FULL JOIN (OUTER): Returns rows when there is a match in one of the
tables.

6. SQL Constraints:
Constraints enforce rules on data in a table. Common constraints include:

PRIMARY KEY: Uniquely identifies each row in a table.

FOREIGN KEY: Enforces a relationship between two tables.

UNIQUE: Ensures all values in a column are unique.

NOT NULL: Ensures a column cannot have NULL values.

CHECK: Ensures values in a column meet a specific condition.

7. Indexes:
An Index is a database object that speeds up data retrieval. It’s created on a
column (or set of columns) to improve query performance.

CREATE INDEX index_name ON table_name (column_name);

Views, Triggers, and Cursors in SQL:


1. Views:

Web Application Attacks 8


Definition: A view is a virtual table based on the result of a query.

Usage: Simplifies complex queries, hides sensitive data, and presents data
in a customized way.

Example: CREATE VIEW view_name AS SELECT column1 FROM table_name WHERE condition;

Advantage: Improves security and readability by encapsulating logic.

2. Triggers:
Definition: A trigger is an automatic action that occurs when specific
events ( INSERT , UPDATE , DELETE ) happen on a table.

Usage: Enforces business rules, updates data, or prevents unauthorized


changes.

Example: CREATE TRIGGER trigger_name BEFORE INSERT ON table_name FOR EACH ROW SET
NEW.column = value;

Advantage: Automates tasks and ensures data integrity.

3. Cursors:
Definition: A cursor is a database object that processes query results row
by row.

Usage: Useful for complex, row-by-row data manipulation.

Example: DECLARE cursor_name CURSOR FOR SELECT column1 FROM table_name;

Advantage: Allows detailed processing of each row in a result set.

Each feature helps manage, manipulate, and process data in different ways,
enhancing SQL’s functionality for various tasks.

Monolithic Architecture and Microservice


Architecture:
Aspect Monolithic Architecture Microservice Architecture

A system designed as a
A single, unified codebase
collection of small,
where all components (UI,
Definition independent services that
business logic, database)
communicate over a
are tightly integrated.
network.

Web Application Attacks 9


Single codebase, all Multiple loosely coupled
Structure components are part of one services, each focused on
system. a specific function.

More complex to develop,


Easier to develop initially,
Development requires managing many
as it is all in one place.
services.

Scaling requires scaling the Each service can be scaled


Scaling entire application, which independently based on its
can be inefficient. needs.

Deployed as multiple
Deployment Deployed as a single unit.
independent services.

A failure in one part of the A failure in one service


Fault Isolation system can affect the entire doesn’t necessarily affect
application. other services.

Typically, uses a single Allows different services to


Technology Stack technology stack for the use different technology
entire application. stacks.

Harder to maintain as the Easier to maintain due to


Maintenance application grows, due to modularity and smaller
its size and complexity. services.

Traditional web Modern applications like e-


applications, like a single commerce platforms, where
Example
application that handles payment, inventory, and
everything. user services are separate.

Key Differences:
Monolithic: Everything is in one place, making initial development easier
but harder to scale and maintain as it grows.

Microservices: Breaks the application into small, manageable services that


are independently deployable, scalable, and maintainable, but more
complex to set up and manage.

Web Application Attacks 10

You might also like