Graudit 使用教程
grauditgrep rough audit - source code auditing tool项目地址:https://gitcode.com/gh_mirrors/gr/graudit
1. 项目的目录结构及介绍
Graudit 是一个用于源代码审计的工具,它使用 GNU 工具 grep 来查找潜在的安全漏洞。以下是 Graudit 项目的目录结构及其介绍:
graudit/
├── README.md
├── graudit
├── signatures/
│ ├── asp.db
│ ├── c.db
│ ├── default.db
│ ├── exec.db
│ ├── php.db
│ ├── pl.db
│ ├── py.db
│ ├── ror.db
│ ├── sh.db
│ ├── sql.db
│ └── xss.db
└── tests/
├── test.c
├── test.php
└── test.sh
README.md
: 项目说明文件,包含项目的基本信息和使用方法。graudit
: 项目的启动脚本,用于执行代码审计。signatures/
: 包含各种编程语言的签名文件,用于匹配潜在的安全漏洞。tests/
: 包含一些测试文件,用于验证工具的正确性。
2. 项目的启动文件介绍
Graudit 的启动文件是 graudit
,它是一个 Bash 脚本。以下是启动文件的主要内容和功能介绍:
#!/bin/bash
# graudit - Rough code review tool using grep
# Written by Wireghoul - http://www.justanotherhacker.com
# Released under the GPL licence
# 设置基本变量
SIGNATURES="signatures"
启动文件主要包含以下部分:
- 头部注释:包含项目的名称、作者和许可证信息。
- 变量设置:定义了签名文件的目录路径。
- 主要功能:使用 grep 工具根据签名文件查找潜在的安全漏洞。
3. 项目的配置文件介绍
Graudit 的配置主要通过命令行参数和签名文件来完成。签名文件位于 signatures/
目录下,每个文件对应一种编程语言的潜在安全漏洞模式。
例如,php.db
文件包含用于查找 PHP 代码中潜在安全漏洞的模式:
# PHP signatures
# SQL Injection
-B "sql" ".*\\$.*\\(.*\\$.*\\).*"
# XSS
-B "xss" ".*echo.*\\$.*\\..*"
每个签名文件包含一系列的模式,用于匹配源代码中的潜在安全漏洞。用户可以根据需要自定义签名文件,以适应不同的审计需求。
通过以上介绍,您可以更好地理解和使用 Graudit 进行源代码审计。
grauditgrep rough audit - source code auditing tool项目地址:https://gitcode.com/gh_mirrors/gr/graudit