Vulny Code Static Analysis
1.0.0
semgrep --config=./semgrep/ vulns/*.php本存儲庫中提供的大多數SEMGREP規則來自https://github.com/github.com/returntocorp/returntocorp/semgrep-rules
基本腳本將漏洞檢測到PHP源代碼中,它使用正則表達式來查找凹坑。
# HELP
╭─ ? swissky@crashlab: ~ /Github/PHP_Code_Static_Analysis ‹master * ›
╰─$ python3 index.py
usage: index.py [-h] [--dir DIR] [--plain]
optional arguments:
-h, --help show this help message and exit
--dir DIR Directory to analyse
--plain No color in output
# Example
╭─ ? swissky@crashlab: ~ /Github/PHP_Code_Static_Analysis ‹master * ›
╰─$ python3 index.py --dir vulns
------------------------------------------------------------
Analyzing ' vulns ' source code
------------------------------------------------------------
Potential vulnerability found : File Inclusion
Line 19 in vulns/include.php
Code : include( $_GET [ ' patisserie ' ])
------------------------------------------------------------
Potential vulnerability found : Insecure E-mail
Line 2 in vulns/mail.php
Code : mail( $dest , " subject " , " message " , " " , " -f " . $_GET [ ' from ' ])
Declared at line 1 : $dest = $_GET [ ' who ' ] ;目前檢測到:
如果要將每個漏洞類型導出到文件夾中,請使用“ export.sh”
不要忘記閱讀許可證;)