diff --git a/config/config.go b/config/config.go index 5bed77b809..c6f0a94684 100644 --- a/config/config.go +++ b/config/config.go @@ -40,7 +40,6 @@ type Config struct { // report CveDict GoCveDictConf `json:"cveDict,omitzero"` Gost GostConf `json:"gost,omitzero"` - Exploit ExploitConf `json:"exploit,omitzero"` Cti CtiConf `json:"cti,omitzero"` Vuls2 Vuls2Conf `json:"vuls2,omitzero"` @@ -188,7 +187,6 @@ func (c *Config) ValidateOnReport() bool { for _, cnf := range []VulnDictInterface{ &Conf.CveDict, &Conf.Gost, - &Conf.Exploit, &Conf.Cti, } { if err := cnf.Validate(); err != nil { diff --git a/config/tomlloader.go b/config/tomlloader.go index 6d8fc7363a..642d98a8db 100644 --- a/config/tomlloader.go +++ b/config/tomlloader.go @@ -40,7 +40,6 @@ func (c TOMLLoader) Load(pathToToml string) error { for _, cnf := range []VulnDictInterface{ &Conf.CveDict, &Conf.Gost, - &Conf.Exploit, &Conf.Cti, } { cnf.Init() diff --git a/config/vulnDictConf.go b/config/vulnDictConf.go index 33102154ba..6437d24d52 100644 --- a/config/vulnDictConf.go +++ b/config/vulnDictConf.go @@ -146,33 +146,6 @@ func (cnf VulnDict) CheckHTTPHealth() error { return nil } -// ExploitConf is exploit config -type ExploitConf struct { - VulnDict -} - -const exploitDBType = "EXPLOITDB_TYPE" -const exploitDBURL = "EXPLOITDB_URL" -const exploitDBPATH = "EXPLOITDB_SQLITE3_PATH" - -// Init set options with the following priority. -// 1. Environment variable -// 2. config.toml -func (cnf *ExploitConf) Init() { - cnf.Name = "exploit" - if os.Getenv(exploitDBType) != "" { - cnf.Type = os.Getenv(exploitDBType) - } - if os.Getenv(exploitDBURL) != "" { - cnf.URL = os.Getenv(exploitDBURL) - } - if os.Getenv(exploitDBPATH) != "" { - cnf.SQLite3Path = os.Getenv(exploitDBPATH) - } - cnf.setDefault("go-exploitdb.sqlite3") - cnf.DebugSQL = Conf.DebugSQL -} - // GoCveDictConf is GoCveDict config type GoCveDictConf struct { VulnDict diff --git a/detector/detector.go b/detector/detector.go index 8ec38071ad..75796de956 100644 --- a/detector/detector.go +++ b/detector/detector.go @@ -203,12 +203,6 @@ func Detect(rs []models.ScanResult, dir string) ([]models.ScanResult, error) { return nil, xerrors.Errorf("Failed to fill with CVE: %w", err) } - nExploitCve, err := FillWithExploit(&r, config.Conf.Exploit, config.Conf.LogOpts) - if err != nil { - return nil, xerrors.Errorf("Failed to fill with exploit: %w", err) - } - logging.Log.Infof("%s: %d PoC are detected", r.FormatServerName(), nExploitCve) - if err := FillWithCTI(&r, config.Conf.Cti, config.Conf.LogOpts); err != nil { return nil, xerrors.Errorf("Failed to fill with Cyber Threat Intelligences: %w", err) } diff --git a/detector/exploitdb.go b/detector/exploitdb.go deleted file mode 100644 index 7b4b32a2b7..0000000000 --- a/detector/exploitdb.go +++ /dev/null @@ -1,259 +0,0 @@ -//go:build !scanner - -package detector - -import ( - "encoding/json" - "errors" - "net/http" - "time" - - "github.com/cenkalti/backoff" - "github.com/parnurzeal/gorequest" - "golang.org/x/xerrors" - - "github.com/future-architect/vuls/config" - "github.com/future-architect/vuls/logging" - "github.com/future-architect/vuls/models" - "github.com/future-architect/vuls/util" - exploitdb "github.com/vulsio/go-exploitdb/db" - exploitmodels "github.com/vulsio/go-exploitdb/models" - exploitlog "github.com/vulsio/go-exploitdb/util" -) - -// goExploitDBClient is a DB Driver -type goExploitDBClient struct { - driver exploitdb.DB - baseURL string -} - -// closeDB close a DB connection -func (client goExploitDBClient) closeDB() error { - if client.driver == nil { - return nil - } - return client.driver.CloseDB() -} - -func newGoExploitDBClient(cnf config.VulnDictInterface, o logging.LogOpts) (*goExploitDBClient, error) { - if err := exploitlog.SetLogger(o.LogToFile, o.LogDir, o.Debug, o.LogJSON); err != nil { - return nil, xerrors.Errorf("Failed to set go-exploitdb logger. err: %w", err) - } - - db, err := newExploitDB(cnf) - if err != nil { - return nil, xerrors.Errorf("Failed to newExploitDB. err: %w", err) - } - return &goExploitDBClient{driver: db, baseURL: cnf.GetURL()}, nil -} - -// FillWithExploit fills exploit information that has in Exploit -func FillWithExploit(r *models.ScanResult, cnf config.ExploitConf, logOpts logging.LogOpts) (nExploitCve int, err error) { - client, err := newGoExploitDBClient(&cnf, logOpts) - if err != nil { - return 0, xerrors.Errorf("Failed to newGoExploitDBClient. err: %w", err) - } - defer func() { - if err := client.closeDB(); err != nil { - logging.Log.Errorf("Failed to close DB. err: %+v", err) - } - }() - - if client.driver == nil { - var cveIDs []string - for cveID := range r.ScannedCves { - cveIDs = append(cveIDs, cveID) - } - prefix, err := util.URLPathJoin(client.baseURL, "cves") - if err != nil { - return 0, xerrors.Errorf("Failed to join URLPath. err: %w", err) - } - responses, err := getExploitsViaHTTP(cveIDs, prefix) - if err != nil { - return 0, xerrors.Errorf("Failed to get Exploits via HTTP. err: %w", err) - } - for _, res := range responses { - exps := []exploitmodels.Exploit{} - if err := json.Unmarshal([]byte(res.json), &exps); err != nil { - return 0, xerrors.Errorf("Failed to unmarshal json. err: %w", err) - } - exploits := ConvertToModelsExploit(exps) - v, ok := r.ScannedCves[res.request.cveID] - if ok { - v.Exploits = exploits - } - r.ScannedCves[res.request.cveID] = v - nExploitCve++ - } - } else { - for cveID, vuln := range r.ScannedCves { - if cveID == "" { - continue - } - es, err := client.driver.GetExploitByCveID(cveID) - if err != nil { - return 0, xerrors.Errorf("Failed to get Exploits by CVE-ID. err: %w", err) - } - if len(es) == 0 { - continue - } - exploits := ConvertToModelsExploit(es) - vuln.Exploits = exploits - r.ScannedCves[cveID] = vuln - nExploitCve++ - } - } - return nExploitCve, nil -} - -// ConvertToModelsExploit converts exploit model to vuls model -func ConvertToModelsExploit(es []exploitmodels.Exploit) (exploits []models.Exploit) { - for _, e := range es { - exploit := models.Exploit{ - ExploitType: e.ExploitType, - ID: e.ExploitUniqueID, - URL: e.URL, - Description: e.Description, - } - if e.OffensiveSecurity != nil { - switch { - case e.OffensiveSecurity.Document != nil: - exploit.Verified = &e.OffensiveSecurity.Document.Verified - exploit.DocumentURL = &e.OffensiveSecurity.Document.FileURL - case e.OffensiveSecurity.ShellCode != nil: - exploit.Verified = &e.OffensiveSecurity.ShellCode.Verified - exploit.ShellCodeURL = &e.OffensiveSecurity.ShellCode.FileURL - case e.OffensiveSecurity.Paper != nil: - exploit.Verified = &e.OffensiveSecurity.Paper.Verified - exploit.PaperURL = &e.OffensiveSecurity.Paper.FileURL - case e.OffensiveSecurity.GHDB != nil: - exploit.GHDBURL = &e.OffensiveSecurity.GHDB.Link - } - } - exploits = append(exploits, exploit) - } - return exploits -} - -type exploitResponse struct { - request exploitRequest - json string -} - -func getExploitsViaHTTP(cveIDs []string, urlPrefix string) ( - responses []exploitResponse, err error) { - nReq := len(cveIDs) - reqChan := make(chan exploitRequest, nReq) - resChan := make(chan exploitResponse, nReq) - errChan := make(chan error, nReq) - defer close(reqChan) - defer close(resChan) - defer close(errChan) - - go func() { - for _, cveID := range cveIDs { - reqChan <- exploitRequest{ - cveID: cveID, - } - } - }() - - concurrency := 10 - tasks := util.GenWorkers(concurrency) - for range nReq { - tasks <- func() { - req := <-reqChan - url, err := util.URLPathJoin( - urlPrefix, - req.cveID, - ) - if err != nil { - errChan <- err - } else { - logging.Log.Debugf("HTTP Request to %s", url) - httpGetExploit(url, req, resChan, errChan) - } - } - } - - var timeout <-chan time.Time - if config.Conf.Exploit.TimeoutSec > 0 { - timeout = time.After(time.Duration(config.Conf.Exploit.TimeoutSec) * time.Second) - } - var errs []error - for range nReq { - select { - case res := <-resChan: - responses = append(responses, res) - case err := <-errChan: - errs = append(errs, err) - case <-timeout: - return nil, xerrors.New("Timeout Fetching Exploit") - } - } - if len(errs) != 0 { - return nil, xerrors.Errorf("Failed to fetch Exploit. err: %w", errs) - } - return -} - -type exploitRequest struct { - cveID string -} - -func httpGetExploit(url string, req exploitRequest, resChan chan<- exploitResponse, errChan chan<- error) { - var body string - var errs []error - var resp *http.Response - count, retryMax := 0, 3 - f := func() (err error) { - req := gorequest.New().Get(url) - if config.Conf.Exploit.TimeoutSecPerRequest > 0 { - req = req.Timeout(time.Duration(config.Conf.Exploit.TimeoutSecPerRequest) * time.Second) - } - resp, body, errs = req.End() - if 0 < len(errs) || resp == nil || resp.StatusCode != 200 { - count++ - if count == retryMax { - return nil - } - return xerrors.Errorf("HTTP GET error, url: %s, resp: %v, err: %+v", url, resp, errs) - } - return nil - } - notify := func(err error, t time.Duration) { - logging.Log.Warnf("Failed to HTTP GET. retrying in %f seconds. err: %+v", t.Seconds(), err) - } - err := backoff.RetryNotify(f, backoff.NewExponentialBackOff(), notify) - if err != nil { - errChan <- xerrors.Errorf("HTTP Error %w", err) - return - } - if count == retryMax { - errChan <- xerrors.New("Retry count exceeded") - return - } - - resChan <- exploitResponse{ - request: req, - json: body, - } -} - -func newExploitDB(cnf config.VulnDictInterface) (exploitdb.DB, error) { - if cnf.IsFetchViaHTTP() { - return nil, nil - } - path := cnf.GetURL() - if cnf.GetType() == "sqlite3" { - path = cnf.GetSQLite3Path() - } - driver, err := exploitdb.NewDB(cnf.GetType(), path, cnf.GetDebugSQL(), exploitdb.Option{}) - if err != nil { - if errors.Is(err, exploitdb.ErrDBLocked) { - return nil, xerrors.Errorf("Failed to init exploit DB. SQLite3: %s is locked. err: %w", cnf.GetSQLite3Path(), err) - } - return nil, xerrors.Errorf("Failed to init exploit DB. DB Path: %s, err: %w", path, err) - } - return driver, nil -} diff --git a/detector/exploitdb_test.go b/detector/exploitdb_test.go deleted file mode 100644 index 74af3df120..0000000000 --- a/detector/exploitdb_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build !scanner - -package detector_test - -import ( - "reflect" - "testing" - - "github.com/future-architect/vuls/detector" - "github.com/future-architect/vuls/models" - exploitmodels "github.com/vulsio/go-exploitdb/models" -) - -func TestConvertToModelsExploit(t *testing.T) { - tests := []struct { - name string - es []exploitmodels.Exploit - want []models.Exploit - }{ - { - name: "happy", - es: []exploitmodels.Exploit{ - { - ExploitType: exploitmodels.OffensiveSecurityType, - ExploitUniqueID: "00001", - URL: "https://www.exploit-db.com/exploits/00001", - Description: "This is a test exploit", - CveID: "CVE-2025-0001", - OffensiveSecurity: &exploitmodels.OffensiveSecurity{ - Document: &exploitmodels.Document{ - Base: exploitmodels.Base{ - FileURL: "https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/00001.txt", - Verified: false, - }, - }, - }, - }, - { - ExploitType: exploitmodels.OffensiveSecurityType, - ExploitUniqueID: "00002", - URL: "https://www.exploit-db.com/exploits/00002", - Description: "This is a test exploit", - CveID: "CVE-2025-0001", - OffensiveSecurity: &exploitmodels.OffensiveSecurity{ - ShellCode: &exploitmodels.ShellCode{ - Base: exploitmodels.Base{ - FileURL: "https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/00002.c", - Verified: true, - }, - }, - }, - }, - { - ExploitType: exploitmodels.GitHubRepositoryType, - ExploitUniqueID: "GitHub-f61ce4e51784521b6ee584d42f2aads2", - URL: "https://github.com/vuls/CVE-2025-0001", - Description: "This is a test exploit", - CveID: "CVE-2025-0001", - GitHubRepository: &exploitmodels.GitHubRepository{ - Star: 12, - Fork: 3, - }, - }, - }, - want: []models.Exploit{ - { - ExploitType: exploitmodels.OffensiveSecurityType, - ID: "00001", - URL: "https://www.exploit-db.com/exploits/00001", - Description: "This is a test exploit", - Verified: new(false), - DocumentURL: new("https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/00001.txt"), - }, - { - ExploitType: exploitmodels.OffensiveSecurityType, - ID: "00002", - URL: "https://www.exploit-db.com/exploits/00002", - Description: "This is a test exploit", - Verified: new(true), - ShellCodeURL: new("https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/00002.c"), - }, - { - ExploitType: exploitmodels.GitHubRepositoryType, - ID: "GitHub-f61ce4e51784521b6ee584d42f2aads2", - URL: "https://github.com/vuls/CVE-2025-0001", - Description: "This is a test exploit", - }, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := detector.ConvertToModelsExploit(tt.es); !reflect.DeepEqual(got, tt.want) { - t.Errorf("ConvertToModelsExploit() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/detector/util.go b/detector/util.go index 7932234563..7cbd6b995c 100644 --- a/detector/util.go +++ b/detector/util.go @@ -263,7 +263,7 @@ func loadOneServerScanResult(jsonFile string) (*models.ScanResult, error) { } // ValidateDBs checks if the databases are accessible and can be closed properly -func ValidateDBs(cveConf config.GoCveDictConf, gostConf config.GostConf, exploitConf config.ExploitConf, ctiConf config.CtiConf, logOpts logging.LogOpts) error { +func ValidateDBs(cveConf config.GoCveDictConf, gostConf config.GostConf, ctiConf config.CtiConf, logOpts logging.LogOpts) error { cvec, err := newGoCveDictClient(&cveConf, logOpts) if err != nil { return xerrors.Errorf("Failed to new CVE client. err: %w", err) @@ -280,14 +280,6 @@ func ValidateDBs(cveConf config.GoCveDictConf, gostConf config.GostConf, exploit return xerrors.Errorf("Failed to close gost DB. err: %w", err) } - exploitc, err := newGoExploitDBClient(&exploitConf, logOpts) - if err != nil { - return xerrors.Errorf("Failed to new exploit client. err: %w", err) - } - if err := exploitc.closeDB(); err != nil { - return xerrors.Errorf("Failed to close exploit DB. err: %w", err) - } - ctic, err := newGoCTIDBClient(&ctiConf, logOpts) if err != nil { return xerrors.Errorf("Failed to new CTI client. err: %w", err) diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-exploitdb/data/2017/CVE-2017-3132.json b/detector/vuls2/testdata/fixtures/enrich/exploit-exploitdb/data/2017/CVE-2017-3132.json new file mode 100644 index 0000000000..71bc821d96 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-exploitdb/data/2017/CVE-2017-3132.json @@ -0,0 +1,33 @@ +{ + "id": "CVE-2017-3132", + "vulnerabilities": [ + { + "content": { + "id": "CVE-2017-3132", + "exploit": [ + { + "source": "www.exploit-db.com", + "description": "Fortinet FortiOS < 5.6.0 - Cross-Site Scripting", + "published": "2017-07-28T00:00:00Z", + "modified": "2021-04-30T00:00:00Z", + "link": "https://www.exploit-db.com/exploits/42388", + "exploit_db": { + "id": "42388", + "author": "patryk_bogdan", + "type": "webapps", + "platform": "hardware", + "verified": true, + "raw_url": "https://www.exploit-db.com/raw/42388" + } + } + ] + } + } + ], + "data_source": { + "id": "exploit-exploitdb", + "raws": [ + "vuls-data-raw-exploit-exploitdb/exploits/42388.json" + ] + } +} \ No newline at end of file diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-exploitdb/datasource.json b/detector/vuls2/testdata/fixtures/enrich/exploit-exploitdb/datasource.json new file mode 100644 index 0000000000..8b16fb4bfa --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-exploitdb/datasource.json @@ -0,0 +1,4 @@ +{ + "id": "exploit-exploitdb", + "name": "Exploit-DB" +} diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-github/data/2017/CVE-2017-9779.json b/detector/vuls2/testdata/fixtures/enrich/exploit-github/data/2017/CVE-2017-9779.json new file mode 100644 index 0000000000..2b8321f1ad --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-github/data/2017/CVE-2017-9779.json @@ -0,0 +1,40 @@ +{ + "id": "CVE-2017-9779", + "vulnerabilities": [ + { + "content": { + "id": "CVE-2017-9779", + "exploit": [ + { + "source": "github.com/nomi-sec/PoC-in-GitHub", + "description": "Automatic execution Payload From Windows By Path Users All Exploit Via File bashrc ", + "published": "2017-08-18T18:30:42Z", + "modified": "2017-09-11T14:35:42Z", + "link": "https://github.com/homjxi0e/CVE-2017-9779", + "github": { + "owner": "homjxi0e", + "topics": [ + "automatic", + "bashrc", + "by", + "cmder", + "exploit", + "implementation", + "via" + ], + "stargazers_count": 0, + "forks_count": 1, + "pushed_at": "2017-09-11T23:28:35Z" + } + } + ] + } + } + ], + "data_source": { + "id": "exploit-github", + "raws": [ + "vuls-data-raw-exploit-github/2017/CVE-2017-9779.json" + ] + } +} \ No newline at end of file diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-github/datasource.json b/detector/vuls2/testdata/fixtures/enrich/exploit-github/datasource.json new file mode 100644 index 0000000000..558e333938 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-github/datasource.json @@ -0,0 +1,4 @@ +{ + "id": "exploit-github", + "name": "github.com/nomi-sec/PoC-in-GitHub" +} diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-inthewild/data/2017/CVE-2017-16885.json b/detector/vuls2/testdata/fixtures/enrich/exploit-inthewild/data/2017/CVE-2017-16885.json new file mode 100644 index 0000000000..89739dd1f0 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-inthewild/data/2017/CVE-2017-16885.json @@ -0,0 +1,27 @@ +{ + "id": "CVE-2017-16885", + "vulnerabilities": [ + { + "content": { + "id": "CVE-2017-16885", + "exploit": [ + { + "source": "inthewild.io", + "published": "2019-10-03T00:03:00Z", + "link": "https://www.exploit-db.com/exploits/43460/", + "inthewild": { + "type": "exploit", + "source": "NVD" + } + } + ] + } + } + ], + "data_source": { + "id": "exploit-inthewild", + "raws": [ + "vuls-data-raw-exploit-inthewild/2017/CVE-2017-16885.json" + ] + } +} \ No newline at end of file diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-inthewild/datasource.json b/detector/vuls2/testdata/fixtures/enrich/exploit-inthewild/datasource.json new file mode 100644 index 0000000000..6ebbb0a7f8 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-inthewild/datasource.json @@ -0,0 +1,4 @@ +{ + "id": "exploit-inthewild", + "name": "InTheWild.io - Check if a CVE is exploited in the wild" +} diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-trickest/data/2017/CVE-2017-7273.json b/detector/vuls2/testdata/fixtures/enrich/exploit-trickest/data/2017/CVE-2017-7273.json new file mode 100644 index 0000000000..665e2a2af0 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-trickest/data/2017/CVE-2017-7273.json @@ -0,0 +1,60 @@ +{ + "id": "CVE-2017-7273", + "vulnerabilities": [ + { + "content": { + "id": "CVE-2017-7273", + "exploit": [ + { + "source": "trickest.com", + "description": "The cp_report_fixup function in drivers/hid/hid-cypress.c in the Linux kernel 3.2 and 4.x before 4.9.4 allows physically proximate attackers to cause a denial of service (integer underflow) or possibly have unspecified other impact via a crafted HID report.", + "link": "https://github.com/thdusdl1219/CVE-Study", + "trickest": { + "tags": [ + { + "label": "Product", + "message": "n/a" + }, + { + "label": "Version", + "message": "n/a" + }, + { + "label": "Vulnerability", + "message": "n/a" + } + ] + } + }, + { + "source": "trickest.com", + "description": "The cp_report_fixup function in drivers/hid/hid-cypress.c in the Linux kernel 3.2 and 4.x before 4.9.4 allows physically proximate attackers to cause a denial of service (integer underflow) or possibly have unspecified other impact via a crafted HID report.", + "link": "https://github.com/vincent-deng/veracode-container-security-finding-parser", + "trickest": { + "tags": [ + { + "label": "Product", + "message": "n/a" + }, + { + "label": "Version", + "message": "n/a" + }, + { + "label": "Vulnerability", + "message": "n/a" + } + ] + } + } + ] + } + } + ], + "data_source": { + "id": "exploit-trickest", + "raws": [ + "vuls-data-raw-exploit-trickest/2017/CVE-2017-7273.json" + ] + } +} \ No newline at end of file diff --git a/detector/vuls2/testdata/fixtures/enrich/exploit-trickest/datasource.json b/detector/vuls2/testdata/fixtures/enrich/exploit-trickest/datasource.json new file mode 100644 index 0000000000..630811e062 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/exploit-trickest/datasource.json @@ -0,0 +1,4 @@ +{ + "id": "exploit-trickest", + "name": "Trickest CVE Repository" +} diff --git a/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/data/2017/CVE-2017-14535.json b/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/data/2017/CVE-2017-14535.json new file mode 100644 index 0000000000..43951d5dfd --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/data/2017/CVE-2017-14535.json @@ -0,0 +1,26 @@ +{ + "id": "CVE-2017-14535", + "vulnerabilities": [ + { + "content": { + "id": "CVE-2017-14535", + "exploit": [ + { + "source": "nuclei.projectdiscovery.io", + "description": "Trixbox 2.8.0.4 is vulnerable to OS command injection via shell metacharacters in the lang parameter to /maint/modules/home/index.php.", + "link": "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-14535.yaml", + "nuclei": { + "template_id": "CVE-2017-14535" + } + } + ] + } + } + ], + "data_source": { + "id": "nuclei-repository", + "raws": [ + "vuls-data-raw-nuclei-repository/http/cves/2017/CVE-2017-14535.json" + ] + } +} \ No newline at end of file diff --git a/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/data/2017/CVE-2017-18565.json b/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/data/2017/CVE-2017-18565.json new file mode 100644 index 0000000000..36c530dc54 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/data/2017/CVE-2017-18565.json @@ -0,0 +1,27 @@ +{ + "id": "CVE-2017-18565", + "vulnerabilities": [ + { + "content": { + "id": "CVE-2017-18565", + "exploit": [ + { + "source": "nuclei.projectdiscovery.io", + "description": "The updater plugin before 1.35 for WordPress has multiple XSS issues.", + "link": "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-18565.yaml", + "nuclei": { + "template_id": "CVE-2017-18565", + "verified": true + } + } + ] + } + } + ], + "data_source": { + "id": "nuclei-repository", + "raws": [ + "vuls-data-raw-nuclei-repository/http/cves/2017/CVE-2017-18565.json" + ] + } +} \ No newline at end of file diff --git a/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/datasource.json b/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/datasource.json new file mode 100644 index 0000000000..a5429ce302 --- /dev/null +++ b/detector/vuls2/testdata/fixtures/enrich/nuclei-repository/datasource.json @@ -0,0 +1,4 @@ +{ + "id": "nuclei-repository", + "name": "Nuclei Templates Repository" +} diff --git a/detector/vuls2/vendor.go b/detector/vuls2/vendor.go index cf2a8b165a..4691a0c75d 100644 --- a/detector/vuls2/vendor.go +++ b/detector/vuls2/vendor.go @@ -1056,6 +1056,8 @@ func enrichVulnerabilities(vi *models.VulnInfo, vulns []dbTypes.VulnerabilityDat enrichRedHatCVE(vi, rootMap) case sourceTypes.Metasploit: enrichMetasploit(vi, rootMap) + case sourceTypes.ExploitExploitDB, sourceTypes.ExploitGitHub, sourceTypes.ExploitInTheWild, sourceTypes.ExploitTrickest, sourceTypes.NucleiRepository: + vi.Exploits = append(vi.Exploits, enrichExploits(sourceID, rootMap)...) } } } @@ -1265,3 +1267,44 @@ func enrichAdvisoryKEV(rootMap map[dataTypes.RootID][]advisoryTypes.Advisory) [] } return kevs } + +// enrichExploits converts vulnerability exploit data to models.Exploit slice. +func enrichExploits(sourceID sourceTypes.SourceID, rootMap map[dataTypes.RootID][]vulnerabilityTypes.Vulnerability) []models.Exploit { + var exploits []models.Exploit + for _, vulns := range rootMap { + for _, v := range vulns { + for _, e := range v.Content.Exploit { + exploit := models.Exploit{ + URL: e.Link, + Description: e.Description, + } + switch sourceID { + case sourceTypes.ExploitExploitDB: + exploit.ExploitType = models.ExploitTypeExploitDB + if e.ExploitDB != nil { + exploit.ID = e.ExploitDB.ID + exploit.Verified = &e.ExploitDB.Verified + if e.ExploitDB.RawURL != "" { + exploit.DocumentURL = &e.ExploitDB.RawURL + } + } + case sourceTypes.ExploitGitHub: + exploit.ExploitType = models.ExploitTypeGitHub + case sourceTypes.ExploitInTheWild: + exploit.ExploitType = models.ExploitTypeInTheWild + case sourceTypes.ExploitTrickest: + exploit.ExploitType = models.ExploitTypeTrickest + case sourceTypes.NucleiRepository: + exploit.ExploitType = models.ExploitTypeNuclei + if e.Nuclei != nil { + exploit.Verified = &e.Nuclei.Verified + } + default: + exploit.ExploitType = models.ExploitType(sourceID) + } + exploits = append(exploits, exploit) + } + } + } + return exploits +} diff --git a/detector/vuls2/vuls2.go b/detector/vuls2/vuls2.go index 8c1c2786fd..61553e7027 100644 --- a/detector/vuls2/vuls2.go +++ b/detector/vuls2/vuls2.go @@ -1214,7 +1214,12 @@ func enrich(sesh *session.Session, vim models.VulnInfos) error { DataSources: []sourceTypes.SourceID{ sourceTypes.CISAKEV, sourceTypes.ENISAKEV, + sourceTypes.ExploitExploitDB, + sourceTypes.ExploitGitHub, + sourceTypes.ExploitInTheWild, + sourceTypes.ExploitTrickest, sourceTypes.Metasploit, + sourceTypes.NucleiRepository, sourceTypes.RedHatCVE, sourceTypes.VulnCheckKEV, }, diff --git a/detector/vuls2/vuls2_test.go b/detector/vuls2/vuls2_test.go index 7a405470c5..83752f0e61 100644 --- a/detector/vuls2/vuls2_test.go +++ b/detector/vuls2/vuls2_test.go @@ -9171,7 +9171,7 @@ func Test_enrich(t *testing.T) { RequiredAction: "Apply updates per vendor instructions.", KnownRansomwareCampaignUse: "Unknown", DateAdded: time.Date(2022, time.August, 18, 0, 0, 0, 0, time.UTC), - DueDate: func() *time.Time { t := time.Date(2022, time.September, 8, 0, 0, 0, 0, time.UTC); return &t }(), + DueDate: new(time.Date(2022, time.September, 8, 0, 0, 0, 0, time.UTC)), CISA: &models.CISAKEV{ Note: "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2022-21971", }, @@ -9204,7 +9204,7 @@ func Test_enrich(t *testing.T) { RequiredAction: "Apply updates per vendor instructions.", KnownRansomwareCampaignUse: "Unknown", DateAdded: time.Date(2021, time.November, 3, 0, 0, 0, 0, time.UTC), - DueDate: func() *time.Time { t := time.Date(2021, time.November, 17, 0, 0, 0, 0, time.UTC); return &t }(), + DueDate: new(time.Date(2021, time.November, 17, 0, 0, 0, 0, time.UTC)), VulnCheck: &models.VulnCheckKEV{ XDB: []models.VulnCheckXDB{ { @@ -9288,6 +9288,159 @@ func Test_enrich(t *testing.T) { }, }, }, + { + name: "enrich with exploit-exploitdb data", + args: args{ + vim: models.VulnInfos{ + "CVE-2017-3132": models.VulnInfo{ + CveID: "CVE-2017-3132", + CveContents: models.CveContents{}, + }, + }, + }, + want: models.VulnInfos{ + "CVE-2017-3132": models.VulnInfo{ + CveID: "CVE-2017-3132", + CveContents: models.CveContents{}, + Exploits: []models.Exploit{ + { + ExploitType: models.ExploitTypeExploitDB, + ID: "42388", + URL: "https://www.exploit-db.com/exploits/42388", + Description: "Fortinet FortiOS < 5.6.0 - Cross-Site Scripting", + Verified: new(true), + DocumentURL: new("https://www.exploit-db.com/raw/42388"), + }, + }, + }, + }, + }, + { + name: "enrich with exploit-github data", + args: args{ + vim: models.VulnInfos{ + "CVE-2017-9779": models.VulnInfo{ + CveID: "CVE-2017-9779", + CveContents: models.CveContents{}, + }, + }, + }, + want: models.VulnInfos{ + "CVE-2017-9779": models.VulnInfo{ + CveID: "CVE-2017-9779", + CveContents: models.CveContents{}, + Exploits: []models.Exploit{ + { + ExploitType: models.ExploitTypeGitHub, + URL: "https://github.com/homjxi0e/CVE-2017-9779", + Description: "Automatic execution Payload From Windows By Path Users All Exploit Via File bashrc ", + }, + }, + }, + }, + }, + { + name: "enrich with exploit-inthewild data", + args: args{ + vim: models.VulnInfos{ + "CVE-2017-16885": models.VulnInfo{ + CveID: "CVE-2017-16885", + CveContents: models.CveContents{}, + }, + }, + }, + want: models.VulnInfos{ + "CVE-2017-16885": models.VulnInfo{ + CveID: "CVE-2017-16885", + CveContents: models.CveContents{}, + Exploits: []models.Exploit{ + { + ExploitType: models.ExploitTypeInTheWild, + URL: "https://www.exploit-db.com/exploits/43460/", + }, + }, + }, + }, + }, + { + name: "enrich with exploit-trickest data", + args: args{ + vim: models.VulnInfos{ + "CVE-2017-7273": models.VulnInfo{ + CveID: "CVE-2017-7273", + CveContents: models.CveContents{}, + }, + }, + }, + want: models.VulnInfos{ + "CVE-2017-7273": models.VulnInfo{ + CveID: "CVE-2017-7273", + CveContents: models.CveContents{}, + Exploits: []models.Exploit{ + { + ExploitType: models.ExploitTypeTrickest, + URL: "https://github.com/thdusdl1219/CVE-Study", + Description: "The cp_report_fixup function in drivers/hid/hid-cypress.c in the Linux kernel 3.2 and 4.x before 4.9.4 allows physically proximate attackers to cause a denial of service (integer underflow) or possibly have unspecified other impact via a crafted HID report.", + }, + { + ExploitType: models.ExploitTypeTrickest, + URL: "https://github.com/vincent-deng/veracode-container-security-finding-parser", + Description: "The cp_report_fixup function in drivers/hid/hid-cypress.c in the Linux kernel 3.2 and 4.x before 4.9.4 allows physically proximate attackers to cause a denial of service (integer underflow) or possibly have unspecified other impact via a crafted HID report.", + }, + }, + }, + }, + }, + { + name: "enrich with nuclei-repository data (verified=true)", + args: args{ + vim: models.VulnInfos{ + "CVE-2017-18565": models.VulnInfo{ + CveID: "CVE-2017-18565", + CveContents: models.CveContents{}, + }, + }, + }, + want: models.VulnInfos{ + "CVE-2017-18565": models.VulnInfo{ + CveID: "CVE-2017-18565", + CveContents: models.CveContents{}, + Exploits: []models.Exploit{ + { + ExploitType: models.ExploitTypeNuclei, + URL: "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-18565.yaml", + Description: "The updater plugin before 1.35 for WordPress has multiple XSS issues.", + Verified: new(true), + }, + }, + }, + }, + }, + { + name: "enrich with nuclei-repository data (verified=false)", + args: args{ + vim: models.VulnInfos{ + "CVE-2017-14535": models.VulnInfo{ + CveID: "CVE-2017-14535", + CveContents: models.CveContents{}, + }, + }, + }, + want: models.VulnInfos{ + "CVE-2017-14535": models.VulnInfo{ + CveID: "CVE-2017-14535", + CveContents: models.CveContents{}, + Exploits: []models.Exploit{ + { + ExploitType: models.ExploitTypeNuclei, + URL: "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-14535.yaml", + Description: "Trixbox 2.8.0.4 is vulnerable to OS command injection via shell metacharacters in the lang parameter to /maint/modules/home/index.php.", + Verified: new(false), + }, + }, + }, + }, + }, { name: "empty VulnInfos", args: args{ diff --git a/go.mod b/go.mod index 4ca5305b16..3c98f7f521 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.4 github.com/BurntSushi/toml v1.6.0 github.com/CycloneDX/cyclonedx-go v0.10.0 - github.com/MaineK00n/vuls-data-update v0.0.0-20260415100620-ce86ca1a408d + github.com/MaineK00n/vuls-data-update v0.0.0-20260422085454-27a5cbe1b3fc github.com/MaineK00n/vuls2 v0.0.1-alpha.0.20260416040322-81ce30605753 github.com/Ullaakut/nmap/v2 v2.2.2 github.com/aquasecurity/trivy v0.69.2 @@ -24,7 +24,7 @@ require ( github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 github.com/emersion/go-smtp v0.24.0 github.com/google/go-cmp v0.7.0 - github.com/google/go-containerregistry v0.21.3 + github.com/google/go-containerregistry v0.21.5 github.com/google/subcommands v1.2.0 github.com/google/uuid v1.6.0 github.com/gosnmp/gosnmp v1.43.2 @@ -53,11 +53,10 @@ require ( github.com/spf13/cobra v1.10.2 github.com/vulsio/go-cti v0.3.4 github.com/vulsio/go-cve-dictionary v0.16.0 - github.com/vulsio/go-exploitdb v0.7.0 github.com/vulsio/gost v0.7.2 go.etcd.io/bbolt v1.4.3 - golang.org/x/term v0.41.0 - golang.org/x/text v0.35.0 + golang.org/x/term v0.42.0 + golang.org/x/text v0.36.0 golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da ) @@ -147,8 +146,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dlclark/regexp2 v1.11.0 // indirect - github.com/docker/cli v29.3.0+incompatible // indirect - github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/cli v29.4.0+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.5 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -167,7 +165,7 @@ require ( github.com/go-errors/errors v1.4.2 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.8.0 // indirect - github.com/go-git/go-git/v5 v5.17.2 // indirect + github.com/go-git/go-git/v5 v5.18.0 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect github.com/go-ini/ini v1.67.0 // indirect github.com/go-jose/go-jose/v4 v4.1.3 // indirect @@ -339,15 +337,15 @@ require ( go.opentelemetry.io/otel/trace v1.40.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.49.0 // indirect + golang.org/x/crypto v0.50.0 // indirect golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect - golang.org/x/mod v0.34.0 // indirect - golang.org/x/net v0.52.0 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.42.0 // indirect + golang.org/x/sys v0.43.0 // indirect golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.43.0 // indirect + golang.org/x/tools v0.44.0 // indirect google.golang.org/api v0.260.0 // indirect google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect @@ -374,10 +372,10 @@ require ( k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect k8s.io/kubectl v0.34.0 // indirect k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d // indirect - modernc.org/libc v1.70.0 // indirect + modernc.org/libc v1.72.0 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect - modernc.org/sqlite v1.48.1 // indirect + modernc.org/sqlite v1.49.1 // indirect mvdan.cc/sh/v3 v3.12.0 // indirect oras.land/oras-go/v2 v2.6.0 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect diff --git a/go.sum b/go.sum index 2141dfcbd9..879ec09865 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/MaineK00n/go-microsoft-version v0.0.0-20260325021654-1d9206bdeffc h1: github.com/MaineK00n/go-microsoft-version v0.0.0-20260325021654-1d9206bdeffc/go.mod h1:GNf+Vhnxk8/pW56jsxAeFCBP0VCgVQlLIJ812UnAj9c= github.com/MaineK00n/go-paloalto-version v0.0.0-20250909032857-57479910413b h1:pDmxa1+HCq7nShTgLURMOpjKc38hYq3lrgNHqur/Nps= github.com/MaineK00n/go-paloalto-version v0.0.0-20250909032857-57479910413b/go.mod h1:ELOxzfAd4oAe4niMmoZlSiJwzf1DF+DjNdjsUcuqAR8= -github.com/MaineK00n/vuls-data-update v0.0.0-20260415100620-ce86ca1a408d h1:QdfZfoz8rJSZmlM9t9LSjqq7WmQdFe7aRPZTni14eSI= -github.com/MaineK00n/vuls-data-update v0.0.0-20260415100620-ce86ca1a408d/go.mod h1:3bTaNbc4WrdAWFbo9kCtdbvMz10i72XGpa8U1fGMzOE= +github.com/MaineK00n/vuls-data-update v0.0.0-20260422085454-27a5cbe1b3fc h1:AU84WemlOE7XoB5ZIwV7L3caPPnYHcpSGupBWyILCLo= +github.com/MaineK00n/vuls-data-update v0.0.0-20260422085454-27a5cbe1b3fc/go.mod h1:zgZp2Gf0JQ8pPSHgDSxm+KFKf8twW+rWice7TIY7zEs= github.com/MaineK00n/vuls2 v0.0.1-alpha.0.20260416040322-81ce30605753 h1:SraOXYeQdog7TihZYbgdwyUc76oiMNxARWI+3NG3RPQ= github.com/MaineK00n/vuls2 v0.0.1-alpha.0.20260416040322-81ce30605753/go.mod h1:o02d7v5LzUDj32vt1LibE30MoO9X9yWUhmHfgAO/46I= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= @@ -273,8 +273,8 @@ github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5 github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk= -github.com/docker/cli v29.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v29.4.0+incompatible h1:+IjXULMetlvWJiuSI0Nbor36lcJ5BTcVpUmB21KBoVM= +github.com/docker/cli v29.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= @@ -343,8 +343,8 @@ github.com/go-git/go-billy/v5 v5.8.0 h1:I8hjc3LbBlXTtVuFNJuwYuMiHvQJDq1AT6u4DwDz github.com/go-git/go-billy/v5 v5.8.0/go.mod h1:RpvI/rw4Vr5QA+Z60c6d6LXH0rYJo0uD5SqfmrrheCY= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.17.2 h1:B+nkdlxdYrvyFK4GPXVU8w1U+YkbsgciIR7f2sZJ104= -github.com/go-git/go-git/v5 v5.17.2/go.mod h1:pW/VmeqkanRFqR6AljLcs7EA7FbZaN5MQqO7oZADXpo= +github.com/go-git/go-git/v5 v5.18.0 h1:O831KI+0PR51hM2kep6T8k+w0/LIAD490gvqMCvL5hM= +github.com/go-git/go-git/v5 v5.18.0/go.mod h1:pW/VmeqkanRFqR6AljLcs7EA7FbZaN5MQqO7oZADXpo= github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs= github.com/go-gorp/gorp/v3 v3.1.0/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw= github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= @@ -451,8 +451,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-containerregistry v0.21.3 h1:Xr+yt3VvwOOn/5nJzd7UoOhwPGiPkYW0zWDLLUXqAi4= -github.com/google/go-containerregistry v0.21.3/go.mod h1:D5ZrJF1e6dMzvInpBPuMCX0FxURz7GLq2rV3Us9aPkc= +github.com/google/go-containerregistry v0.21.5 h1:KTJG9Pn/jC0VdZR6ctV3/jcN+q6/Iqlx0sTVz3ywZlM= +github.com/google/go-containerregistry v0.21.5/go.mod h1:ySvMuiWg+dOsRW0Hw8GYwfMwBlNRTmpYBFJPlkco5zU= github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4= github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -892,8 +892,6 @@ github.com/vulsio/go-cti v0.3.4 h1:aCLFKLKsyJNbMHXcPlK3TwKq5DTdfZZcjwqjQH7+ORE= github.com/vulsio/go-cti v0.3.4/go.mod h1:quRi50ioECl6WSLxwjq2a10aq9G7eWzfnYTutXnpwF8= github.com/vulsio/go-cve-dictionary v0.16.0 h1:mVUD+8+NXumaNTOt2QRYTGaWPSovM43BYr+XjbQ+vXM= github.com/vulsio/go-cve-dictionary v0.16.0/go.mod h1:nx/pU+20B2DTY+z/lrzZOx73607tC2wmgvj6cbopzLM= -github.com/vulsio/go-exploitdb v0.7.0 h1:JV/HocGKgMD35I04IYNleB0BpdLLA1KM0dqFPtqqAtI= -github.com/vulsio/go-exploitdb v0.7.0/go.mod h1:+0hjB0HgGVIsqtkdVo0xJB8HDAezF7cG2XxofYkvTyo= github.com/vulsio/gost v0.7.2 h1:COYQ7Y8mi+YK1CDdRyaXgwocP7ZrnCNkJ8jxFe1roPE= github.com/vulsio/gost v0.7.2/go.mod h1:DswLTXFo0CUQie9aI1JKhrJTbWM4jgEhmEHALsSKyTs= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -999,8 +997,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= -golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1010,8 +1008,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1025,8 +1023,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1061,8 +1059,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1072,8 +1070,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= -golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1084,8 +1082,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1096,8 +1094,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1170,10 +1168,10 @@ k8s.io/kubectl v0.34.0 h1:NcXz4TPTaUwhiX4LU+6r6udrlm0NsVnSkP3R9t0dmxs= k8s.io/kubectl v0.34.0/go.mod h1:bmd0W5i+HuG7/p5sqicr0Li0rR2iIhXL0oUyLF3OjR4= k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0= k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis= -modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= -modernc.org/ccgo/v4 v4.32.0 h1:hjG66bI/kqIPX1b2yT6fr/jt+QedtP2fqojG2VrFuVw= -modernc.org/ccgo/v4 v4.32.0/go.mod h1:6F08EBCx5uQc38kMGl+0Nm0oWczoo1c7cgpzEry7Uc0= +modernc.org/cc/v4 v4.27.3 h1:uNCgn37E5U09mTv1XgskEVUJ8ADKpmFMPxzGJ0TSo+U= +modernc.org/cc/v4 v4.27.3/go.mod h1:3YjcbCqhoTTHPycJDRl2WZKKFj0nwcOIPBfEZK0Hdk8= +modernc.org/ccgo/v4 v4.32.4 h1:L5OB8rpEX4ZsXEQwGozRfJyJSFHbbNVOoQ59DU9/KuU= +modernc.org/ccgo/v4 v4.32.4/go.mod h1:lY7f+fiTDHfcv6YlRgSkxYfhs+UvOEEzj49jAn2TOx0= modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= @@ -1182,8 +1180,8 @@ modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo= modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= -modernc.org/libc v1.70.0 h1:U58NawXqXbgpZ/dcdS9kMshu08aiA6b7gusEusqzNkw= -modernc.org/libc v1.70.0/go.mod h1:OVmxFGP1CI/Z4L3E0Q3Mf1PDE0BucwMkcXjjLntvHJo= +modernc.org/libc v1.72.0 h1:IEu559v9a0XWjw0DPoVKtXpO2qt5NVLAnFaBbjq+n8c= +modernc.org/libc v1.72.0/go.mod h1:tTU8DL8A+XLVkEY3x5E/tO7s2Q/q42EtnNWda/L5QhQ= modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI= @@ -1192,8 +1190,8 @@ modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8= modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= -modernc.org/sqlite v1.48.1 h1:S85iToyU6cgeojybE2XJlSbcsvcWkQ6qqNXJHtW5hWA= -modernc.org/sqlite v1.48.1/go.mod h1:hWjRO6Tj/5Ik8ieqxQybiEOUXy0NJFNp2tpvVpKlvig= +modernc.org/sqlite v1.49.1 h1:dYGHTKcX1sJ+EQDnUzvz4TJ5GbuvhNJa8Fg6ElGx73U= +modernc.org/sqlite v1.49.1/go.mod h1:m0w8xhwYUVY3H6pSDwc3gkJ/irZT/0YEXwBlhaxQEew= modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= diff --git a/models/utils.go b/models/utils.go index 141ab2a1db..ef96831727 100644 --- a/models/utils.go +++ b/models/utils.go @@ -154,9 +154,7 @@ func ConvertNvdToModel(cveID string, nvds []cvedict.Nvd) ([]CveContent, []Exploi }) if strings.Contains(r.Tags, "Exploit") { exploits = append(exploits, Exploit{ - //TODO Add const to here - // https://github.com/vulsio/go-exploitdb/blob/master/models/exploit.go#L13-L18 - ExploitType: "nvd", + ExploitType: ExploitTypeNVD, URL: r.Link, }) } diff --git a/models/vulninfos.go b/models/vulninfos.go index d900a7ce9f..38d446bbf4 100644 --- a/models/vulninfos.go +++ b/models/vulninfos.go @@ -11,7 +11,6 @@ import ( "time" "github.com/future-architect/vuls/logging" - exploitmodels "github.com/vulsio/go-exploitdb/models" ) // VulnInfos has a map of VulnInfo @@ -886,18 +885,36 @@ func (p DistroAdvisory) Format() string { return strings.Join(buf, "\n") } +// ExploitType represents the source type of an exploit +type ExploitType string + +const ( + // ExploitTypeExploitDB is the source type for Offensive Security Exploit DB. + ExploitTypeExploitDB ExploitType = "OffensiveSecurity" + // ExploitTypeGitHub is the source type for GitHub PoC-in-GitHub. + ExploitTypeGitHub ExploitType = "GitHub" + // ExploitTypeInTheWild is the source type for inthewild.io. + ExploitTypeInTheWild ExploitType = "InTheWild" + // ExploitTypeTrickest is the source type for Trickest. + ExploitTypeTrickest ExploitType = "Trickest" + // ExploitTypeNuclei is the source type for Nuclei templates. + ExploitTypeNuclei ExploitType = "Nuclei" + // ExploitTypeNVD is the source type for NVD. + ExploitTypeNVD ExploitType = "nvd" +) + // Exploit : type Exploit struct { - ExploitType exploitmodels.ExploitType `json:"exploitType"` - ID string `json:"id"` - URL string `json:"url"` - Description string `json:"description"` - Verified *bool `json:"verified,omitempty"` - DocumentURL *string `json:"documentURL,omitempty"` - ShellCodeURL *string `json:"shellCodeURL,omitempty"` - BinaryURL *string `json:"binaryURL,omitempty"` - PaperURL *string `json:"paperURL,omitempty"` - GHDBURL *string `json:"ghdbURL,omitempty"` + ExploitType ExploitType `json:"exploitType"` + ID string `json:"id"` + URL string `json:"url"` + Description string `json:"description"` + Verified *bool `json:"verified,omitempty"` + DocumentURL *string `json:"documentURL,omitempty"` + ShellCodeURL *string `json:"shellCodeURL,omitempty"` + BinaryURL *string `json:"binaryURL,omitempty"` + PaperURL *string `json:"paperURL,omitempty"` + GHDBURL *string `json:"ghdbURL,omitempty"` } // Metasploit : diff --git a/server/server.go b/server/server.go index 820e33b3ce..ebb5372a40 100644 --- a/server/server.go +++ b/server/server.go @@ -80,13 +80,6 @@ func (h VulsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { http.Error(w, err.Error(), http.StatusServiceUnavailable) } - nExploitCve, err := detector.FillWithExploit(&r, config.Conf.Exploit, config.Conf.LogOpts) - if err != nil { - logging.Log.Errorf("Failed to fill with exploit: %+v", err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - } - logging.Log.Infof("%s: %d PoC detected", r.FormatServerName(), nExploitCve) - if err := detector.FillWithCTI(&r, config.Conf.Cti, config.Conf.LogOpts); err != nil { logging.Log.Errorf("Failed to fill with Cyber Threat Intelligences: %+v", err) http.Error(w, err.Error(), http.StatusServiceUnavailable) diff --git a/subcmds/discover.go b/subcmds/discover.go index 2f4d1a7bfc..68231a21b2 100644 --- a/subcmds/discover.go +++ b/subcmds/discover.go @@ -100,14 +100,6 @@ func printConfigToml(ips []string) (err error) { #timeoutSec = 0 #timeoutSecPerRequest = 0 -[exploit] -#type = ["sqlite3", "mysql", "postgres", "redis", "http" ] -#sqlite3Path = "/path/to/go-exploitdb.sqlite3" -#url = "" -#debugSQL = false -#timeoutSec = 0 -#timeoutSecPerRequest = 0 - [cti] #type = ["sqlite3", "mysql", "postgres", "redis", "http" ] #sqlite3Path = "/path/to/go-cti.sqlite3" diff --git a/subcmds/report.go b/subcmds/report.go index 56d4fa84ff..9432a6f893 100644 --- a/subcmds/report.go +++ b/subcmds/report.go @@ -210,7 +210,6 @@ func (p *ReportCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...any) subcom for _, cnf := range []config.VulnDictInterface{ &config.Conf.CveDict, &config.Conf.Gost, - &config.Conf.Exploit, &config.Conf.Cti, } { cnf.Init() diff --git a/subcmds/report_windows.go b/subcmds/report_windows.go index d11cf172c3..cfaf8ffc06 100644 --- a/subcmds/report_windows.go +++ b/subcmds/report_windows.go @@ -207,7 +207,6 @@ func (p *ReportCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...any) subcom for _, cnf := range []config.VulnDictInterface{ &config.Conf.CveDict, &config.Conf.Gost, - &config.Conf.Exploit, &config.Conf.Cti, } { cnf.Init() diff --git a/subcmds/server.go b/subcmds/server.go index 2a19e5798c..e20f3ef213 100644 --- a/subcmds/server.go +++ b/subcmds/server.go @@ -99,7 +99,6 @@ func (p *ServerCmd) Execute(_ context.Context, _ *flag.FlagSet, _ ...any) subcom for _, cnf := range []config.VulnDictInterface{ &config.Conf.CveDict, &config.Conf.Gost, - &config.Conf.Exploit, &config.Conf.Cti, } { cnf.Init() @@ -117,7 +116,7 @@ func (p *ServerCmd) Execute(_ context.Context, _ *flag.FlagSet, _ ...any) subcom } logging.Log.Info("Validating DBs...") - if err := detector.ValidateDBs(config.Conf.CveDict, config.Conf.Gost, config.Conf.Exploit, config.Conf.Cti, config.Conf.LogOpts); err != nil { + if err := detector.ValidateDBs(config.Conf.CveDict, config.Conf.Gost, config.Conf.Cti, config.Conf.LogOpts); err != nil { logging.Log.Errorf("Failed to validate DBs. err: %+v", err) return subcommands.ExitFailure }