[hyddd安全性测试笔记2]浅淡静态代码分析工具

简介:

本帖hyddd原创,转载请标明,谢谢8>~

这两天看关于静态代码扫描的东东,一开始没什么头绪,搜了一下发现N多东西,整理一下写成文档,由于资料太多,还有很多东西没写上去。

静态代码扫描,借用一段网上的原文解释一下(这里叫静态检查):“静态测试包括代码检查、静态结构分析、代码质量度量等。它可以由人工进行,充分发挥人的逻辑思维优势,也可以借助软件工具自动进行。代码检查代码检查包括代码走查、桌面检查、代码审查等,主要检查代码和设计的一致性,代码对标准的遵循、可读性,代码的逻辑表达的正确性,代码结构的合理性等方面;可以发现违背程序编写标准的问题,程序中不安全、不明确和模糊的部分,找出程序中不可移植部分、违背程序编程风格的问题,包括变量检查、命名和类型审查、程序逻辑审查、程序语法检查和程序结构检查等内容。”。

我看了一系列的静态代码扫描或者叫静态代码分析工具后,总结对工具的看法:静态代码扫描工具,和编译器的某些功能其实是很相似的,他们也需要词法分析,语法分析,语意分析...但和编译器不一样的是他们可以自定义各种各样的复杂的规则去对代码进行分析。

以下将会列出的静态代码扫描工具,会由于实现方法,算法,分析的层次不同,功能上会差异很大。有的可以做SQL注入的检查,有的则不能(当然,由于时间问题还没有对规则进行研究,但要检查复杂的代码安全漏洞,是需要更高深分析算法的,所以有的东西应该不是设置规则库就可以检查到的,但在安全方面的检查,一定程度上也是可以通过设置规则进行检查的)

  以下我在网上搜集到的分析工具,我整理了以下挑了一些出来,这里只是一部分,另外一些可以到参考链接上看一下:

工具名 静态扫描语言 开源/付费 厂商 介绍 主页网址
ounec5.0 VB.Net、C、C++和C#,
还支持Java。
付  费 Ounce Labs \ http://www.ouncelabs.com/
Coverity Prevent C/C++,C#,JAVA 付费 Coverity 还有其他辅助工具:
1.Coverity Thread Analyzer for Java
2.Coverity Software Readiness Manager for Java
3.Coverity Architecture Analyzer
http://www.coverity.com/index.html
@stake SmartRisk™ 
Analyzer
C/C++,Java 付费 Symantec 
Corporation
@stake SmartRisk™ Analyzer harnesses the power of 
static analysis of binary executables (C, C++, and Java) to 
identify, categorize and prioritize security。
注:在Symantec没有搜到此产品?!
http://www.symantec.com/business/index.jsp
Rational Purify  C/C++,Java 付费 IBM Provides memory leak and memory corruption detection for 
Windows,Runtime?!
http://www-01.ibm.com/software/awdtools/purify/
PREfix \ \ microsoft 微软用的静态分析工具,但暂时没有找到下载,
现在好像在考虑发布中!
\
Jtext Java 付费 parasoft 同时还有其他静态分析代码的产品,如:C++Test...
详细请查询官网
http://www.parasoft.com/jsp/cn/support.jsp
flawfinder C/C++ 开源 \ 用Python编写的c、c++程序安全审核工具,
可以检查潜在的安全风险。
http://www.dwheeler.com/flawfinder/
Static Code 
Analyzer
C/C++,C#,JAVA 付费 Fortify \ http://www.fortify.com/
Klocwork Insight C/C++ ,Java  付费 Klocwork \ http://www.klocwork.com/products/insight.asp
PolySpace 
Client/Server
C/C++、Ada语言 付费 MathWorks \ http://www.mathworks.cn/
rats C/C++, Python,
 Perl, 
PHP代码进行安全审核的工具
开源 \ \ http://www.fortify.com/security-resources/rats.jsp
LAPSE Java 开源 \ LAPSE stands for a Lightweight Analysis for Program 
Security in Eclipse. LAPSE is designed to help with 
the task of auditing Java J2EE applications for common 
types of security vulnerabilities found in Web applications.
 LAPSE was developed by Benjamin Livshits as part of the 
Griffin Software Security Project. 
http://www.owasp.org/index.php/Category:OWASP_LAPSE_Project
Fluid java 开源 \ We have explored properties including:

    * race conditions and locking policies,
    * unique references and other programmer-significant
 aliasing properties,
    * effects,
    * appropriate typing,
    * realtime threading policies, and
    * single-threading policies.
http://www.fluid.cs.cmu.edu:8080/Fluid
Splint C 开源 University of 
Virginia,
Department of 
Computer
 Science
静态检测针对C语言的安全工具和漏洞检测。 http://www.splint.org/
cqual C/C++ 开源 马里兰大学 轻量级的静态扫描器,在类Linux系统下运行。 http://www.cs.umd.edu/~jfoster/cqual/
MOPS C 开源 berkeley大学 MOPS is a tool for finding security bugs in C programs 
and for verifying conformance to rules of defensive programming
http://www.cs.berkeley.edu/~daw/mops/
BOON  C 开源 berkeley大学 BOON is a tool for automatically finding buffer overrun 
vulnerabilities in C source code. Buffer overruns are one
 of the most common types of security holes, and we hope 
that BOON will enable software developers and code auditors
 to improve the quality of security-critical programs. 
http://www.cs.berkeley.edu/~daw/boon/
BLAST C 开源 The BLAST 
2.0 Team
BLAST is a software model checker for C programs.  
The goal of BLAST is to be able to check that software
 satisfies behavioral properties of the interfaces it uses.
 BLAST uses counterexample-driven automatic abstraction
 refinement to construct an abstract model which is model
 checked for safety properties. The abstraction is constructed
 on-the-fly, and only to the required precision.
http://mtc.epfl.ch/software-tools/blast/
SpikeWAMP Php 开源 \ for analyzing PHP programs http://developer.spikesource.com/wiki/index.php/SpikeWAMP
Pixy Php 开源 \ Finding XSS and SQLI vulnerabilities http://pixybox.seclab.tuwien.ac.at/pixy/
Mike Java 开源 \ Java source code security scanner built on top of Orizon.
 They are connected to OWASP.
http://milk.sourceforge.net/download.html
Smatch C 开源 \ \ http://smatch.sourceforge.net/
Oink C++ 开源 \ C++ Static Analysis Tools http://www.cubewano.org/oink
Frama-C C 开源 \ static analyzers for the C language. http://frama-c.cea.fr/
RTL-check \ 开源 \ RTL-check is an extensible and powerful abstract interpretation
 framework for static analysis of programs from a safety and
 security perspective
http://rtlcheck.sourceforge.net/
PMD Java 开源 \ PMD scans Java source code and looks for potential problems like:

    * Possible bugs - empty try/catch/finally/
switch statements
    * Dead code - unused local variables, parameters
 and private methods
    * Suboptimal code - wasteful String/StringBuffer usage
    * Overcomplicated expressions - unnecessary if statements,
 for loops that could be while loops
    * Duplicate code - copied/pasted code means copied/pasted bugs
http://pmd.sourceforge.net/
FindBugs Java 开源 马里兰大学 uses static analysis to look for bugs in Java code.
注意:提供Eclipse插件。
http://findbugs.sourceforge.net/
ITS4 C\C++ 开源 \ Cigital developed ITS4 to help automate source code
 review for security.
http://www.cigital.com/its4/
QJ-Pro Java 开源 \ QJ-Pro is a comprehensive software inspection tool targeted 
towards the software developer.

QJ-Pro checks:
    * conformance to coding standards,
    * misuse of the Java language,
    * best practice conformence
    * code structure and
    * potential bugs at the earliest stages of development.
注意:提供各种IDE插件!
http://qjpro.sourceforge.net/
Jint Java 开源 \ Jlint will check your Java code and find bugs, inconsistencies
 and synchronization problems by doing data flow analysis and
 building the lock graph.
http://artho.com/jlint/
Hammurapi Java 开源 \ code review system captures coding best practices and delivers
 them to developers' fingertips. It also generates consolidated
 reports for lead developers, architects, and managers to
 monitor codebase quality and evolution.
http://www.hammurapi.biz/hammurapi-biz/ef/xmenu/hammurapi-group/index.html
DoctorJ Java 开源 \ Among what it detects:

    * misspelled words
    * parameter and exception names:
          o missing
          o misordered
          o misspelled
    * Javadoc tags:
          o invalid
          o misordered
          o missing expected arguments
          o invalid arguments
          o missing descriptions
    * undocumented classes, methods, fields, 
parameters
http://www.incava.org/projects/java/doctorj/index.html
Dependency Finder Java 开源 \ Dependency Finder is a suite of tools for analyzing
compiled Java code. At the core is a powerful dependency
analysis application that extracts dependency graphs and
mines them for useful information. This application comes
in many forms for your ease of use, including command-line 
tools, a Swing-based application, a web application ready
to be deployed in an application server, and a set of Ant
tasks.
http://depfind.sourceforge.net/
Checkstyle Java 开源 \ Checkstyle is a development tool to help programmers
 write Java code that adheres to a coding standard.
 It automates the process of checking Java code to spare
 humans of this boring (but important) task. This makes
 it ideal for projects that want to enforce a coding standard. 
注意:提供多种IDE的插件。
http://checkstyle.sourceforge.net/
Classycle Java 开源 \ Classycle's Analyser analyses the static class and package
 dependencies in Java applications or libraries.
http://classycle.sourceforge.net/
JDepend  Java 开源 \ JDepend traverses Java class file directories and generates
 design quality metrics for each Java package. 
JDepend allows you to automatically measure the quality
 of a design in terms of its extensibility, reusability,
and maintainability to manage package dependencies effectively. 
http://www.clarkware.com/software/JDepend.html
JCSC Java 开源 \ JCSC is a powerful tool to check source code against a highly
 definable coding standard and potential bad code.
http://jcsc.sourceforge.net/

......

以下是直接提供代码检查/相关帮助的厂商:

Fortify:  http://www.fortify.com/

ASPECT:  http://www.aspectsecurity.com/

OWASP:    http://www.owasp.org/index.php/Main_Page

securitycompass: http://www.securitycompass.com/resources.shtml


参考资料:

1. http://www.dwheeler.com/flawfinder/

2. http://www.java2s.com/Product/Java/Byte-Source-Code/Source-Analysis-Diagram.htm 

3. http://www.softwarelist.cn/?fsid=53&cid=530&cpath=ABAN 

4. http://www.hacker.com.cn/article/view_14804.html

5. http://www.cs.cmu.edu/~aldrich/courses/654/tools/

注:以上链接列举了大量相关工具


 


本文转自hyddd博客园博客,原文链接:http://www.cnblogs.com/hyddd/archive/2008/12/16/1356310.html,如需转载请自行联系原作者。

