Week 20220 Report
Week 20220 Report
Full Name:
Program: HCS - Penetration Testing Internship Week-2
Date: 01/03/2024
Introduction
This report document hereby describes the proceedings and results of a Black Box security
assessment conducted against the Week 2 Labs. The report hereby lists the findings and
corresponding best practice mitigation actions and recommendations.
1. Objective
The objective of the assessment was to uncover vulnerabilities in the Week 2 Labs and
provide a final security assessment report comprising vulnerabilities, remediation strategy
and recommendation guidelines to help mitigate the identified vulnerabilities and risks
during the activity.
2. Scope
This section defines the scope and boundaries of the project.
4 5 6
$
Vulnerable URLs
https://labs.hacktify.in/HTML/xss_lab/lab_2/lab_2.php?email=%22%3E%3Cscript%3E+alert%2
8%22Hacktify+Hack+u+bro+hahah%21%21%21%22%29+%3C%2Fscript%3E
Consequences of not Fixing the Issue
• Session hijacking: Attackers can steal session cookies and hijack legitimate user accounts, potentially
leading to unauthorized access to sensitive information or systems.
• Data theft: XSS attacks can be used to steal sensitive data such as login credentials, credit card
information, and personally identifiable information (PII).
• Malicious redirects: Attackers can redirect users to malicious websites or perform other malicious
operations on the user's machine under the guise of the vulnerable site.
• Account compromise: If an attacker gains access to an account with administrative privileges, they
can perform unauthorized actions, potentially leading to severe damage to the web application.
• Reputation damage: XSS vulnerabilities can undermine the trust users have in a company, leading to
negative publicity and potential loss of customers.
Suggested Countermeasures
• Input validation: Validate and sanitize all user inputs to ensure they do not contain malicious
scripts that could be executed on the website.
• Output encoding: Encode user-generated content before displaying it on the website to
prevent browsers from interpreting it as executable code.
• Content Security Policy (CSP): Implement a CSP to restrict the sources from which certain types
of content can be loaded on your website, reducing the risk of XSS attacks.
• Use security libraries: Utilize security libraries like OWASP ESAPI to help prevent common
security vulnerabilities, including XSS attacks.
• Regular security audits: Conduct regular security audits and penetration testing to identify and
address any vulnerabilities in your web application.
References
1.3. XSS Is Everywhere!
Reference Risk Rating
XSS Is Everywhere! Low
Tools Used
Payload : [email protected]<script> alert("Hacktify Hack u bro hahah!!!") </script>
Vulnerability Description
the warning or response thrown in the response, we can think of one of the major reasons for
our payload not working is not the payload itself, but a thing called input validation, basically
in simple words the backed code is checking the input of the search box that it should be in
the
form of a email
How It Was Discovered
Vulnerable URLs
https://labs.hacktify.in/HTML/xss_lab/lab_3/lab_3.php?email=user1%40mail.com%3Cscript%3
E+alert%28%22Hacktify+Hack+u+bro+hahah%21%21%21%22%29+%3C%2Fscript%3E
Consequences of not Fixing the Issue
Session hijacking: Attackers can steal session cookies and hijack legitimate user
accounts, potentially leading to unauthorized access to sensitive information or
systems.
Data theft: XSS attacks can be used to steal sensitive data such as login credentials,
credit card information, and personally identifiable information (PII).
Malicious redirects: Attackers can redirect users to malicious websites or perform
other malicious operations on the user's machine under the guise of the
vulnerable site.
Account compromise: If an attacker gains access to an account with administrative
privileges, they can perform unauthorized actions, potentially leading to severe
damage to the web application.
Reputation damage: XSS vulnerabilities can undermine the trust users have in a
company, leading to negative publicity and potential loss of customers.
Suggested Countermeasures
Output encoding: Encode user-generated content before displaying it on the website
to prevent browsers from interpreting it as executable code.
Content Security Policy (CSP): Implement a CSP to restrict the sources from which
certain types of content can be loaded on your website, reducing the risk of XSS attacks.
Use security libraries: Utilize security libraries like OWASP ESAPI to help prevent
common security vulnerabilities, including XSS attacks.
Regular security audits: Conduct regular security audits and penetration testing to identify and
address any vulnerabilities in your web application
References
Vulnerable URLs
https://labs.hacktify.in/HTML/xss_lab/lab_6/lab_6.php?email=%22%3E%3Cimg+src%3DY+one
rror%3Dalert%28%22hacked%22%29%3E
Consequences of not Fixing the Issue
Session Hijacking: Attackers can exploit XSS vulnerabilities to steal session cookies,
enabling them to hijack user accounts and gain unauthorized access to sensitive
information or systems.
Data Theft: XSS attacks can result in the theft of sensitive data like login credentials,
credit card details, and personally identifiable information (PII), putting users at risk of
identity theft and financial loss.
Account Compromise: The most severe XSS attacks can lead to complete account
compromise, allowing attackers to access user accounts, manipulate content, install
malware, or redirect users to malicious websites
Suggested Countermeasures
Enhanced Input Validation: Strengthen input validation processes to detect and
sanitize malicious scripts effectively, ensuring that all user inputs are thoroughly
validated and sanitized before being processed.
Output Encoding: Apply proper output encoding techniques to all user-generated
content to prevent script execution and protect against XSS attacks, even if "<script>"
tags have been sanitized.
Content Security Policy (CSP): Implement a robust CSP to restrict the sources from which
scripts can be loaded, reducing the risk of unauthorized script execution and
enhancing overall web application security.