Vulny Code Static Analysis
1.0.0
semgrep --config=./semgrep/ vulns/*.phpこのリポジトリで提供されるsemgrepルールのほとんどはhttps://github.com/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」を使用します
ライセンスを読むことを忘れないでください;)