VulnCheck API 讓您能輕鬆開始使用 VulnCheck 目標情資。首先,只要透過 /v3/index/:index?cve=:cve API 查詢 target-intel 索引即可,如下所示:
curl --request GET \
--url https://api.vulncheck.com/v3/index/target-intel?cve=CVE-2024-21887 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer insert_token_here'
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
vulncheck "github.com/vulncheck-oss/sdk-go-v2/v2"
)
func main() {
configuration := vulncheck.NewConfiguration()
configuration.Scheme = "https"
configuration.Host = "api.vulncheck.com"
client := vulncheck.NewAPIClient(configuration)
token := os.Getenv("VULNCHECK_API_TOKEN")
auth := context.WithValue(
context.Background(),
vulncheck.ContextAPIKeys,
map[string]vulncheck.APIKey{
"Bearer": {Key: token},
},
)
resp, httpRes, err := client.IndicesAPI.IndexTargetIntelGet(auth).Cve("CVE-2024-21887").Execute()
if err != nil || httpRes.StatusCode != 200 {
log.Fatal(err)
}
prettyJSON, err := json.MarshalIndent(resp.Data, "", " ")
if err != nil {
log.Fatalf("Failed to generate JSON: %v", err)
return
}
fmt.Println(string(prettyJSON))
}
import vulncheck_sdk
configuration = vulncheck_sdk.Configuration(host="https://api.vulncheck.com/v3")
configuration.api_key["Bearer"] = "insert_token_here"
with vulncheck_sdk.ApiClient(configuration) as api_client:
indices_client = vulncheck_sdk.IndicesApi(api_client)
api_response = indices_client.index_target_intel_get(cve="CVE-2024-21887")
print(api_response.data)
vulncheck index browse target-intel --cve CVE-2024-21887
上述範例會在 target-intel 索引中搜尋所有經確認執行受 CVE-2024-21887 影響之軟體的主機。
每筆結果代表一個觀察到的 主機-連接埠-服務組合:一個 IP、一個連接埠,以及在其上識別出的服務。若主機有多個對外暴露的服務,就會出現多筆記錄。
使用有效的 CVE 識別碼呼叫 /v3/index/target-intel?cve=:cve API 端點後,會回傳類似以下的回應:
{
"_benchmark": 0.050314,
"_meta": {
"timestamp": "2026-09-14T18:22:27.132288937Z",
"index": "target-intel",
"limit": 100,
"total_documents": 411,
"sort": "_timestamp",
"order": "desc",
"page": 1,
"total_pages": 5,
// ...
},
"data": [
{
"ip": "203.0.113.42",
"hostname": "vpn.test.com",
"port": 443,
"timestamp": "2026-09-13T22:12:36.749Z",
"date_added": "2026-06-11T11:22:30.592Z",
"protocol": "http",
"transport": "tcp",
"cpe": [
"cpe:2.3:a:ivanti:connect_secure:9.1:r15.2:*:*:*:*:*:*"
],
"cve": [
"CVE-2023-46805",
"CVE-2024-21887",
"CVE-2024-21893"
],
"cve_confirmed": [
{ "cve_id": "CVE-2023-46805", "confirmed": true },
{ "cve_id": "CVE-2024-21887", "confirmed": true },
{ "cve_id": "CVE-2024-21893", "confirmed": true }
],
"vendor": ["ivanti"],
"product": ["connect secure"],
"version": ["9.1"],
"fingerprints": [
{
"cpe": "cpe:2.3:a:ivanti:connect_secure:9.1:r15.2:*:*:*:*:*:*",
"vendor": "ivanti",
"product": "connect secure",
"version": "9.1",
"deprecated": false,
"cves": [
{ "cve_id": "CVE-2023-46805", "confirmed": true },
{ "cve_id": "CVE-2024-21887", "confirmed": true },
{ "cve_id": "CVE-2024-21893", "confirmed": true }
]
}
],
"contains_cve": true,
"summary": {
"cve_count": 3,
"confirmed_count": 3,
"fingerprint_count": 1,
"contains_cve": true
},
"asn": "AS64500",
"as_name": "Example ISP",
"as_domain": "test.com",
"country": "United States",
"country_code": "US",
"metadata": {
"status_code": 200,
"title": "Web Interface",
"server": "",
"cert_common_name": "vpn.test.com",
"jarm": "29d3fd00029d29d00042d43d00041d598ac0c1012db967bb1ad0ff2491b3ae"
// ...
}
}
]
}
上方的記錄是常見情況:一個指紋、一個 CPE,以及一組全部通過可信度檢查的 CVE。關於欄位之間的關係,有三件事值得了解:
cpe、vendor、product 與 version 陣列,是 fingerprints 中所有內容的扁平化彙總。當主機有多個指紋時,這些陣列會將所有值放在一起,因此請勿依位置對應解讀;若需要知道哪個版本屬於哪個產品,請使用 fingerprints。cve 是單純的 CVE ID 陣列,而 cve_confirmed 是同一份清單,並附註每個 CVE 的可信度。confirmed 查詢參數即是依據 confirmed 旗標進行篩選。summary 是預先計算好的彙總,讓您不必自行計算陣列長度。當經指紋辨識的服務沒有關聯任何 CVE 時,cve 欄位為 null(而非空陣列),且 contains_cve 為 false:
{
"ip": "198.51.100.7",
"hostname": "",
"port": 80,
"timestamp": "2026-09-13T09:10:00Z",
"date_added": "2026-04-02T14:55:11.201Z",
"protocol": "http",
"transport": "tcp",
"cpe": ["cpe:2.3:a:apache:tomcat:10.1.0:*:*:*:*:*:*:*"],
"cve": null,
"vendor": ["apache"],
"product": ["tomcat"],
"version": ["10.1.0"],
"fingerprints": [
{
"cpe": "cpe:2.3:a:apache:tomcat:10.1.0:*:*:*:*:*:*:*",
"vendor": "apache",
"product": "tomcat",
"version": "10.1.0",
"deprecated": false
}
],
"contains_cve": false,
"summary": {
"cve_count": 0,
"confirmed_count": 0,
"fingerprint_count": 1,
"contains_cve": false
},
"asn": "AS64501",
"country": "Germany",
"country_code": "DE"
}
沒有 CVE 的指紋辨識主機仍是有用的資料:它回答的是「誰在執行這個產品」,而不是「誰有漏洞」。若要完全排除這類記錄,請傳入 contains_cve=true。
完整的欄位參考(包括 fingerprints 陣列、deprecated 旗標,以及 confirmed 實際證明了什麼),請參閱回應結構描述。關於上方省略的特定協定 metadata 物件,請參閱擴充資料。