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