DEV Community

Ioneyrezende
Ioneyrezende

Posted on

Inside GreedyRat persistence: reading the systemServer service slots

Inside GreedyRat persistence: reading the systemServer service slots

GreedyRat is designed to keep its services running. XLab described a HidConfig-driven deployment system that downloads services into numbered slots, starts them, guards them, and removes unused slots. Deleting one file may therefore leave the device ready to restore the same activity after a restart or command.

XLab explains that each configuration entry includes a download URL, MD5 value, run type, build version, and hidden launch data. The program maps the run type to a directory named systemServer<type> under /data/adb/prebuilt/nc, writes a .lock file, and starts the service through a hidden main executable. If a process exits, it is restarted after a random backoff of 10 to 20 minutes.

This persistence model matters for incident response and detection. It gives the investigator concrete directories and naming patterns to look for, while also warning that those names may vary or be cleaned up as slots change.

Understand the service-slot model

The botnet receives a HidConfig object from s.aibigdatausa.com/ipfly/api/getHideSh. The runSh list describes the services to run. XLab identified 15 monetization SDK platforms and reported six to eight services configured on each device. The system uses fixed slots and removes services that are no longer listed.

When the main binary starts without arguments, it downloads a version from oss.aibigdatausa.com and saves it as /data/adb/prebuilt/binary before starting cloud-phone mode. Other modes start SOCKS5 and HTTP proxy services, collect device information, and connect to the MQTT control server.

The implication is that investigators should not look only for a single hash. Examine the service manager, hidden configuration, numbered directories, .lock and version files, main executable, and update mechanism that can restore them.

Preserve before you clean

Before removing anything, capture the file listing, hashes, package list, running processes, network sockets, relevant logs, and boot state. Record whether each service is active or only stored. A directory with no running process may still reveal how the device was controlled or which SDKs were configured.

Avoid executing unknown binaries or shell scripts on a production workstation. Use an isolated analysis environment. If the device cannot provide reliable output, photograph the management screen and preserve network evidence rather than interacting with suspicious interfaces.

Build host detections carefully

A process name such as systemServer7 can be a useful lead, but it may also resemble legitimate system components on a customized Android build. Combine the name with its parent process, executable path, .lock files, network connections, and unexpected package or user changes. Do not create a production alert that fires only on the string systemServer.

The path /data/adb/prebuilt is also meaningful in this report, but its presence alone needs context. Emulator tools, test devices, or vendor utilities may use similar directories. Verify the device's intended function and compare the file hash with the published samples.

XLab also documented remote commands that can stop or update the daemon. A clean process list can be temporary. Look for the scheduler, restart logic, and update path, not just the currently visible process.

Use network evidence to test persistence

After the device restarts, check whether the suspicious process or proxy service returns. Observe DNS, broker connections, and outbound sessions over a sufficient window. If a service returns after ten to twenty minutes, the restart behavior described by XLab may be relevant, although the exact delay should be verified on the device.

External search can help find candidate assets, not persistence. The stored ZoomEye title="Android TV" query returned 1,555 public observations, and the five-model title query returned 27. Those results do not show that any path exists on a device. They only narrow the population that may deserve authorized inspection.

Rebuild or monitor

If persistence cannot be explained and removed with confidence, rebuild from a trusted firmware image or replace the device. Re-enrolling the old system without verifying its boot chain can recreate the problem. If replacement is not immediate, isolate the device and alert on any return of the broker destinations or service-slot files.

On managed fleets, record the observed artifacts and their context. Remove the alert only after the device has rebooted, remained isolated for the agreed period, and shown no recurrence. The evidence should identify the service manager, the launch path, the network session, and the recovery result.

GreedyRat's persistence architecture is more valuable to study than a single indicator. It shows how a compromised device can become a durable container for monetization services. Investigators who preserve the service-management layer have a better chance of removing the capability rather than only the visible symptom.

References

Top comments (0)