forked from p15670423/monkey
Fix CR
This commit is contained in:
parent
1d07e5f98f
commit
fcb5b8f85d
|
@ -15,7 +15,7 @@ class NetworkRange(object):
|
|||
self._shuffle = shuffle
|
||||
|
||||
def get_range(self):
|
||||
return [x for x in self._get_range() if (x & 0xFF != 0)] # remove broadcast ips
|
||||
return self._get_range()
|
||||
|
||||
def __iter__(self):
|
||||
base_range = self.get_range()
|
||||
|
@ -66,7 +66,7 @@ class CidrRange(NetworkRange):
|
|||
return ipaddress.ip_address(ip_address) in self._ip_network
|
||||
|
||||
def _get_range(self):
|
||||
return [CidrRange._ip_to_number(str(x)) for x in self._ip_network]
|
||||
return [CidrRange._ip_to_number(str(x)) for x in self._ip_network if x != self._ip_network.broadcast_address]
|
||||
|
||||
|
||||
class IpRange(NetworkRange):
|
|
@ -8,7 +8,7 @@ import itertools
|
|||
import netifaces
|
||||
from subprocess import check_output
|
||||
from random import randint
|
||||
from common.network.range import CidrRange
|
||||
from common.network.network_range import CidrRange
|
||||
|
||||
|
||||
def get_host_subnets():
|
||||
|
|
|
@ -3,7 +3,7 @@ import time
|
|||
|
||||
from config import WormConfiguration
|
||||
from info import local_ips, get_interfaces_ranges
|
||||
from common.network.range import *
|
||||
from common.network.network_range import *
|
||||
from model import VictimHost
|
||||
from . import HostScanner
|
||||
|
||||
|
|
|
@ -14,3 +14,4 @@ ecdsa
|
|||
netifaces
|
||||
mock
|
||||
nose
|
||||
ipaddress
|
Loading…
Reference in New Issue