参考文章:Automating binary vulnerability discovery with Ghidra and Semgrep - hn security
使用流程:
1.提取 Ghidra 反编译器生成的所有伪代码,使其格式适合导入 IDE(例如VS Code)或由静态分析工具(例如Semgrep)解析。
2.使用 Semgrep 和自定义 C/C++ 规则来(重新)发现一些漏洞
GitHub - 0xdea/semgrep-rules: A collection of my Semgrep rules to facilitate vulnerability research.
测试:
semgrep --config /home/kali/Pcode/semgrep-rules-main/c/ /home/kali/Pcode/Pcode/ --sarif -o custom_rules_result.sarif
第一次扫描结果:
第二次扫描结果: