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
1444f4f1
Commit
1444f4f1
authored
Jun 12, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Differentiate CTRL+D and CTRL+C
parent
0a14e8bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
interpreter.py
routersploit/interpreter.py
+4
-2
test_interpreter.py
routersploit/test/test_interpreter.py
+2
-3
No files found.
routersploit/interpreter.py
View file @
1444f4f1
...
...
@@ -83,10 +83,12 @@ class BaseInterpreter(object):
command_handler
(
args
)
except
RoutersploitException
as
err
:
utils
.
print_error
(
err
)
except
(
KeyboardInterrupt
,
EOFError
)
:
except
EOFError
:
print
()
utils
.
print_status
(
"routersploit stopped"
)
break
except
KeyboardInterrupt
:
print
()
def
complete
(
self
,
text
,
state
):
"""Return the next possible completion for 'text'.
...
...
@@ -386,4 +388,4 @@ class RoutersploitInterpreter(BaseInterpreter):
os
.
system
(
args
[
0
])
def
command_exit
(
self
,
*
args
,
**
kwargs
):
raise
KeyboardInterrupt
raise
EOFError
routersploit/test/test_interpreter.py
View file @
1444f4f1
...
...
@@ -152,8 +152,7 @@ class RoutersploitInterpreterTest(RoutersploitTestCase):
self
.
interpreter
.
current_module
=
None
self
.
assertEqual
(
self
.
raw_prompt_default
,
self
.
interpreter
.
prompt
)
def
test_custom_module_
\
(
self
):
def
test_custom_module_prompt
(
self
):
self
.
prepare_prompt_env_variables
(
module_prompt
=
"*{host}*{module} >>>"
)
module_name
=
"module_name"
self
.
interpreter
.
current_module
.
_MagicMock__info__
=
{
'name'
:
module_name
}
...
...
@@ -431,7 +430,7 @@ class RoutersploitInterpreterTest(RoutersploitTestCase):
)
def
test_command_exit
(
self
):
with
self
.
assertRaises
(
KeyboardInterrupt
):
with
self
.
assertRaises
(
EOFError
):
self
.
interpreter
.
command_exit
()
@mock.patch
(
'os.system'
)
...
...
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