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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
autopwn.py
routersploit/modules/scanners/autopwn.py
+21
-16
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,11 +30,25 @@ 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
):
def
check
(
self
):
raise
NotImplementedError
(
"Check method is not available"
)
def
target_function
(
self
,
running
,
data
):
name
=
threading
.
current_thread
()
.
name
print_status
(
name
,
'process is starting...'
)
while
running
.
is_set
():
try
:
exploit
=
data
.
next
()
except
StopIteration
:
break
else
:
exploit
=
exploit
()
exploit
.
target
=
self
.
target
exploit
.
port
=
self
.
port
...
...
@@ -40,20 +56,9 @@ class Exploit(exploits.Exploit):
response
=
exploit
.
check
()
if
response
is
True
:
print_success
(
"{} is vulnerable"
.
format
(
exploit
))
vulnerabilities
.
append
(
exploit
)
print_success
(
"{} {} is vulnerable"
.
format
(
name
,
exploit
))
elif
response
is
False
:
print_error
(
"{} is not vulnerable"
.
format
(
exploit
))
print_error
(
"{} {} is not vulnerable"
.
format
(
name
,
exploit
))
else
:
print_status
(
"{} could not be verified"
.
format
(
exploit
))
print_status
(
"{} {} could not be verified"
.
format
(
name
,
exploit
))
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
"
)
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