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
6d6d1726
Unverified
Commit
6d6d1726
authored
Jun 14, 2018
by
Marcin Bury
Committed by
GitHub
Jun 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing telnet read until (#466)
parent
f61d9eb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
telnet_client.py
routersploit/core/telnet/telnet_client.py
+13
-7
No files found.
routersploit/core/telnet/telnet_client.py
View file @
6d6d1726
...
@@ -81,20 +81,26 @@ class TelnetClient(Exploit):
...
@@ -81,20 +81,26 @@ class TelnetClient(Exploit):
def
telnet_read_until
(
self
,
telnet_client
,
data
):
def
telnet_read_until
(
self
,
telnet_client
,
data
):
if
telnet_client
:
if
telnet_client
:
if
type
(
data
)
is
str
:
try
:
data
=
bytes
(
data
,
"utf-8"
)
if
type
(
data
)
is
str
:
data
=
bytes
(
data
,
"utf-8"
)
response
=
telnet_client
.
read_until
(
data
,
5
)
response
=
telnet_client
.
read_until
(
data
,
5
)
return
str
(
response
,
"utf-8"
)
return
str
(
response
,
"utf-8"
)
except
Exception
:
pass
return
None
return
None
def
telnet_write
(
self
,
telnet_client
,
data
):
def
telnet_write
(
self
,
telnet_client
,
data
):
if
telnet_client
:
if
telnet_client
:
if
type
(
data
)
is
str
:
try
:
data
=
bytes
(
data
,
"utf-8"
)
if
type
(
data
)
is
str
:
data
=
bytes
(
data
,
"utf-8"
)
return
telnet_client
.
write
(
data
,
5
)
return
telnet_client
.
write
(
data
,
5
)
except
Exception
:
pass
return
None
return
None
...
...
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