Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
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
ops
coco
Commits
f749e30c
Commit
f749e30c
authored
Nov 09, 2018
by
广宏伟
Browse files
Options
Browse Files
Download
Plain Diff
Merged in dev (pull request #127)
Dev
parents
f1f264f1
88a9e2d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
connection.py
coco/connection.py
+3
-3
interactive.py
coco/interactive.py
+2
-2
No files found.
coco/connection.py
View file @
f749e30c
...
@@ -183,13 +183,13 @@ class TelnetConnection:
...
@@ -183,13 +183,13 @@ class TelnetConnection:
r'incorrect|failed|失败|错误'
,
re
.
I
r'incorrect|failed|失败|错误'
,
re
.
I
)
)
self
.
username_pattern
=
re
.
compile
(
self
.
username_pattern
=
re
.
compile
(
r'login:
\s*$|username:\s*$|用户名:\s*$|账\s*号:
\s*$'
,
re
.
I
r'login:
?\s*$|username:?\s*$|用户名:?\s*$|账\s*号:?
\s*$'
,
re
.
I
)
)
self
.
password_pattern
=
re
.
compile
(
self
.
password_pattern
=
re
.
compile
(
r'
password:\s*$|passwd:\s*$|密\s*码:
\s*$'
,
re
.
I
r'
Password:?\s*$|passwd:?\s*$|密\s*码:?
\s*$'
,
re
.
I
)
)
self
.
success_pattern
=
re
.
compile
(
self
.
success_pattern
=
re
.
compile
(
r'Last\s*login|success|成功'
,
re
.
I
r'Last\s*login|success|成功
|#|\$
'
,
re
.
I
)
)
def
get_socket
(
self
):
def
get_socket
(
self
):
...
...
coco/interactive.py
View file @
f749e30c
...
@@ -407,7 +407,7 @@ class InteractiveServer:
...
@@ -407,7 +407,7 @@ class InteractiveServer:
self
.
client
.
send
(
wr
(
_
(
'Tips: Enter the asset ID and log directly into the asset.'
),
before
=
1
))
self
.
client
.
send
(
wr
(
_
(
'Tips: Enter the asset ID and log directly into the asset.'
),
before
=
1
))
prompt_page_up
=
_
(
"Page up: P/p"
)
prompt_page_up
=
_
(
"Page up: P/p"
)
prompt_page_down
=
_
(
"Page down: Enter|N/n"
)
prompt_page_down
=
_
(
"Page down: Enter|N/n"
)
prompt_back
=
_
(
"BACK:
B/b
"
)
prompt_back
=
_
(
"BACK:
b/q
"
)
prompts
=
[
prompt_page_up
,
prompt_page_down
,
prompt_back
]
prompts
=
[
prompt_page_up
,
prompt_page_down
,
prompt_back
]
prompt
=
'
\t
'
.
join
(
prompts
)
prompt
=
'
\t
'
.
join
(
prompts
)
self
.
client
.
send
(
wr
(
prompt
,
before
=
1
))
self
.
client
.
send
(
wr
(
prompt
,
before
=
1
))
...
@@ -416,7 +416,7 @@ class InteractiveServer:
...
@@ -416,7 +416,7 @@ class InteractiveServer:
opt
=
net_input
(
self
.
client
,
prompt
=
':'
)
opt
=
net_input
(
self
.
client
,
prompt
=
':'
)
if
opt
in
(
'p'
,
'P'
):
if
opt
in
(
'p'
,
'P'
):
return
PAGE_UP
return
PAGE_UP
elif
opt
in
(
'
B'
,
'b
'
):
elif
opt
in
(
'
b'
,
'q
'
):
return
BACK
return
BACK
elif
opt
.
isdigit
()
and
self
.
search_result
and
0
<
int
(
opt
)
<=
len
(
self
.
search_result
):
elif
opt
.
isdigit
()
and
self
.
search_result
and
0
<
int
(
opt
)
<=
len
(
self
.
search_result
):
self
.
proxy
(
self
.
search_result
[
int
(
opt
)
-
1
])
self
.
proxy
(
self
.
search_result
[
int
(
opt
)
-
1
])
...
...
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