cvemap

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 12 Imported by: 0

README ΒΆ

vulnx

Modern CLI for exploring vulnerability data with powerful search, filtering, and analysis capabilities

image

πŸš€ Migration Notice

vulnx is the next generation of cvemap - we recommend upgrading to vulnx for the latest features and improvements.

⚠️ Important: cvemap uses an older API version that will be discontinued on August 1, 2025.

Quick Start

# 1. Get vulnx
go install github.com/projectdiscovery/cvemap/cmd/vulnx@latest

# 2. Explore commands
vulnx --help
vulnx search --help

# 3. Start exploring vulnerabilities (no API key required)
vulnx filters                          # See all available search fields
vulnx search apache                    # Basic search (subject to rate limits)

# 4. Set up your API key (recommended to avoid rate limits)
vulnx auth                              # Get free API key at https://cloud.projectdiscovery.io

# 5. Enhanced exploration with higher limits
vulnx search apache                    # No rate limits
vulnx id CVE-2021-44228               # Faster responses

What vulnx Does

Search vulnerabilities with precision:

vulnx search "severity:critical && is_remote:true"
vulnx search "apache || nginx" --limit 20
vulnx search "cvss_score:>8.0 && cve_created_at:2024"

Get detailed vulnerability info:

vulnx id CVE-2021-44228
vulnx id CVE-2024-1234 --json

Analyze vulnerability patterns:

vulnx analyze --fields severity
vulnx analyze --fields affected_products.vendor

Core Commands

Command Purpose Example
search Find vulnerabilities with advanced filters vulnx search "apache && severity:high"
id Get details for specific CVE vulnx id CVE-2021-44228
filters List all available search fields and filters vulnx filters
analyze Aggregate data by fields vulnx analyze -f severity
auth Configure API access vulnx auth
version Show version info and check for updates vulnx version
update Update vulnx to latest version vulnx update
healthcheck Test connectivity vulnx healthcheck

Essential Options

Output formats:

vulnx search "apache" --json              # Machine-readable JSON
vulnx search "apache" --output results.json  # Save to file
vulnx search "apache" --silent            # Quiet output

Search control:

vulnx search "apache" --limit 50          # Get 50 results
vulnx search "apache" --sort-desc cvss_score  # Sort by CVSS score
vulnx search "apache" --fields cve_id,severity  # Specific fields only

Advanced search:

vulnx search --term-facets severity=5,tags=10 "apache"
vulnx search --range-facets numeric:cvss_score:high:8:10 "remote"
vulnx search --highlight "apache"            # Enable search highlighting
vulnx search --facet-size 20 "nginx"         # More facet buckets
vulnx search --detailed "xss"                # Detailed output like 'id' command

Discovering Available Fields

Explore what you can search on:

vulnx filters                           # Show all available search fields
vulnx filters --json                    # Machine-readable field list
vulnx filters --output fields.json      # Save field info to file

The filters command shows detailed information about all searchable fields including:

  • Field names and data types
  • Descriptions and examples
  • Whether fields support sorting and faceting
  • Available enum values for specific fields
  • Search analyzer types

Example output:

Field: severity
Data Type: string
Description: Vulnerability severity level (e.g., critical, high, medium, low, info)
Can Sort: Yes
Facet Possible: Yes
Search Analyzer: keyword-lower
Examples: severity:critical, severity:high
Enum Values: critical, high, medium, low, info, unknown

Total: 69 filters available

Use this command to discover new search possibilities and understand field syntax before building complex queries.

Common Search Patterns

Find high-risk vulnerabilities:

vulnx search "severity:critical && is_remote:true && is_kev:true"
vulnx search "cvss_score:>8.0 && cve_created_at:>=2024"  # High CVSS from 2024
vulnx search "is_kev:true && age_in_days:<90"            # Recent KEV exploits

Search by technology:

vulnx search "apache"                     # Apache vulnerabilities
vulnx search "apache || nginx"          # Multiple technologies
vulnx search "affected_products.vendor:microsoft"  # By vendor

Filter by severity and scores:

vulnx search "severity:high"              # High severity
vulnx search "cvss_score:>7.0"            # CVSS score above 7
vulnx search "epss_score:>0.8"            # High EPSS score

Time-based searches:

vulnx search "cve_created_at:>=2024"      # Published in 2024 or later
vulnx search "cve_created_at:>=2024-01-01 && cve_created_at:<2024-07-01"  # First half of 2024
vulnx search "age_in_days:<30"            # Recent vulnerabilities (last 30 days)

Find exploitable vulnerabilities:

vulnx search "is_poc:true"                # Has proof of concept
vulnx search "is_kev:true"                # Known exploited vulns
vulnx search "is_template:true"           # Has Nuclei templates
vulnx search --detailed "log4j"          # Detailed analysis of specific vuln

Filter Flags

Filter Flags Reference

Flag Short Description Example
--product -p Filter by products --product apache,nginx
--vendor Filter by vendors --vendor microsoft,oracle
--severity -s Filter by severity --severity critical,high
--tags Filter by tags --tags rce,injection
--cvss-score Filter by CVSS score --cvss-score ">8.0"
--epss-score Filter by EPSS score --epss-score ">0.8"
--vuln-age -a Filter by age --vuln-age "<30"
--vuln-type Filter by vulnerability type --vuln-type sql_injection
--kev KEV vulnerabilities only --kev
--template -t Has Nuclei templates --template
--poc Has proof of concept --poc
--hackerone HackerOne reported --hackerone
--remote-exploit Remotely exploitable --remote-exploit
--vuln-status Filter by vuln status --vuln-status confirmed

Search Control Flags

Flag Short Description Example
--detailed Detailed output like 'id' --detailed
--highlight Enable search highlighting --highlight
--limit -n Number of results --limit 50
--offset Pagination offset --offset 100
--sort-asc Sort ascending --sort-asc cvss_score
--sort-desc Sort descending --sort-desc cve_created_at
--fields Select specific fields --fields cve_id,severity
--term-facets Calculate term facets --term-facets severity=5
--range-facets Calculate range facets --range-facets numeric:cvss_score:high:8:10
--facet-size Facet bucket count --facet-size 20

Product and vendor filtering:

vulnx search --product apache,nginx     # Filter by products (searches both vendor and product fields)
vulnx search --vendor microsoft,oracle  # Filter by vendors only
vulnx search "NOT apache"               # Exclude products using query syntax
vulnx search "NOT affected_products.vendor:microsoft"  # Exclude vendors using query syntax

Severity and scoring:

vulnx search --severity critical,high   # Filter by severity
vulnx search "NOT severity:low"         # Exclude severities using query syntax
vulnx search --cvss-score ">8.0"        # Filter by CVSS score
vulnx search --epss-score ">0.8"        # Filter by EPSS score
vulnx search --vuln-status confirmed     # Filter by status
vulnx search --vuln-age "<30"           # Recent vulnerabilities

Exploit characteristics:

vulnx search --kev                      # KEV vulnerabilities only
vulnx search --template                 # Has Nuclei templates
vulnx search --poc                      # Has proof of concept
vulnx search --hackerone                # HackerOne reported
vulnx search --remote-exploit           # Remotely exploitable

Vulnerability ID Lookup

Multiple input methods:

# Single ID lookup
vulnx id CVE-2024-1234

# Multiple IDs (comma-separated)
vulnx id CVE-2024-1234,CVE-2024-5678,CVE-2023-9999

# Auto-detection from stdin (no 'id' command needed!)
echo "CVE-2024-1234" | vulnx
echo -e "CVE-2024-1234\nCVE-2024-5678" | vulnx

# File input
vulnx id --file ids.txt

Batch processing:

# JSON output for automation
vulnx id --json CVE-2024-1234 CVE-2024-5678

# Save to file
vulnx id --output vulns.json --file ids.txt

# Pipeline integration
cat report.txt | grep -o 'CVE-[0-9]\{4\}-[0-9]\+' | vulnx id --json

Useful Field Names

Field Description Example Values
severity Vulnerability severity low, medium, high, critical
cvss_score CVSS score (0-10) 7.5, >8.0, <9.0
cve_id CVE identifier CVE-2021-44228
is_remote Remotely exploitable true, false
is_kev Known exploited vuln true, false
is_poc Has proof of concept true, false
affected_products.vendor Vendor name apache, microsoft
affected_products.product Product name tomcat, windows
cve_created_at Publication date >=2024, >2024-01-01, <2023
age_in_days Days since publication <30, >365, <=90

