Rsync [873]

chevron-rightInfohashtag

Rsyncarrow-up-right is a fast and efficient tool for locally and remotely copying files. It can be used to copy files locally on a given machine and to/from remote hosts.

chevron-rightGuidehashtag

This guidearrow-up-right covers some of the ways Rsync can be abused, most notably by listing the contents of a shared folder on a target server and retrieving files. This can sometimes be done without authentication. Other times we will need credentials. If you find credentials during a pentest and run into Rsync on an internal (or external) host, it is always worth checking for password re-use as you may be able to pull down some sensitive files that could be used to gain remote access to the target.

chevron-rightNmap Rsynchashtag
z3tssu@htb[/htb]$ sudo nmap -sV -p 873 127.0.0.1
chevron-rightProbing for accessible shareshashtag

We can next probe the service a bit to see what we can gain access to.

Linux Remote Management Protocols

z3tssu@htb[/htb]$ nc -nv 127.0.0.1 873

(UNKNOWN) [127.0.0.1] 873 (rsync) open
@RSYNCD: 31.0
@RSYNCD: 31.0
#list
dev            	Dev Tools
@RSYNCD: EXIT
chevron-rightEnumerating Accessible Sharehashtag
rsync -av --list-only rsync://127.0.0.1/dev

rsync rsync://10.129.225.48/ --list-only
chevron-rightSyncing Shares to our Attacker Machinehashtag

we could sync all files to our attack host with the command

rsync -av rsync://127.0.0.1/dev.

If Rsync is configured to use SSH to transfer files, we could modify our commands to include the -e ssh flag, or -e "ssh -p2222" if a non-standard port is in use for SSH. This guidearrow-up-right is helpful for understanding the syntax for using Rsync over SSH.

chevron-rightDownloading Contents of a Sharehashtag

Last updated