

def brute_amqp(host, port=5672, user=None, password=None, db=0):
    host_and_port = ('%s:%s' % (host, port))
    user_name = ('guest' if (user is None) else user)
    user_password = ('guest' if (password is None) else password)
    timeout = 0.2
    try:
        amqp.connection.Connection(host=host_and_port, userid=user_name, password=user_password, connect_timeout=timeout, read_timeout=timeout, socket_timeout=timeout).connected
        return True
    except socket.timeout as e:
        raise AuthRequired()
    except Exception:
        return False

dataset/ETHPy150Open cr0hn/enteletaor/enteletaor_lib/modules/brute/authers.py brute_amqp/original