This document describes the configuration options and file structure for vulhub-cli.
By default, vulhub-cli stores all configuration and data in ~/.vulhub/:
~/.vulhub/
├── config.toml # Main configuration file
├── environments.toml # Cached list of available environments
└── environments/ # Downloaded environment files
├── log4j/
│ └── CVE-2021-44228/
│ ├── docker-compose.yml
│ └── ...
└── struts2/
└── s2-045/
└── ...
| Platform | Default Path |
|---|---|
| Linux | ~/.vulhub/ |
| macOS | ~/.vulhub/ |
| Windows | %USERPROFILE%\.vulhub\ |
The main configuration file uses TOML format:
# GitHub repository settings
[github]
owner = "vulhub"
repo = "vulhub"
branch = "master"
token = "" # GitHub access token (set by github-auth)
# Sync settings
[sync]
last_sync = "2024-01-15T10:30:00Z"
auto_sync_days = 7 # Prompt to sync after this many days
# Network settings
[network]
proxy = "" # Proxy server URL (e.g., "http://127.0.0.1:8080" or "socks5://127.0.0.1:1080")
timeout = 30 # HTTP request timeout in seconds| Key | Type | Default | Description |
|---|---|---|---|
owner |
string | "vulhub" |
GitHub repository owner |
repo |
string | "vulhub" |
GitHub repository name |
branch |
string | "master" |
Git branch to use |
token |
string | "" |
GitHub access token |
| Key | Type | Default | Description |
|---|---|---|---|
last_sync |
datetime | - | Timestamp of last sync |
auto_sync_days |
integer | 7 |
Days before prompting to sync |
| Key | Type | Default | Description |
|---|---|---|---|
proxy |
string | "" |
Proxy server URL (HTTP or SOCKS5) |
timeout |
integer | 30 |
HTTP request timeout in seconds |
Supported proxy formats:
- HTTP proxy:
http://host:portorhttps://host:port - SOCKS5 proxy:
socks5://host:port - With authentication:
http://user:password@host:port
Environment variables take precedence over configuration file settings:
| Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub access token (overrides config.toml) |
VULHUB_PROXY |
Proxy server URL (highest priority for proxy) |
HTTPS_PROXY |
HTTPS proxy URL (standard environment variable) |
HTTP_PROXY |
HTTP proxy URL (standard environment variable) |
When multiple proxy sources are configured, the priority order is:
--proxycommand-line flag (highest)VULHUB_PROXYenvironment variableHTTPS_PROXYenvironment variableHTTP_PROXYenvironment variableproxysetting in config.toml (lowest)
# Use a specific GitHub token
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
vulhub start log4j
# Use proxy via environment variable
export VULHUB_PROXY=http://127.0.0.1:8080
vulhub syncup
# Or use standard proxy environment variables
export HTTPS_PROXY=http://127.0.0.1:8080
vulhub syncupThis file contains the cached list of available vulnerability environments. It is automatically downloaded from the Vulhub repository during init and syncup.
[[environment]]
path = "log4j/CVE-2021-44228"
app = "Apache Log4j"
cve = ["CVE-2021-44228"]
description = "Apache Log4j2 Remote Code Execution"
[[environment]]
path = "struts2/s2-045"
app = "Apache Struts2"
cve = ["CVE-2017-5638"]
description = "Apache Struts2 Remote Code Execution"
# ... more environments| Field | Type | Description |
|---|---|---|
path |
string | Environment directory path |
app |
string | Application name |
cve |
array | List of CVE numbers |
description |
string | Brief description |
When you start an environment for the first time, vulhub-cli downloads the necessary files from GitHub and stores them locally:
~/.vulhub/environments/<app>/<vulnerability>/
├── docker-compose.yml # Docker Compose configuration
├── README.md # Documentation (if available)
├── README.zh-cn.md # Chinese documentation (if available)
└── ... # Other files (Dockerfiles, configs, etc.)
List downloaded environments:
vulhub listRemove a specific environment:
vulhub clean <keyword>Manual cleanup:
rm -rf ~/.vulhub/environments/<app>/<vulnerability>You can specify a custom configuration file location using the --config flag:
vulhub --config /path/to/custom/config.toml start log4jThis only changes the config file location; the environments directory remains relative to the config file location.
To completely reset vulhub-cli:
# Remove all configuration and downloaded environments
rm -rf ~/.vulhub
# Re-initialize
vulhub initIf vulhub-cli reports "not initialized":
vulhub init-
Check if environment variable is set:
echo $GITHUB_TOKEN
-
Re-authenticate:
vulhub github-auth --remove vulhub github-auth
Force a fresh sync:
vulhub syncupReset and reinitialize:
rm ~/.vulhub/config.toml
vulhub init --force