Skip to main content

Command-line tool to scan search results for vulnerabilities

Project description

Image of Dorkbot

dorkbot

Scan Google (or other) search results for vulnerabilities.

dorkbot is a modular command-line tool for performing vulnerability scans against sets of webpages returned by Google search queries or other supported sources. It is broken up into two sets of modules:

  • Indexers - modules that return a list of targets
  • Scanners - modules that perform a vulnerability scan against each target

Targets are stored in a database as they are indexed. Once scanned, a standard JSON report is produced containing any vulnerabilities found. Indexing and scanning processes can be run separately or combined in a single command (up to one of each).

Quickstart

$ pip3 install dorkbot wapiti3
$ dorkbot -i google_api -o key=your_api_credential_here -o engine=your_engine_id_here -o query="filetype:php inurl:id"
$ dorkbot -s wapiti

Help

 -h, --help            Show program (or specified module) help
  --show-defaults       Show default values in help output

Usage

usage: dorkbot.py [-c CONFIG] [-r DIRECTORY] [--source [SOURCE]]
                  [--show-defaults] [--count COUNT] [--random] [-h]
                  [--log LOG] [-v] [-V] [-d DATABASE] [-u] [-l]
                  [--list-unscanned] [--add-target TARGET]
                  [--delete-target TARGET] [--flush-targets] [-i INDEXER]
                  [-o INDEXER_ARG] [-s SCANNER] [-p SCANNER_ARG] [-f]
                  [--list-blocklist] [--add-blocklist-item ITEM]
                  [--delete-blocklist-item ITEM] [--flush-blocklist]
                  [-b EXTERNAL_BLOCKLIST]

options:
  -c CONFIG, --config CONFIG
                        Configuration file
  -r DIRECTORY, --directory DIRECTORY
                        Dorkbot directory (default location of db, tools,
                        reports)
  --source [SOURCE]     Label associated with targets
  --show-defaults       Show default values in help output
  -h, --help            Show program (or specified module) help
  --log LOG             Path to log file
  -v, --verbose         Enable verbose logging (DEBUG output)
  -V, --version         Print version

global scanner options:
  --count COUNT         number of urls to scan, or -1 to scan all urls
  --random              retrieve urls in random order

database:
  -d DATABASE, --database DATABASE
                        Database file/uri
  -u, --prune           Apply fingerprinting and blocklist without scanning

targets:
  -l, --list-targets    List targets in database
  --list-unscanned      List unscanned targets in database
  --add-target TARGET   Add a url to the target database
  --delete-target TARGET
                        Delete a url from the target database
  --flush-targets       Delete all targets

indexing:
  -i INDEXER, --indexer INDEXER
                        Indexer module to use
  -o INDEXER_ARG, --indexer-arg INDEXER_ARG
                        Pass an argument to the indexer module (can be used
                        multiple times)

scanning:
  -s SCANNER, --scanner SCANNER
                        Scanner module to use
  -p SCANNER_ARG, --scanner-arg SCANNER_ARG
                        Pass an argument to the scanner module (can be used
                        multiple times)

fingerprints:
  -f, --flush-fingerprints
                        Delete all fingerprints of previously-scanned items

blocklist:
  --list-blocklist      List internal blocklist entries
  --add-blocklist-item ITEM
                        Add an ip/host/regex pattern to the internal blocklist
  --delete-blocklist-item ITEM
                        Delete an item from the internal blocklist
  --flush-blocklist     Delete all internal blocklist items
  -b EXTERNAL_BLOCKLIST, --external-blocklist EXTERNAL_BLOCKLIST
                        Supplemental external blocklist file/db (can be used
                        multiple times)

Tools / Dependencies

As needed, dorkbot will search for tools in the following order:

  • Directory specified via relevant module option
  • Located in tools directory (within current directory, by default), with the subdirectory named after the tool
  • Available in the user's PATH (e.g. installed system-wide)

Files

All SQLite3 databases, tools, and reports are saved in the dorkbot directory, which by default is the current directory. You can force a specific directory with the --directory flag. Default file paths within this directory are as follows:

  • SQLite3 database file: dorkbot.db
  • External tools directory: tools/
  • Scan report output directory: reports/

Configuration files are by default read from ~/.config/dorkbot/ (Linux / MacOS) or in the Application Data folder (Windows), honoring $XDG_CONFIG_HOME / %APPDATA%. Default file paths within this directory are as follows:

  • Dorkbot configuration file: dorkbot.ini

Config File

The configuration file (dorkbot.ini) can be used to prepopulate certain command-line flags.

Example dorkbot.ini:

[dorkbot]
database=/opt/dorkbot/dorkbot.db
[dorkbot.indexers.wayback]
domain=example.com
[dorkbot.scanners.arachni]
arachni_dir=/opt/arachni
report_dir=/tmp/reports

Blocklist

