-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathbenchmark-h1-race.py
More file actions
61 lines (47 loc) · 1.68 KB
/
Copy pathbenchmark-h1-race.py
File metadata and controls
61 lines (47 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
def queueRequests(target, wordlists):
global BATCH_SIZE
BATCH_SIZE = 20
engine = RequestEngine(endpoint='https://x.psres.net:443/',
concurrentConnections=BATCH_SIZE,
requestsPerConnection=100,
engine=Engine.THREADED,
pipeline=False,
maxQueueSize=BATCH_SIZE
)
req = '''GET /wtf/?nottime=%s HTTP/1.1
Host: x.psres.net
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en-US;q=0.9,en;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5481.78 Safari/537.36
Cache-Control: max-age=0
'''
for i in xrange(10):
gate_id = str(i)
for x in xrange(BATCH_SIZE):
engine.queue(req, '0.000', gate=gate_id)
engine.openGate(gate_id)
time.sleep(0.5)
def handleResponse(req, interesting):
xtime= req.response.split('\r\n\r\n')[1]
req.label = xtime
table.add(req)
def completed(reqsFromTable):
diffs = []
time.sleep(1)
print len(reqsFromTable)
for i in xrange(len(reqsFromTable)):
if i % BATCH_SIZE != 0:
continue
entries = []
for x in xrange(BATCH_SIZE):
entries.append(float(reqsFromTable[i+x].label))
entries.sort()
diffs.append(entries[-1] - entries[0])
diffs.sort()
print('Best: '+str(min(diffs)))
print('Mean: '+str(mean(diffs)))
print('Stddev: '+str(stddev(diffs)))
print('Median: '+str(diffs[len(diffs)/2]))
print('Range: '+str(max(diffs)-min(diffs)))
handler.setMessage(str(sum(diffs)/len(diffs)))