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
1faaa5db
Commit
1faaa5db
authored
Jul 02, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unsetg all possible opts from module.
parent
1fd7cb7c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
interpreter.py
routersploit/interpreter.py
+5
-8
No files found.
routersploit/interpreter.py
View file @
1faaa5db
...
...
@@ -240,7 +240,7 @@ class RoutersploitInterpreter(BaseInterpreter):
matches
.
add
(
""
.
join
((
text
,
head
,
sep
)))
return
list
(
map
(
utils
.
humanize_path
,
matches
))
# humanize output, replace dots to forward slashes
def
suggested_commands
(
self
):
def
suggested_commands
(
self
):
# TODO: sorted list, factor out generic commands
""" Entry point for intelligent tab completion.
Based on state of interpreter this method will return intelligent suggestions.
...
...
@@ -293,7 +293,7 @@ class RoutersploitInterpreter(BaseInterpreter):
key
,
_
,
value
=
args
[
0
]
.
partition
(
' '
)
if
key
in
self
.
current_module
.
options
:
setattr
(
self
.
current_module
,
key
,
value
)
if
kwargs
.
get
(
"glob
al
"
,
False
):
if
kwargs
.
get
(
"glob"
,
False
):
GLOBAL_OPTS
[
key
]
=
value
utils
.
print_success
({
key
:
value
})
else
:
...
...
@@ -309,7 +309,7 @@ class RoutersploitInterpreter(BaseInterpreter):
@utils.module_required
def
command_setg
(
self
,
*
args
,
**
kwargs
):
kwargs
[
'glob
al
'
]
=
True
kwargs
[
'glob'
]
=
True
self
.
command_set
(
*
args
,
**
kwargs
)
@utils.stop_after
(
2
)
...
...
@@ -319,16 +319,13 @@ class RoutersploitInterpreter(BaseInterpreter):
@utils.module_required
def
command_unsetg
(
self
,
*
args
,
**
kwargs
):
key
,
_
,
value
=
args
[
0
]
.
partition
(
' '
)
if
key
in
self
.
current_module
.
options
:
try
:
del
GLOBAL_OPTS
[
key
]
except
KeyError
:
utils
.
print_error
(
"There is no such option set!"
)
else
:
utils
.
print_success
({
key
:
value
})
else
:
utils
.
print_error
(
"You can't unset global option '{}'.
\n
"
"Available global options: {}"
.
format
(
key
,
GLOBAL_OPTS
.
keys
()))
else
:
utils
.
print_success
({
key
:
value
})
@utils.stop_after
(
2
)
def
complete_unsetg
(
self
,
text
,
*
args
,
**
kwargs
):
...
...
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