WithSecureLabs / doublepulsar-detection-script

A python2 script for sweeping a network to find windows systems compromised with the DOUBLEPULSAR implant.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add exception handling when the --ip option is used

bontchev opened this issue · comments

Both scripts barf badly if an exception occurs (e.g., a timeout) when scanning a single IP address using the --ip option. The reason is because while the check is surrounded by proper exception handling when scanning multiple IPs via the --file option, this exception handling is missing when scanning a single IP. Please add it; it's trivial.

if ip:
#    check_ip(ip)
    try:
        check_ip(ip)
    except Exception as e:
        with print_lock:
            print "[ERROR] [%s] - %s" % (ip, e)