SSH
Secure Shell Protocol - Port 22
Key Generation
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"ssh-keygen -t ed25519ssh-keygen -t ecdsa-skFIDO/U2F NO-TOUCH MODE
ssh-keygen -O no-touch-required -t ed25519-skno-touch-required sk-ssh-ed25519@openssh.com AAAAInN... user@example.comEnumeration
ssh-keygen -C "$(whoami)@$(uname -n)-$(date -I)"ssh-keygen -l -f public_keyPassword Spray
nxc ssh <IP> -u <USER> -p 'password'nxc ssh 10.10.10.229 -u usersList -p 'Password' --continue-on-successnmap -n -p22 --script ssh-brute --script-args userdb=usernames.txt,passdb=passwords.txt <IP>Troubleshooting
SSH2_MSG_KEX_ECDH_REPLY error:
ssh -o MACs=hmac-sha2-256 <HOST>Sometimes the
/etc/hosts.allowor/etc/hosts.denymay be configured to blacklist or whitelistIPstrying to connect to the server:
ALL : 10.10.16.8
Add that in the
/hosts.allowfile; make sure to let a blank line at the end.sshd_wlis the syslink tohost.allowand is normally in.ssh
In recent versions of
OpenSSH, certain older key types likessh-rsahave been deprecated because of security concerns with theSHA-1hash algorithm they use:
ssh root@10.10.10.34 -i id_rsa -o PubkeyAcceptedKeyTypes=ssh-rsaOpenSSH Vulnerabilities
RsaCtfTool
RSA attack tool(mainly for ctf) - retrieve private key from weak public key and/or uncipher data.Install
libmpc-dev,libgmp3-devandsagemathAlso recommend to use a virtual environment
RsaCtfTool/RsaCtfTool.py --publickey decoder.pub --decryptfile pass.cryptCVE-2008-0166
Debian OpenSSL Predictable PRNG-> Check the repoLook for matches for a given
public_key:
grep -R -n `cat public_key` rsa/Last updated