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
16a1de19
Commit
16a1de19
authored
Jul 29, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring autopwn scanner
parent
6cc8bea7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
23 deletions
+8
-23
autopwn.py
routersploit/modules/scanners/autopwn.py
+8
-23
No files found.
routersploit/modules/scanners/autopwn.py
View file @
16a1de19
from
os
import
listdir
import
imp
from
routersploit
import
(
from
routersploit
import
(
exploits
,
exploits
,
print_error
,
print_error
,
print_success
,
print_success
,
print_status
,
print_status
,
print_info
,
print_info
,
utils
,
)
)
...
@@ -32,38 +30,25 @@ class Exploit(exploits.Exploit):
...
@@ -32,38 +30,25 @@ class Exploit(exploits.Exploit):
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
def
run
(
self
):
def
run
(
self
):
rootpath
=
'routersploit/modules/'
path
=
'exploits'
modules
=
[]
for
device
in
listdir
(
rootpath
+
path
):
# TODO refactor this, using load_modules() from core
if
not
device
.
endswith
(
".py"
)
and
not
device
.
endswith
(
".pyc"
):
for
f
in
listdir
(
rootpath
+
path
+
"/"
+
device
):
if
f
.
endswith
(
".py"
)
and
f
!=
"__init__.py"
:
modules
.
append
(
device
+
"/"
+
f
[:
-
3
])
vulnerabilities
=
[]
vulnerabilities
=
[]
for
module_name
in
modules
:
f
=
""
.
join
((
path
,
"/"
,
module_name
))
module
=
imp
.
load_source
(
'module'
,
rootpath
+
f
+
'.py'
)
exploit
=
module
.
Exploit
()
for
exploit
in
utils
.
iter_modules
(
utils
.
EXPLOITS_DIR
):
exploit
=
exploit
()
exploit
.
target
=
self
.
target
exploit
.
target
=
self
.
target
exploit
.
port
=
self
.
port
exploit
.
port
=
self
.
port
response
=
exploit
.
check
()
response
=
exploit
.
check
()
if
response
is
True
:
if
response
is
True
:
print_success
(
"{} is vulnerable"
.
format
(
f
))
print_success
(
"{} is vulnerable"
.
format
(
exploit
))
vulnerabilities
.
append
(
f
)
vulnerabilities
.
append
(
exploit
)
elif
response
is
False
:
elif
response
is
False
:
print_error
(
"{} is not vulnerable"
.
format
(
f
))
print_error
(
"{} is not vulnerable"
.
format
(
exploit
))
else
:
else
:
print_status
(
"{} could not be verified"
.
format
(
f
))
print_status
(
"{} could not be verified"
.
format
(
exploit
))
if
vulnerabilities
:
if
vulnerabilities
:
print
print
_info
()
print_success
(
"Device is vulnerable!"
)
print_success
(
"Device is vulnerable!"
)
for
v
in
vulnerabilities
:
for
v
in
vulnerabilities
:
print_info
(
" - {}"
.
format
(
v
))
print_info
(
" - {}"
.
format
(
v
))
...
...
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