Skip to content

Commit 2bea077

Browse files
committed
Merge branch 'dev'
2 parents 1488f58 + 0b6c099 commit 2bea077

File tree

9 files changed

+60
-90
lines changed

9 files changed

+60
-90
lines changed

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ vulnx analyze --fields affected_products.vendor
7171
| `filters` | List all available search fields and filters | `vulnx filters` |
7272
| `analyze` | Aggregate data by fields | `vulnx analyze -f severity` |
7373
| `auth` | Configure API access | `vulnx auth` |
74-
| `version` | Show version info | `vulnx version` |
74+
| `version` | Show version info and check for updates | `vulnx version` |
75+
| `update` | Update vulnx to latest version | `vulnx update` |
7576
| `healthcheck` | Test connectivity | `vulnx healthcheck` |
7677

7778
## Essential Options
@@ -181,14 +182,14 @@ vulnx search --detailed "log4j" # Detailed analysis of specific vuln
181182
| `--tags` | | Filter by tags | `--tags rce,injection` |
182183
| `--cvss-score` | | Filter by CVSS score | `--cvss-score ">8.0"` |
183184
| `--epss-score` | | Filter by EPSS score | `--epss-score ">0.8"` |
184-
| `--vuln-age` | | Filter by age | `--vuln-age "<30"` |
185+
| `--vuln-age` | `-a` | Filter by age | `--vuln-age "<30"` |
185186
| `--vuln-type` | | Filter by vulnerability type | `--vuln-type sql_injection` |
186-
| `--kev-only` | | KEV vulnerabilities only | `--kev-only` |
187+
| `--kev` | | KEV vulnerabilities only | `--kev` |
187188
| `--template` | `-t` | Has Nuclei templates | `--template` |
188189
| `--poc` | | Has proof of concept | `--poc` |
189190
| `--hackerone` | | HackerOne reported | `--hackerone` |
190191
| `--remote-exploit` | | Remotely exploitable | `--remote-exploit` |
191-
| `--vstatus` | | Filter by vuln status | `--vstatus confirmed` |
192+
| `--vuln-status` | | Filter by vuln status | `--vuln-status confirmed` |
192193

193194

194195
### Search Control Flags
@@ -220,13 +221,13 @@ vulnx search --severity critical,high # Filter by severity
220221
vulnx search "NOT severity:low" # Exclude severities using query syntax
221222
vulnx search --cvss-score ">8.0" # Filter by CVSS score
222223
vulnx search --epss-score ">0.8" # Filter by EPSS score
223-
vulnx search --vstatus confirmed # Filter by status
224+
vulnx search --vuln-status confirmed # Filter by status
224225
vulnx search --vuln-age "<30" # Recent vulnerabilities
225226
```
226227

227228
**Exploit characteristics:**
228229
```bash
229-
vulnx search --kev-only # KEV vulnerabilities only
230+
vulnx search --kev # KEV vulnerabilities only
230231
vulnx search --template # Has Nuclei templates
231232
vulnx search --poc # Has proof of concept
232233
vulnx search --hackerone # HackerOne reported
@@ -361,11 +362,20 @@ export PDCP_API_KEY="your-key-here" # Environment variable
361362
- **Non-interactive**: `vulnx auth --api-key KEY` - Perfect for automation/CI/CD
362363
- **Test only**: `vulnx auth --test` - Validate current configuration
363364

365+
**Version management:**
366+
```bash
367+
vulnx version # Show version and check for updates
368+
vulnx version --disable-update-check # Show version without update check
369+
vulnx update # Update to latest version
370+
vulnx --update # Alternative update command
371+
```
372+
364373
**Global options:**
365374
```bash
366375
vulnx --json search "apache" # JSON output
367376
vulnx --silent search "apache" # No banner
368377
vulnx --timeout 60s search "apache" # Custom timeout
378+
vulnx --disable-update-check search "apache" # Disable automatic update checks
369379
```
370380

