【安全测试】【fortify】fortify的命令行使用
2022-09-26 16:39 码上起舞 阅读(1455) 评论(0) 编辑 收藏 举报扫描代码路径为D:\workspace
1、打开命令提示符
2、清除上一次扫描的缓存
#sourceanalyzer -b SCG-AuthCenter -clean
#sourceanalyzer -b DMC -clean
3、扫描、编译源码
#sourceanalyzer -encoding UTF-8 -Xmx1024M -b DMC -cp D:\workspace\libs\*.jar -source 1.8 "D:\workspace\src\main\java\**\*.java"
4、生成fpr文件,
#sourceanalyzer -Xmx1200M -b DMC -scan -f DMC.fpr
5、生成pdf报告
#BIRTReportGenerator -template "CWE Top 25 2019" -format pdf -output test.pdf -source DMC.fpr -showSuppressed --Version "DISA STIG 3.9" -UseFortifyPriorityOrder
6、打开test.pdf报告,查看统计结果
二、C/C++源码扫描
例:源码路径fortify-example
sourceanalyzer -b fortify-example make
sourceanalyzer -b fortify-example -scan -f fortify-example.fpr
例2:
源码地址sample/sample.cpp
#cd sample
#sourceanalyzer -b sample-cpp -clean
#
sourceanalyzer -b sample-cpp g++ sample.cpp
-or-
sourceanalyzer -b sample-cpp make
#sourceanalyzer -b sample-cpp -scan -f sample.fpr
在audit workbench打开sample.fpr文件,
切换左上角filter site到Security Audit View这个选项,查看各级别的漏洞信息
三、Troubshooting
1.如果make后无法扫描,将makefile中的g++命令单独拎出来执行sourceanalyzer -b sample-cpp g++ -c sample.cpp
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?