Last active
April 22, 2025 08:09
-
-
Save oshoval/2eae889f25582b723d408ab30de50c8d to your computer and use it in GitHub Desktop.
CVE Symbol check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from lxml import html | |
| url = "https://pkg.go.dev/vuln/GO-2024-3333" | |
| response = requests.get(url) | |
| tree = html.fromstring(response.content) | |
| symbols_div = tree.xpath('//div[@class="VulnEntryPackages-attr VulnEntryPackages-symbols"]')[0] | |
| symbols = symbols_div.xpath('.//ul/li/a/text()') | |
| package_name = symbols_div.xpath('.//ul/li/a/@href')[0].split('#')[0].lstrip('/') | |
| # print(f"{package_name}\n") | |
| # print("\n".join(symbols)) | |
| for symbol in symbols: | |
| cmd = f'callgraph -format=digraph ./... | digraph nodes | egrep "{package_name}.*{symbol}"' | |
| print(cmd) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Putting it together
The regex isn't perfect yet (it can match partial matches and so on)
Usage example (in the source code directory):
./cve.py CVE-2024-45338