2024-08-10 10:11:43 +02:00
|
|
|
# nxc smb
|
|
|
|
|
|
|
|
> Pentest and exploit SMB servers.
|
|
|
|
> More information: <https://www.netexec.wiki/smb-protocol>.
|
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
- Search for valid domain credentials by trying out every combination in the specified lists of usernames and passwords:
|
2024-08-10 10:11:43 +02:00
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
`nxc smb {{192.168.178.2}} {{[-u|--username]}} {{path/to/usernames.txt}} {{[-p|--password]}} {{path/to/passwords.txt}}`
|
2024-08-10 10:11:43 +02:00
|
|
|
|
|
|
|
- Search for valid credentials for local accounts instead of domain accounts:
|
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
`nxc smb {{192.168.178.2}} {{[-u|--username]}} {{path/to/usernames.txt}} {{[-p|--password]}} {{path/to/passwords.txt}} --local-auth`
|
2024-08-10 10:11:43 +02:00
|
|
|
|
|
|
|
- Enumerate SMB shares and the specified users' access rights to them on the target hosts:
|
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
`nxc smb {{192.168.178.0/24}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} --shares`
|
2024-08-10 10:11:43 +02:00
|
|
|
|
|
|
|
- Enumerate network interfaces on the target hosts, performing authentication via pass-the-hash:
|
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
`nxc smb {{192.168.178.30-45}} {{[-u|--username]}} {{username}} {{[-H|--hash]}} {{NTLM_hash}} --interfaces`
|
2024-08-10 10:11:43 +02:00
|
|
|
|
|
|
|
- Scan the target hosts for common vulnerabilities:
|
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
`nxc smb {{path/to/target_list.txt}} {{[-u|--username]}} '' {{[-p|--password]}} '' {{[-M|--module]}} zerologon {{[-M|--module]}} petitpotam`
|
2024-08-10 10:11:43 +02:00
|
|
|
|
|
|
|
- Attempt to execute a command on the target hosts:
|
|
|
|
|
2025-05-04 20:03:26 +03:00
|
|
|
`nxc smb {{192.168.178.2}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -x {{command}}`
|