diff --git a/chaos_monkey/exploit/tools.py b/chaos_monkey/exploit/tools.py index 1fc76147a..60e3950a6 100644 --- a/chaos_monkey/exploit/tools.py +++ b/chaos_monkey/exploit/tools.py @@ -389,7 +389,9 @@ class HTTPTools(object): def get_interface_to_target(dst): if sys.platform == "win32": - return get_close_matches(dst, local_ips())[0] + ips = local_ips() + matches = get_close_matches(dst, ips) + return matches[0] if (len(matches) > 0) else ips[0] else: # based on scapy implementation