One port can be a costly mistake | Attack The Rsync Service in a Private Program
Published on medium.com
{{media:0}}
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a story about a private HackerOne program, which the author calls 'Target, Inc.' The scope contained about five wildcards. After working the subdomains, the author turned to the CIDR ranges that the program had also published as in-scope assets. The point of the article is that not every asset is a web application: one of the hosts in those ranges exposed an rsync service on a port the author did not commonly see, with no authentication, and the whole file system could be read through it.
Setup
The program was private, so the target is anonymised throughout. The scope had roughly 25 CIDR ranges, which the author collected into a text file called list_OfCIDRs.txt. The tools used were:
- subfinder, for subdomain collection, and deep reconnaissance on each subdomain before the CIDR work began.
- Naabu and Wappalyzer for fingerprinting subdomains, plus fuzzing and crawling.
- Masscan for the CIDR ranges, chosen because it is fast over a wide scope.
- Nmap for deeper enumeration of a single port.
- The rsync client itself, installed with
apt install rsync.
No credentials or accounts were needed at any point: the finding is entirely about unauthenticated access.
Finding it
Before the CIDR phase, the subdomain work had already produced some bugs (one valid, one duplicate, one informational). When the author came back to the program, the CIDR ranges stood out, and the question was why they had not been tested: not all assets are web apps.
For the fingerprinting phase the workflow was active. On subdomains it was Naabu and Wappalyzer followed by fuzzing and crawling one by one. On CIDRs it was Masscan, run per range rather than over the whole list at once. The general form of the command was:
masscan -p <port_numbers> <one_CIDR_range> --exclude <broadcast_IPs> --banners -oL <output.txt>
<port_numbers>: not all ports, because that is time and resource consuming. The author focused on the top 1000 ports (0 to 1024), added common default service ports such as 8080 and 8433, and manually added any default port seen in published write-ups or tips that was missing from the list.<one_CIDR_range>: one range at a time. Masscan's-iLcould takelist_OfCIDRs.txt, but the author preferred to work through the ranges individually.<broadcast_IPs>:[redacted].
The concrete run, starting from the first CIDR and repeated for each one, was:
masscan -p 8080,8001,3389,8009,1311,2480,4444,4445,3333,4567,5000,5001,5104,5800,7000,7001,7002,8008,8042,8088,8222,8243,8280,8281,8333,8530,8531,8887,8888,8443,8834,9080,9443,9981,12043,12046,16080,18091,10443,18092,1010,1311,2082,2087,2095,2096,3000,3128,4243,4711,4712,4993,5108,6543,7396,7474,8000,8001,8008,8014,8069,8080,8081,8090,8091,8118,8088,8123,8172,8500,8880,8800,8983,9000,9043,9060,9090,9091,9200,9800,12443,20720,28017,0-1024 111.222.333.444/24 --exclude [redacted] --banners -oL outputOf_111_222_333_444_24.txt
Most of the output was ordinary: ports 22, 80, 443 and similar across the assets. Then one port appeared that was not common to the author. The masscan output is shown without the timestamp column.
Putting that port into a browser did not work, so the next step was a deeper enumeration with Nmap:
nmap -sV -sC [redacted]
-sVenables service and version detection.-sCenables script scanning, to gather additional information about hosts and services.
The Nmap result identified the service as rsync. The IP addresses in the article are invented examples, not the real target.
Exploitation
rsync is described in the article as an open source utility that provides fast incremental file transfer. Reading a write-up by Nairuz Abulhul on attacking an insecure rsync service and obtaining a shell with SSH gave the author the idea of an RCE, but the path actually taken was simpler: enumeration of the shares.
Step 1: install the client
apt install rsync
Step 2: list the shares
If rsync returns the available directories and files without asking for authentication, the service allows anonymous unauthenticated access. The command used to check was:
rsync -a "rsyn://[redacted]/"
The result was a share named gentoo, with no authentication required. The author did not initially know what the name meant, and research showed it is the name of a Linux distribution; the share was a root directory.
Step 3: try to upload
Following the referenced write-up, the next check was upload permission. An empty file was created and pushed to the share:
touch sword0x00
rsync /root/sword0x00 [redacted]::gentoo/etc
This did not work. The author stopped, went back to the tool's documentation and read through the options and operators, and then reversed the direction of the test: if writing was not possible, what about reading?
Step 4: read a file
rsync [redacted]::gentoo/etc/passwd .
The syntax is rsync <destination> <source>. Here the source is the remote path [redacted]::gentoo/etc/passwd and the destination is the dot, meaning the current directory. The command returned the contents of /etc/passwd.
With read access to the share, a threat actor can read configuration, backups and sensitive data, or, as the author puts it, the entire file system. The severity was critical and the bounty was also maximum.
Root cause
The rsync daemon was reachable on a port the author found unusual, and its gentoo share could be listed without authentication. Because the module was exported without authentication, any client that could reach the port could list the module and pull files from it. The write attempt failed, so the module was read-only from the client's point of view, but read access alone was enough to expose the file system. The report does not describe the daemon's configuration file or how the module was set up, so the exact directives behind the exposure are not stated.
Impact
An unauthenticated attacker who can reach the port can read the entire file system exposed by the share: configuration files, backups and other sensitive data. In this program the severity was rated critical and the bounty was maximum. The impact depends on the host being reachable and on the module being exported without authentication; the author's write attempt was refused, so the demonstrated impact is disclosure rather than modification.
Fix
The report does not say what the program changed after the disclosure. The measures that follow from the finding are to stop exposing the rsync daemon to the internet, or to restrict it to known hosts, and to require authentication on any exported module instead of allowing anonymous access.
Variants to test
- Run Masscan over every in-scope CIDR, one range at a time, with the top 1000 ports plus common default service ports, and look for services that are not web servers. A positive result is a port whose banner or Nmap
-sVoutput identifies a file-transfer or remote-access service. - Run
nmap -sV -sCagainst any unusual open port. A positive result is a service name and version that matches a known unauthenticated daemon. - List shares with
rsync -a "rsyn://<host>/". A positive result is a module name returned without a password prompt. - Try to read a known file from the module, for example
rsync <host>::<module>/etc/passwd .. A positive result is file contents in the local directory. - Try to write to the module with a harmless empty file, as in the upload test above. A positive result is the file appearing on the remote side, which raises the impact from disclosure to modification.
- If the program is private or exclusive, monitor its CIDRs at least once per day, because the insider team may deploy new services and unauthenticated access may appear between visits. A positive result is a new port or service that was not present on the previous scan.

