From c33c1043f547269cefebbc2b9e2b9e9c2e745753 Mon Sep 17 00:00:00 2001 From: Moshe Kaplan Date: Sun, 3 Mar 2019 16:49:40 -0500 Subject: [PATCH 1/2] Remove unused imports and specific exception --- autorecon.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/autorecon.py b/autorecon.py index f71983d..0553325 100644 --- a/autorecon.py +++ b/autorecon.py @@ -7,17 +7,18 @@ # option) any later version. # -import argparse -import asyncio -from colorama import init, Fore, Back, Style -from concurrent.futures import ProcessPoolExecutor, as_completed, FIRST_COMPLETED -import ipaddress import os import re +import sys import socket import string -import sys +import asyncio +import argparse +import ipaddress +from concurrent.futures import ProcessPoolExecutor, as_completed, FIRST_COMPLETED + import toml +from colorama import Fore, Style verbose = 0 nmap = '' @@ -575,7 +576,7 @@ if __name__ == '__main__': if target not in targets: targets.append(target) - except: + except socket.gaierror: error(target + ' does not appear to be a valid IP address, IP range, or resolvable hostname.') errors = True From ccacd200bcf78d3baa107397c2aefb09ed4a8d91 Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Mon, 18 Mar 2019 18:35:23 -0400 Subject: [PATCH 2/2] Re-ordered imports. --- autorecon.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/autorecon.py b/autorecon.py index 073aec1..cf7a452 100644 --- a/autorecon.py +++ b/autorecon.py @@ -7,18 +7,17 @@ # option) any later version. # +import argparse +import asyncio +from colorama import Fore, Style +from concurrent.futures import ProcessPoolExecutor, as_completed, FIRST_COMPLETED +import ipaddress import os import re -import sys import socket import string -import asyncio -import argparse -import ipaddress -from concurrent.futures import ProcessPoolExecutor, as_completed, FIRST_COMPLETED - +import sys import toml -from colorama import Fore, Style verbose = 0 nmap = ''