Query Syntax

Basic searches:

vulnx search "apache"                     # Simple term
vulnx search "remote code execution"    # Phrase search
vulnx search "severity:critical"          # Field search

Boolean logic:

vulnx search "apache && nginx"           # Both terms
vulnx search "apache || nginx"            # Either term
vulnx search "apache NOT tomcat"          # Exclude term
vulnx search "(apache || nginx) && severity:high"  # Grouped

Ranges and wildcards:

vulnx search "cvss_score:>8.0"            # Greater than
vulnx search "cvss_score:<9.0"            # Less than
vulnx search "cve_created_at:>=2024-01-01" # Date comparison
vulnx search "age_in_days:<30"            # Recent vulnerabilities
vulnx search "apache*"                    # Wildcard

Date Queries

Important: Date fields require comparison operators (>=, >, <, <=).

Single date comparisons:

vulnx search "cve_created_at:>=2024"      # CVEs from 2024 onward
vulnx search "cve_created_at:<2024"       # CVEs before 2024
vulnx search "cve_created_at:>2024-06-01" # CVEs after June 1, 2024

Date ranges:

# CVEs from January 2024 only
vulnx search "cve_created_at:>=2024-01-01 && cve_created_at:<2024-02-01"

# High CVSS CVEs from 2024
vulnx search "cvss_score:>8.0 && cve_created_at:>=2024"

# Recent vulnerabilities (age-based)
vulnx search "age_in_days:<30"            # Last 30 days
vulnx search "age_in_days:>365"           # Older than 1 year

Supported formats:

  • 2024 (year)
  • 2024-01 (year-month)
  • 2024-01-15 (full date)

Configuration

Authentication (Optional)

vulnx works without an API key, but authentication provides significant benefits:

⚠️ Without API key:

  • Limited to 10 requests per minutes
  • Subject to strict rate limits
  • May encounter "429 Too Many Requests" errors

βœ… With API key:

  • Much higher rate limits
  • Access to all the filters

Set up authentication:

vulnx auth                              # Interactive setup
vulnx auth --api-key YOUR_API_KEY       # Non-interactive (automation)
vulnx auth --test                       # Test current API key
export PDCP_API_KEY="your-key-here"     # Environment variable

Authentication modes:

  • Interactive: vulnx auth - Guided setup with prompts
  • Non-interactive: vulnx auth --api-key KEY - Perfect for automation/CI/CD
  • Test only: vulnx auth --test - Validate current configuration

Version management:

vulnx version                            # Show version and check for updates
vulnx version --disable-update-check     # Show version without update check
vulnx update                             # Update to latest version
vulnx --update                           # Alternative update command

Global options:

vulnx --json search "apache"              # JSON output
vulnx --silent search "apache"            # No banner
vulnx --timeout 60s search "apache"       # Custom timeout
vulnx --disable-update-check search "apache"  # Disable automatic update checks

Troubleshooting

Rate limit issues:

Rate limit exceeded! API key required for higher limits.
β†’ Run: vulnx auth to configure API key and get higher limits

Automation/CI/CD setup:

# Docker containers
vulnx auth --api-key "$SECRET_API_KEY"

# CI/CD pipelines
vulnx auth --api-key "${PDCP_API_KEY}"

# Kubernetes init containers
vulnx auth --api-key "$(cat /secrets/api-key)"

# Test authentication in scripts
vulnx auth --test && echo "Auth OK" || echo "Auth failed"

Rate limit suggestions:

Configure API key with 'vulnx auth' to avoid rate limits
β†’ This appears when no API key is configured. To remove:
  1. Set up API key: vulnx auth
  2. Or use --silent flag to suppress informational messages

No results:

vulnx search "is_kev:true" --limit 1      # Test with known results
vulnx healthcheck                       # Check connectivity

Large result sets:

vulnx search "apache" --limit 100         # Increase limit
vulnx search "apache" --offset 100        # Pagination
vulnx search --fields cve_id,severity "apache"  # Fewer fields

Connection issues:

vulnx --timeout 60s search "apache"       # Increase timeout
vulnx --proxy http://localhost:8080 search "apache"  # Use proxy
vulnx --debug search "apache"             # Debug mode

Getting Help

Help commands (no API key required):

vulnx --help                           # All commands overview
vulnx search --help                    # Search command help
vulnx id --help                        # ID command help
vulnx filters --help                   # Filters command help
vulnx analyze --help                   # Analyze command help
vulnx version                          # Version info with update check
vulnx version --disable-update-check   # Version info without update check

Data exploration (subject to rate limits without API key):

vulnx filters                          # Show all searchable fields
vulnx search help                      # Detailed search fields
vulnx analyze help                     # Available analyze fields

⚠️ Note All commands work without an API key, but are subject to rate limits. Configure an API key with vulnx auth for higher limits and better performance.

Tips

  • Start immediately: vulnx works without an API key - just run vulnx search apache
  • Avoid rate limits: Configure API key with vulnx auth for heavy usage
  • Stay updated: vulnx automatically checks for updates; use --disable-update-check to disable
  • Use vulnx filters to discover all available search fields and their syntax
  • Start with broad searches, then narrow down with filters
  • Use --json for scripting and automation
  • Combine multiple filters for precise results
  • Use analyze to understand data patterns
  • Save frequently used queries as shell aliases

For advanced usage patterns and examples, see USAGE.md.

Development

For development setup, code quality checks, and contribution guidelines, see DEVELOPMENT.md.

License

vulnx is distributed under MIT License.

Documentation ΒΆ

Overview ΒΆ

Package cvemap provides a robust, idiomatic Go client for interacting with the ProjectDiscovery CVE Map (CVEMap) REST API. The client focuses on the "/v2/vulnerability" endpoints, exposing high-level helper methods that handle authentication, request construction, network-level retries, and JSON decoding so that callers can concentrate on business logic.

Quick Start ΒΆ

The snippet below demonstrates a minimal, production-ready workflow. While authentication is optional, using an API key is strongly recommended to avoid rate limiting and ensure better performance:

ctx := context.Background()

client, err := cvemap.New(
    cvemap.WithKeyFromEnv(), // or cvemap.WithPDCPKey("<YOUR_KEY>")
)
if err != nil {
    log.Fatal(err)
}

out, err := client.SearchVulnerabilities(ctx, cvemap.SearchParams{
    Query: cvemap.Ptr("id:CVE-2023-4799"),
    Limit: cvemap.Ptr(10),
})
if err != nil {
    log.Fatal(err)
}

fmt.Println(len(out.Vulnerabilities))

Rate Limiting ΒΆ

Unauthenticated requests are subject to strict rate limits. If you encounter 429 (Too Many Requests) errors, configure an API key using WithPDCPKey() or WithKeyFromEnv() to get higher rate limits and better service reliability.

The client is safe for concurrent use by multiple goroutines.

For complete API semantics refer to https://api.projectdiscovery.io/docs.

Package cvemap provides types for the /v2/vulnerability API client.

Index ΒΆ

Constants ΒΆ

View Source
const (
	// DefaultBaseURL is the default base URL for the API.
	DefaultBaseURL = "https://api.projectdiscovery.io"
	// UserAgent is the default user agent for the client.
	UserAgent = "cvemap-client/1.0"
)

Variables ΒΆ

View Source
var (
	ErrBadRequest          = errkit.New("bad request: client sent an invalid request")
	ErrUnauthorized        = errkit.New("unauthorized: invalid or missing API key")
	ErrNotFound            = errkit.New("not found: resource does not exist")
	ErrTooManyRequests     = errkit.New("too many requests: rate limit exceeded - consider using an API key for higher limits")
	ErrInternalServerError = errkit.New("internal server error: something went wrong on the server")
	ErrUnknownAPIError     = errkit.New("unknown api error")

	ErrRequestBuildFailure = errkit.New("failed to build request")
	ErrRequestFailed       = errkit.New("request failed")
	ErrMarshalBody         = errkit.New("failed to marshal request body")
	ErrCreateHTTPRequest   = errkit.New("failed to create http request")
	ErrDecodeResponse      = errkit.New("failed to decode response")
)

Client errors

Functions ΒΆ

func Ptr ΒΆ

func Ptr[T any](v T) *T

Ptr is a helper function to create a pointer to a value Simple yet useful

Types ΒΆ

type AIMeta ΒΆ

type AIMeta struct {
	IsPromptByHuman   bool   `json:"is_prompt_by_human,omitempty"`
	IsTemplateByHuman bool   `json:"is_template_by_human,omitempty"`
	ModelUsed         string `json:"model_used,omitempty"`
	Prompt            string `json:"prompt,omitempty"`
}

AIMeta represents AI metadata for a template.

type Citation ΒΆ

type Citation struct {
	AddedAt *time.Time `json:"added_at,omitempty"`
	Source  string     `json:"source,omitempty"`
	Tags    []string   `json:"tags,omitempty"`
	URL     string     `json:"url,omitempty"`
}

Citation represents a citation for a vulnerability/template.

type Classification ΒΆ

type Classification struct {
	Cpe            string   `json:"cpe,omitempty"`
	CveID          []string `json:"cve_id,omitempty"`
	CvssMetrics    string   `json:"cvss_metrics,omitempty"`
	CvssScore      float64  `json:"cvss_score,omitempty"`
	CweID          []string `json:"cwe_id,omitempty"`
	EpssPercentile float64  `json:"epss_percentile,omitempty"`
	EpssScore      float64  `json:"epss_score,omitempty"`
}

Classification represents classification metadata for a template.

type Client ΒΆ

type Client struct {
	// contains filtered or unexported fields
}

Client provides high-level helpers around the CVEMap API. It is safe for concurrent use. Zero values for *Client* fields are not meaningfulβ€”always use the *New* constructor.

func New ΒΆ

func New(opts ...Option) (*Client, error)

New returns a new *Client* configured by the supplied *Option*s. Authentication is optional but strongly recommended - unauthenticated requests are subject to strict rate limits. Use *WithPDCPKey* or *WithKeyFromEnv* to configure an API key for better performance and higher rate limits.

The returned client is ready for immediate use:

c, err := cvemap.New(cvemap.WithPDCPKey("<YOUR_KEY>"))
if err != nil { /* handle */ }

// Or without authentication (subject to rate limits):
c, err := cvemap.New()
if err != nil { /* handle */ }

Custom HTTP behaviour (timeouts, retries, logging) can be injected via *WithClient* or *WithRetryableHTTPOptions*.

func (*Client) GetVulnerabilityByID ΒΆ

func (c *Client) GetVulnerabilityByID(ctx context.Context, id string, params *GetByIDParams) (VulnerabilityResponse, error)

GetVulnerabilityByID fetches a single vulnerability document identified by its canonical ID (for example "CVE-2023-1234").

When *params* is non-nil the *Fields* slice can be used to limit the response payload to a subset of fields, reducing bandwidth.

func (*Client) GetVulnerabilityFilters ΒΆ

func (c *Client) GetVulnerabilityFilters(ctx context.Context) ([]VulnerabilityFilter, error)

GetVulnerabilityFilters lists all filter definitions that can be applied to search queries. Filters are stable identifiers used for building rich UI facets or powering autocomplete experiences.

func (*Client) IsAuthenticated ΒΆ

func (c *Client) IsAuthenticated() bool

IsAuthenticated returns true if the client has an API key configured. This can be used to provide better UX messaging about rate limits.

func (*Client) SearchVulnerabilities ΒΆ

func (c *Client) SearchVulnerabilities(ctx context.Context, params SearchParams) (SearchResponse, error)

SearchVulnerabilities performs a full-text search across all vulnerability documents and returns a paginated *SearchResponse*.

The behaviour of the search is controlled via *SearchParams*; see that type for field-level documentation.

SearchVulnerabilities may contact the network multiple times if retries are enabled on the underlying HTTP client. It is safe to call concurrently.

type ExposureStats ΒΆ