目录
相关文章
|
2月前
|
Java 测试技术 数据安全/隐私保护
软件测试中的自动化策略与工具应用
在软件开发的快速迭代中,自动化测试以其高效、稳定的特点成为了质量保证的重要手段。本文将深入探讨自动化测试的核心概念、常见工具的应用,以及如何设计有效的自动化测试策略,旨在为读者提供一套完整的自动化测试解决方案,帮助团队提升测试效率和软件质量。
|
2月前
|
Web App开发 IDE 测试技术
Selenium:强大的 Web 自动化测试工具
Selenium 是一款强大的 Web 自动化测试工具,包括 Selenium IDE、WebDriver 和 Grid 三大组件,支持多种编程语言和跨平台操作。它能有效提高测试效率,解决跨浏览器兼容性问题,进行性能测试和数据驱动测试,尽管存在学习曲线较陡、不稳定等缺点,但其优势明显,是自动化测试领域的首选工具。
277 17
Selenium:强大的 Web 自动化测试工具
|
3月前
|
监控 网络协议 Java
一些适合性能测试脚本编写和维护的工具
一些适合性能测试脚本编写和维护的工具
146 59
|
3月前
|
机器学习/深度学习 人工智能 算法
BALROG:基准测试工具,用于评估 LLMs 和 VLMs 在复杂动态环境中的推理能力
BALROG 是一款用于评估大型语言模型(LLMs)和视觉语言模型(VLMs)在复杂动态环境中推理能力的基准测试工具。它通过一系列挑战性的游戏环境,如 NetHack,测试模型的规划、空间推理和探索能力。BALROG 提供了一个开放且细粒度的评估框架,推动了自主代理研究的进展。
85 3
BALROG:基准测试工具,用于评估 LLMs 和 VLMs 在复杂动态环境中的推理能力
|
3月前
|
监控 测试技术 开发工具
移动端性能测试工具
移动端性能测试工具
151 2
|
3月前
|
安全 前端开发 测试技术
如何选择合适的自动化安全测试工具
选择合适的自动化安全测试工具需考虑多个因素,包括项目需求、测试目标、系统类型和技术栈,工具的功能特性、市场评价、成本和许可,以及集成性、误报率、社区支持、易用性和安全性。综合评估这些因素,可确保所选工具满足项目需求和团队能力。
|
3月前
|
安全 网络协议 关系型数据库
最好用的17个渗透测试工具
渗透测试是安全人员为防止恶意黑客利用系统漏洞而进行的操作。本文介绍了17款业内常用的渗透测试工具,涵盖网络发现、无线评估、Web应用测试、SQL注入等多个领域,包括Nmap、Aircrack-ng、Burp Suite、OWASP ZAP等,既有免费开源工具,也有付费专业软件,适用于不同需求的安全专家。
526 2
|
4月前
|
机器学习/深度学习 JSON 算法
实例分割笔记(一): 使用YOLOv5-Seg对图像进行分割检测完整版(从自定义数据集到测试验证的完整流程)
本文详细介绍了使用YOLOv5-Seg模型进行图像分割的完整流程,包括图像分割的基础知识、YOLOv5-Seg模型的特点、环境搭建、数据集准备、模型训练、验证、测试以及评价指标。通过实例代码,指导读者从自定义数据集开始,直至模型的测试验证,适合深度学习领域的研究者和开发者参考。
1586 3
实例分割笔记(一): 使用YOLOv5-Seg对图像进行分割检测完整版(从自定义数据集到测试验证的完整流程)
|
4月前
|
测试技术
自动化测试项目实战笔记(三):测试用户注册(验证码错误,成功,出现弹框时处理)
本文是关于自动化测试项目实战笔记,主要介绍了如何测试用户注册功能,包括验证码错误、注册成功以及弹框处理的测试步骤和代码实现。
197 2
自动化测试项目实战笔记(三):测试用户注册(验证码错误,成功,出现弹框时处理)
|
4月前
|
Java 关系型数据库 MySQL
自动化测试项目实战笔记(一):JDK、Tomcat、MySQL、Jpress环境安装和搭建
这篇文章是关于自动化测试项目实战笔记,涵盖了JDK、Tomcat、MySQL、Jpress环境的安装和搭建过程,以及测试用例和常见问题总结。
106 1
自动化测试项目实战笔记(一):JDK、Tomcat、MySQL、Jpress环境安装和搭建

热门文章

最新文章

  • 1
    小鱼深度评测 | 通义灵码2.0,不仅可跨语言编码,自动生成单元测试,更炸裂的是集成DeepSeek模型且免费使用,太炸裂了。
  • 2
    3天功能开发→3小时:通义灵码2.0+DEEPSEEK实测报告,单元测试生成准确率92%的秘密
  • 3
    Potpie.ai:比Copilot更狠!这个AI直接接管项目代码,自动Debug+测试+开发全搞定
  • 4
    基于FPGA的图像双线性插值算法verilog实现,包括tb测试文件和MATLAB辅助验证
  • 5
    【01】噩梦终结flutter配安卓android鸿蒙harmonyOS 以及next调试环境配鸿蒙和ios真机调试环境-flutter项目安卓环境配置-gradle-agp-ndkVersion模拟器运行真机测试环境-本地环境搭建-如何快速搭建android本地运行环境-优雅草卓伊凡-很多人在这步就被难倒了
  • 6
    大前端之前端开发接口测试工具postman的使用方法-简单get接口请求测试的使用方法-简单教学一看就会-以实际例子来说明-优雅草卓伊凡
  • 7
    「ximagine」业余爱好者的非专业显示器测试流程规范,同时也是本账号输出内容的数据来源!如何测试显示器?荒岛整理总结出多种测试方法和注意事项,以及粗浅的原理解析!
  • 8
    以项目登录接口为例-大前端之开发postman请求接口带token的请求测试-前端开发必学之一-如果要学会联调接口而不是纯写静态前端页面-这个是必学-本文以优雅草蜻蜓Q系统API为实践来演示我们如何带token请求接口-优雅草卓伊凡
  • 9
    AxBench:斯坦福大学推出评估语言模型控制方法的基准测试框架
  • 10
    Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描