forked from p15670423/monkey
Agent: Remove disused get_interfaces_ranges()
This commit is contained in:
parent
4cf448ebe1
commit
aac8638df2
|
@ -9,7 +9,6 @@ from typing import List
|
||||||
import netifaces
|
import netifaces
|
||||||
import psutil
|
import psutil
|
||||||
|
|
||||||
from common.network.network_range import CidrRange
|
|
||||||
from infection_monkey.utils.environment import is_windows_os
|
from infection_monkey.utils.environment import is_windows_os
|
||||||
|
|
||||||
# Timeout for monkey connections
|
# Timeout for monkey connections
|
||||||
|
@ -136,19 +135,3 @@ def get_free_tcp_port(min_range=1024, max_range=65535):
|
||||||
return port
|
return port
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_interfaces_ranges():
|
|
||||||
"""
|
|
||||||
Returns a list of IPs accessible in the host in each network interface, in the subnet.
|
|
||||||
Limits to a single class C if the network is larger
|
|
||||||
:return: List of IPs, marked as strings.
|
|
||||||
"""
|
|
||||||
res = []
|
|
||||||
ifs = get_host_subnets()
|
|
||||||
for net_interface in ifs:
|
|
||||||
address_str = net_interface["addr"]
|
|
||||||
netmask_str = net_interface["netmask"]
|
|
||||||
# limit subnet scans to class C only
|
|
||||||
res.append(CidrRange(cidr_range="%s/%s" % (address_str, netmask_str)))
|
|
||||||
return res
|
|
||||||
|
|
Loading…
Reference in New Issue