Exemplo n.º 1
0
    def clean_gowitness(self, command):
        utils.print_good('Cleaning for {0}:{1}'.format(
            command.get('banner'), command.get('post_run')))

        real_cmd = utils.resolve_command(
            self.options, {
                "banner":
                "gowitness gen report",
                "cmd":
                "$GO_PATH/gowitness report generate -n $WORKSPACE/portscan/screenshot/$OUTPUT-raw-gowitness.html --destination $WORKSPACE/portscan/screenshot/raw-gowitness/ --db $WORKSPACE/portscan/screenshot/gowitness.db",
                "output_path":
                "$WORKSPACE/portscan/screenshot/$OUTPUT-raw-gowitness.html",
            })

        execute.send_cmd(self.options, real_cmd)
        raw_html = utils.just_read(real_cmd.get('output_path'))
        if not raw_html:
            utils.print_bad('Requirement not found: {0}'.format(
                real_cmd.get('output_path')))
            return False

        local_path = utils.replace_argument(self.options,
                                            '$WORKSPACE/portscan/')
        real_html = raw_html.replace(local_path, '')
        utils.just_write(command.get('cleaned_output'), real_html)
        utils.check_output(command.get('cleaned_output'))
Exemplo n.º 2
0
    def run(self, commands):
        for command in commands:
            if command.get('cmd') == 'ignore' or command.get('cmd') == '':
                continue

            if self.options['CURRENT_SPEED'] == command.get('speed') or command.get('speed') == 'general':
                utils.print_good(
                    'Starting {0}'.format(command.get('banner')))
                if utils.check_required(command):
                    # really execute it
                    execute.send_cmd(self.options, command)
        polling.waiting(self.options, delay=self.delay)
        utils.random_sleep(fixed=0.5)