feat: 添加对pyc文件的反汇编功能模块
This commit is contained in:
@@ -25,6 +25,16 @@ def find_dangerous_functions(
|
||||
".cpp": {
|
||||
r"\bsystem\(": "high",
|
||||
},
|
||||
".pyc": {
|
||||
r"\bexec\b": "high",
|
||||
r"\beval\b": "high",
|
||||
r"\bos\.system\b": "high",
|
||||
r"\bos\.exec\b": "high",
|
||||
r"\bos\.fork\b": "high",
|
||||
r"\bos\.kill\b": "high",
|
||||
r"\bos\.popen\b": "medium",
|
||||
r"\bos\.spawn\b": "medium",
|
||||
},
|
||||
}
|
||||
risk_patterns = patterns.get(file_extension, {})
|
||||
classified_results = {"high": [], "medium": [], "low": [], "none": []}
|
||||
@@ -36,4 +46,3 @@ def find_dangerous_functions(
|
||||
if re.search(pattern, clean_line):
|
||||
classified_results[risk_level].append((line_number, clean_line))
|
||||
return classified_results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user