371381
## Troubleshooting
@@ -428,7 +438,8 @@ vulnx search --help # Search command help
428438
vulnx id --help # ID command help
429439
vulnx filters --help # Filters command help
430440
vulnx analyze --help # Analyze command help
431-
vulnx version --disable-update-check # Version info
441+
vulnx version # Version info with update check
442+
vulnx version --disable-update-check # Version info without update check
432443
```
433444

434445
**Data exploration (subject to rate limits without API key):**
@@ -444,6 +455,7 @@ vulnx analyze help # Available analyze fields
444455

445456
- **Start immediately**: vulnx works without an API key - just run `vulnx search apache`
446457
- **Avoid rate limits**: Configure API key with `vulnx auth` for heavy usage
458+
- **Stay updated**: vulnx automatically checks for updates; use `--disable-update-check` to disable
447459
- Use `vulnx filters` to discover all available search fields and their syntax
448460
- Start with broad searches, then narrow down with filters
449461
- Use `--json` for scripting and automation

cmd/vulnx/clis/analyzehelp.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package clis
22

33
import (
44
"fmt"
5-
"strings"
65

76
"github.com/jedib0t/go-pretty/v6/table"
87
"github.com/projectdiscovery/gologger"
@@ -24,34 +23,7 @@ var (
2423
}
2524
}
2625

27-
overview := `ANALYZE COMMAND — OVERVIEW
28-
29-
The analyze command provides a convenient shorthand for performing
30-
"GROUP BY"-style aggregations over the ProjectDiscovery Vulnerability Database.
31-
It leverages the Search API's term-facet capability internally, automatically
32-
setting 'fields' to 'doc_id' and 'limit' to 1.
33-
34-
It supports:
35-
• --fields / -f Comma-separated list of facet fields (required)
36-
• --facet-size Default bucket size (overridden per-field via field=size)
37-
• --query / -q Optional Lucene-style search filter before aggregation
38-
39-
Example invocations:
40-
# Analyze by severity (top 5 buckets)
41-
vulnx analyze -f severity=5
42-
43-
# Analyze by vendor and product for templates with planned / covered coverage
44-
vulnx analyze -f affected_products.vendor,affected_products.product \
45-
-q 'template_coverage:planned || template_coverage:covered'
46-
`
47-
48-
// Print overview
49-
fmt.Println(overview)
50-
fmt.Println(strings.Repeat("-", 120))
51-
5226
// Print command usage & flags (default Cobra output) before examples
53-
fmt.Println("COMMAND USAGE & FLAGS")
54-
fmt.Println(strings.Repeat("-", 120))
5527
fmt.Println(cmd.UsageString())
5628

5729
// Fetch filters via handler

cmd/vulnx/clis/common.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ var (
6161
// Add global no-color flag
6262
noColor bool
6363

64+
// Global disable update check flag
65+
globalDisableUpdateCheck bool
66+
6467
// Track if the banner has already been shown for this invocation
6568
bannerShown bool
6669

@@ -183,6 +186,9 @@ func init() {
183186
// Add persistent no-color flag
184187
rootCmd.PersistentFlags().BoolVar(&noColor, "no-color", false, "disable colored output")
185188

189+
// Add persistent disable update check flag
190+
rootCmd.PersistentFlags().BoolVar(&globalDisableUpdateCheck, "disable-update-check", false, "disable automatic vulnx update check")
191+
186192
// Update flag
187193
rootCmd.Flags().Bool("update", false, "update vulnx to latest version")
188194

@@ -1007,7 +1013,7 @@ func renderQuickStartCommands() {
10071013

10081014
// showVersionInfo displays version information like other ProjectDiscovery tools
10091015
func showVersionInfo() {
1010-
if versionShown || silent {
1016+
if versionShown || silent || globalDisableUpdateCheck {
10111017
return
10121018
}
10131019
versionShown = true
@@ -1018,21 +1024,16 @@ func showVersionInfo() {
10181024
// Check for updates using PDTM API
10191025
latestVersion, err := updateutils.GetToolVersionCallback("vulnx", currentVersion)()
10201026
if err != nil {
1021-
// If version check fails, still show current version
1022-
gologger.Info().Msgf("Current vulnx version %s", currentVersion)
1027+
// If version check fails, show error only in verbose/debug mode
10231028
if verbose || debug {
1024-
gologger.Warning().Msgf("Version check failed: %v", err)
1029+
gologger.Error().Msgf("vulnx version check failed: %v", err.Error())
10251030
}
10261031
return
10271032
}
10281033

1029-
// Format version status
1030-
status := updateutils.GetVersionDescription(currentVersion, latestVersion)
1031-
if status == "" || strings.Contains(status, "latest") {
1032-
status = "latest"
1033-
}
1034-
1035-
gologger.Info().Msgf("Current vulnx version %s (%s)", currentVersion, status)
1034+
// Format version status exactly like cvemap
1035+
description := updateutils.GetVersionDescription(currentVersion, latestVersion)
1036+
gologger.Info().Msgf("Current vulnx version %s %s", currentVersion, description)
10361037
}
10371038

10381039
// GetUpdateCallback returns a callback function that updates vulnx

cmd/vulnx/clis/completion.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ _vulnx_completion() {
127127
prev="${COMP_WORDS[COMP_CWORD-1]}"
128128
129129
# Available commands
130-
commands="analyze auth completion healthcheck id mcp search version help"
130+
commands="analyze auth completion filters healthcheck id mcp search update version help"
131131
132132
# Available shells for completion command
133133
shells="bash zsh fish powershell"
@@ -149,7 +149,7 @@ _vulnx_completion() {
149149
return 0
150150
;;
151151
search)
152-
COMPREPLY=( $(compgen -W "--limit -n --offset --sort-asc --sort-desc --fields --term-facets --range-facets --highlight --facet-size --product -p --vendor --exclude-product --exclude-vendor --severity -s --exclude-severity --cpe -c --assignee -a --vstatus --vuln-age --product-file --vendor-file --exclude-product-file --exclude-vendor-file --severity-file --exclude-severity-file --assignee-file --kev-only --template -t --poc --hackerone --remote-exploit ${global_flags}" -- ${cur}) )
152+
COMPREPLY=( $(compgen -W "--limit -n --offset --sort-asc --sort-desc --fields --term-facets --range-facets --highlight --facet-size --detailed --product -p --vendor --severity -s --vuln-status --vuln-age -a --kev --template -t --poc --hackerone --remote-exploit --cvss-score --epss-score --tags --vuln-type ${global_flags}" -- ${cur}) )
153153
return 0
154154
;;
155155
id)
@@ -168,6 +168,14 @@ _vulnx_completion() {
168168
COMPREPLY=( $(compgen -W "--mode --port ${global_flags}" -- ${cur}) )
169169
return 0
170170
;;
171+
update)
172+
COMPREPLY=( $(compgen -W "--disable-update-check ${global_flags}" -- ${cur}) )
173+
return 0
174+
;;
175+
filters)
176+
COMPREPLY=( $(compgen -W "${global_flags}" -- ${cur}) )
177+
return 0
178+
;;
171179
version)
172180
COMPREPLY=( $(compgen -W "--disable-update-check ${global_flags}" -- ${cur}) )
173181
return 0

cmd/vulnx/clis/search.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ func init() { // Register flags and add command to rootCmd
633633
// NOTE: Assignee filter commented out as search queries don't return results even though field exists in API
634634
// searchCmd.Flags().StringSliceVarP(&filterAssignee, "assignee", "a", nil, "Filter by assignee (comma-separated)")
635635

636-
searchCmd.Flags().StringVar(&filterVulnStatus, "vstatus", "", "filter by vulnerability status (new, confirmed, unconfirmed, modified, rejected, unknown)")
637-
searchCmd.Flags().StringVar(&filterVulnAge, "vuln-age", "", "filter by vulnerability age (supports <, >, exact: e.g., '5', '<10', '>30')")
636+
searchCmd.Flags().StringVar(&filterVulnStatus, "vuln-status", "", "filter by vulnerability status (new, confirmed, unconfirmed, modified, rejected, unknown)")
637+
searchCmd.Flags().StringVarP(&filterVulnAge, "vuln-age", "a", "", "filter by vulnerability age (supports <, >, exact: e.g., '5', '<10', '>30')")
638638

639639
// Boolean filters with default to true when flag is present without value
640-
searchCmd.Flags().StringVar(&filterKevOnly, "kev-only", "", "filter kev (known exploited vulnerabilities) only (true/false)")
641-
searchCmd.Flags().Lookup("kev-only").NoOptDefVal = "true"
640+
searchCmd.Flags().StringVar(&filterKevOnly, "kev", "", "filter kev (known exploited vulnerabilities) only (true/false)")
641+
searchCmd.Flags().Lookup("kev").NoOptDefVal = "true"
642642

643643
searchCmd.Flags().StringVarP(&filterTemplate, "template", "t", "", "filter cves with nuclei templates (true/false)")
644644
searchCmd.Flags().Lookup("template").NoOptDefVal = "true"

cmd/vulnx/clis/searchhelp.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package clis
22

33
import (
44
"fmt"
5-
"strings"
65

76
"github.com/jedib0t/go-pretty/v6/table"
87
"github.com/projectdiscovery/gologger"
@@ -23,38 +22,7 @@ var (
2322
gologger.Fatal().Msgf("Failed to initialize cvemap client: %s", err)
2423
}
2524
}
26-
// 1. Print high-level overview of the search feature
27-
overview := `SEARCH COMMAND — OVERVIEW
28-
29-
The search command provides powerful full-text and faceted search across the entire
30-
ProjectDiscovery Vulnerability Database. It supports:
31-
• Lucene-style query syntax (e.g. cvss_score:>7 severity:critical)
32-
• Sorting (ascending / descending) on any sortable field
33-
• Pagination via limit / offset
34-
• Field selection to minimise payload size
35-
• Term facets for categorical aggregations (e.g. tags, severity)
36-
37-
Example invocations:
38-
# Top 20 remote, exploitable KEV vulns published in 2024
39-
vulnx search --limit 20 "is_remote:true && is_kev:true && cve_created_at:>2024"
40-
41-
# Facet by severity and tag
42-
vulnx search --term-facets severity=5,tags=10 is_template:true
43-
44-
# Sort by CVSS score with filtering
45-
vulnx search --sort-desc cvss_score "apache && is_remote:true"
46-
47-
Below is a list of all fields that can be used in search queries. Fields marked
48-
as "Facet" support term/range faceting. Fields marked "Sortable" can be used
49-
with --sort-asc/--sort-desc.`
50-
51-
// Print overview
52-
fmt.Println(overview)
53-
fmt.Println(strings.Repeat("-", 120))
54-
5525
// Print command usage & flags (default Cobra output) before field table
56-
fmt.Println("COMMAND USAGE & FLAGS")
57-
fmt.Println(strings.Repeat("-", 120))
5826
fmt.Println(cmd.UsageString())
5927

6028
// 2. Fetch filters via handler

cmd/vulnx/clis/version.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ var (
1919
2020
This command displays the current version of vulnx and checks if a newer version
2121
is available. Update checking can be disabled with the --disable-update-check flag.
22-
23-
Note: Currently uses 'cvemap' for version checking until server-side support is added.
2422
`,
2523
Example: `
2624
# Show version and check for updates
@@ -43,31 +41,34 @@ vulnx version --disable-update-check
4341
)
4442

4543
func showVersion() {
46-
gologger.Info().Msgf("vulnx version %s", Version)
44+
gologger.Info().Msgf("Current vulnx version %s", Version)
4745

4846
if disableUpdateCheck {
4947
return
5048
}
5149

52-
// Use vulnx for version checks - pdtm now supports vulnx directly
50+
// Check for latest version using PDTM API
5351
latestVersion, err := updateutils.GetToolVersionCallback("vulnx", Version)()
5452
if err != nil {
5553
if verbose || debug {
56-
gologger.Warning().Msgf("Version check failed: %v", err)
54+
gologger.Error().Msgf("vulnx version check failed: %v", err.Error())
5755
}
5856
return
5957
}
6058

59+
// Show version comparison in the same format as cvemap
6160
description := updateutils.GetVersionDescription(Version, latestVersion)
6261
if description != "" {
63-
gologger.Info().Msgf("Update status: %s", description)
62+
gologger.Info().Msgf("Current vulnx version %s %s", Version, description)
6463

6564
// If there's a newer version available, provide helpful information
6665
if latestVersion != Version {
6766
gologger.Info().Msg("To update vulnx, use:")
6867
gologger.Info().Msg("vulnx --update or vulnx update")
6968
gologger.Info().Msg("Or install via pdtm: pdtm -u vulnx")
7069
}
70+
} else {
71+
gologger.Info().Msgf("Current vulnx version %s (latest)", Version)
7172
}
7273
}
7374

pkg/runner/banner.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const Version = `v0.0.7`
2323
func showBanner() {
2424
gologger.Print().Msgf("%s\n", banner)
2525
gologger.Print().Msgf("\t\tprojectdiscovery.io\n\n")
26+
27+
// Show deprecation warning
28+
gologger.Info().Msgf("⚠️ Important: cvemap uses an older API version that will be discontinued on August 1, 2025.")
29+
gologger.Info().Msgf("Please migrate to 'vulnx' for continued access to vulnerability data.")
30+
gologger.Info().Msgf("Install: go install github.com/projectdiscovery/cvemap/cmd/vulnx@latest\n")
2631
}
2732

2833
// GetUpdateCallback returns a callback function that updates proxify

pkg/runner/runner.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ func ParseOptions() *Options {
158158
options.Debug = env.GetEnvOrDefault("DEBUG", false)
159159
}
160160
if options.Version {
161+
gologger.Info().Msgf("⚠️ Important: cvemap uses an older API version that will be discontinued on August 1, 2025.")
162+
gologger.Info().Msgf("Please migrate to 'vulnx' for continued access to vulnerability data.")
163+
gologger.Info().Msgf("Install: go install github.com/projectdiscovery/cvemap/cmd/vulnx@latest")
161164
gologger.Info().Msgf("Current Version: %s\n", Version)
162165
os.Exit(0)
163166
}

0 commit comments

Comments
 (0)