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
433dd4be
Commit
433dd4be
authored
8 years ago
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing search's command completer tests
parent
930c1b3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
interpreter.py
routersploit/interpreter.py
+1
-1
test_completer.py
routersploit/test/test_completer.py
+20
-7
No files found.
routersploit/interpreter.py
View file @
433dd4be
...
...
@@ -457,7 +457,7 @@ class RoutersploitInterpreter(BaseInterpreter):
def
command_exec
(
self
,
*
args
,
**
kwargs
):
os
.
system
(
args
[
0
])
def
command_search
(
self
,
*
args
,
**
kwargs
):
def
command_search
(
self
,
*
args
,
**
kwargs
):
# TODO cover with unit tests
for
arg
in
args
:
matches
=
[
s
for
s
in
self
.
modules
if
arg
in
s
]
for
match
in
matches
:
...
...
This diff is collapsed.
Click to expand it.
routersploit/test/test_completer.py
View file @
433dd4be
...
...
@@ -89,7 +89,8 @@ class RoutersploitCompleterTest(RoutersploitTestCase):
self
.
set_module
()
self
.
rsf
.
send
(
"
\t\t
"
)
self
.
assertPrompt
(
'
\r\n
'
,
'back exec help search setg use
\r\n
'
'check exit run set show
\r\n
'
,
self
.
module_prompt
(
'FTP Bruteforce'
)
)
...
...
@@ -117,6 +118,14 @@ class RoutersploitCompleterTest(RoutersploitTestCase):
'run'
)
def
test_complete_search
(
self
):
self
.
set_module
()
self
.
rsf
.
send
(
"sea
\t
"
)
self
.
assertPrompt
(
self
.
module_prompt
(
'FTP Bruteforce'
),
'search '
,
)
def
test_complete_set_raw
(
self
):
self
.
set_module
()
self
.
rsf
.
send
(
"s
\t\t
"
)
...
...
@@ -145,7 +154,8 @@ class RoutersploitCompleterTest(RoutersploitTestCase):
self
.
set_module
()
self
.
rsf
.
send
(
"set
\t\t
"
)
self
.
assertPrompt
(
'passwords stop_on_success threads verbosity
\r\n
port target usernames
\r\n
'
,
'passwords stop_on_success threads verbosity
\r\n
'
'port target usernames
\r\n
'
,
self
.
module_prompt
(
'FTP Bruteforce'
),
'set '
,
)
...
...
@@ -162,7 +172,8 @@ class RoutersploitCompleterTest(RoutersploitTestCase):
self
.
set_module
()
self
.
rsf
.
send
(
"setg
\t\t
"
)
self
.
assertPrompt
(
'passwords stop_on_success threads verbosity
\r\n
port target usernames
\r\n
'
,
'passwords stop_on_success threads verbosity
\r\n
'
'port target usernames
\r\n
'
,
self
.
module_prompt
(
'FTP Bruteforce'
),
'setg '
,
)
...
...
@@ -182,8 +193,9 @@ class RoutersploitCompleterTest(RoutersploitTestCase):
self
.
set_module
()
self
.
rsf
.
send
(
"
\t\t
"
)
self
.
assertPrompt
(
"
\r\n
"
,
self
.
module_prompt
(
'FTP Bruteforce'
)
"back exec help search setg use
\r\n
"
"check exit run set show
\r\n
"
,
self
.
module_prompt
(
'FTP Bruteforce'
),
)
def
test_complete_unsetg_2
(
self
):
...
...
@@ -194,8 +206,9 @@ class RoutersploitCompleterTest(RoutersploitTestCase):
self
.
rsf
.
send
(
"setg target foo
\r\n
"
)
self
.
rsf
.
send
(
"
\t\t
"
)
self
.
assertPrompt
(
'
\r\n
'
,
self
.
module_prompt
(
'FTP Bruteforce'
)
'back exec help search setg unsetg
\r\n
'
'check exit run set show use
\r\n
'
,
self
.
module_prompt
(
'FTP Bruteforce'
),
)
def
test_complete_unsetg_3
(
self
):
...
...
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