vulncheck-oss / cli

VulnCheck's official command line tool
https://vulncheck.com
Apache License 2.0
116 stars 5 forks source link

[BUG] JSON response fields are sorted in alphabetical order and not in the original order #150

Open leaf06 opened 1 day ago

leaf06 commented 1 day ago

Is there an existing issue for this?

What happened?

Command: vulncheck index list initial-access --cve CVE-2024-9644

Output:

 {
    "_timestamp": "2024-11-01T17:05:16.733697Z",
    "artifacts": [
      {
        "artifactName": "Four-Faith Auth Bypass via Hidden API",
        "censysQueries": [
          "https://search.censys.io/search?resource=hosts\u0026sort=RELEVANCE\u0026per_page=25\u0026virtual_hosts=EXCLUDE\u0026q=same_service%28services.http.response.headers%3A+%28key%3A+%60Server%60+and+value.headers%3A+%60httpd_four-faith%60%29+and+services.http.response.protocol%3D%22HTTP%2F1.0%22+and+services.http.response.status_reason%3D%22Ok%22%29"
        ],
        "censysRawQueries": [
          "same_service(services.http.response.headers: (key: `Server` and value.headers: `httpd_four-faith`) and services.http.response.protocol=\"HTTP/1.0\" and services.http.response.status_reason=\"Ok\")"
        ],
        "cloneSSHURL": "git@git.vulncheck.com:vulncheck/initial-access.git",
        "dateAdded": "2024-10-09T00:00:00Z",
        "exploit": true,
        "fofaQueries": [],
        "greynoiseQueries": [
          "https://viz.greynoise.io/query/raw_data.web.paths:%22%2Fbapply.cgi%22"
        ],
        "nmapScript": false,
        "pcap": true,
        "product": [
          "F3x24",
          "F3x36"
        ],
        "shodanQueries": [
          "https://www.shodan.io/search?query=httpd_four-faith+%2B%22HTTP%2F1.0+200+Ok%22+%2B%22Cache-Control%3A+no-store%2C+no-cache%2C+must-revalidate%22"
        ],
        "shodanRawQueries": [
          "httpd_four-faith +\"HTTP/1.0 200 Ok\" +\"Cache-Control: no-store, no-cache, must-revalidate\""
        ],
        "snortRule": true,
        "suricataRule": true,
        "targetDocker": false,
        "targetService": "HTTP",
        "vendor": "Four-Faith",
        "versionScanner": true,
        "yara": false,
        "zeroday": true,
        "zoomEyeQueries": []
      }
    ],
    "cve": "CVE-2024-9644",
    "inKEV": false,
    "inVCKEV": false
  }
]

Expected Behavior

Command: https://api.vulncheck.com/v3/index/initial-access?cve=CVE-2024-9644

Output:

"data": [
    {
      "cve": "CVE-2024-9644",
      "inKEV": false,
      "inVCKEV": false,
      "artifacts": [
        {
          "vendor": "Four-Faith",
          "product": [
            "F3x24",
            "F3x36"
          ],
          "dateAdded": "2024-10-09T00:00:00Z",
          "artifactName": "Four-Faith Auth Bypass via Hidden API",
          "exploit": true,
          "versionScanner": true,
          "pcap": true,
          "suricataRule": true,
          "snortRule": true,
          "yara": false,
          "nmapScript": false,
          "zeroday": true,
          "targetService": "HTTP",
          "targetDocker": false,
          "shodanQueries": [
            "https://www.shodan.io/search?query=httpd_four-faith+%2B%22HTTP%2F1.0+200+Ok%22+%2B%22Cache-Control%3A+no-store%2C+no-cache%2C+must-revalidate%22"
          ],
          "censysQueries": [
            "https://search.censys.io/search?resource=hosts&sort=RELEVANCE&per_page=25&virtual_hosts=EXCLUDE&q=same_service%28services.http.response.headers%3A+%28key%3A+%60Server%60+and+value.headers%3A+%60httpd_four-faith%60%29+and+services.http.response.protocol%3D%22HTTP%2F1.0%22+and+services.http.response.status_reason%3D%22Ok%22%29"
          ],
          "greynoiseQueries": [
            "https://viz.greynoise.io/query/raw_data.web.paths:%22%2Fbapply.cgi%22"
          ],
          "fofaQueries": [],
          "zoomEyeQueries": [],
          "shodanRawQueries": [
            "httpd_four-faith +\"HTTP/1.0 200 Ok\" +\"Cache-Control: no-store, no-cache, must-revalidate\""
          ],
          "censysRawQueries": [
            "same_service(services.http.response.headers: (key: `Server` and value.headers: `httpd_four-faith`) and services.http.response.protocol=\"HTTP/1.0\" and services.http.response.status_reason=\"Ok\")"
          ],
          "cloneSSHURL": "git@git.vulncheck.com:vulncheck/initial-access.git"
        }
      ],
      "_timestamp": "2024-11-01T17:05:16.733697Z"
    }
  ]
}

Steps To Reproduce

No response

Which operating system where you on?

Mac

Anything else?

No response

acidjazz commented 8 hours ago

https://github.com/vulncheck-oss/sdk-go/pull/5 will fix this