restored mission import

This commit is contained in:
itsikkes 2016-07-21 11:45:29 +03:00
parent 9adffe86dc
commit df4c8c6415
2 changed files with 6 additions and 1 deletions

View File

@ -1,8 +1,9 @@
import os import os
import sys import sys
import array
import socket import socket
import struct import struct
import array import psutil
import ipaddress import ipaddress
from random import randint from random import randint

View File

@ -153,6 +153,10 @@ class MonkeyTunnel(Thread):
def set_tunnel_for_host(self, host): def set_tunnel_for_host(self, host):
assert isinstance(host, VictimHost) assert isinstance(host, VictimHost)
if not self.local_port:
return
ip_match = get_close_matches(host.ip_addr, local_ips()) or self.l_ips ip_match = get_close_matches(host.ip_addr, local_ips()) or self.l_ips
host.default_tunnel = '%s:%d' % (ip_match[0], self.local_port) host.default_tunnel = '%s:%d' % (ip_match[0], self.local_port)