1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-05 17:35:28 +02:00
tldr/pages/common/nxc-ssh.md

26 lines
1.1 KiB
Markdown
Raw Normal View History

# nxc ssh
> Pentest and exploit SSH servers.
> See also: `hydra`.
> More information: <https://www.netexec.wiki/ssh-protocol>.
2025-05-04 20:03:26 +03:00
- Spray the specified password against a list of usernames on the specified target:
2025-05-04 20:03:26 +03:00
`nxc ssh {{192.168.178.2}} {{[-u|--username]}} {{path/to/usernames.txt}} {{[-p|--password]}} {{password}}`
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:
2025-05-04 20:03:26 +03:00
`nxc ssh {{192.168.178.2}} {{[-u|--username]}} {{path/to/usernames.txt}} {{[-p|--password]}} {{path/to/passwords.txt}}`
2025-05-04 20:03:26 +03:00
- Use the specified private key for authentication, using the supplied password as the key's passphrase:
2025-05-04 20:03:26 +03:00
`nxc ssh {{192.186.178.2}} {{[-u|--username]}} {{path/to/usernames.txt}} {{[-p|--password]}} {{password}} --key-file {{path/to/id_rsa}}`
2025-05-04 20:03:26 +03:00
- Try a combination of username and password on a number of targets:
2025-05-04 20:03:26 +03:00
`nxc ssh {{192.168.178.0/24}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}}`
- Check for `sudo` privileges on a successful login:
2025-05-04 20:03:26 +03:00
`nxc ssh {{192.168.178.2}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{path/to/passwords.txt}} --sudo-check`