The blocklist is a list of ip addresses, hostnames, or regular expressions of url patterns that should not be scanned. If a target url matches any item in this list it will be skipped and removed from the database. The internal blocklist is maintained in the dorkbot database, but a separate file or databasecan be specified by passing the appropriate file path or connection uri to --external-blocklist. Targets are matched first against the internal blocklist and then optionally against any provided external blocklists.

Supported external blocklists:

  • postgresql://[server info]
  • phoenixdb://[server info]
  • sqlite3:///path/to/blocklist.db
  • /path/to/blocklist.txt

Example blocklist items:

regex:^[^\?]+$
regex:.*login.*
regex:^https?://[^.]*.example.com/.*
host:www.google.com
ip:127.0.0.1

The first item will remove any target that doesn't contain a question mark, in other words any url that doesn't contain any GET parameters to test. The second attempts to avoid login functions, and the third blocklists all target urls on example.com. The fourth excludes targets with a hostname of www.google.com and the fifth excludes targets whose host resolves to 127.0.0.1.

Prune

The prune flag iterates through all targets, computes the fingerprints in memory, and marks subsequent matching targets as scanned. Additionally it deletes any target matching a blocklist item. The result is a database where --list-unscanned returns only scannable urls. It honors the random flag to compute fingerprints in random order.

General Options

These options are applicable regardless of module chosen:

  --source [SOURCE]     Label associated with targets
  --count COUNT         number of urls to scan, or -1 to scan all urls
  --random              retrieve urls in random order

Indexer Modules

google

  Searches google.com via scraping

  --engine ENGINE       CSE id
  --query QUERY         search query
  --phantomjs-dir PHANTOMJS_DIR
                        phantomjs base dir containing bin/phantomjs
  --domain DOMAIN       limit searches to specified domain

google_api

  Searches google.com

  --key KEY             API key
  --engine ENGINE       CSE id
  --query QUERY         search query
  --domain DOMAIN       limit searches to specified domain

pywb

  Searches a given pywb server's crawl data

  --server SERVER       pywb server url
  --domain DOMAIN       pull all results for given domain or subdomain
  --cdx-api-suffix CDX_API_SUFFIX
                        suffix after index for index api
  --index INDEX         search a specific index
  --filter FILTER       query filter to apply to the search
  --retries RETRIES     number of times to retry fetching results on error
  --threads THREADS     number of concurrent requests to wayback.org

commoncrawl

  Searches commoncrawl.org crawl data

  --domain DOMAIN       pull all results for given domain or subdomain
  --index INDEX         search a specific index, e.g. CC-MAIN-2019-22 (default: latest)
  --filter FILTER       query filter to apply to the search
  --retries RETRIES     number of times to retry fetching results on error
  --threads THREADS     number of concurrent requests to commoncrawl.org

wayback

  Searches archive.org crawl data

  --domain DOMAIN       pull all results for given domain or subdomain
  --filter FILTER       query filter to apply to the search
  --from FROM           beginning timestamp
  --to TO               end timestamp
  --retries RETRIES     number of times to retry fetching results on error
  --threads THREADS     number of concurrent requests to wayback.org

bing_api

  Searches bing.com

  --key KEY             API key
  --query QUERY         search query

stdin

  Accepts urls from stdin, one per line

Scanner Modules

arachni

  Scans with the arachni command-line scanner

  --arachni-dir ARACHNI_DIR
                        arachni base dir containing bin/arachni and bin/arachni_reporter
  --args ARGS           space-delimited list of additional arguments
  --report-dir REPORT_DIR
                        directory to save vulnerability report
  --label LABEL         friendly name field to include in vulnerability report

wapiti

  Scans with the wapiti3 command-line scanner

  --wapiti-dir WAPITI_DIR
                        wapiti base dir containing bin/wapiti
  --args ARGS           space-delimited list of additional arguments
  --report-dir REPORT_DIR
                        directory to save vulnerability report
  --label LABEL         friendly name field to include in vulnerability report

Project details


Release history Release notifications | RSS feed

This version

0.4.8

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dorkbot-0.4.8.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dorkbot-0.4.8-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file dorkbot-0.4.8.tar.gz.

File metadata

  • Download URL: dorkbot-0.4.8.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dorkbot-0.4.8.tar.gz
Algorithm Hash digest
SHA256 3a6f984ea369dd0793b768f1152a7c0a1a0ce9b2b3e7631a223c5ff2cd41c925
MD5 aff8b617314ec10dd10da64bb76f75e6
BLAKE2b-256 6c20f6fd6e970e9f9c2d08bb0fef00b0aa633ac765e0e901188d3e206f24ec28

See more details on using hashes here.

File details

Details for the file dorkbot-0.4.8-py3-none-any.whl.

File metadata

  • Download URL: dorkbot-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dorkbot-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 cc979eb121efce9899358df09db71b4bf1e0ce6660340ef50606c6ef3201d6f1
MD5 e5c623273e780146006e24b324659c01
BLAKE2b-256 27d713d1dd9f82e10901eb340bb7f1eb0c408f347d1b7e741e95ef945b62fd13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page