Skip to content

Commit 914969b

Browse files
committed
remove open calls.
1 parent ddda292 commit 914969b

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

docs/TODO

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
files ) and brute it
1515

1616

17+
===> 1.3.4
18+
19+
[x] remove open() calls
20+
21+
1722
===> 1.3.3
1823

1924
[x] use mmap to read wordlist files

sshprank.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
__author__ = 'noptrix'
41-
__version__ = '1.3.3'
41+
__version__ = '1.3.4'
4242
__copyright = 'santa clause'
4343
__license__ = 'MIT'
4444

@@ -483,30 +483,22 @@ def run_threads(host, ports, val='single'):
483483
e.submit(crack_login, host, port, opts['user'], opts['pass'])
484484

485485
with ThreadPoolExecutor(opts['lthreads']) as exe:
486-
if 'userlist' in opts:
487-
uf = open(opts['userlist'], 'r', encoding='latin-1')
488-
if 'passlist' in opts:
489-
pf = open(opts['passlist'], 'r', encoding='latin-1')
490-
if 'combolist' in opts:
491-
cf = open(opts['combolist'], 'r', encoding='latin-1')
492-
493486
if 'userlist' in opts and 'passlist' in opts:
494-
for u in uf:
495-
pf = open(opts['passlist'], 'r', encoding='latin-1')
496-
for p in pf:
487+
for u in opts['userlist']:
488+
for p in opts['passlist']:
497489
exe.submit(crack_login, host, port, u.rstrip(), p.rstrip())
498490
pf.close()
499491

500492
if 'userlist' in opts and 'passlist' not in opts:
501-
for u in uf:
493+
for u in opts['userlist']:
502494
exe.submit(crack_login, host, port, u.rstrip(), opts['pass'])
503495

504496
if 'passlist' in opts and 'userlist' not in opts:
505-
for p in pf:
497+
for p in opts['passlist']:
506498
exe.submit(crack_login, host, port, opts['user'], p.rstrip())
507499

508500
if 'combolist' in opts:
509-
for line in cf:
501+
for line in opts['combolist']:
510502
try:
511503
l = line.split(':')
512504
exe.submit(crack_login, host, port, l[0].rstrip(), l[1].rstrip())

0 commit comments

Comments
 (0)