Beispiel #1
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)
Beispiel #2
0
 def sub_routine(self, commands, kind='post'):
     utils.print_info('Starting {0} routine for {1}'.format(
         kind, self.options.get('CURRENT_MODULE')))
     for command in commands:
         if 'pre' in kind:
             sub_method = command.get('pre_run')
         elif 'post' in kind:
             sub_method = command.get('post_run')
         if sub_method and sub_method in self.methods:
             # bypass this and get a RCE :)
             eval_string = utils.safe_eval('self.{0}(command)', sub_method)
             if eval_string:
                 eval(eval_string)
         utils.random_sleep(fixed=0.5)
def send_post(url,
              data,
              headers=osmedeus_headers,
              cookies=None,
              is_json=False,
              proxy=None,
              retries=3):

    for times in range(retries):
        try:
            r = just_send_post(url,
                               data,
                               headers=headers,
                               cookies=cookies,
                               is_json=is_json,
                               proxy=proxy)
            return r
        except Exception:
            # retry if something went wrong
            utils.random_sleep(3, 6)
            # return nothing after few times retry
            if times == int(retries - 1):
                return None