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
b479e5a5
Commit
b479e5a5
authored
8 years ago
by
Joshua Abraham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made search tab complete and other fixes
parent
311d72d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
interpreter.py
routersploit/interpreter.py
+3
-3
gxv3611hd_ip_camera_rce.py
...t/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py
+3
-5
test_interpreter.py
routersploit/test/test_interpreter.py
+3
-3
No files found.
routersploit/interpreter.py
View file @
b479e5a5
...
...
@@ -181,7 +181,7 @@ class RoutersploitInterpreter(BaseInterpreter):
self
.
prompt_hostname
=
'rsf'
self
.
show_sub_commands
=
(
'info'
,
'options'
,
'devices'
,
'all'
,
'creds'
,
'exploits'
,
'scanners'
)
self
.
global_commands
=
sorted
([
'use '
,
'exec '
,
'help'
,
'exit'
,
'show '
])
self
.
global_commands
=
sorted
([
'use '
,
'exec '
,
'help'
,
'exit'
,
'show '
,
'search '
])
self
.
module_commands
=
[
'run'
,
'back'
,
'set '
,
'setg '
,
'check'
]
self
.
module_commands
.
extend
(
self
.
global_commands
)
self
.
module_commands
.
sort
()
...
...
@@ -459,9 +459,9 @@ class RoutersploitInterpreter(BaseInterpreter):
def
command_search
(
self
,
*
args
,
**
kwargs
):
for
arg
in
args
:
matches
=
[
s
for
s
in
self
.
modules
if
arg
in
s
tr
(
s
)
]
matches
=
[
s
for
s
in
self
.
modules
if
arg
in
s
]
for
match
in
matches
:
print
(
match
.
replace
(
'.'
,
'/'
))
utils
.
print_info
(
match
.
replace
(
'.'
,
'/'
))
def
command_exit
(
self
,
*
args
,
**
kwargs
):
raise
EOFError
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py
View file @
b479e5a5
...
...
@@ -70,9 +70,7 @@ class Exploit(exploits.Exploit):
def
check
(
self
):
try
:
conn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
)
except
:
except
Exception
:
return
False
output
=
conn
.
read_until
(
"login:"
)
if
'Grandstream'
in
output
:
return
True
return
False
else
:
return
'Grandstream'
in
conn
.
read_until
(
"login:"
)
This diff is collapsed.
Click to expand it.
routersploit/test/test_interpreter.py
View file @
b479e5a5
...
...
@@ -256,21 +256,21 @@ class RoutersploitInterpreterTest(RoutersploitTestCase):
def
test_suggested_commands_with_loaded_module_and_no_global_value_set
(
self
):
self
.
assertEqual
(
list
(
self
.
interpreter
.
suggested_commands
()),
[
'back'
,
'check'
,
'exec '
,
'exit'
,
'help'
,
'run'
,
'set '
,
'setg '
,
'show '
,
'use '
]
# Extra space at the end because of following param
[
'back'
,
'check'
,
'exec '
,
'exit'
,
'help'
,
'run'
,
'se
arch '
,
'se
t '
,
'setg '
,
'show '
,
'use '
]
# Extra space at the end because of following param
)
def
test_suggested_commands_with_loaded_module_and_global_value_set
(
self
):
GLOBAL_OPTS
[
'key'
]
=
'value'
self
.
assertEqual
(
list
(
self
.
interpreter
.
suggested_commands
()),
[
'back'
,
'check'
,
'exec '
,
'exit'
,
'help'
,
'run'
,
'set '
,
'setg '
,
'show '
,
'unsetg '
,
'use '
]
# Extra space at the end because of following param
[
'back'
,
'check'
,
'exec '
,
'exit'
,
'help'
,
'run'
,
'se
arch '
,
'se
t '
,
'setg '
,
'show '
,
'unsetg '
,
'use '
]
# Extra space at the end because of following param
)
def
test_suggested_commands_without_loaded_module
(
self
):
self
.
interpreter
.
current_module
=
None
self
.
assertEqual
(
self
.
interpreter
.
suggested_commands
(),
# Extra space at the end because of following param
[
'exec '
,
'exit'
,
'help'
,
'show '
,
'use '
]
[
'exec '
,
'exit'
,
'help'
,
's
earch '
,
's
how '
,
'use '
]
)
@mock.patch
(
'importlib.import_module'
)
...
...
This diff is collapsed.
Click to expand it.
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