From 42f93ffbfaeb310be824939a308cfb98384f570d Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 15 Feb 2016 14:01:06 +0800 Subject: [PATCH] attack.sh add http1.1 pipelining check Signed-off-by: Andy Green --- test-server/attack.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test-server/attack.sh b/test-server/attack.sh index 65fb4b0..ba5b0b3 100755 --- a/test-server/attack.sh +++ b/test-server/attack.sh @@ -258,13 +258,23 @@ check forbidden check echo -echo "---- directory attack 7 (%2f%2e%2e%2f%2e./.%2e/.%2e%2fetc/passwd should be /etc/passswd)" +echo "---- directory attack 8 (%2f%2e%2e%2f%2e./.%2e/.%2e%2fetc/passwd should be /etc/passswd)" rm -f /tmp/lwscap echo -e "GET %2f%2e%2e%2f%2e./.%2e/.%2e%2fetc/passwd HTTP/1.1\x0d\x0a\x0d\x0a" | nc $SERVER $PORT | sed '1,/^\r$/d'> /tmp/lwscap check forbidden check echo +echo "---- http/1.1 pipelining" +rm -f /tmp/lwscap +wget -O/tmp/lwsdump http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html http://localhost:7681/test.html 2>&1 | grep "Downloaded: 8 files" > /tmp/lwscap +good=`cat $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html $INSTALLED/../share/libwebsockets-test-server/test.html | md5sum | cut -d' ' -f1` +if [ "$good" != "`md5sum /tmp/lwsdump | cut -d' ' -f 1`" ] ; then + echo "FAIL: mismatched content good=$good received=`md5sum /tmp/lwsdump`" + exit 1 +fi + +echo echo "--- survived OK ---" kill -2 $CPID -- 2.7.4