Linux Remote Protocols
Overview
Linux systems commonly use various remote management protocols for secure access and file transfer. These protocols enable remote administration, file synchronization, and system management across networks.
SSH (Secure Shell)
Overview
SSH (Secure Shell) is a network protocol that enables secure network communication and remote access to network services. It uses encryption to secure the communication channel between client and server.
Key Characteristics:
Port 22: Default SSH port
Authentication: Public key, password, or certificate-based
Encryption: AES, 3DES, ChaCha20-Poly1305
Integrity: HMAC-SHA256, HMAC-SHA1
Key Exchange: Diffie-Hellman, ECDH
SSH Features
Secure Remote Access: Encrypted terminal sessions
File Transfer: SCP and SFTP protocols
Port Forwarding: Local and remote port forwarding
Tunneling: Secure tunneling of other protocols
X11 Forwarding: Remote GUI application access
SSH Authentication Methods
SSH Configuration
SSH Enumeration
SSH Security Issues
Weak Authentication: Default or weak passwords
Key Management: Unprotected private keys
Configuration: Insecure SSH daemon settings
Brute Force: Password guessing attacks
Version Vulnerabilities: Outdated SSH versions
Rsync
Overview
Rsync is a utility for efficiently transferring and synchronizing files between computers. It uses the rsync protocol to transfer only the differences between files, making it bandwidth-efficient.
Key Characteristics:
Port 873: Default rsync daemon port
Protocol: Custom rsync protocol over TCP
Efficiency: Delta-sync algorithm (only transfers changes)
Authentication: Module-based access control
Encryption: Can tunnel through SSH
Rsync Modes
Local
Files on same machine
rsync source destination
Remote Shell
SSH/RSH transport
rsync -e ssh source user@host:dest
Rsync Daemon
Native rsync protocol
rsync source rsync://host/module
Rsync Configuration
Rsync Enumeration
Rsync Security Issues
Anonymous Access: Unauthenticated access to shares
Information Disclosure: Directory listings and file access
Data Exfiltration: Ability to download sensitive files
Configuration: Overly permissive access controls
Network Exposure: Rsync accessible from untrusted networks
R-Services (RSH, RCP, RLOGIN)
Overview
R-Services are a suite of remote access services developed for Unix systems. They provide remote shell access, file copying, and remote login capabilities. WARNING: R-Services are inherently insecure and should not be used in production environments.
R-Service Components
RSH
514
Remote shell execution
RCP
514
Remote file copy
RLOGIN
513
Remote login
R-Service Authentication
R-Services use host-based authentication through:
.rhosts: Per-user access control/etc/hosts.equiv: System-wide access controlTrusted hosts: IP-based authentication
R-Service Configuration Files
R-Service Enumeration
R-Service Security Issues
No Encryption: All communication in plain text
Weak Authentication: Host-based authentication only
Information Disclosure: Verbose error messages
Privilege Escalation: Potential for root access
Network Sniffing: Credentials transmitted in clear text
Advanced Enumeration Techniques
SSH Advanced Enumeration
SSH Brute Force
Rsync Advanced Enumeration
R-Service Exploitation
Practical Examples
HTB Academy Style SSH Enumeration
HTB Academy Style Rsync Enumeration
HTB Academy Lab Questions Examples
Security Assessment
SSH Security Assessment
Rsync Security Assessment
R-Service Security Assessment
Enumeration Checklist
SSH Enumeration
Rsync Enumeration
R-Service Enumeration
Common Vulnerabilities
SSH Vulnerabilities
CVE-2018-15473: OpenSSH user enumeration
CVE-2016-10009: OpenSSH privilege escalation
CVE-2008-5161: OpenSSH client vulnerability
Rsync Vulnerabilities
CVE-2014-9512: Rsync path traversal
CVE-2011-1097: Rsync daemon security bypass
R-Service Vulnerabilities
Inherent Design Flaws: No encryption, weak authentication
CVE-1999-0651: R-Services buffer overflow
CVE-1999-0025: R-Services authentication bypass
Tools and Techniques
SSH Tools
Rsync Tools
R-Service Tools
Defensive Measures
SSH Hardening
Rsync Security
R-Service Mitigation
Best Practices
SSH Best Practices
Use key-based authentication only
Disable root login
Change default port
Use fail2ban for brute force protection
Regular security updates
Monitor SSH logs
Rsync Best Practices
Use authentication and encryption
Restrict network access
Use read-only shares when possible
Monitor rsync logs
Regular security audits
R-Service Recommendations
Do not use R-Services in production
Replace with SSH
Disable all R-Services
Use secure alternatives
Regular security assessments
Last updated