type ExposureStats struct {
	Fofa     *SearchEngineStats `json:"fofa,omitempty"`
	ID       string             `json:"id,omitempty"`
	MaxHosts int                `json:"max_hosts,omitempty"`
	MinHosts int                `json:"min_hosts,omitempty"`
	Shodan   *SearchEngineStats `json:"shodan,omitempty"`
}

ExposureStats represents search engine stats for a product.

type GetByIDParams ΒΆ

type GetByIDParams struct {
	Fields []string `json:"fields,omitempty"`
}

GetByIDParams defines optional query parameters for GetVulnerabilityByID.

type H1Stats ΒΆ

type H1Stats struct {
	DeltaRank    int `json:"delta_rank,omitempty"`
	DeltaReports int `json:"delta_reports,omitempty"`
	Rank         int `json:"rank,omitempty"`
	Reports      int `json:"reports,omitempty"`
}

H1Stats represents HackerOne stats for a vulnerability.

type KevInfo ΒΆ

type KevInfo struct {
	AddedDate                  *time.Time `json:"added_date,omitempty"`
	DueDate                    *time.Time `json:"due_date,omitempty"`
	KnownRansomwareCampaignUse bool       `json:"known_ransomware_campaign_use,omitempty"`
	Source                     string     `json:"source,omitempty"`
}

KevInfo represents KEV (Known Exploited Vulnerabilities) info.

type Option ΒΆ

type Option func(*Client)

Option represents a functional option that mutates a *Client* during construction. It follows the standard "functional options" pattern popularised by Google and is the preferred way to add optional parameters without an explosion of constructor variants.

A typical call site looks like this:

client, err := cvemap.New(
    cvemap.WithPDCPKey("<YOUR_KEY>"),
    cvemap.WithRetryableHTTPOptions(retryablehttp.Options{RetryMax: 5}),
)
if err != nil {
    // handle error
}

func WithBaseURL ΒΆ

func WithBaseURL(url string) Option

WithBaseURL points the client at an alternative endpointβ€”useful for testing against staging or mock servers.

func WithClient ΒΆ

func WithClient(hc *retryablehttp.Client) Option

WithClient overrides the default *retryablehttp.Client* used for all network operations. It enables advanced users to specify custom transports, proxy settings, or instrumentation hooks.

func WithDebugRequest ΒΆ

func WithDebugRequest(cb func(*http.Request)) Option

WithDebugRequest sets a callback that is invoked with the *http.Request before it is sent.

func WithDebugResponse ΒΆ

func WithDebugResponse(cb func(*http.Response)) Option

WithDebugResponse sets a callback that is invoked with the *http.Response after it is received (before decoding).

func WithKeyFromEnv ΒΆ

func WithKeyFromEnv() Option

WithKeyFromEnv attempts to discover a PDCP API key from the local credential store (managed by `pdcp`) or the `PDCP_API_KEY` environment variable.

func WithPDCPKey ΒΆ

func WithPDCPKey(apiKey string) Option

WithPDCPKey sets the ProjectDiscovery Cloud Platform (PDCP) API key that will be sent in the `X-PDCP-Key` HTTP header.

func WithRetryableHTTPOptions ΒΆ

func WithRetryableHTTPOptions(clientOpts retryablehttp.Options) Option

WithRetryableHTTPOptions constructs a fresh *retryablehttp.Client* with the supplied options and wires it into the *Client* instance.

type POC ΒΆ

type POC struct {
	AddedAt *time.Time `json:"added_at,omitempty"`
	Source  string     `json:"source,omitempty"`
	URL     string     `json:"url,omitempty"`
}

POC represents a proof of concept for a vulnerability.

type ProductInfo ΒΆ

type ProductInfo struct {
	Category        string         `json:"category,omitempty"`
	Cpe             []string       `json:"cpe,omitempty"`
	DeploymentModel string         `json:"deployment_model,omitempty"`
	Industry        string         `json:"industry,omitempty"`
	IsPd            bool           `json:"is_pd,omitempty"`
	Product         string         `json:"product,omitempty"`
	ProjectRepos    map[string]any `json:"project_repos,omitempty"`
	Projects        []string       `json:"projects,omitempty"`
	Summary         string         `json:"summary,omitempty"`
	TechDomain      string         `json:"tech_domain,omitempty"`
	Vendor          string         `json:"vendor,omitempty"`
}

