Unverified Commit d61c41b2 by Anuj Koli Committed by GitHub

Resolved issue with exploit (#766) (#767)

parent ba839fdd
......@@ -145,7 +145,7 @@ class ApiRosClient(object):
ret = ''
while len(ret) < length:
s = self.sk.recv(length - len(ret))
if s == '':
if s is None or s == '':
raise RuntimeError("connection closed by remote end")
ret += s.decode('UTF-8', 'replace')
......
......@@ -51,7 +51,7 @@ class Exploit(TCPClient):
tcp_client = self.tcp_create()
tcp_sock = tcp_client.connect()
apiros = ApiRosClient(tcp_sock)
apiros = ApiRosClient(tcp_client)
output = apiros.login(username, password)
......@@ -65,6 +65,9 @@ class Exploit(TCPClient):
print_error("Authentication Failed - Username: '{}' Password: '{}'".format(username, password), verbose=self.verbosity)
tcp_client.close()
except RuntimeError:
print_error("Connection closed by remote end")
except StopIteration:
break
......
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