Skip to content

Instantly share code, notes, and snippets.

@mkol5222
Created June 4, 2020 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkol5222/0b4b605b48731fc6b68610b2ab583fa6 to your computer and use it in GitHub Desktop.
Save mkol5222/0b4b605b48731fc6b68610b2ab583fa6 to your computer and use it in GitHub Desktop.
map CVE to JSON describing it. usage: curl -s $(./cveurl.sh "CVE-2017-0015") | jq -r .impact
#!/bin/bash
cve2cveUrl () {
[[ $1 =~ CVE-([0-9]{4})-([0-9]+) ]]
#echo "${BASH_REMATCH[0]}"
#echo "${BASH_REMATCH[1]}"
#echo "${BASH_REMATCH[2]}"
cveUrl="https://raw.githubusercontent.com/aquasecurity/vuln-list/master/nvd/${BASH_REMATCH[1]}/$1.json"
}
cve2cveUrl $1
echo $cveUrl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment