repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
1026-pentesting-rusersd.mdMarkdown87 lines3.9 KiBrendered raw download
---
title: "1026 - Pentesting Rusersd"
section: "Network Services"
sectionSlug: "network-services-pentesting"
sourcePath: "src/network-services-pentesting/1026-pentesting-rusersd.md"
sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/1026-pentesting-rusersd.md"
sha: "188de82beb54e70956b2952367a0af91d26758b8"
isIndex: false
modified: true
license: "CC-BY-NC-4.0"
---

# 1026 - Pentesting Rusersd

## Basic Information

`rusersd` is a legacy SunRPC/ONC RPC service that answers `rusers` queries and returns `who`-style information about users currently logged in to the target. In long format this can reveal the username, hostname, TTY, login time, idle time, and sometimes the remote host the session came from, which is enough to identify real usernames, active sessions, and interesting pivot hosts.<sup>[[1]](#references)</sup>

Although this page is named after **port 1026**, `rusersd` is usually **not** a fixed `1026/tcp` or `1026/udp` service. In practice it is normally discovered through **rpcbind/portmapper** as RPC program **`100002`**, often exposing versions **2** and **3** over UDP and sometimes TCP on dynamically assigned high ports.<sup>[[2]](#references)</sup>

If you haven't mapped the RPC programs yet, start with [Pentesting Portmapper / RPCBind](/hacktricks/network-services-pentesting/pentesting-rpcbind).

![1026 - Pentesting Rusersd: This protocol will provide you the usernames of the host. You may be able to find this services listed by the port-mapper service like this](https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/188de82beb54e70956b2952367a0af91d26758b8/src/images/image%20%281041%29.png)

## Enumeration

### Discover it behind rpcbind

```bash
rpcinfo -p <target> | grep -i rusersd
# or
nmap -sV -p 111 --script rpcinfo <target>
```

The interesting part of the output is the RPC program number, supported versions, transport, and the real high port assigned by `rpcbind`.<sup>[[2]](#references)</sup>

```bash
100002  2,3  32776/udp  rusersd
100002  2,3  32780/tcp  rusersd
```

### Query a single host

```bash
apt-get install rusers
rusers -l <target>
rusers -al <target>
```

`-l` requests the long listing, which is the most useful mode during a pentest because it exposes the TTY, login timestamp, idle time, and remote origin host when available. `-a` is useful when you want to confirm that the daemon responds even if nobody is currently logged in.<sup>[[1]](#references)</sup>

Example:

```bash
root@kali:~# rusers -l 192.168.10.1
Sending broadcast for rusersd protocol version 3...
Sending broadcast for rusersd protocol version 2...
tiff       potatohead:console         Sep  2 13:03   22:03
katykat    potatohead:ttyp5           Sep  1 09:35      14
```

### Broadcast the local segment

If no host is specified, `rusers` queries the local network and waits briefly for late responses, which makes it useful for quickly identifying legacy UNIX hosts on the same broadcast domain.<sup>[[1]](#references)</sup>

```bash
rusers -a
rusers -al
rusers -h
rusers -il
```

Useful flags:<sup>[[1]](#references)</sup>

- `-a`: Print hosts that answer even when no one is logged in.
- `-h`: Sort results by hostname.
- `-i`: Sort by idle time to quickly spot active sessions.
- `-l`: Print the long `who`-style listing.

### Offensive use of the output

Treat `rusersd` as a **username and session-intelligence leak**, not just as a banner grab. Low-idle sessions often point to real operators or admins currently working on the system, while the optional remote-host field can reveal jump boxes, trusted workstations, or naming conventions worth reusing against SSH, NFS, NIS/YP, or other legacy RPC services on the same environment.<sup>[[1]](#references)</sup>

## References

- [1] [OpenBSD `rusers(1)` manual page](https://man.openbsd.org/rusers.1)
- [2] [Nmap `rpcinfo` NSE script documentation](https://nmap.org/nsedoc/scripts/rpcinfo.html)