mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
attack.sh add check for nonexistant file processing
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
c6b0b607d4
commit
d0249a82ec
1 changed files with 14 additions and 0 deletions
|
@ -35,6 +35,13 @@ function check {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "media" ] ; then
|
||||||
|
if [ -z "`grep '<h1>415</h1>' /tmp/lwscap`" ] ; then
|
||||||
|
echo "FAIL: should have told unknown media type"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$1" == "1" ] ; then
|
if [ "$1" == "1" ] ; then
|
||||||
a="`dd if=$LOG bs=1 skip=$LEN 2>/dev/null |grep URI\ Arg\ 1\: | tr -s ' ' | cut -d' ' -f5-`"
|
a="`dd if=$LOG bs=1 skip=$LEN 2>/dev/null |grep URI\ Arg\ 1\: | tr -s ' ' | cut -d' ' -f5-`"
|
||||||
if [ "$a" != "$2" ] ; then
|
if [ "$a" != "$2" ] ; then
|
||||||
|
@ -208,6 +215,13 @@ echo -e "GET /test.html HTTP/1.1\x0d\x0a\x0d\x0aILLEGAL-PAYLOAD.................
|
||||||
check default
|
check default
|
||||||
check
|
check
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "---- nonexistant file"
|
||||||
|
rm -f /tmp/lwscap
|
||||||
|
echo -e "GET nope HTTP/1.1\x0d\x0a\x0d\x0a" | nc $SERVER $PORT | sed '1,/^\r$/d'> /tmp/lwscap
|
||||||
|
check media
|
||||||
|
check
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "---- directory attack 1 (/../../../../etc/passwd should be /etc/passswd)"
|
echo "---- directory attack 1 (/../../../../etc/passwd should be /etc/passswd)"
|
||||||
rm -f /tmp/lwscap
|
rm -f /tmp/lwscap
|
||||||
|
|
Loading…
Add table
Reference in a new issue