Klaus Demo bjoern / 3e07919
Tests for previous commit Jonas Haag 5 years ago
1 changed file(s) with 16 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
22
33 conn = socket.create_connection(('0.0.0.0', 8080))
44 msgs = [
5 # Keep-Alive, Transfer-Encoding chunked
5 # 0 Keep-Alive, Transfer-Encoding chunked
66 'GET / HTTP/1.1\r\nConnection: Keep-Alive\r\n\r\n',
7 # Close, EOF "encoding"
7
8 # 1,2,3 Close, EOF "encoding"
89 'GET / HTTP/1.1\r\n\r\n',
910 'GET / HTTP/1.1\r\nConnection: close\r\n\r\n',
1011 'GET / HTTP/1.0\r\nConnection: Keep-Alive\r\n\r\n',
11 # Bad Request
12
13 # 4 Bad Request
1214 'GET /%20%20% HTTP/1.1\r\n\r\n',
13 # Bug #14
15
16 # 5 Bug #14
1417 'GET /%20abc HTTP/1.0\r\n\r\n',
15 # Content-{Length, Type}
18
19 # 6 Content-{Length, Type}
1620 'GET / HTTP/1.0\r\nContent-Length: 11\r\n'
1721 'Content-Type: text/blah\r\nContent-Fype: bla\r\n'
1822 'Content-Tength: bla\r\n\r\nhello world',
19 # POST memory leak
20 'POST / HTTP/1.0\r\nContent-Length: 1000\r\n\r\n%s' % ('a'*1000)
23
24 # 7 POST memory leak
25 'POST / HTTP/1.0\r\nContent-Length: 1000\r\n\r\n%s' % ('a'*1000),
26
27 # 8,9 CVE-2015-0219
28 'GET / HTTP/1.1\r\nFoo_Bar: bad\r\n\r\n',
29 'GET / HTTP/1.1\r\nFoo-Bar: good\r\nFoo_Bar: bad\r\n\r\n'
2130 ]
2231 conn.send(msgs[int(sys.argv[1])])
2332 while 1: