2025-03-14 21:59:59 -06:00
|
|
|
# nxc winrm
|
|
|
|
|
|
|
|
|
|
> Pentest and exploit Windows Remote Management (winrm).
|
|
|
|
|
> More information: <https://www.netexec.wiki/winrm-protocol>.
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
- Search for valid credentials by trying out every combination in the specified lists of usernames and passwords:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nxc winrm {{192.168.178.2}} {{[-u|--username]}} {{path/to/usernames.txt}} {{[-p|--password]}} {{path/to/passwords.txt}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Specify the domain to authenticate to (avoids an initial SMB connection):
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nxc winrm {{192.168.178.2}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -d {{domain_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Execute the specified command on the host:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nxc winrm {{192.168.178.2}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -x {{whoami}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Execute the specified PowerShell command on the host as administrator using LAPS:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nxc winrm {{192.168.178.2}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} --laps -X {{whoami}}`
|