What happened, in plain words
A security researcher was taking part in a private bug bounty programme on HackerOne. Bug bounty programmes are schemes where organisations invite independent testers to look for security weaknesses in their systems and pay for the ones that are confirmed. This particular programme was private, meaning only selected researchers could see it, and the author calls it 'Target, Inc.' to keep it anonymous.
The programme's scope (the list of systems a researcher is allowed to test) contained about five wildcards. A wildcard is a notation that covers every subdomain of a domain, for example *.example.com covers shop.example.com, mail.example.com and so on. The scope also listed about 25 CIDR ranges. A CIDR range is a compact way of writing a block of IP addresses, the numeric addresses that identify machines on the internet. The author had already spent time on the subdomains and found some bugs, but then noticed the CIDR ranges and asked himself why he had not tested them. Not every asset is a web application: some machines run other kinds of services, and those services can be just as exposed.
He scanned those ranges for open ports. A port is a numbered channel on a machine; a web server usually listens on port 80 or 443, an email server on port 25, and so on. Most of what he found was ordinary. Then one port appeared that he did not recognise. He tried it in a browser and it did not work, which makes sense because it was not a web server. He ran a deeper scanning tool against it and learned that the service was rsync. rsync is a program for copying files between computers efficiently, and it can run as a server that offers shared folders, called modules or shares, to clients. The share he found was named gentoo and required no password at all. He could list it, and then he could download files from it, including /etc/passwd, a file that lists the users on a Linux system. In effect, he could read the entire file system of that machine. The severity was critical and the bounty was maximum.
The rest of this article walks through the same steps in the same order, explaining each concept from scratch.
Who the author is and why the story matters