ProductInfo represents affected product information.

type Schema ΒΆ

type Schema struct {
	Version string `json:"version,omitempty"`
}

Schema represents schema information for a template.

type SearchEngineStats ΒΆ

type SearchEngineStats struct {
	MaxHosts int      `json:"max_hosts,omitempty"`
	MinHosts int      `json:"min_hosts,omitempty"`
	Queries  []string `json:"queries,omitempty"`
}

SearchEngineStats represents stats from a search engine.

type SearchParams ΒΆ

type SearchParams struct {
	Limit       *int     `json:"limit,omitempty"`
	Offset      *int     `json:"offset,omitempty"`
	SortAsc     *string  `json:"sort_asc,omitempty"`
	SortDesc    *string  `json:"sort_desc,omitempty"`
	Fields      []string `json:"fields,omitempty"`
	TermFacets  []string `json:"term_facets,omitempty"`
	RangeFacets []string `json:"range_facets,omitempty"`
	Query       *string  `json:"q,omitempty"`
	Highlight   *bool    `json:"highlight,omitempty"`
	FacetSize   *int     `json:"facet_size,omitempty"`
}

SearchParams defines query parameters for vulnerability search.

type SearchResponse ΒΆ

type SearchResponse struct {
	Count   int             `json:"count"`
	Facets  map[string]any  `json:"facets,omitempty"`
	Results []Vulnerability `json:"results"`
	Total   int             `json:"total"`
}

SearchResponse represents the response from /v2/vulnerability/search.

type VulnExposure ΒΆ

type VulnExposure struct {
	MaxHosts int              `json:"max_hosts,omitempty"`
	MinHosts int              `json:"min_hosts,omitempty"`
	Values   []*ExposureStats `json:"values,omitempty"`
}

VulnExposure represents exposure stats for a vulnerability.

type Vulnerability ΒΆ

