PyNuclei is an unofficial Python library for Nuclei Scanner.
- Run Nuclei Scans for all or selected templates
- By default uses random User-Agents for every scan.
- User-defined rate limit (Default: 150)
pip3 install PyNuclei
from PyNuclei import Nuclei
"""
nucleiScanner.scan()
Args:
host [str]: The hostname of the target which Nuclei will run against
templates [list][Optional]: If templates list not provided all nuclei templates from "nucleiTemplates" property will be executed
userAgents [str][Optional]: If not provided random User-Agents will be used.
rateLimit [int][Optional]: Defaults to 150.
Returns:
result [dict]: Scan result from all templates.
"""
nucleiScanner = Nuclei()
scanResult = nucleiScanner.scan("example.com", template=["cves","network", "ssl"], rateLimit=150))
print(scanResult)
from PyNuclei import Nuclei
nucleiScanner = Nuclei()
"""
All active templates.
"""
print(nucleiScanner.nucleiTemplates)
[
"cnvd", "cves", "default-logins", "exposed-panels",
"exposures", "file", "misconfiguration",
"miscellaneous", "takeovers", "technologies",
"token-spray", "vulnerabilities", "network",
"dns", "iot", "ssl"
]
"""
All ignored templates.
"""
print(nucleiScanner.ignoredTemplates)
[
"headless", "fuzzing", "helpers",
]
NOTE: You can run ignored templates by passing them in the template parameter in nucleiScanner.scan(<host>, template=nucleiScanner.ignoredTemplates)
from PyNuclei import Nuclei
"""
This will update Nuclei engine & Nuclei Templates.
"""
Nuclei.updateNuclei(verbose=True)