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"를 사용하십시오.
라이센스를 읽는 것을 잊지 마십시오;)