def run():
    # print banner
    banner()
    options = parse_options()
    # config
    config = read_config(CONFIG_PATH)

    if options.mode == "s":
        target = config["share_mode"][options.target]
        target["mode"] = "share"
        mail = Sender(**target)
        mail.show_status()

    elif options.mode == 'd':
        target = config['direct_mode'][options.target]
        target["mode"] = "direct"
        mail = Sender(**target)
        mail.show_status()
    else:
        logger.error("Option.mode illegal!{}".format(options.mode))
        sys.exit()

    fuzz_vector = json.loads(read_data(FUZZ_PATH).decode())
    m = config["attack"][options.attack]
    for k in iterkeys(fuzz_vector):
        for f in fuzz_vector[k]:
            # TODO
            m[k] = f
            message = Message(**m)
            message = prepare_message(message, mail)
            message.show_status()
            mail.send(message)
            sleep()
    logger.info("All Task Done! :)")
示例#2
0
def run():
    options = parse_options()
    # config
    config = read_config(CONFIG_PATH)

    if options.mode == "s":
        target = config["share_mode"][options.target]
        target["mode"] = "share"
        mail = Sender(**target)
        mail.show_status()

    elif options.mode == 'd':
        target = config['direct_mode'][options.target]
        target["mode"] = "direct"
        mail = Sender(**target)
        mail.show_status()
    else:
        logger.error("Option.mode illegal!{}".format(options.mode))
        sys.exit()

    m = config["attack"][options.attack]
    if options.mail_from:
        m['mail_from'] = options.mail_from
    if options.mail_to:
        m['mail_to'] = options.mail_to
    if options.mime_from:
        m['mime_from'] = options.mime_from
    if options.mime_to:
        m['to'] = options.mime_to
    message = Message(**m)
    message = prepare_message(message, mail)
    message.show_status()
    mail.send(message)
    logger.info("All Task Done! :)")
示例#3
0
def run():
    logger.info("Start evaluate email server....")
    logger.warning("-" * 70)
    options = parse_options()
    # config
    config = read_config(CONFIG_PATH)

    if options.mode == "s":
        target = config["share_mode"][options.target]
        target["mode"] = "share"
        mail = Sender(**target)
        mail.show_status()

    elif options.mode == 'd':
        target = config['direct_mode'][options.target]
        target["mode"] = "direct"
        mail = Sender(**target)
        mail.show_status()
    else:
        logger.error("Option.mode illegal!{}".format(options.mode))
        sys.exit()

    for a in config["attack"]:
        try:
            data = config["attack"][a]
            name = a
            subject = template_subject.format(name=name)
            description = data['description']
            defense = data['defense']
            body = template_body.format(name=name,
                                        defense=defense,
                                        description=description)
            data['subject'] = subject
            data['body'] = body
            message = Message(**data)
            message = prepare_message(message, mail)
            message.show_status()
            mail.send(message)
            sleep()
        except Exception as e:
            logger.info(e)
            pass
    logger.info("All Task Done! :)")