Skip to content

Commit

Permalink
use mmap to read wordlist files. update lists/*
Browse files Browse the repository at this point in the history
  • Loading branch information
noptrix committed Jan 19, 2021
1 parent a6ad40f commit ddda292
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 13 deletions.
5 changes: 5 additions & 0 deletions docs/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
files ) and brute it


===> 1.3.3

[x] use mmap to read wordlist files


===> 1.3.2

[x] decrease default hosts threads num
Expand Down
2 changes: 0 additions & 2 deletions lists/combo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
admin:admin
root:r00t
root:root
test:test
toor:t00r
toor:toor
39 changes: 39 additions & 0 deletions lists/pws.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,50 @@
!!!!
....
0000
00000000
1111
1234
12345
123456
1234567
12345678
123456789
1234567890
1234root
123admin
123login
123root
2222
3333
4444
5555
6666
7777
8888
9999
admin
admin123
letmein
login
login!
login123
login1234
pass!
pass123
pass1234
password
password1
password1!
Password1
Password1!
p@ssw0rd
P@ssw0rd
p@ssword
qwerty
qwertz
root
root123
root1234
test
test123
toor
1 change: 0 additions & 1 deletion lists/user.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
admin
root
test
toor
30 changes: 20 additions & 10 deletions sshprank.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
import masscan
import paramiko
import shodan
import mmap
from collections import deque


__author__ = 'noptrix'
__version__ = '1.3.2'
__version__ = '1.3.3'
__copyright = 'santa clause'
__license__ = 'MIT'

Expand Down Expand Up @@ -106,9 +107,9 @@
-p - single password (default: root)
-P <file> - list of passwords
-C <file> - list of user:pass combination
-x <num> - num threads for parallel host crack (default: 10)
-S <num> - num threads for parallel service crack (default: 1)
-X <num> - num threads for parallel login crack (default: 5)
-x <num> - num threads for parallel host crack (default: 30)
-S <num> - num threads for parallel service crack (default: 10)
-X <num> - num threads for parallel login crack (default: 20)
-B <num> - num threads for parallel banner grabbing (default: 70)
-T <sec> - num sec for auth and connect timeout (default: 5s)
-R <sec> - num sec for (banner) read timeout (default: 3s)
Expand Down Expand Up @@ -159,9 +160,9 @@
'cmd_no_out': False,
'user': 'root',
'pass': 'root',
'hthreads': 10,
'sthreads': 1,
'lthreads': 5,
'hthreads': 30,
'sthreads': 10,
'lthreads': 20,
'bthreads': 70,
'ctimeout': 5,
'rtimeout': 3,
Expand Down Expand Up @@ -221,6 +222,15 @@ def parse_target(target):
return dtarget


def read_list(_file):
try:
with open(_file, 'r', encoding='latin-1') as f:
with mmap.mmap(f.fileno(), length=0, access=mmap.ACCESS_READ) as m:
return m.read().decode('latin-1').split()
except:
log(f'could not read wordlist {_file}', 'error')


def parse_cmdline(cmdline):
global opts

Expand All @@ -247,13 +257,13 @@ def parse_cmdline(cmdline):
if o == '-u':
opts['user'] = a
if o == '-U':
opts['userlist'] = a
opts['userlist'] = read_list(a)
if o == '-p':
opts['pass'] = a
if o == '-P':
opts['passlist'] = a
opts['passlist'] = read_list(a)
if o == '-C':
opts['combolist'] = a
opts['combolist'] = read_list(a)
if o == '-x':
opts['hthreads'] = int(a)
if o == '-S':
Expand Down

0 comments on commit ddda292

Please sign in to comment.