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
7318a775
Commit
7318a775
authored
May 01, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new command show devices.
parent
e0393dff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
interpreter.py
routersploit/interpreter.py
+17
-2
No files found.
routersploit/interpreter.py
View file @
7318a775
...
...
@@ -331,7 +331,7 @@ class RoutersploitInterpreter(BaseInterpreter):
@utils.module_required
def
command_show
(
self
,
*
args
,
**
kwargs
):
info
,
options
=
'info'
,
'option
s'
info
,
options
,
devices
=
'info'
,
'options'
,
'device
s'
sub_command
=
args
[
0
]
if
sub_command
==
info
:
utils
.
pprint_dict_in_order
(
...
...
@@ -352,12 +352,27 @@ class RoutersploitInterpreter(BaseInterpreter):
utils
.
print_table
(
headers
,
*
self
.
get_opts
(
*
module_opts
))
utils
.
print_info
()
elif
sub_command
==
devices
:
if
devices
in
self
.
current_module
.
_Exploit__info__
.
keys
():
devices
=
self
.
current_module
.
_Exploit__info__
[
'devices'
]
print
(
"
\n
Target devices:"
)
i
=
0
for
device
in
devices
:
if
isinstance
(
device
,
dict
):
print
(
" {} - {}"
.
format
(
i
,
device
[
'name'
]))
else
:
print
(
" {} - {}"
.
format
(
i
,
device
))
i
+=
1
print
()
else
:
print
(
"
\n
Target devices are not defined"
)
else
:
print
(
"Unknown command 'show {}'. You want to 'show {}' or 'show {}'?"
.
format
(
sub_command
,
info
,
options
))
@utils.stop_after
(
2
)
def
complete_show
(
self
,
text
,
*
args
,
**
kwargs
):
sub_commands
=
[
'info'
,
'options'
]
sub_commands
=
[
'info'
,
'options'
,
'devices'
]
if
text
:
return
filter
(
lambda
command
:
command
.
startswith
(
text
),
sub_commands
)
else
:
...
...
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