Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
routersploit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
czos-dpend
routersploit
Commits
095f2a10
Commit
095f2a10
authored
Apr 18, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSH verbosity option
parent
13fafdab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
ssh_bruteforce.py
routersploit/modules/creds/ssh_bruteforce.py
+14
-4
ssh_default.py
routersploit/modules/creds/ssh_default.py
+14
-4
No files found.
routersploit/modules/creds/ssh_bruteforce.py
View file @
095f2a10
...
...
@@ -30,8 +30,10 @@ class Exploit(exploits.Exploit):
threads
=
exploits
.
Option
(
8
,
'Number of threads'
)
usernames
=
exploits
.
Option
(
'admin'
,
'Username or file with usernames (file://)'
)
passwords
=
exploits
.
Option
(
wordlists
.
passwords
,
'Password or file with passwords (file://)'
)
verbosity
=
exploits
.
Option
(
'yes'
,
'Display authentication attempts'
)
credentials
=
[]
verb
=
None
def
run
(
self
):
self
.
credentials
=
[]
...
...
@@ -58,6 +60,7 @@ class Exploit(exploits.Exploit):
else
:
passwords
=
[
self
.
passwords
]
self
.
verb
=
self
.
verbosity
.
lower
()
collection
=
LockedIterator
(
itertools
.
product
(
usernames
,
passwords
))
self
.
run_threads
(
self
.
threads
,
self
.
target_function
,
collection
)
...
...
@@ -73,7 +76,8 @@ class Exploit(exploits.Exploit):
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
print_status
(
name
,
'thread is starting...'
)
if
self
.
verb
==
'yes'
:
print_status
(
name
,
'thread is starting...'
)
while
running
.
is_set
():
try
:
...
...
@@ -85,10 +89,16 @@ class Exploit(exploits.Exploit):
break
except
paramiko
.
ssh_exception
.
SSHException
as
err
:
ssh
.
close
()
print_error
(
name
,
err
,
user
,
password
)
if
self
.
verb
==
'yes'
:
print_error
(
name
,
err
,
user
,
password
)
else
:
running
.
clear
()
print_success
(
"{}: Authentication succeed!"
.
format
(
name
),
user
,
password
)
if
self
.
verb
==
'yes'
:
print_success
(
"{}: Authentication succeed!"
.
format
(
name
),
user
,
password
)
self
.
credentials
.
append
((
user
,
password
))
print_status
(
name
,
'thread is terminated.'
)
if
self
.
verb
==
'yes'
:
print_status
(
name
,
'thread is terminated.'
)
routersploit/modules/creds/ssh_default.py
View file @
095f2a10
...
...
@@ -29,8 +29,10 @@ class Exploit(exploits.Exploit):
port
=
exploits
.
Option
(
22
,
'Target port'
)
threads
=
exploits
.
Option
(
8
,
'Numbers of threads'
)
defaults
=
exploits
.
Option
(
wordlists
.
defaults
,
'User:Pass or file with default credentials (file://)'
)
verbosity
=
exploits
.
Option
(
'yes'
,
'Display authentication attempts'
)
credentials
=
[]
verb
=
None
def
run
(
self
):
self
.
credentials
=
[]
...
...
@@ -52,6 +54,7 @@ class Exploit(exploits.Exploit):
else
:
defaults
=
[
self
.
defaults
]
self
.
verb
=
self
.
verbosity
.
lower
()
collection
=
LockedIterator
(
defaults
)
self
.
run_threads
(
self
.
threads
,
self
.
target_function
,
collection
)
...
...
@@ -67,7 +70,8 @@ class Exploit(exploits.Exploit):
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
print_status
(
name
,
'process is starting...'
)
if
self
.
verb
==
'yes'
:
print_status
(
name
,
'process is starting...'
)
while
running
.
is_set
():
try
:
...
...
@@ -79,10 +83,16 @@ class Exploit(exploits.Exploit):
break
except
paramiko
.
ssh_exception
.
SSHException
as
err
:
ssh
.
close
()
print_error
(
name
,
err
,
"Username: '{}' Password: '{}'"
.
format
(
user
,
password
))
if
self
.
verb
==
'yes'
:
print_error
(
name
,
err
,
"Username: '{}' Password: '{}'"
.
format
(
user
,
password
))
else
:
running
.
clear
()
print_success
(
"{}: Authentication succeed!"
.
format
(
name
),
user
,
password
)
if
self
.
verb
==
'yes'
:
print_success
(
"{}: Authentication succeed!"
.
format
(
name
),
user
,
password
)
self
.
credentials
.
append
((
user
,
password
))
print_status
(
name
,
'process is terminated.'
)
if
self
.
verb
==
'yes'
:
print_status
(
name
,
'process is terminated.'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment