Skip to content

secretshunter is a penetration testing tool that uses regular expressions to search a filesystem for secrets (logins, passwords, API keys, hashes, ssh keys etc.).

License

Notifications You must be signed in to change notification settings

hhruszka/secrethunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: AGPL v3v1.0.0-alpha

secrethunter

secrethunter is a penetration testing tool that uses regular expressions to search a filesystem for secrets. It can be used to search also container images for secrets by pointing to a container's root filesystem. It uses regular expressions provided in yaml files to find secrets (passwords, hashes, API keys etc.) in found plaintext files. It is compatible with yaml files provided by https://github.com/mazen160/secrets-patterns-db project.

secrethunter is multithreaded application that allows to control its impact on the system. It can be done by specifying the number of vCPUs it is allowed to use with option -c and also by throttling it based on maximum CPU usage set with option -t.

Usage

Usage: secrethunter [OPTIONS] "space seperated directories to scan"
  -c int
        maximum number of vCPUs to be used by a program - optional (default 16)
  -h    prints help
  -t float
        throttling, range from 10 to 80 denoting maximum CPU usage (%) that the
        system cannot exceed during execution of the program - optional (default 80)
  -o string
        output file - optional (default "Stdout")
  -p string
        file with patterns - mandatory. Patterns can be found on https://github.com/mazen160/secrets-patterns-db
  -v    prints version information
  -x string
        comma seperated list of directories to exclude during the scan

Examples:

./secrethunter -p ./high-confidence.yaml -c 4 -t 65 -o ~/seceret-scan-report -x /proc,/dev /home /opt 

The above will:

  • use ./high-confidence.yaml file with secrets regresion expressions
  • use only 4 vCPUs
  • throttle itself if CPU usage is above 65%
  • save found secrets in ~/seceret-scan-report
  • exclude directories /proc and /dev from scanning
  • scan directories /home and /opt

Binaries

Compiled secretshunter binaries for Linux and Windows can be found under the releases link or in executables folder.

Licensing

secrethunter is licensed under the GNU Affero General Public License v3.0 (AGPLv3). You are free to use, distribute, and modify this software under the terms of the AGPLv3. If you modify this software, any changes or improvements made must be made available to the community under the same license. This license also applies to any software that uses or is derived from this software. Please refer to the full text of the AGPLv3 for more details: https://www.gnu.org/licenses/agpl-3.0.html

secrethunter includes third-party packages that are subject to their respective licenses:

Please review these licenses before using this code or these packages in your own projects.

About

secretshunter is a penetration testing tool that uses regular expressions to search a filesystem for secrets (logins, passwords, API keys, hashes, ssh keys etc.).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages