summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Voisin2015-04-21 10:11:01 +0200
committerJulien Voisin2015-04-21 10:11:01 +0200
commit861fde7d04e6b95ba66f8c06f351198fac06d7c7 (patch)
tree1c4e08daee35a67646199b0d4d61b3d1ea988069
parent81a3df2a2a7d8c264bab39a02563ddea60e342db (diff)
Add some tests :)
-rwxr-xr-xrun_tests.sh30
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
10echo '[+] Testing scanning engine'
11EXPECTED='ObfuscatedPhp run_tests.sh
12SuspiciousEncoding run_tests.sh
13DodgyPhp run_tests.sh
14DangerousPhp run_tests.sh
15DodgyStrings run_tests.sh
16Websites run_tests.sh'
17RESULT="$(./phpmalwarefinder -c ./malwares.yara run_tests.sh)"
18if [ "$RESULT" != "$EXPECTED" ] ; then
19 diff <(echo "$RESULT") <(echo "$EXPECTED")
20 exit 1
21fi
22
23echo '[+] Testing on non-existing rules'
24EXPECTED="./nonexistentfile doesn't exist. Please give me a valid file."
25RESULT="$(./phpmalwarefinder -c ./nonexistentfile run_tests.sh)"
26if [ "$RESULT" != "$EXPECTED" ] ; then
27 diff <(echo "$RESULT") <(echo "$EXPECTED")
28 exit 1
29fi
30