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
Feb 02, 2017
by
Joshua Abraham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made search tab complete and other fixes
parent
311d72d9
Show 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):
...
@@ -181,7 +181,7 @@ class RoutersploitInterpreter(BaseInterpreter):
self
.
prompt_hostname
=
'rsf'
self
.
prompt_hostname
=
'rsf'
self
.
show_sub_commands
=
(
'info'
,
'options'
,
'devices'
,
'all'
,
'creds'
,
'exploits'
,
'scanners'
)
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
=
[
'run'
,
'back'
,
'set '
,
'setg '
,
'check'
]
self
.
module_commands
.
extend
(
self
.
global_commands
)
self
.
module_commands
.
extend
(
self
.
global_commands
)
self
.
module_commands
.
sort
()
self
.
module_commands
.
sort
()
...
@@ -459,9 +459,9 @@ class RoutersploitInterpreter(BaseInterpreter):
...
@@ -459,9 +459,9 @@ class RoutersploitInterpreter(BaseInterpreter):
def
command_search
(
self
,
*
args
,
**
kwargs
):
def
command_search
(
self
,
*
args
,
**
kwargs
):
for
arg
in
args
:
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
:
for
match
in
matches
:
print
(
match
.
replace
(
'.'
,
'/'
))
utils
.
print_info
(
match
.
replace
(
'.'
,
'/'
))
def
command_exit
(
self
,
*
args
,
**
kwargs
):
def
command_exit
(
self
,
*
args
,
**
kwargs
):
raise
EOFError
raise
EOFError
routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py
View file @
b479e5a5
...
@@ -70,9 +70,7 @@ class Exploit(exploits.Exploit):
...
@@ -70,9 +70,7 @@ class Exploit(exploits.Exploit):
def
check
(
self
):
def
check
(
self
):
try
:
try
:
conn
=
telnetlib
.
Telnet
(
self
.
target
,
self
.
port
)
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
return
False
else
:
return
'Grandstream'
in
conn
.
read_until
(
"login:"
)
routersploit/test/test_interpreter.py
View file @
b479e5a5
...
@@ -256,21 +256,21 @@ class RoutersploitInterpreterTest(RoutersploitTestCase):
...
@@ -256,21 +256,21 @@ class RoutersploitInterpreterTest(RoutersploitTestCase):
def
test_suggested_commands_with_loaded_module_and_no_global_value_set
(
self
):
def
test_suggested_commands_with_loaded_module_and_no_global_value_set
(
self
):
self
.
assertEqual
(
self
.
assertEqual
(
list
(
self
.
interpreter
.
suggested_commands
()),
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
):
def
test_suggested_commands_with_loaded_module_and_global_value_set
(
self
):
GLOBAL_OPTS
[
'key'
]
=
'value'
GLOBAL_OPTS
[
'key'
]
=
'value'
self
.
assertEqual
(
self
.
assertEqual
(
list
(
self
.
interpreter
.
suggested_commands
()),
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
):
def
test_suggested_commands_without_loaded_module
(
self
):
self
.
interpreter
.
current_module
=
None
self
.
interpreter
.
current_module
=
None
self
.
assertEqual
(
self
.
assertEqual
(
self
.
interpreter
.
suggested_commands
(),
# Extra space at the end because of following param
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'
)
@mock.patch
(
'importlib.import_module'
)
...
...
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