Unverified Commit 6d6d1726 by Marcin Bury Committed by GitHub

Fixing telnet read until (#466)

parent f61d9eb8
......@@ -81,20 +81,26 @@ class TelnetClient(Exploit):
def telnet_read_until(self, telnet_client, data):
if telnet_client:
if type(data) is str:
data = bytes(data, "utf-8")
try:
if type(data) is str:
data = bytes(data, "utf-8")
response = telnet_client.read_until(data, 5)
return str(response, "utf-8")
response = telnet_client.read_until(data, 5)
return str(response, "utf-8")
except Exception:
pass
return None
def telnet_write(self, telnet_client, data):
if telnet_client:
if type(data) is str:
data = bytes(data, "utf-8")
try:
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment