From 1d07e5f98fc792cbf3ea513b6106570a72d3a181 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 26 Feb 2018 18:39:49 +0200 Subject: [PATCH] Move range to common code folder --- common/__init__.py | 1 + common/network/__init__.py | 1 + {infection_monkey => common}/network/range.py | 0 infection_monkey/monkey-linux.spec | 2 +- infection_monkey/monkey.spec | 2 +- infection_monkey/network/info.py | 2 +- infection_monkey/network/network_scanner.py | 3 ++- 7 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 common/__init__.py create mode 100644 common/network/__init__.py rename {infection_monkey => common}/network/range.py (100%) diff --git a/common/__init__.py b/common/__init__.py new file mode 100644 index 000000000..ee5b79ad0 --- /dev/null +++ b/common/__init__.py @@ -0,0 +1 @@ +__author__ = 'itay.mizeretz' diff --git a/common/network/__init__.py b/common/network/__init__.py new file mode 100644 index 000000000..ee5b79ad0 --- /dev/null +++ b/common/network/__init__.py @@ -0,0 +1 @@ +__author__ = 'itay.mizeretz' diff --git a/infection_monkey/network/range.py b/common/network/range.py similarity index 100% rename from infection_monkey/network/range.py rename to common/network/range.py diff --git a/infection_monkey/monkey-linux.spec b/infection_monkey/monkey-linux.spec index c8c4c631b..fac69536e 100644 --- a/infection_monkey/monkey-linux.spec +++ b/infection_monkey/monkey-linux.spec @@ -4,7 +4,7 @@ block_cipher = None a = Analysis(['main.py'], - pathex=['.'], + pathex=['.', '..'], binaries=None, datas=None, hiddenimports=['_cffi_backend'], diff --git a/infection_monkey/monkey.spec b/infection_monkey/monkey.spec index 8e004145b..cb9c6130e 100644 --- a/infection_monkey/monkey.spec +++ b/infection_monkey/monkey.spec @@ -2,7 +2,7 @@ import os import platform a = Analysis(['main.py'], - pathex=['.'], + pathex=['.', '..'], hiddenimports=['_cffi_backend', 'queue'], hookspath=None, runtime_hooks=None) diff --git a/infection_monkey/network/info.py b/infection_monkey/network/info.py index 30a75780e..da30e7b0f 100644 --- a/infection_monkey/network/info.py +++ b/infection_monkey/network/info.py @@ -8,7 +8,7 @@ import itertools import netifaces from subprocess import check_output from random import randint -from range import CidrRange +from common.network.range import CidrRange def get_host_subnets(): diff --git a/infection_monkey/network/network_scanner.py b/infection_monkey/network/network_scanner.py index df1b4f369..7837e36c3 100644 --- a/infection_monkey/network/network_scanner.py +++ b/infection_monkey/network/network_scanner.py @@ -3,7 +3,8 @@ import time from config import WormConfiguration from info import local_ips, get_interfaces_ranges -from range import * +from common.network.range import * +from model import VictimHost from . import HostScanner __author__ = 'itamar'