SlideShare a Scribd company logo
DINKAR MISHRA 1
• Solve Labs that are created for the following
vulnerabilities:
1.Login Bypass
2. Admin Credentials Access (SQLi)
3. CSRF
4. XSS
DINKAR MISHRA 2
1. Login Bypass :-
Introduction :-
Login bypass vulnerabilities are security flaws that allow
unauthorized users to gain access to a system by
circumventing the standard authentication mechanisms.
These vulnerabilities can be exploited in various ways, each
depending on the specific weaknesses of the system in
question.
Here are some common method of login bypass
vulnerabilities:-
1. SQL Injection.
2. Brute Force Attack.
3. Default Credentials.
DINKAR MISHRA 3
4. URL Manipulation.
5. Weak Password Recovery Mechanisms.
Tools Used :-
1. Brup Suite
2. Kali Linux
3. Wappalizer
Web site Link for Practical used :-
https://0ac5007d0496376680a6c61e008c0063.web-
security-academy.net/ ----> Port Swigger
DINKAR MISHRA 4
Technology Used By Site :-
DINKAR MISHRA 5
Login Bypass using Brute Force Password Change :-
Step 1:-
Login a site with your username and Password.
Step 2:-
Change a password using two different new password
the error msg says “New passwords do not match”.
We can use this message to enumerate correct
passwords.
Step 3:-Send This MSG to Burp Intruder
“POST /my-account/change-password HTTP/2”
DINKAR MISHRA 6
DINKAR MISHRA 7
DINKAR MISHRA 8
Step 4:-
In Burp Intruder, change the username parameter to carlos
and add a payload position to the current-password
parameter.
Step 5:-
On the Payloads tab, enter the list of passwords as the
payload set
Step 6:-
On the Settings tab, add a grep match rule to flag responses
containing New passwords do not match. Start the attack
DINKAR MISHRA 9
DINKAR MISHRA 10
DINKAR MISHRA 11
Step 7 :-
When the attack finished, notice that one response was
found that contains the New passwords do not match
message. Make a note of this password.
Step 8:-
In the browser, log out of your own account and lock back
in with the username carlos and the password that you just
identified.
DINKAR MISHRA 12
DINKAR MISHRA 13
Mitigations :-
• Implement Strong Password Policies: Encourage users to
create complex passwords that include a mix of upper and
lowercase letters, numbers, and special characters. Enforce
password complexity requirements through your
authentication system.
• Enforce Regular Password Changes: Regularly prompt
users to change their passwords, but ensure that the
frequency isn't so high that it becomes burdensome or
encourages users to create predictable passwords.
• Multi-factor Authentication (MFA): Implement MFA to
add an extra layer of security beyond passwords. This
could involve using a one-time code sent to a user's phone
or email, biometric authentication, or hardware tokens.
DINKAR MISHRA 14
• Account Lockout Policies: Implement account lockout
mechanisms that temporarily lock an account after a
certain number of failed login attempts. This prevents
brute force attacks by making it impractical to try a large
number of passwords.
• Monitoring and Alerting: Set up monitoring systems to
detect unusual login attempts or patterns of activity that
may indicate a brute force attack. Configure alerts to
notify administrators when such activity is detected so
they can take action.
• Rate Limiting: Implement rate limiting on login attempts
to prevent an attacker from making too many requests in a
short period of time. This can help mitigate the
effectiveness of brute force attacks by slowing down the
rate at which passwords can be tried.
DINKAR MISHRA 15
2. ADMIN CREDENTIALS ACCESS
(SQLI)
Introduction :-
SQLi stands for SQL Injection, and it's a type of
vulnerability that occurs in web applications. In VAPT
(Vulnerability Assessment and Penetration Testing),
SQLi refers to the exploitation of this vulnerability to
manipulate a database using SQL queries.
when a web application doesn't properly sanitize or
validate user input, an attacker can inject malicious
SQL code into the input fields.
DINKAR MISHRA 16
This malicious code can then be executed by the application's
database, allowing the attacker to perform various actions
like retrieving sensitive data, modifying or deleting data, and
even taking control of the entire database server.
SQLi is identified through various techniques such as input
validation testing, automated scanning tools, and manual
testing. Once identified, it's crucial to fix the vulnerability by
implementing proper input validation and sanitization
techniques to prevent potential exploitation.
DINKAR MISHRA 17
Tool used :-
1. Brup Suite
2. Kali Linux
3. Wappalizer
Web site Link for Practical used :-
https://0a6d003e03145e2d8015940d00fb00f7.web-
security-academy.net/ ----> Port Swigger
“The login function on the website already has a SQL
Injection Vulnerability, so we don’t need to use any
additional tools to find it. So we can directly perform our
labs.”
DINKAR MISHRA 18
SQL Injection Vulnerability Attack and Login As Admin User :-
Step :-1
Use default Username and password to capture the request
in Burp Suite.
Step :-2
Analyze the pattern of SQL query
Like :-
Select * from users where username =‘admin’ and
password=‘admin’
DINKAR MISHRA 19
• As you can see if write a wrong username and password it gives and error “400 Bad
request”
• But if we use SQL injection it give a error which defines that this site has a SQLi
Vulnerability
DINKAR MISHRA 20
Step 3:-
After Capturing the request send the request to Intruder
and Repeater.
After that make parameterize username
And payload list and run the payload.
DINKAR MISHRA 21
Step 4:-
As you can “302” code is for successful authentication.
Correct SQLi payload is “Administrator’—”
Username :- Administrator’—
Password :- Anything
DINKAR MISHRA 22
Mitigations:-
Parameterized Queries: Use parameterized queries or prepared
statements provided by your programming language or ORM (Object-
Relational Mapping) framework. This helps separate SQL code from
data, making it much harder for attackers to inject malicious SQL
code.
Stored Procedures: Utilize stored procedures to encapsulate SQL
code on the database server. This can prevent attackers from directly
manipulating SQL queries.
Input Validation: Validate and sanitize user inputs to ensure they
conform to expected formats. Reject any input that doesn't meet
validation criteria.
Least Privilege Principle: Ensure that the database user account used
by the application has the least privileges necessary. For example, it
should only have permissions to execute stored procedures or
specific queries, rather than being able to directly modify database
structure or access sensitive data.
DINKAR MISHRA 23
3. CSRF:-
Introduction:-
CSRF stands for Cross-Site Request Forgery. It's a type of
malicious attack where an attacker tricks a user into
unintentionally executing actions on a web application in which
they are authenticated. This is achieved by exploiting the trust
that a web application has in a user's browser.
Here's how CSRF attacks typically work:
1.Authentication: The victim user is authenticated to a web
application by logging in, and a session cookie is stored in their
browser to maintain the session.
2.Malicious Link or Code: The attacker then lures the victim into
visiting a web page controlled by the attacker. This could be
through a phishing email, a malicious website, or other means.
The malicious page contains code or a link that automatically
sends a request to the vulnerable web application.
DINKAR MISHRA 24
Tool used :-
1. Brup Suite
2. Kali Linux
3. Wappalizer
Web site Link for Practical used :-
https://0a9800da03544bed81608aa800080017.web-
security-academy.net/login ----> Port Swigger
“The login function on the website already has a CSRF
Vulnerability, so we don’t need to use any additional tools
to find it. So we can directly perform our labs.”
DINKAR MISHRA 25
CSRF vulnerability test :-
Step 1:-
Checking that the site has CSRF vulnerability or not .
We need to test whether changing the request method from
“POST” to “GET” allows the request to work without
requiring a CSRF token or not.
DINKAR MISHRA 26
• Request Method can be changed to GET which does not
required CSRF token.
• Hence it states that this site has CSRF vulnerability.
Step 2:- Exploit
• Generate CSRF PoC.
• right-click on the request, and from the context menu
select Engagement tools / Generate CSRF PoC. Enable the
option to include an auto-submit script and click
"Regenerate".
DINKAR MISHRA 27
Change the email Address and match the Request Session ID.
DINKAR MISHRA 28
Step 3:-
use the following HTML template. You can get the request
URL by right-clicking and selecting "Copy URL“ and Store the
exploit, then click "Deliver to victim" .
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<form action="https://0a9800da03544bed81608aa800080017.web-security-academy.net/my-account/change-email">
<input type="hidden" name="email" value="dinkarmishra105&#64;test&#46;com" />
<input type="submit" value="Submit request" />
</form>
<script>
history.pushState('', '', '/');
document.forms[0].submit();
</script>
</body>
</html>
DINKAR MISHRA 29
DINKAR MISHRA 30
Mitigations:-
CSRF Tokens: Generate unique tokens for each session or
form submission. These tokens are embedded in forms or
included in requests, and the server verifies them to ensure
the request is legitimate.
SameSite Cookies: Set the SameSite attribute on cookies to
"Strict" or "Lax" to prevent cookies from being sent in
cross-origin requests. This helps mitigate CSRF attacks by
reducing the likelihood of unauthorized requests
originating from other sites.
Custom Headers: Include custom headers in requests and
verify them on the server side. This can add an extra layer
of protection, as attackers would need to know and include
these custom headers in their forged requests.
DINKAR MISHRA 31
4. XSS :-
• XSS, or Cross-Site Scripting, is a type of security
vulnerability commonly found in web applications. In an
XSS attack, an attacker injects malicious scripts (usually
JavaScript) into web pages viewed by other users. These
scripts execute in the context of the victim's browser,
allowing the attacker to steal sensitive information, hijack
user sessions, deface websites, or perform other malicious
actions.
• There are three main types of XSS attacks:
1.Reflected XSS: In a reflected XSS attack, the malicious
script is injected into a web application's input (e.g., a URL
parameter or a form field) and then reflected back to the
user in the application's response. This often occurs when
an application fails to properly sanitize user input before
echoing it back to the user.
DINKAR MISHRA 32
2.Stored XSS: In a stored XSS attack, the malicious script is
permanently stored on the web server, typically in a
database, and then served to multiple users whenever they
access the vulnerable web page. This type of XSS attack is
more dangerous as it can affect multiple users and persists
over time.
3.DOM-based XSS: DOM-based XSS occurs when the client-
side JavaScript code in a web page processes data from an
untrusted source in an unsafe way, leading to the execution
of malicious scripts. Unlike reflected and stored XSS, DOM-
based XSS does not involve server-side vulnerabilities;
instead, it exploits client-side vulnerabilities in the
Document Object Model (DOM) of the web page.
DINKAR MISHRA 33
Tool used :-
1. Brup Suite
2. Kali Linux
3. Wappalizer
Web site Link for Practical used :-
https://0a34004f043720a881b46bbb00cb00e9.web-
security-academy.net/ ----> Port Swigger
“The login function on the website already has a XSS
Vulnerability, so we don’t need to use any additional tools to
find it. So we can directly perform our labs.”
DINKAR MISHRA 34
“DOM-based cross-site scripting vulnerability” in the
search query tracking functionality :-
It uses the JavaScript document.write function, which
writes data out to the page. The document.write function
is called with data from location.search, which you can
control using the website URL.
Step 1:-
Enter a random alphanumeric string into the search box.
Right-click and inspect the element, and observe that
your random string has been placed inside an img src
attribute.
DINKAR MISHRA 35
DINKAR MISHRA 36
Step 2:-
Break out of the img attribute by searching for:
"><svg onload=alert(1)>
DINKAR MISHRA 37
DINKAR MISHRA 38
Mitigations:-
To prevent XSS attacks, developers should implement
proper input validation and output encoding techniques.
This includes validating and sanitizing user input to ensure
that it does not contain malicious scripts and encoding
output data to prevent unintended script execution.
Additionally, using security mechanisms such as Content
Security Policy (CSP) can help mitigate the risk of XSS
attacks by restricting the types of content that can be
executed on a web page. Regular security audits and
testing are also essential to identify and address XSS
vulnerabilities in web applications.
DINKAR MISHRA 39
Thank You!!
From :- DINKAR MISHRA
DINKAR MISHRA 40

