analysis: 运行了info_reveal_ai_analysis

This commit is contained in:
sleepwithoutbz
2025-05-27 22:07:38 +08:00
parent 79ae3fec86
commit 35e418a9c9
2 changed files with 7917 additions and 5 deletions

View File

@@ -28,10 +28,10 @@ def analyze_with_ai(data: str) -> str:
prompt = """ prompt = """
你是一个计算机安全领域的专家能够更具CVE描述分析出CVE产生于哪个程序、有何影响后果等信息。 你是一个计算机安全领域的专家能够更具CVE描述分析出CVE产生于哪个程序、有何影响后果等信息。
下面我会发给你一段文本第一行是CVE的编号与文件位置信息后续是这个CVE的详细描述。 下面我会发给你一段文本第一行是CVE的编号与文件位置信息后续是这个CVE的详细描述。
请分析我发送给你的CVE详细描述内容并进行分析我有个分析要求: 请分析我发送给你的CVE详细描述内容并进行分析我有3个分析要求:
1. 分析这个CVE信息是否与namespace、cgroup、container或者容器、隔离相关 1. 分析这个CVE信息是否与namespace、cgroup、container或者容器、隔离相关
2. 分析这个CVE是否会导致容器例如Docker等在运行时会影响其他容器或宿主机 2. 告诉我这是什么程序的漏洞是内核Kernel还是容器实现Docker还是容器内部运行的应用同时告诉我这个漏洞如何发生它有何效果。
3. 如果条件1、2全部不满足直接返回“N/A”不需要附带任何信息。 注意如果这个CVE和namespace、cgroup、container或者容器、隔离无关你只需返回"N/A"即可,无需任何多余信息。
""" """
client = OpenAI( client = OpenAI(
@@ -61,7 +61,7 @@ if __name__ == "__main__":
pattern = r"\./data/.*x/CVE.*?\.json" pattern = r"\./data/.*x/CVE.*?\.json"
regex = re.compile(pattern) regex = re.compile(pattern)
with open("keyword_filter_11-25.log", "r", encoding="utf-8") as file: with open("keyword_filter_21-25.log", "r", encoding="utf-8") as file:
text = file.read() text = file.read()
matches = list(regex.finditer(text)) matches = list(regex.finditer(text))
@@ -79,4 +79,4 @@ if __name__ == "__main__":
ans = analyze_with_ai(block) ans = analyze_with_ai(block)
if ans == "N/A": if ans == "N/A":
continue continue
log.write(f"cve: {block}, analysis: {ans}\n\n") log.write(f"cve: {block}\n\nanalysis: {ans}\n\n")

File diff suppressed because it is too large Load Diff