The author introduces himself as Mohanad Hesham, also known as @sword0x00, a Master's student in Cybersecurity at uOttawa and a part-time bug bounty hunter. This is his first write-up. The story is about gaining access to the entire file system of a machine in a private programme on HackerOne.
A bug bounty hunter is someone who, outside a normal job, looks for security flaws in systems that organisations have agreed to have tested, and reports them in exchange for a reward. A write-up is a public account of a finding, usually with the technical details removed or anonymised, so that other researchers can learn from it.
Before the story: subdomains and CIDR ranges
The programme was private, so the target is called 'Target, Inc.' throughout. The scope had about five wildcards. The author used a tool called subfinder to gather subdomains, then did deep reconnaissance on each one. Reconnaissance means gathering information about a target before attacking it: what software it runs, what versions, what pages exist, what other machines it talks to. On the subdomains he found some bugs: one valid, one duplicate (someone else had already reported it) and one informational (a minor observation that is not a security flaw).
After a break he came back and noticed the CIDR ranges in the scope. He asked himself why he was not testing them, because not all assets are web apps. An asset is anything the programme says you may test: a website, a server, a mobile app, a network range. A CIDR range is a block of IP addresses written in a short form. For example, [redacted]/24 means all addresses from [redacted] to [redacted]. The /24 says how many addresses are in the block. The programme had prepared these ranges, and the author collected them into a text file called list_OfCIDRs.txt. There were approximately 25 CIDR ranges.
A useful everyday comparison: a subdomain is like a named shop in a shopping centre, while a CIDR range is like a whole postcode district. If you only visit the shops whose names you know, you miss every building that does not have a sign.
Fingerprinting and port scanning
Fingerprinting means finding out what technologies are running on a target: the software stacks, version numbers, running services and anything else that identifies what is on an endpoint. An endpoint is a single addressable thing, such as a host and port pair.
The author's workflow for subdomains was active: he used Naabu (a port scanner) and Wappalyzer (a tool that identifies technologies used by a website), then went deeper by fuzzing and crawling one by one. Fuzzing means sending many slightly different inputs to see how the system reacts. Crawling means following links automatically to map a site. For CIDR ranges, however, he used Masscan, because it is very fast over a large and wide scope. Masscan is a port scanner designed to scan huge numbers of addresses quickly.
The general form of the command was:
masscan -p <port_numbers> <one_CIDR_range> --exclude <broadcast_IPs> --banners -oL <output.txt>
Line by line:
masscanis the program being run.-p <port_numbers>tells it which ports to check. The angle brackets are placeholders: you replace them with real values.<one_CIDR_range>is the block of addresses to scan.--exclude <broadcast_IPs>tells Masscan to skip certain addresses. A broadcast address is a special address used to send a message to every machine on a network; scanning it is pointless and can cause noise.--bannersasks Masscan to grab a small piece of text that a service sends when you connect, called a banner. A banner often reveals the software name and version, like a shop sign.-oL <output.txt>writes the results to a file in list format.
The author did not scan all ports, because that is time and resource consuming. He focused on:
- The top 1000 ports, which in his list means ports 0 to 1024.
- Common default service ports such as 8080 and 8433, because services are sometimes launched on their default ports and should not be ignored.
- Any default port mentioned in published write-ups or tips that was missing from his list, added manually.
He preferred to work through the CIDR ranges one at a time rather than passing the whole list_OfCIDRs.txt with Masscan's -iL option. The concrete run, starting from the first CIDR and repeated for each one, was:
masscan -p 8080,8001,3389,8009,1311,2480,4444,4445,3333,4567,5000,5001,5104,5800,7000,7001,7002,8008,8042,8088,8222,8243,8280,8281,8333,8530,8531,8887,8888,8443,8834,9080,9443,9981,12043,12046,16080,18091,10443,18092,1010,1311,2082,2087,2095,2096,3000,3128,4243,4711,4712,4993,5108,6543,7396,7474,8000,8001,8008,8014,8069,8080,8081,8090,8091,8118,8088,8123,8172,8500,8880,8800,8983,9000,9043,9060,9090,9091,9200,9800,12443,20720,28017,0-1024 111.222.333.444/24 --exclude [redacted] --banners -oL outputOf_111_222_333_444_24.txt
What each part does:
-pis followed by a long comma-separated list of port numbers, ending with0-1024, which means every port from 0 to 1024 inclusive. This is the top 1000 ports plus the extra default ports the author added.111.222.333.444/24is the one CIDR range being scanned. The author notes that all IP addresses in the article are invented examples, not the real target.--exclude [redacted]skips the broadcast address.--bannersgrabs service banners.-oL outputOf_111_222_333_444_24.txtsaves the output to a file named after the range.
Most of the output was ordinary: ports 22, 80, 443 and similar across the assets. Port 22 is usually SSH (secure remote login), port 80 is plain web traffic, port 443 is encrypted web traffic. Then one port appeared that was not common to the author. The masscan output is shown without the timestamp column.
He put that port into a browser, but it did not work. That is expected: a browser speaks web protocols, and this service spoke something else. So he ran Nmap, a more detailed scanner, against the address:
nmap -sV -sC [redacted]
Line by line:
nmapis the program.-sVenables service and version detection: Nmap tries to work out which software is listening and which version it is.-sCenables script scanning, which runs a set of small built-in scripts to gather additional information about hosts and services.[redacted]is the address being examined. Again, this is an invented example.
The Nmap result identified the service as rsync. rsync is described in the article as an open source utility that provides fast incremental file transfer. Open source means the source code is publicly available. Incremental means it only copies the parts of files that have changed, which makes it fast. It can run as a daemon, a background server process, and offer shared directories called modules.
Enumerating and attacking the rsync service
Reading a write-up by Nairuz Abulhul about attacking an insecure rsync service and obtaining a shell with SSH gave the author the idea of a remote code execution (RCE) vulnerability. RCE means an attacker can run their own commands on the target machine. A shell is a command-line interface on the remote machine. But the path actually taken was simpler: enumeration of the shares. Enumeration means listing what a service offers, such as share names, users or files.
Step 1: install the client
apt install rsync
apt is the package manager on Debian and Ubuntu Linux systems. install rsync tells it to download and install the rsync program. The author needed the client on his own machine so he could talk to the remote rsync server.
Step 2: list the shares
If rsync returns the available directories and files without asking for authentication, the service allows anonymous unauthenticated access. Authentication means proving who you are, usually with a username and password. Anonymous means no identity is required at all.
The command used to check was:
rsync -a "rsyn://[redacted]/"
Line by line:
rsyncis the client program.-ais the archive option, which tells rsync to copy files recursively (including subdirectories) and preserve attributes such as permissions and timestamps. In this listing context it makes rsync behave in a convenient, complete way."rsyn://[redacted]/"is the address of the remote rsync service. The double slash after the address means the root of what the server offers. The address is an invented example.
The result was a share named gentoo, with no authentication required. The author did not initially know what the name meant. Research showed it is the name of a Linux distribution, and the share was a root directory. A Linux distribution is a packaged version of the Linux operating system, such as Ubuntu, Debian or Gentoo. A root directory is the top-level folder of a file system, from which all other folders branch out.
Step 3: try to upload
Following the referenced write-up, the next check was upload permission. If you can write files to a share, the impact is higher than if you can only read. He created an empty file and pushed it to the share:
touch sword0x00
touch creates an empty file if it does not exist, or updates its timestamp if it does. Here it creates a file named sword0x00 in the current directory.
rsync /root/sword0x00 [redacted]::gentoo/etc
Line by line:
rsyncis the client./root/sword0x00is the local source file./rootis the home directory of the root user on many Linux systems.[redacted]::gentoo/etcis the remote destination. The double colon::is rsync's syntax for connecting directly to an rsync daemon and naming a module. Here the module isgentooand the path inside it is/etc.
This did not work. The author stopped, went back to the tool's documentation and read through the options and operators, and then reversed the direction of the test: if writing was not possible, what about reading?
Step 4: read a file
rsync [redacted]::gentoo/etc/passwd .
Line by line:
rsyncis the client.[redacted]::gentoo/etc/passwdis the source. It names the remote daemon, the modulegentoo, and the file/etc/passwdinside it./etc/passwdis a text file on Linux that lists user accounts and some of their details. It does not contain passwords in the modern sense, but it is still sensitive because it reveals which users exist..is the destination, meaning the current directory on the local machine.
The syntax is rsync <destination> <source>. Here the source is the remote path and the destination is the dot. The command returned the contents of /etc/passwd.
With read access to the share, a threat actor can read configuration, backups and sensitive data, or, as the author puts it, the entire file system. A threat actor is anyone who might abuse the access, whether a criminal, a competitor or a curious outsider. Configuration files often contain passwords and keys; backups often contain copies of databases. The severity was critical and the bounty was the maximum for the programme. Severity is a rating of how serious a flaw is, often using a scale such as CVSS. A bounty is the money paid for a valid report.
Why it worked
The rsync daemon was reachable on a port the author found unusual, and its gentoo share could be listed without authentication. A daemon is a program that runs in the background and waits for connections. Because the module was exported without authentication, any client that could reach the port could list the module and pull files from it. The write attempt failed, so the module was read-only from the client's point of view, but read access alone was enough to expose the file system. The report does not describe the daemon's configuration file or how the module was set up, so the exact directives behind the exposure are not stated.
What the impact was
An unauthenticated attacker who can reach the port can read the entire file system exposed by the share: configuration files, backups and other sensitive data. In this programme the severity was rated critical and the bounty was maximum. The impact depends on the host being reachable and on the module being exported without authentication; the author's write attempt was refused, so the demonstrated impact is disclosure rather than modification. Disclosure means information is revealed; modification means data is changed.
How to fix it
The report does not say what the programme changed after the disclosure. The measures that follow from the finding are to stop exposing the rsync daemon to the internet, or to restrict it to known hosts, and to require authentication on any exported module instead of allowing anonymous access. Restricting to known hosts means only allowing connections from specific IP addresses, for example the company's own backup servers.
Variants to test
- Run Masscan over every in-scope CIDR, one range at a time, with the top 1000 ports plus common default service ports, and look for services that are not web servers. A positive result is a port whose banner or Nmap
-sVoutput identifies a file-transfer or remote-access service. - Run
nmap -sV -sCagainst any unusual open port. A positive result is a service name and version that matches a known unauthenticated daemon. - List shares with
rsync -a "rsyn://<host>/". A positive result is a module name returned without a password prompt. - Try to read a known file from the module, for example
rsync <host>::<module>/etc/passwd .. A positive result is file contents in the local directory. - Try to write to the module with a harmless empty file, as in the upload test above. A positive result is the file appearing on the remote side, which raises the impact from disclosure to modification.
- If the programme is private or exclusive, monitor its CIDRs at least once per day, because the insider team may deploy new services and unauthenticated access may appear between visits. A positive result is a new port or service that was not present on the previous scan.
Glossary
- Asset: anything the programme says you may test, such as a website, server, mobile app or network range.
- Authentication: proving who you are, usually with a username and password.
- Anonymous access: access without any identity or password.
- Banner: a short piece of text a service sends when you connect, often revealing its name and version.
- Bounty: the money paid for a valid security report.
- Broadcast address: a special address used to send a message to every machine on a network.
- Bug bounty programme: a scheme where organisations invite independent testers to find security weaknesses and pay for confirmed ones.
- CIDR range: a compact way of writing a block of IP addresses, such as
[redacted]/24. - Configuration file: a file that holds settings for a program, often including passwords or keys.
- Crawling: automatically following links to map a website.
- Critical: the highest severity rating, meaning the flaw can cause major damage.
- CVSS: a standard scale for rating the severity of security flaws.
- Daemon: a program that runs in the background and waits for connections.
- Disclosure: revealing information.
- Duplicate: a report of a bug that someone else has already reported.
- Endpoint: a single addressable thing, such as a host and port pair.
- Enumeration: listing what a service offers, such as share names, users or files.
- Fingerprinting: finding out what technologies are running on a target.
- Fuzzing: sending many slightly different inputs to see how a system reacts.
- HackerOne: a platform where organisations run bug bounty programmes.
- Incremental file transfer: copying only the parts of files that have changed.
- Informational: a minor observation that is not a security flaw.
- IP address: the numeric address that identifies a machine on the internet.
- Linux distribution: a packaged version of the Linux operating system, such as Ubuntu, Debian or Gentoo.
- Masscan: a very fast port scanner designed for large address ranges.
- Module: a shared directory offered by an rsync daemon.
- Naabu: a port scanner used for subdomains.
- Nmap: a detailed port and service scanner.
- Open source: software whose source code is publicly available.
- Port: a numbered channel on a machine that a service listens on.
- Private programme: a bug bounty programme visible only to selected researchers.
- Reconnaissance: gathering information about a target before attacking it.
- Remote code execution (RCE): a flaw that lets an attacker run their own commands on a target machine.
- Root directory: the top-level folder of a file system.
- rsync: an open source utility for fast incremental file transfer, which can run as a daemon offering modules.
- Scope: the list of systems a researcher is allowed to test.
- Severity: a rating of how serious a flaw is.
- Share: another name for an rsync module, a shared directory.
- Shell: a command-line interface on a machine.
- SSH: a protocol for secure remote login.
- Subdomain: a named part of a domain, such as
shop.example.com. - subfinder: a tool for collecting subdomains.
- Threat actor: anyone who might abuse access, whether criminal, competitor or curious outsider.
- Wappalyzer: a tool that identifies technologies used by a website.
- Wildcard: a notation covering every subdomain of a domain, such as
*.example.com. - Write-up: a public account of a security finding, usually anonymised.