diff options
| -rwxr-xr-x | run_tests.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..3ad2ea1 --- /dev/null +++ b/run_tests.sh | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # <? system($_GET['p']); | ||
| 4 | # $___ $___ $_____ $_____ $____ $___ | ||
| 5 | # ZXhlYyg | ||
| 6 | # system php_uname posix_setuid phpinfo exec eval | ||
| 7 | # /etc/passwd WinExec uname -a nc -l | ||
| 8 | # 1337day.com | ||
| 9 | |||
| 10 | echo '[+] Testing scanning engine' | ||
| 11 | EXPECTED='ObfuscatedPhp run_tests.sh | ||
| 12 | SuspiciousEncoding run_tests.sh | ||
| 13 | DodgyPhp run_tests.sh | ||
| 14 | DangerousPhp run_tests.sh | ||
| 15 | DodgyStrings run_tests.sh | ||
| 16 | Websites run_tests.sh' | ||
| 17 | RESULT="$(./phpmalwarefinder -c ./malwares.yara run_tests.sh)" | ||
| 18 | if [ "$RESULT" != "$EXPECTED" ] ; then | ||
| 19 | diff <(echo "$RESULT") <(echo "$EXPECTED") | ||
| 20 | exit 1 | ||
| 21 | fi | ||
| 22 | |||
| 23 | echo '[+] Testing on non-existing rules' | ||
| 24 | EXPECTED="./nonexistentfile doesn't exist. Please give me a valid file." | ||
| 25 | RESULT="$(./phpmalwarefinder -c ./nonexistentfile run_tests.sh)" | ||
| 26 | if [ "$RESULT" != "$EXPECTED" ] ; then | ||
| 27 | diff <(echo "$RESULT") <(echo "$EXPECTED") | ||
| 28 | exit 1 | ||
| 29 | fi | ||
| 30 | |||
