首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏iSharkFly

    WinRM 如何设置 TrustedHosts

    查看当前 WinRM 的白名单 通过在命令行工具中运行下面的命令: Get-Item WSMan:\localhost\Client\TrustedHosts 上面命令行工具中显示了当前的配置情况 设置所有地址 Set-Item WSMan:\localhost\Client\TrustedHosts -Value '*' 添加到列表尾部 如果希望添加不同的地址到当前的信任列表中,但不修改当前的配置的话,需要使用关键字 Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'machineC' -Concatenate https://www.ossez.com/t/

    3.4K40发布于 2021-06-17
  • 来自专栏Windows技术交流

    AWS的Windows机器通过UserData设置密码并开启winrm

    auto-launches on startup. cmd.exe /c net stop winrm cmd.exe /c sc.exe config winrm start= auto Set-Item WSMan as it throws an error $ErrorActionPreference = "Continue" # Remove HTTP listener Remove-Item -Path WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan as it throws an error $ErrorActionPreference = "Continue" # Remove HTTP listener Remove-Item -Path WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan

    44510编辑于 2024-12-11
  • 来自专栏Windows技术交流

    winrm不指定端口远程即可执行命令

    2>&1 > $null winrm quickconfig -q -force 2>&1 > $null restart-service winrm 2>&1 > $null #Set-Item WSMan winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1 > $null netstat -ato|findstr :5985 Set-Item WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1 > $null netstat -ato|findstr :5985 Set-Item WSMan 后要重启机器 #执行完这段Powershell后要重启机器 #执行完这段Powershell后要重启机器 #shutdown -r -t 0 客户端上以管理员身份打开powershell执行Set-Item WSMan

    2K60编辑于 2024-09-14
  • 来自专栏python3

    python winrm模块使用

    使用session方法 ### import winrm s=winrm.Session('http://10.10.60.14:5985/wsman',auth=('administrator',' print  r.std_err 使用Protocol方法 ### import winrm conn = winrm.Protocol(endpoint='http://10.10.60.14:5985/wsman

    2.5K20发布于 2020-01-07
  • 来自专栏黑客技术家园

    从Linux到Windows的PowerShell远程处理

    要完成此操作,请运行以下命令之一:使用通配符允许所有计算机在对此主机进行身份验证时使用NTLM Set-Item WSMan:localhostClientTrustedHosts -Force -Value 或者只将您的IP添加到NTLM身份验证允许列表中 Set-Item WSMan:localhostClientTrustedHosts -Force -Concatenate -Value 192.168.10.100 清除痕迹 如果您的命令之前存在TrustedHosts以自行添加,请更换您的IP并运行以下命令: $newvalue = ((Get-ChildItem WSMan:localhostClientTrustedHosts ).Value).Replace(",192.168.10.100","")Set-Item WSMan:localhostClientTrustedHosts -Force -Value $newvalue 或者,如果您是唯一的TrustedHosts,则可以删除所有TrustedHosts Clear-Item WSMan:localhostClientTrustedHosts 重新启动WinRM服务以完成更改

    2.8K20发布于 2021-04-02
  • 来自专栏Windows技术交流

    powershell批量远程示例,批量给多台机器安装dotnet和iis

    2>&1 > $null winrm quickconfig -q -force 2>&1 > $null restart-service winrm 2>&1 > $null #Set-Item WSMan winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1 > $null netstat -ato|findstr :5985 Set-Item WSMan Set-ExecutionPolicy as it throws an error #$ErrorActionPreference = "stop" # Remove listener Remove-Item -Path WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1 > $null netstat -ato|findstr :5985 Set-Item WSMan

    2K20编辑于 2024-09-14
  • 来自专栏华来四Azure混合云

    Azure部署Azure Stack技巧

    接下来回到宿主机,执行以下命令: Set-Item wsman:localhost\client\trustedhosts -Value * Enable-WSManCredSSP -Role Client Credential Delegation 启用Allow Delegating Fresh Credentials with NTLM-only Server Authentication 策略项并设置值为 WSMAN 确保在宿主机上运行以下命令: Enable-WSManCredSSP -Role Server Set-Item wsman:localhost\client\trustedhosts -Value * Enable-WSManCredSSP -Role Client -DelegateComputer * 并且确保在宿主机上启用以下组策略项,并都指定为wsman/*: Allow Delegating

    1.7K50发布于 2019-04-24
  • 来自专栏python3

    python winrm 连接windo

        Address = *     Transport = HTTP     Port = 5985     Hostname     Enabled = true     URLPrefix = wsman /usr/bin/python import winrm win2008 = winrm.Session('http://11.22.33.44:5985/wsman',auth=('administrator

    1.2K20发布于 2020-01-07
  • 来自专栏Windows技术交流

    Windows机器在线扩容系统盘大小后如何批量扩展卷实现多台机器自动扩容C分区

    2>&1 > $null winrm quickconfig -q -force 2>&1 > $null restart-service winrm 2>&1 > $null #Set-Item WSMan winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1 > $null netstat -ato|findstr :5985 Set-Item WSMan Set-ExecutionPolicy as it throws an error #$ErrorActionPreference = "stop" # Remove listener Remove-Item -Path WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan winrm set winrm/config/client '@{TrustedHosts="*"}' 2>&1 > $null netstat -ato|findstr :5985 Set-Item WSMan

    2.6K110编辑于 2024-09-14
  • 来自专栏黑白天安全团队

    横向移动之WinRM横向移动

    WinRM的简要概述 "Windows远程管理(WinRM)"是WS-Management协议(Web Services for Management,又名WSMan)的Microsoft实现,WS-Management 作为DCOM和WMI远程管理的替代方法,WinRM用于通过WSMan与远程计算机建立会话,WAMan利用HTTP/S作为传输机制来传递XML格式的消息。 以此配置为例,此时远程主机已经可以通过WS-Management协议访问http://192.168.8.215/wsman连接当前服务器的WinRM服务。 在.NET C#中构建WSMan-WinRM工具,创建新的.NET Framework(4)控制台应用程序项目后,通过在解决方案资源管理器中右键单击“依赖项”菜单并选择“添加COM引用”,接着选择图中的选项 POST /wsman?

    5.8K10发布于 2021-03-16
  • 来自专栏好派笔记

    Ansible 客户端需求–设置Windows主机

    Transport = HTTPS       Port = 5986       Hostname = SERVER2016       Enabled = true     URLPrefix = wsman URLPrefix:要监听的URL前缀,默认为wsman。如果更改此ansiblewinrmpath设置,则必须将主机var设置为相同的值。 删除WinRM侦听器 删除WinRM侦听器: # Remove all listeners Remove-Item -Path WSMan:\localhost\Listener\* -Recurse  -Force   # Only remove listeners that are run over HTTPS Get-ChildItem -Path WSMan:\localhost\Listener 请执行以下操作: # substitute {path} with the path to the option after winrm/config/Service Set-Item -Path WSMan

    11.5K41发布于 2021-09-13
  • 来自专栏Windows技术交流

    Win10 Win11如何通过命令开启WinRM

    as it throws an error $ErrorActionPreference = "Continue" # Remove HTTP listener Remove-Item -Path WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan winrm start= auto winrm quickconfig -q -force 2>&1 > $null winrm quickconfig -q 2>&1 > $null Set-Item WSMan

    1.1K10编辑于 2024-12-12
  • 来自专栏全栈工程师修炼之路

    PS命令之操作系统远程管理及进程服务操作示例

    Set-WSManQuickConfig : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/<em>wsman</em>/1/wsmanfault" Code Set-Item WSMan:localhost\client\trustedhosts -value 10.20.172.106 -Force Set-Item : 客户端无法连接到请求中指定的目标。 Force] [-LocalCredential <System.Management.Automation.PSCredential>] [-PassThru] [-Protocol {DCOM | WSMan Force] [-Impersonation {Default | Anonymous | Identify | Impersonate | Delegate}] [-Protocol {DCOM | WSMan Protocol 参数 : 指定使用WSMan协议。

    8.5K40编辑于 2022-09-29
  • 来自专栏Ms08067安全实验室

    关于Powershell 你要知道的知识!

    ShouldProcess {Variable} Certificate ShouldProcess {Cert} WSMan Credentials {WSMan} /* - ShouldProcess: 可支持-whatIf、-Confirm参数 - Credentials: 支持凭据参数(-Credentials)连接数据存储 - Transactions: 支持事务,提交操作,回滚等 */ 如你所见,注册表,别名,环境变量,文件系统,函数,变量,证书和WSMan

    1.9K30发布于 2021-04-07
  • 来自专栏鸿鹄实验室

    T1028: WinRM for Lateral Movement

    其中HTTP 的票据就是winrm的服务票据 PowerShell Remoting 参考:Running Remote Commands Powershell Remoting有两种方式: SSH WSMAN SSH暂且不谈,这里的Wsman就是前面所说的 WS-Management Protocol,也就是WinRM服务。 其他的一些命令 Enable-PSRemoting -force #启用PsRemoting 等同于winrm quickconfig Set-Item WSMan:\localhost\Client\ Value * -Force #设置TrustedHosts 列表 Test-NetConnection <IP> -CommonTCPPort WINRM #测试目标 Listener 是否打开 Test-WsMan {hostname|ip} #和上一个命令类似 Get-Item WSMan:\localhost\Client\TrustedHosts #获取TrustedHosts的值 Invoke-Command

    2.4K30发布于 2021-04-15
  • 来自专栏《ATT&CK视角下的红蓝攻防对抗》

    Windows WMI 详解之WMI远程交互

    我们可以通过在Powershell中使用Test-WSMan函数来验证目标是否已经配置了WinRM。如果Test-WSMan返回了如图1-1所示的信息,则表示目标系统中的WinRm服务处于监听状态。

    1.3K10编辑于 2024-01-29
  • 来自专栏Windows技术交流

    基于Packer打包Windows镜像的避坑指南

    as it throws an error $ErrorActionPreference = "Continue" # Remove HTTP listener Remove-Item -Path WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan winrm start= auto winrm quickconfig -q -force 2>&1 > $null winrm quickconfig -q 2>&1 > $null Set-Item WSMan New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" New-Item -Path WSMan winrm start= auto winrm quickconfig -q -force 2>&1 > $null winrm quickconfig -q 2>&1 > $null Set-Item WSMan

    93710编辑于 2025-08-15
  • 来自专栏FreeBuf

    如何使用CIMplant收集远程系统中的数据并执行命令

    通常,WMI使用DCOM作为通信协议,而CIM使用的是WSMan(或WinRM)。对于DCOM,我们可以做的第一件事是通过端口135寻找初始TCP连接。然后,连接和接收系统将决定使用一个新的端口。 对于WSMan,初始TCP连接使用的是端口5985。 接下来,你需要在事件查看器中查看Microsoft Windows WMI活动/跟踪事件日志。

    1.7K30发布于 2021-07-02
  • 来自专栏林德熙的博客

    dotnet core 使用 PowerShell 脚本

    程序然后安装下面几个 Nuget 库 Microsoft.PowerShell.Commands.Diagnostics Microsoft.PowerShell.SDK Microsoft.WSMan.Management

    1.5K10编辑于 2022-08-04
  • 来自专栏Ms08067安全实验室

    如何在远程系统执行程序

    实现在目标主机远程执行程序后,可对目标主机开放powershell remoting,用作远程连接 条件: 远程连接会有痕迹 本机要开启winRM服务 命令汇总: 列出所有远程信任主机 powershell Get-Item WSMan :\localhost\Client\TrustedHosts设置信任所有主机 powershell Set-Item WSMan:\localhost\Client\TrustedHosts -Value

    2K20发布于 2019-12-18
领券