Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
414f114b
Commit
414f114b
authored
8 years ago
by
Andy Green
Browse files
Options
Downloads
Patches
Plain Diff
attack.sh: adapt to changes
parent
855f7e87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test-server/attack.sh
+6
-4
6 additions, 4 deletions
test-server/attack.sh
with
6 additions
and
4 deletions
test-server/attack.sh
+
6
−
4
View file @
414f114b
...
@@ -29,10 +29,10 @@ function check {
...
@@ -29,10 +29,10 @@ function check {
fi
fi
if
[
"
$1
"
=
"defaultplusforbidden"
]
;
then
if
[
"
$1
"
=
"defaultplusforbidden"
]
;
then
cat
$INSTALLED
/../share/libwebsockets-test-server/test.html
>
/tmp/plusforb
cat
$INSTALLED
/../share/libwebsockets-test-server/test.html
>
/tmp/plusforb
echo
-e
-n
"HTTP/1.1 403 Forbidden
\x
0d
\
x
0aserver: libwebsockets
\x
0d
\
x
0acontent-type: text/html
\x
0d
\x
0acontent-length: 38
\x
0d
\x
0a
\x
0d
\x
0a<html><body><h1>403</h1></body></html>"
>>
/tmp/plusforb
echo
-e
-n
"HTTP/1.1 403 Forbidden
\x
0d
\x
0acontent-type: text/html
\x
0d
\x
0acontent-length: 38
\x
0d
\x
0a
\x
0d
\x
0a<html><body><h1>403</h1></body></html>"
>>
/tmp/plusforb
diff /tmp/lwscap /tmp/plusforb
>
/dev/null
diff /tmp/lwscap /tmp/plusforb
>
/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"FAIL: got something other than test.html back"
echo
"FAIL: got something other than test.html
+ forbidden
back"
exit
1
exit
1
fi
fi
fi
fi
...
@@ -101,7 +101,9 @@ killall libwebsockets-test-server 2>/dev/null
...
@@ -101,7 +101,9 @@ killall libwebsockets-test-server 2>/dev/null
libwebsockets-test-server
-d15
2>>
$LOG
&
libwebsockets-test-server
-d15
2>>
$LOG
&
CPID
=
$!
CPID
=
$!
while
[
-z
"
`
grep
Listening
$LOG
`
"
]
;
do
echo
"Started server on PID
$CPID
"
while
[
-z
"
`
grep
ort
\
7681
$LOG
`
"
]
;
do
sleep
0.5s
sleep
0.5s
done
done
check
check
...
@@ -220,7 +222,7 @@ echo -e "GET ...................................................................
...
@@ -220,7 +222,7 @@ echo -e "GET ...................................................................
check
check
echo
echo
echo
"---- good request but http payload coming too (
should be ignored and
test.html served)"
echo
"---- good request but http payload coming too (test.html served
then forbidden
)"
echo
-e
"GET /test.html HTTP/1.1
\x
0d
\x
0a
\x
0d
\x
0aILLEGAL-PAYLOAD........................................"
\
echo
-e
"GET /test.html HTTP/1.1
\x
0d
\x
0a
\x
0d
\x
0aILLEGAL-PAYLOAD........................................"
\
"......................................................................................................................."
\
"......................................................................................................................."
\
"......................................................................................................................."
\
"......................................................................................................................."
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment