diff --git a/enteletaor_lib/config.py b/enteletaor_lib/config.py index 7a9a3fd..35c1b62 100644 --- a/enteletaor_lib/config.py +++ b/enteletaor_lib/config.py @@ -33,7 +33,7 @@ __banner__ = """ ____ _ _ ___ ____ _ ____ ___ ____ ____ ____ |___ |\ | | |___ | |___ | |__| | | |__/ |___ | \| | |___ |___ |___ | | | |__| | \\ -""" +""" # Font name: Cyberlarge # -------------------------------------------------------------------------- # Generic global config diff --git a/enteletaor_lib/modules/scan/__init__.py b/enteletaor_lib/modules/scan/__init__.py index a022ef3..7dbb167 100644 --- a/enteletaor_lib/modules/scan/__init__.py +++ b/enteletaor_lib/modules/scan/__init__.py @@ -5,7 +5,7 @@ import logging from modules import IModule from libs.core.structs import CommonData -from libs.core.models import StringField, BoolField, IntegerField +from libs.core.models import StringField, BoolField, IntegerField, FloatField from .scan_main import action_scan_main @@ -19,6 +19,7 @@ class ModuleModel(CommonData): own_ips = BoolField(label="Try to find all IPs registered for this company") concurrency = IntegerField(label="maximum parallels scans", default=10) output = StringField(label="output file, in JSON format") + timeout = FloatField(label="timeout for socket connections", default=0.2) # ---------------------------------------------------------------------- diff --git a/enteletaor_lib/modules/scan/scan_main.py b/enteletaor_lib/modules/scan/scan_main.py index b30bae2..d1b0c3d 100644 --- a/enteletaor_lib/modules/scan/scan_main.py +++ b/enteletaor_lib/modules/scan/scan_main.py @@ -57,7 +57,7 @@ def _do_scan(config, sem, host): # Try to check if port is open s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.settimeout(1) + s.settimeout(config.timeout) result = s.connect_ex((host, int(port))) @@ -69,10 +69,10 @@ def _do_scan(config, sem, host): # Is port open? if result == 0: - log.error(" ) Port '%s' is open in '%s'" % (port, host)) + log.info(" Port '%s' is open in '%s'" % (port, host)) if handle(host, port, config) is True: - log.error(" Open '%s' server found in port '%s'" % (server_type, port)) + log.error(" Open '%s' server found in port '%s' at '%s'" % (server_type, port, host)) OPEN_SERVICES[host][server_type] = dict( state="open", @@ -121,6 +121,19 @@ def action_scan_main(config): for t in threads: t.join() + # -------------------------------------------------------------------------- + # Display results + # -------------------------------------------------------------------------- + if OPEN_SERVICES: + log.error(" - Open services found:") + for host, content in six.iteritems(OPEN_SERVICES): + log.error(" -> Host - %s" % host) + for server_type, server_info in six.iteritems(content): + log.error(" * %s/TCP [%s]" % (server_info['port'], server_type)) + + else: + log.error(" - No open services found") + # -------------------------------------------------------------------------- # Export results # -------------------------------------------------------------------------- @@ -139,7 +152,7 @@ def build_targets(config): results = set() # Split targets - for t in config.target.split("-"): + for t in config.target.split(","): try: results.update(str(x) for x in ipaddress.ip_network(t, strict=False)) except ValueError: