aboutsummaryrefslogtreecommitdiffstats
path: root/service/src/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'service/src/test.sh')
-rw-r--r--service/src/test.sh72
1 files changed, 50 insertions, 22 deletions
diff --git a/service/src/test.sh b/service/src/test.sh
index 9a905b7..57c7ca7 100644
--- a/service/src/test.sh
+++ b/service/src/test.sh
@@ -26,26 +26,54 @@ checkleaks() {
export RESULTDIR="scans"
-announce "Trying ASCII STL"
-(
- echo "submit"
- cat tests/sample-ascii.stl | wc -c
- cat tests/sample-ascii.stl
-) | checkleaks
-
-announce "Trying BIN STL"
-(
- echo "submit"
- cat tests/sample-binary.stl | wc -c
- cat tests/sample-binary.stl
- echo "testname"
-) | checkleaks
-
-
-announce "Testing Proof-Of-Concept"
-(
- echo "submit"
- cat tests/evil1.stl | wc -c
- cat tests/evil1.stl
-) | checkleaks
+if [ "$1" == "stl" ]; then
+ announce "Testing ASCII STL Parsing"
+ (
+ echo "submit"
+ cat tests/sample-ascii.stl | wc -c
+ cat tests/sample-ascii.stl
+ ) | checkleaks
+
+ announce "Testing BIN STL Parsing"
+ (
+ echo "submit"
+ cat tests/sample-binary.stl | wc -c
+ cat tests/sample-binary.stl
+ echo "testname"
+ ) | checkleaks
+
+elif [ "$1" == "poc" ]; then
+
+ announce "Testing Proof-Of-Concept"
+
+ rm -rf scans/*
+
+ echo -e "\n--- Uploading evil STL ---\n" 1>&2
+ (
+ echo "submit"
+ cat tests/evil1.stl | wc -c
+ cat tests/evil1.stl
+ echo "AAAA"
+ ) | ./printdoc
+
+ echo -e "\n--- Testing Exploit ---\n" 1>&2
+
+ (
+ echo "query"
+ echo "AAAA"
+ echo "0"
+ echo "n"
+
+ echo "query"
+ ) | ./printdoc
+
+else
+ (
+ echo "submit"
+ echo "2"
+ echo "AA"
+ echo "AAAA"
+ ) | ./printdoc
+
+fi