type Vulnerability struct {
	// CVEInfo fields
	CVEID            string     `json:"cve_id,omitempty"`
	AgeInDays        int        `json:"age_in_days,omitempty"`
	Assignee         string     `json:"assignee,omitempty"`
	CveCreatedAt     *time.Time `json:"cve_created_at,omitempty"`
	CveUpdatedAt     *time.Time `json:"cve_updated_at,omitempty"`
	CvssMetrics      string     `json:"cvss_metrics,omitempty"`
	CvssScore        float64    `json:"cvss_score,omitempty"`
	EpssPercentile   float64    `json:"epss_percentile,omitempty"`
	EpssScore        float64    `json:"epss_score,omitempty"`
	IsAuth           bool       `json:"is_auth,omitempty"`
	IsKev            bool       `json:"is_kev,omitempty"`
	IsOss            bool       `json:"is_oss,omitempty"`
	IsPatchAvailable bool       `json:"is_patch_available,omitempty"`
	IsPoc            bool       `json:"is_poc,omitempty"`
	IsRemote         bool       `json:"is_remote,omitempty"`
	IsTemplate       bool       `json:"is_template,omitempty"`
	IsVkev           bool       `json:"is_vkev,omitempty"`
	Kev              []*KevInfo `json:"kev,omitempty"`
	PocCount         int        `json:"poc_count,omitempty"`
	PocFirstSeen     *time.Time `json:"poc_first_seen,omitempty"`
	Pocs             []*POC     `json:"pocs,omitempty"`
	VulnStatus       string     `json:"vuln_status,omitempty"`

	// VulnerabilityInfo extra fields
	Citations           []*Citation `json:"citations,omitempty"`
	Cwe                 []string    `json:"cwe,omitempty"`
	Description         string      `json:"description,omitempty"`
	Impact              string      `json:"impact,omitempty"`
	Name                string      `json:"name,omitempty"`
	Product             string      `json:"product,omitempty"`
	Remediation         string      `json:"remediation,omitempty"`
	RequirementType     string      `json:"requirement_type,omitempty"`
	Requirements        string      `json:"requirements,omitempty"`
	Severity            string      `json:"severity,omitempty"`
	TemplateCoverage    string      `json:"template_coverage,omitempty"`
	Vendor              string      `json:"vendor,omitempty"`
	VulnerabilityImpact []string    `json:"vulnerability_impact,omitempty"`
	VulnerabilityType   string      `json:"vulnerability_type,omitempty"`
	Weaknesses          []*Weakness `json:"weaknesses,omitempty"`

	// NucleiTemplate fields (flattened)
	// TemplateSourceMeta
	Category        string `json:"category,omitempty"`
	IntegrationID   string `json:"integration_id,omitempty"`
	IntegrationType string `json:"integration_type,omitempty"`
	PullRequest     string `json:"pull_request,omitempty"`
	Ref             string `json:"ref,omitempty"`
	ReleaseTag      string `json:"release_tag,omitempty"`
	Score           int    `json:"score,omitempty"`
	TemplateType    string `json:"template_type,omitempty"`

	// TemplateStatus
	IsDraft      bool `json:"is_draft,omitempty"`
	IsEarly      bool `json:"is_early,omitempty"`
	IsGithub     bool `json:"is_github,omitempty"`
	IsNew        bool `json:"is_new,omitempty"`
	IsPdresearch bool `json:"is_pdresearch,omitempty"`
	IsPdteam     bool `json:"is_pdteam,omitempty"`
	IsPdtemplate bool `json:"is_pdtemplate,omitempty"`

	// TemplateFileMeta
	Dir      string `json:"dir,omitempty"`
	Filename string `json:"filename,omitempty"`
	URI      string `json:"uri,omitempty"`

	// TemplateContent
	Author   []string       `json:"author,omitempty"`
	Digest   string         `json:"digest,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
	Raw      string         `json:"raw,omitempty" yaml:"nuclei_template,omitempty"`
	Tags     []string       `json:"tags,omitempty"`
	Type     string         `json:"type,omitempty"`

	// TemplateSharingMetadata
	Organizations    []string   `json:"organizations,omitempty"`
	OriginTemplateID string     `json:"origin_template_id,omitempty"`
	ShareType        string     `json:"share_type,omitempty"`
	TTL              string     `json:"ttl,omitempty"`
	TTLFrom          *time.Time `json:"ttl_from,omitempty"`
	Users            []int      `json:"users,omitempty"`

	// NucleiTemplate extra fields
	AIMeta         *AIMeta         `json:"ai_meta,omitempty"`
	Classification *Classification `json:"classification,omitempty"`
	ID             string          `json:"id,omitempty"`
	UserID         int             `json:"user_id,omitempty"`

	// Vulnerability extra fields
	AffectedProducts []*ProductInfo `json:"affected_products,omitempty"`
	CreatedAt        *time.Time     `json:"created_at,omitempty"`
	DocID            string         `json:"doc_id,omitempty"`
	DocType          string         `json:"doc_type,omitempty"`
	Exposure         *VulnExposure  `json:"exposure,omitempty"`
	H1               *H1Stats       `json:"h1,omitempty"`
	NTPS             int            `json:"ntps,omitempty"`
	UpdatedAt        *time.Time     `json:"updated_at,omitempty"`
}

Vulnerability represents a vulnerability object returned by the API. This struct is a flat composition of all fields from the OpenAPI Vulnerability schema. All fields have omitempty. No struct embedding is used.

type VulnerabilityFilter ΒΆ

type VulnerabilityFilter struct {
	CanSort        bool     `json:"can_sort"`
	DataType       string   `json:"data_type"`
	Description    string   `json:"description"`
	Examples       []string `json:"examples"`
	FacetPossible  bool     `json:"facet_possible"`
	Field          string   `json:"field"`
	SearchAnalyzer string   `json:"search_analyzer"`
	EnumValues     []string `json:"enum_values"`
}

VulnerabilityFilter describes a filter field for vulnerabilities.

type VulnerabilityResponse ΒΆ

type VulnerabilityResponse struct {
	Data *Vulnerability `json:"data"`
}

VulnerabilityResponse represents the response from /v2/vulnerability/{id}.

type Weakness ΒΆ

type Weakness struct {
	CweID   string `json:"cwe_id,omitempty"`
	CweName string `json:"cwe_name,omitempty"`
}

Weakness represents a CWE weakness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL