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
6c0ce514
Commit
6c0ce514
authored
Jul 30, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Threaded scanner
parent
6a60de9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
autopwn.py
routersploit/modules/scanners/autopwn.py
+26
-21
No files found.
routersploit/modules/scanners/autopwn.py
View file @
6c0ce514
import
threading
from
routersploit
import
(
exploits
,
print_error
,
...
...
@@ -5,6 +6,7 @@ from routersploit import (
print_status
,
print_info
,
utils
,
LockedIterator
)
...
...
@@ -28,32 +30,35 @@ class Exploit(exploits.Exploit):
target
=
exploits
.
Option
(
''
,
'Target IP address e.g. 192.168.1.1'
)
# target address
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
threads
=
exploits
.
Option
(
8
,
"Number of threads"
)
def
run
(
self
):
vulnerabilities
=
[]
data
=
LockedIterator
(
utils
.
iter_modules
(
utils
.
EXPLOITS_DIR
))
self
.
run_threads
(
self
.
threads
,
self
.
target_function
,
data
)
for
exploit
in
utils
.
iter_modules
(
utils
.
EXPLOITS_DIR
):
exploit
=
exploit
()
exploit
.
target
=
self
.
target
exploit
.
port
=
self
.
port
def
check
(
self
):
raise
NotImplementedError
(
"Check method is not available"
)
response
=
exploit
.
check
()
def
target_function
(
self
,
running
,
data
):
name
=
threading
.
current_thread
()
.
name
print_status
(
name
,
'process is starting...'
)
if
response
is
True
:
print_success
(
"{} is vulnerable"
.
format
(
exploit
))
vulnerabilities
.
append
(
exploit
)
e
lif
response
is
False
:
print_error
(
"{} is not vulnerable"
.
format
(
exploit
))
while
running
.
is_set
()
:
try
:
exploit
=
data
.
next
(
)
e
xcept
StopIteration
:
break
else
:
print_status
(
"{} could not be verified"
.
format
(
exploit
))
exploit
=
exploit
()
exploit
.
target
=
self
.
target
exploit
.
port
=
self
.
port
if
vulnerabilities
:
print_info
()
print_success
(
"Device is vulnerable!"
)
for
v
in
vulnerabilities
:
print_info
(
" - {}"
.
format
(
v
))
else
:
print_error
(
"Device is not vulnerable to any exploits!
\n
"
)
response
=
exploit
.
check
()
if
response
is
True
:
print_success
(
"{} {} is vulnerable"
.
format
(
name
,
exploit
))
elif
response
is
False
:
print_error
(
"{} {} is not vulnerable"
.
format
(
name
,
exploit
))
else
:
print_status
(
"{} {} could not be verified"
.
format
(
name
,
exploit
))
def
check
(
self
):
raise
NotImplementedError
(
"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