forked from p15670423/monkey
Remove unused `get_ip_for_connection()` in `infection_monkey/network/info.py`
This commit is contained in:
parent
b7535dccb0
commit
6cc22afd9b
|
@ -157,22 +157,3 @@ def get_interfaces_ranges():
|
||||||
# limit subnet scans to class C only
|
# limit subnet scans to class C only
|
||||||
res.append(CidrRange(cidr_range="%s/%s" % (address_str, netmask_str)))
|
res.append(CidrRange(cidr_range="%s/%s" % (address_str, netmask_str)))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
if is_windows_os():
|
|
||||||
|
|
||||||
def get_ip_for_connection(target_ip):
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
def get_ip_for_connection(target_ip):
|
|
||||||
try:
|
|
||||||
query_str = "ip route get %s" % target_ip
|
|
||||||
resp = check_output(query_str.split())
|
|
||||||
substr = resp.split()
|
|
||||||
src = substr[substr.index("src") + 1]
|
|
||||||
return src
|
|
||||||
except Exception:
|
|
||||||
return None
|
|
||||||
|
|
Loading…
Reference in New Issue