Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ go.work.sum
*.db

.vscode

CLAUDE.md
.claude
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We welcome contributions from everyone! Here's how you can contribute:

2. **Create a New Branch**
- Make your changes
- If you want to add a new vulnerable target template, check [the example template](./templates/example-template/index.yaml)
- If you want to add a new vulnerable target template, please contribute to our separate templates repository: [vt-templates](https://github.com/HappyHackingSpace/vt-templates). You can check the [example template](https://github.com/HappyHackingSpace/vt-templates/blob/main/cves/vt-2024-53995/index.yaml).
- Test your changes locally before submitting

3. **Submit a Pull Request**
Expand Down
54 changes: 48 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ Vulnerable Target (VT) is a specialized tool designed for security professionals
> This tool creates intentionally vulnerable environments. Running this on a public server or an insecure network can expose you to severe security risks. Use only in an isolated, local environment (sandbox/VM).

## Features
- Community-Curated List of Vulnerable Targets
- Interactive Vulnerability Playground (TODO)
- CLI (In-Progress)
- CLI for managing vulnerable environments
- Docker Compose provider for container orchestration
- Community-curated templates from [vt-templates](https://github.com/HappyHackingSpace/vt-templates)
- Template filtering by tags
- Deployment state tracking

## Prerequisites
- Go 1.24+
- Docker & Docker Compose

## Installation

## Quickstart
1. Clone the repository
```bash
git clone https://github.com/HappyHackingSpace/vulnerable-target.git
Expand All @@ -28,10 +35,45 @@ cd vulnerable-target
go mod download
```

3. Run the application with:
3. Build the binary
```bash
go build -o vt cmd/vt/main.go
```

4. (Optional) Move to your PATH
```bash
mv vt /usr/local/bin/
```

## Usage

```bash
go run cmd/vt/main.go
# List available templates
vt template --list

# Filter templates by tag
vt template --list --filter sql

# Update templates from remote repository
vt template --update

# Start a vulnerable environment
vt start --id <template-id> --provider docker-compose

# List running environments
vt ps

# Stop an environment
vt stop --id <template-id> --provider docker-compose

# Set verbosity level
vt -v debug <command>
```

## Templates

Templates are automatically cloned to `~/vt-templates` on first run. To contribute new vulnerable target templates, visit the [vt-templates repository](https://github.com/HappyHackingSpace/vt-templates).

## Documentation
Check the full documentation here: [Vulnerable Target Wiki](https://github.com/HappyHackingSpace/vulnerable-target/wiki)

Expand Down
37 changes: 29 additions & 8 deletions cmd/vt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,40 @@
package main

import (
"github.com/happyhackingspace/vulnerable-target/internal/banner"
"github.com/happyhackingspace/vulnerable-target/internal/app"
"github.com/happyhackingspace/vulnerable-target/internal/cli"
"github.com/happyhackingspace/vulnerable-target/internal/logger"
"github.com/happyhackingspace/vulnerable-target/pkg/templates"
"github.com/happyhackingspace/vulnerable-target/internal/state"
"github.com/happyhackingspace/vulnerable-target/pkg/provider/registry"
"github.com/happyhackingspace/vulnerable-target/pkg/store/disk"
"github.com/happyhackingspace/vulnerable-target/pkg/template"
"github.com/rs/zerolog/log"
)

func main() {
// Initialize logger and templates explicitly
logger.Init()
templates.Init()
cfg := app.DefaultConfig()

banner.Print()
appLogger := logger.NewWithLevel(cfg.LogLevel)
logger.SetGlobal(appLogger)

// Run the CLI
cli.Run()
templates, err := template.LoadTemplates(cfg.TemplatesPath)
if err != nil {
log.Fatal().Err(err).Msg("failed to load templates")
}

storeCfg := disk.NewConfig().
WithFileName("deployments.db").
WithBucketName("deployments")
stateManager, err := state.NewManager(storeCfg)
if err != nil {
log.Fatal().Err(err).Msg("failed to create state manager")
}

providers := registry.NewProviders(stateManager)

application := app.NewApp(templates, providers, stateManager, cfg)

if err := cli.New(application).Run(); err != nil {
log.Fatal().Err(err).Msg("CLI error")
}
}
6 changes: 1 addition & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/compose-spec/compose-go/v2 v2.8.1
github.com/docker/cli v28.3.3+incompatible
github.com/docker/compose/v2 v2.39.2
github.com/go-git/go-git/v5 v5.16.3
github.com/jedib0t/go-pretty/v6 v6.6.6
github.com/rs/zerolog v1.33.0
github.com/spf13/cobra v1.9.1
Expand Down Expand Up @@ -73,7 +74,6 @@ require (
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-git/go-git/v5 v5.16.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
Expand Down Expand Up @@ -114,7 +114,6 @@ require (
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/buildkit v0.23.0-rc1.0.20250618182037-9b91d20367db // indirect
Expand Down Expand Up @@ -158,7 +157,6 @@ require (
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
github.com/spf13/pflag v1.0.7 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/theupdateframework/notary v0.7.0 // indirect
github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375 // indirect
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect
Expand Down Expand Up @@ -205,8 +203,6 @@ require (
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
k8s.io/api v0.32.3 // indirect
k8s.io/apimachinery v0.32.3 // indirect
Expand Down
Loading