This is a python wrapper around the amazing KNOXSS API by Brute Logic. To use this tool (and the underlying API), you must have a valid KNOXSS API key. Don't have one? Go visit https://knoxss.me and subscribe! This was inspired by the "knoxssme" tool by @edoardottt2, but developed to allow for greater options.
DISCLAIMER: We are not responsible for any use, and especially misuse, of this tool or the KNOXSS API
NOTE: If you already have a config.yml
file, it will not be overwritten. The file config.yml.NEW
will be created in the same directory. If you need the new config, remove config.yml
and rename config.yml.NEW
back to config.yml
.
knoxnl
supports Python 3.
Install knoxnl
in default (global) python environment.
pip install knoxnl
OR
pip install git+https://github.com/xnl-h4ck3r/knoxnl.git -v
You can upgrade with
knoxnl -up
OR
pip install --upgrade knoxnl
Quick setup in isolated python environment using pipx
pipx install git+https://github.com/xnl-h4ck3r/knoxnl.git
Arg | Long Arg | Description |
---|---|---|
-i | --input | Input to send to KNOXSS API: a single URL, or file of URLs. NOTE: If you pass a URL, put it in quotes otherwise the shell can interpret & characters as instruction to run a background task. |
-o | --output | The file to save the successful XSS and payloads to. If the file already exist it will just be appended to unless option -ow is passed. If the full path doesn't exist, then any necessary directories will be created. |
-ow | --output-overwrite | If the output file already exists, it will be overwritten instead of being appended to. |
-oa | --output-all | Write all results to the output file, not just successful one's. |
-X | --http-method | Which HTTP method to use, values GET , POST or BOTH (default: GET ). If BOTH is chosen, then a GET call will be made, followed by a POST . |
-pd | --post-data | If a POST request is made, this is the POST data passed. It must be in the format 'param1=value¶m2=value¶m3=value' . If this isn't passed and query string parameters are used, then these will be used as POST data if POST Method is requested. |
-H | --headers | Add custom headers to pass with HTTP requests. Pass in the format 'Header1:value1;\|Header2:value2' (e.g. separate different headers with a pipe | character). |
-A | --api-key | The KNOXSS API Key to use. This will be used instead of the value in config.yml |
-afb | --advanced-filter-bypass | If the advanced filter bypass should be used on the KNOXSS API. |
-s | --success-only | Only show successful XSS payloads in the CLI output. |
-p | --processes | Basic multithreading is done when getting requests for a file of URLs. This argument determines the number of processes (one per URL to check) are run per minute (default: 3). This is due to the rate limit of the KNOXSS API. |
-t | --timeout | How many seconds to wait for the KNOXSS API to respond before giving up (default: 600). If set to 0, then timeout will be used. |
-bp | --burp-piper | Use if knoxnl is called from the Burp Piper extension, so that a request in Burp Suite proxy can be tested. See the Using in Burp Suite Proxy section below. |
-r | --retries | The number of times to retry when having issues connecting to the KNOXSS API (default: 3) |
-ri | --retry-interval | How many seconds to wait before retrying when having issues connecting to the KNOXSS API (default: 30) |
-rb | --retry-backoff | The backoff factor used when retrying when having issues connecting to the KNOXSS API (default: 1.5). For example, with defaults, first time will wait for 30 seconds, 2nd time will be 45 (30 x 1.5) seconds, etc. |
-pur | --pause-until-reset | If the API Limit reset time is known and the API limit is reached, wait the required time until the limit is reset and continue again. The reset time is only known if knoxnl has run for request number 1 previously. The API rate limit is reset 24 hours after request 1. |
-sb | --skip-blocked | The number of 403 Forbidden responses from a target (for a given HTTP method + scheme + (sub)domain) before skipping. This is useful if you know the target has a WAF. The default is zero, which means no blocking is done. |
-up | --update | Update knoxnl to the latest version. |
-v | --verbose | Verbose output |
--version | Show current version number. | |
-h | --help | show the help message and exit |
The config.yml
file (in the global location based on the OS, e.g. ~/.config/knoxnl/config.yml
) has the keys which can be updated to suit your needs:
API_URL
- This can be set to the KNOXSS API endpoint, if and when it is changedAPI_KEY
- Your KNOXSS API key that you will have generated on https://knoxss.me/DISCORD_WEBHOOK
- Your discord webhook URL if you want to be notified of successful XSS-p
/--processes
) will be run per minute.[XSS]
mark in any place of the target's data values to enable Flash Mode which enables KNOXSS to perform a single quick XSS Polyglot based test.-o
/ --output
option to specify a file where output will be written. If you do reach the API limit, it resets 24 hours after the first API call was made. If you are processing a file of URLs, you can use the -pur
/--pause-until-reset
to wait until the reset happens and then continue (this is only possible if the first request was run by knoxnl
so it could save the response timestamp)..YYYYMMDD_HHMMSS.todo
suffix. You can then rename this file and use this as input at another time. The .todo
file will be created in the current directory unless a path is specified in the -o
/--output
directory, and then the .todo
file will be created in the same directory.-oa
/ --output-all
will write ALL results to the output file, not just successful one's.'param1=value¶m2=value¶m3=value'
.-pd
/--post-data
argument is not passed and a POST request is made, it will use the query string from the URL as post data if it has one.https://example.com?postParam1=value&postParam2-value
. If you use the -pd
/--post-data
with an input file then ALL URLs will use that post data.Pass a single URL:
NOTE: If you pass a URL, put it in quotes otherwise the shell can interpret &
characters as instruction to run a background task.
knoxnl -i "https://brutelogic.com.br/xss.php"
Or a file of URLs:
knoxnl -i ~/urls.txt
Test a single URL for both GET and POST. if it is successful, the payload will be output to output.txt
. In this case, an API key is provided, overriding any in config.yml
if it exists. Also, the parameter value has been passed as [XSS]
which will request the KNOXSS API to enable Flash Mode which performs a single quick XSS Polyglot based test:
knoxnl -i "https://brutelogic.com.br/xss.php?b3=[XSS]" -X BOTH -o output.txt -A 93c864f5-af3a-4f6a-8b25-8662bc8b5ab6
Test a single URL for POST and pass post body data:
knoxnl -i "https://brutelogic.com.br/xss.php" -X POST -pd user=xnl -o output.txt
Pass cookies and an auth header for a single URL, and use the Advanced Filter Bypass option:
knoxnl -i "https://bugbountytarget.com?a=one&b=2" -afb -H "Cookie: sessionId=9d7127ca-8966-4ae9-b20a-c2892a2f1167; lang=en;|Authorization: Basic eyJZb3UgZGlkbid0IHRoaW5rIHRoaXMgYSBnZW51aW5lIHRva2VuIGRpZCB5b3U/ISA7KSJ9"
To be able to use knoxnl to test a request in Burp Suite Proxy, we can use it in conjunction with the amazing Piper
extension by András Veres-Szentkirályi. Follow the steps below to set it up:
knoxnl
and change the Can handle... drop down to HTTP requests only
.1
./my/path/to/python3 /my/path/to/knoxnl.py --burp-piper -X BOTH
for example, providing the full path of the knoxnl
binary file./my/path/to/knoxnl
--burp-piper
-X
BOTH
-A your_knoxss_api_key
, -t 60
, etc. Remember to put the argument and the value on separate lines.wsl -e /my/path/to/knoxnl --burp-piper -X BOTH
for example, providing the full path of the knoxnl.py
binary file.wsl
-e
/my/path/to/knoxnl
--burp-piper
-X
BOTH
-A your_knoxss_api_key
, -t 60
, etc. Remember to put the argument and the value on separate lines.Piper is now set up to be able to call knoxnl.
To call knoxnl for a particular request, follow these steps:
-t
/--timeout
).With Piper you can also send the knoxnl request to a queue by selecting Extensions -> Piper -> Add to queue. You can then go to the Queue sub tab under Piper and see the request. Right click the request to send to knoxnl.
If you come across any problems at all, or have ideas for improvements, please feel free to raise an issue on Github. If there is a problem, it will be useful if you can provide the exact command you ran and a detailed description of the problem. If possible, run with -v
to reproduce the problem and let me know about any error messages that are given, and the KNOXSS API request/response.
knoxnl
..blocked
file.Single URL:
File of URLs checked with GET and POST:
Example Discord notification:
Good luck and good hunting! If you really love the tool (or any others), or they helped you find an awesome bounty, consider BUYING ME A COFFEE! ☕ (I could use the caffeine!)
🤘 /XNL-h4ck3r