More Related Content

PPTX
Solving Labs for Vulnerabilities: Login Bypass & SQL Injection Exploits
PPTX
Solving Labs for Common Web Vulnerabilities: A Hands-On Guide
PPT
A Brief Introduction in SQL Injection
PPTX
Sql injection
PDF
Sql Injection - Vulnerability and Security
PPTX
Sql injections - with example
PDF
SQL Injection: complete walkthrough (not only) for PHP developers
PPTX
SQL injection prevention techniques
Solving Labs for Vulnerabilities: Login Bypass & SQL Injection Exploits
Solving Labs for Common Web Vulnerabilities: A Hands-On Guide
A Brief Introduction in SQL Injection
Sql injection
Sql Injection - Vulnerability and Security
Sql injections - with example
SQL Injection: complete walkthrough (not only) for PHP developers
SQL injection prevention techniques

What's hot (20)

PPTX
Sql injection - security testing
PPTX
Sql injection
PPTX
Cookies: HTTP state management mechanism
PPTX
SQL Injections (Part 1)
PPTX
security misconfigurations
PDF
Building Advanced XSS Vectors
PDF
How to Achieve Agile API Security
PPT
SQL Injection
PDF
Broken access controls
PPTX
Ppt on sql injection
PPTX
Whatis SQL Injection.pptx
PPTX
Reflective and Stored XSS- Cross Site Scripting
PPTX
Vulnerabilities in modern web applications
PPTX
A2 - broken authentication and session management(OWASP thailand chapter Apri...
PDF
Broken access control
PPTX
Sql injection in cybersecurity
PPTX
Web authentication & authorization
PPTX
Security testing
PPTX
Web application Security tools
PDF
CNIT 129S: Ch 6: Attacking Authentication
Sql injection - security testing
Sql injection
Cookies: HTTP state management mechanism
SQL Injections (Part 1)
security misconfigurations
Building Advanced XSS Vectors
How to Achieve Agile API Security
SQL Injection
Broken access controls
Ppt on sql injection
Whatis SQL Injection.pptx
Reflective and Stored XSS- Cross Site Scripting
Vulnerabilities in modern web applications
A2 - broken authentication and session management(OWASP thailand chapter Apri...
Broken access control
Sql injection in cybersecurity
Web authentication & authorization
Security testing
Web application Security tools
CNIT 129S: Ch 6: Attacking Authentication
Ad

Similar to Solving Labs for Common Web Vulnerabilities (20)

PPTX
Identifying and Eradicating Web Application Vulnerabilities : Cyber Security ...
PPTX
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
PPTX
Ethical Hacking Techniques for Web Application Security
PPTX
Security Testing Training With Examples
PDF
Lets Make our Web Applications Secure
PDF
Hacking the Web
PPTX
Securing Solve Labs: Addressing Key Vulnerabilities through Practical Labs
PPTX
Hacker, you shall not pass!
PDF
Web PenTest Sample Report
PPT
Introduction to Web Application Penetration Testing
PPTX
AW-Infs201101067.pptx
PDF
Tales of modern day data breaches - a web security guide for developers
PPTX
Pci compliance writing secure code
PPTX
OWASP top 10-2013
PDF
Jouri Dufour - How About Security Testing - EuroSTAR 2013
PPTX
State of the information security nation
PDF
Web application sec_3
PDF
Devbeat Conference - Developer First Security
PPTX
Hacking_Environment_Web_Application_updated.pptx
Identifying and Eradicating Web Application Vulnerabilities : Cyber Security ...
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
Ethical Hacking Techniques for Web Application Security
Security Testing Training With Examples
Lets Make our Web Applications Secure
Hacking the Web
Securing Solve Labs: Addressing Key Vulnerabilities through Practical Labs
Hacker, you shall not pass!
Web PenTest Sample Report
Introduction to Web Application Penetration Testing
AW-Infs201101067.pptx
Tales of modern day data breaches - a web security guide for developers
Pci compliance writing secure code
OWASP top 10-2013
Jouri Dufour - How About Security Testing - EuroSTAR 2013
State of the information security nation
Web application sec_3
Devbeat Conference - Developer First Security
Hacking_Environment_Web_Application_updated.pptx
Ad

More from jatniwalafizza786 (9)

PPTX
Heart Disease Analysis: Insights and Data TrendsHeart Disease Analysis: Insig...
PPTX
Heart Disease Prediction: A Data Science Approach
PPTX
Credit Card Fraud Detection: Leveraging Advanced Techniques
PPTX
Password Management System: Enhancing Security and Efficiency
PPTX
Comprehensive Website Port Scan: Functions, Benefits, and Security Threats
PPTX
Scan Website Vulnerability - Project Presentation
PDF
Navigating the World of Mergers and Acquisitions Strategies for Success
PDF
Exploring time series analysis: Methods and Classifications
PDF
Exploring the Key Types of Cybersecurity Testing
Heart Disease Analysis: Insights and Data TrendsHeart Disease Analysis: Insig...
Heart Disease Prediction: A Data Science Approach
Credit Card Fraud Detection: Leveraging Advanced Techniques
Password Management System: Enhancing Security and Efficiency
Comprehensive Website Port Scan: Functions, Benefits, and Security Threats
Scan Website Vulnerability - Project Presentation
Navigating the World of Mergers and Acquisitions Strategies for Success
Exploring time series analysis: Methods and Classifications
Exploring the Key Types of Cybersecurity Testing

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
Classroom Observation Tools for Teachers
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Types and Its function , kingdom of life
PDF
Complications of Minimal Access Surgery at WLH
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
01-Introduction-to-Information-Management.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
master seminar digital applications in india
PPTX
Cell Structure & Organelles in detailed.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
102 student loan defaulters named and shamed – Is someone you know on the list?
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Pre independence Education in Inndia.pdf
Classroom Observation Tools for Teachers
FourierSeries-QuestionsWithAnswers(Part-A).pdf
O7-L3 Supply Chain Operations - ICLT Program
TR - Agricultural Crops Production NC III.pdf
Pharma ospi slides which help in ospi learning
Cell Types and Its function , kingdom of life
Complications of Minimal Access Surgery at WLH
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial disease of the cardiovascular and lymphatic systems
01-Introduction-to-Information-Management.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
master seminar digital applications in india
Cell Structure & Organelles in detailed.

Solving Labs for Common Web Vulnerabilities

  • 2. • Solve Labs that are created for the following vulnerabilities: 1.Login Bypass 2. Admin Credentials Access (SQLi) 3. CSRF 4. XSS DINKAR MISHRA 2
  • 3. 1. Login Bypass :- Introduction :- Login bypass vulnerabilities are security flaws that allow unauthorized users to gain access to a system by circumventing the standard authentication mechanisms. These vulnerabilities can be exploited in various ways, each depending on the specific weaknesses of the system in question. Here are some common method of login bypass vulnerabilities:- 1. SQL Injection. 2. Brute Force Attack. 3. Default Credentials. DINKAR MISHRA 3
  • 4. 4. URL Manipulation. 5. Weak Password Recovery Mechanisms. Tools Used :- 1. Brup Suite 2. Kali Linux 3. Wappalizer Web site Link for Practical used :- https://0ac5007d0496376680a6c61e008c0063.web- security-academy.net/ ----> Port Swigger DINKAR MISHRA 4
  • 5. Technology Used By Site :- DINKAR MISHRA 5
  • 6. Login Bypass using Brute Force Password Change :- Step 1:- Login a site with your username and Password. Step 2:- Change a password using two different new password the error msg says “New passwords do not match”. We can use this message to enumerate correct passwords. Step 3:-Send This MSG to Burp Intruder “POST /my-account/change-password HTTP/2” DINKAR MISHRA 6
  • 9. Step 4:- In Burp Intruder, change the username parameter to carlos and add a payload position to the current-password parameter. Step 5:- On the Payloads tab, enter the list of passwords as the payload set Step 6:- On the Settings tab, add a grep match rule to flag responses containing New passwords do not match. Start the attack DINKAR MISHRA 9
  • 12. Step 7 :- When the attack finished, notice that one response was found that contains the New passwords do not match message. Make a note of this password. Step 8:- In the browser, log out of your own account and lock back in with the username carlos and the password that you just identified. DINKAR MISHRA 12
  • 14. Mitigations :- • Implement Strong Password Policies: Encourage users to create complex passwords that include a mix of upper and lowercase letters, numbers, and special characters. Enforce password complexity requirements through your authentication system. • Enforce Regular Password Changes: Regularly prompt users to change their passwords, but ensure that the frequency isn't so high that it becomes burdensome or encourages users to create predictable passwords. • Multi-factor Authentication (MFA): Implement MFA to add an extra layer of security beyond passwords. This could involve using a one-time code sent to a user's phone or email, biometric authentication, or hardware tokens. DINKAR MISHRA 14
  • 15. • Account Lockout Policies: Implement account lockout mechanisms that temporarily lock an account after a certain number of failed login attempts. This prevents brute force attacks by making it impractical to try a large number of passwords. • Monitoring and Alerting: Set up monitoring systems to detect unusual login attempts or patterns of activity that may indicate a brute force attack. Configure alerts to notify administrators when such activity is detected so they can take action. • Rate Limiting: Implement rate limiting on login attempts to prevent an attacker from making too many requests in a short period of time. This can help mitigate the effectiveness of brute force attacks by slowing down the rate at which passwords can be tried. DINKAR MISHRA 15
  • 16. 2. ADMIN CREDENTIALS ACCESS (SQLI) Introduction :- SQLi stands for SQL Injection, and it's a type of vulnerability that occurs in web applications. In VAPT (Vulnerability Assessment and Penetration Testing), SQLi refers to the exploitation of this vulnerability to manipulate a database using SQL queries. when a web application doesn't properly sanitize or validate user input, an attacker can inject malicious SQL code into the input fields. DINKAR MISHRA 16
  • 17. This malicious code can then be executed by the application's database, allowing the attacker to perform various actions like retrieving sensitive data, modifying or deleting data, and even taking control of the entire database server. SQLi is identified through various techniques such as input validation testing, automated scanning tools, and manual testing. Once identified, it's crucial to fix the vulnerability by implementing proper input validation and sanitization techniques to prevent potential exploitation. DINKAR MISHRA 17
  • 18. Tool used :- 1. Brup Suite 2. Kali Linux 3. Wappalizer Web site Link for Practical used :- https://0a6d003e03145e2d8015940d00fb00f7.web- security-academy.net/ ----> Port Swigger “The login function on the website already has a SQL Injection Vulnerability, so we don’t need to use any additional tools to find it. So we can directly perform our labs.” DINKAR MISHRA 18
  • 19. SQL Injection Vulnerability Attack and Login As Admin User :- Step :-1 Use default Username and password to capture the request in Burp Suite. Step :-2 Analyze the pattern of SQL query Like :- Select * from users where username =‘admin’ and password=‘admin’ DINKAR MISHRA 19
  • 20. • As you can see if write a wrong username and password it gives and error “400 Bad request” • But if we use SQL injection it give a error which defines that this site has a SQLi Vulnerability DINKAR MISHRA 20
  • 21. Step 3:- After Capturing the request send the request to Intruder and Repeater. After that make parameterize username And payload list and run the payload. DINKAR MISHRA 21
  • 22. Step 4:- As you can “302” code is for successful authentication. Correct SQLi payload is “Administrator’—” Username :- Administrator’— Password :- Anything DINKAR MISHRA 22
  • 23. Mitigations:- Parameterized Queries: Use parameterized queries or prepared statements provided by your programming language or ORM (Object- Relational Mapping) framework. This helps separate SQL code from data, making it much harder for attackers to inject malicious SQL code. Stored Procedures: Utilize stored procedures to encapsulate SQL code on the database server. This can prevent attackers from directly manipulating SQL queries. Input Validation: Validate and sanitize user inputs to ensure they conform to expected formats. Reject any input that doesn't meet validation criteria. Least Privilege Principle: Ensure that the database user account used by the application has the least privileges necessary. For example, it should only have permissions to execute stored procedures or specific queries, rather than being able to directly modify database structure or access sensitive data. DINKAR MISHRA 23
  • 24. 3. CSRF:- Introduction:- CSRF stands for Cross-Site Request Forgery. It's a type of malicious attack where an attacker tricks a user into unintentionally executing actions on a web application in which they are authenticated. This is achieved by exploiting the trust that a web application has in a user's browser. Here's how CSRF attacks typically work: 1.Authentication: The victim user is authenticated to a web application by logging in, and a session cookie is stored in their browser to maintain the session. 2.Malicious Link or Code: The attacker then lures the victim into visiting a web page controlled by the attacker. This could be through a phishing email, a malicious website, or other means. The malicious page contains code or a link that automatically sends a request to the vulnerable web application. DINKAR MISHRA 24
  • 25. Tool used :- 1. Brup Suite 2. Kali Linux 3. Wappalizer Web site Link for Practical used :- https://0a9800da03544bed81608aa800080017.web- security-academy.net/login ----> Port Swigger “The login function on the website already has a CSRF Vulnerability, so we don’t need to use any additional tools to find it. So we can directly perform our labs.” DINKAR MISHRA 25
  • 26. CSRF vulnerability test :- Step 1:- Checking that the site has CSRF vulnerability or not . We need to test whether changing the request method from “POST” to “GET” allows the request to work without requiring a CSRF token or not. DINKAR MISHRA 26
  • 27. • Request Method can be changed to GET which does not required CSRF token. • Hence it states that this site has CSRF vulnerability. Step 2:- Exploit • Generate CSRF PoC. • right-click on the request, and from the context menu select Engagement tools / Generate CSRF PoC. Enable the option to include an auto-submit script and click "Regenerate". DINKAR MISHRA 27
  • 28. Change the email Address and match the Request Session ID. DINKAR MISHRA 28
  • 29. Step 3:- use the following HTML template. You can get the request URL by right-clicking and selecting "Copy URL“ and Store the exploit, then click "Deliver to victim" . <html> <!-- CSRF PoC - generated by Burp Suite Professional --> <body> <form action="https://0a9800da03544bed81608aa800080017.web-security-academy.net/my-account/change-email"> <input type="hidden" name="email" value="dinkarmishra105&#64;test&#46;com" /> <input type="submit" value="Submit request" /> </form> <script> history.pushState('', '', '/'); document.forms[0].submit(); </script> </body> </html> DINKAR MISHRA 29
  • 31. Mitigations:- CSRF Tokens: Generate unique tokens for each session or form submission. These tokens are embedded in forms or included in requests, and the server verifies them to ensure the request is legitimate. SameSite Cookies: Set the SameSite attribute on cookies to "Strict" or "Lax" to prevent cookies from being sent in cross-origin requests. This helps mitigate CSRF attacks by reducing the likelihood of unauthorized requests originating from other sites. Custom Headers: Include custom headers in requests and verify them on the server side. This can add an extra layer of protection, as attackers would need to know and include these custom headers in their forged requests. DINKAR MISHRA 31
  • 32. 4. XSS :- • XSS, or Cross-Site Scripting, is a type of security vulnerability commonly found in web applications. In an XSS attack, an attacker injects malicious scripts (usually JavaScript) into web pages viewed by other users. These scripts execute in the context of the victim's browser, allowing the attacker to steal sensitive information, hijack user sessions, deface websites, or perform other malicious actions. • There are three main types of XSS attacks: 1.Reflected XSS: In a reflected XSS attack, the malicious script is injected into a web application's input (e.g., a URL parameter or a form field) and then reflected back to the user in the application's response. This often occurs when an application fails to properly sanitize user input before echoing it back to the user. DINKAR MISHRA 32
  • 33. 2.Stored XSS: In a stored XSS attack, the malicious script is permanently stored on the web server, typically in a database, and then served to multiple users whenever they access the vulnerable web page. This type of XSS attack is more dangerous as it can affect multiple users and persists over time. 3.DOM-based XSS: DOM-based XSS occurs when the client- side JavaScript code in a web page processes data from an untrusted source in an unsafe way, leading to the execution of malicious scripts. Unlike reflected and stored XSS, DOM- based XSS does not involve server-side vulnerabilities; instead, it exploits client-side vulnerabilities in the Document Object Model (DOM) of the web page. DINKAR MISHRA 33
  • 34. Tool used :- 1. Brup Suite 2. Kali Linux 3. Wappalizer Web site Link for Practical used :- https://0a34004f043720a881b46bbb00cb00e9.web- security-academy.net/ ----> Port Swigger “The login function on the website already has a XSS Vulnerability, so we don’t need to use any additional tools to find it. So we can directly perform our labs.” DINKAR MISHRA 34
  • 35. “DOM-based cross-site scripting vulnerability” in the search query tracking functionality :- It uses the JavaScript document.write function, which writes data out to the page. The document.write function is called with data from location.search, which you can control using the website URL. Step 1:- Enter a random alphanumeric string into the search box. Right-click and inspect the element, and observe that your random string has been placed inside an img src attribute. DINKAR MISHRA 35
  • 37. Step 2:- Break out of the img attribute by searching for: "><svg onload=alert(1)> DINKAR MISHRA 37
  • 39. Mitigations:- To prevent XSS attacks, developers should implement proper input validation and output encoding techniques. This includes validating and sanitizing user input to ensure that it does not contain malicious scripts and encoding output data to prevent unintended script execution. Additionally, using security mechanisms such as Content Security Policy (CSP) can help mitigate the risk of XSS attacks by restricting the types of content that can be executed on a web page. Regular security audits and testing are also essential to identify and address XSS vulnerabilities in web applications. DINKAR MISHRA 39
  • 40. Thank You!! From :- DINKAR MISHRA DINKAR MISHRA 40