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
3ab4ffe3
Commit
3ab4ffe3
authored
Aug 07, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using validators.boolify in creds/http_basic_default
parent
00e9f68b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
http_basic_default.py
routersploit/modules/creds/http_basic_default.py
+5
-7
No files found.
routersploit/modules/creds/http_basic_default.py
View file @
3ab4ffe3
...
...
@@ -7,7 +7,6 @@ from routersploit import (
print_error
,
print_success
,
print_table
,
boolify
,
http_request
,
multi
,
validators
,
...
...
@@ -42,8 +41,8 @@ class Exploit(exploits.Exploit):
threads
=
exploits
.
Option
(
8
,
'Number of threads'
)
defaults
=
exploits
.
Option
(
wordlists
.
defaults
,
'User:Pass or file with default credentials (file://)'
)
path
=
exploits
.
Option
(
'/'
,
'URL Path'
)
verbosity
=
exploits
.
Option
(
'yes'
,
'Display authentication attempts'
)
stop_on_success
=
exploits
.
Option
(
'yes'
,
'Stop on first valid authentication attempt'
)
verbosity
=
exploits
.
Option
(
'yes'
,
'Display authentication attempts'
,
validators
=
validators
.
boolify
)
stop_on_success
=
exploits
.
Option
(
'yes'
,
'Stop on first valid authentication attempt'
,
validators
=
validators
.
boolify
)
credentials
=
[]
...
...
@@ -83,7 +82,6 @@ class Exploit(exploits.Exploit):
defaults
.
close
()
def
target_function
(
self
,
user
,
password
):
module_verbosity
=
boolify
(
self
.
verbosity
)
name
=
threading
.
current_thread
()
.
name
url
=
"{}:{}{}"
.
format
(
self
.
target
,
self
.
port
,
self
.
path
)
...
...
@@ -93,9 +91,9 @@ class Exploit(exploits.Exploit):
response
=
http_request
(
method
=
"GET"
,
url
=
url
,
auth
=
(
user
,
password
))
if
response
.
status_code
!=
401
:
print_success
(
"Target: {}:{} {}: Authentication Succeed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_
verbosity
)
print_success
(
"Target: {}:{} {}: Authentication Succeed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
self
.
verbosity
)
self
.
credentials
.
append
((
self
.
target
,
self
.
port
,
user
,
password
))
if
boolify
(
self
.
stop_on_success
)
:
if
self
.
stop_on_success
:
raise
StopThreadPoolExecutor
else
:
print_error
(
"Target: {}:{} {}: Authentication Failed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
module_
verbosity
)
print_error
(
"Target: {}:{} {}: Authentication Failed - Username: '{}' Password: '{}'"
.
format
(
self
.
target
,
self
.
port
,
name
,
user
,
password
),
verbose
=
self
.
verbosity
)
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