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
78c76930
Commit
78c76930
authored
Apr 19, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module cosmetics and PEP8 fixes.
parent
5b698f59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
autopwn.py
routersploit/modules/scanners/autopwn.py
+24
-22
No files found.
routersploit/modules/scanners/autopwn.py
View file @
78c76930
from
routersploit
import
*
from
os
import
listdir
from
os.path
import
isfile
,
join
import
imp
from
routersploit
import
(
exploits
,
print_error
,
print_success
,
print_status
,
print_info
,
)
class
Exploit
(
exploits
.
Exploit
):
"""
...
...
@@ -12,54 +18,50 @@ class Exploit(exploits.Exploit):
'name'
:
'AutoPwn'
,
'description'
:
'Scanner module for all vulnerabilities.'
,
'author'
:
[
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
],
}
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
)
# target address
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
)
# target address
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
def
run
(
self
):
exploits
=
[]
rootpath
=
'routersploit/modules/'
path
=
'exploits'
modules
=
[]
for
device
in
listdir
(
rootpath
+
path
):
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
])
vulns
=
[]
vuln
erabilitie
s
=
[]
for
module_name
in
modules
:
f
=
path
+
"/"
+
module_name
f
=
""
.
join
((
path
,
"/"
,
module_name
))
module
=
imp
.
load_source
(
'module'
,
rootpath
+
f
+
'.py'
)
exploit
=
module
.
Exploit
()
exploit
.
target
=
self
.
target
exploit
.
port
=
self
.
port
res
=
exploit
.
check
()
res
ponse
=
exploit
.
check
()
if
res
is
True
:
if
res
ponse
is
True
:
print_success
(
"{} is vulnerable"
.
format
(
f
))
vulns
.
append
(
f
)
elif
res
is
False
:
vuln
erabilitie
s
.
append
(
f
)
elif
res
ponse
is
False
:
print_error
(
"{} is not vulnerable"
.
format
(
f
))
else
:
print_status
(
"{} could not be verified"
.
format
(
f
))
print
if
len
(
vulns
):
print_success
(
"Device is vulnerable!"
)
for
v
in
vulns
:
print
" - {}"
.
format
(
v
)
if
vulnerabilities
:
print_success
(
"
\n
Device is vulnerable!"
)
for
v
in
vulnerabilities
:
print_info
(
" - {}"
.
format
(
v
))
else
:
print_error
(
"Device is not vulnerable to any exploits!"
)
print
print_error
(
"Device is not vulnerable to any exploits!
\n
"
)
def
check
(
self
):
print_error
(
"Check method is not available"
)
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