# Local Privilege Escalation using System Clean-up functionality

Acronis True Image's System Clean-up followed directory junctions, letting a low-priv user delete arbitrary protected files like C:\Windows\System32\drivers\etc\hosts.

- Payout: $250
- Severity: medium
- Program: Acronis
- Found by: z3ron3
- Disclosed: 2024-08-27
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/996576
- Library page: https://bugbountylibrary.com/r/h1%3A996576
- Tags: area:os domain:desktop impact:integrity impact:privesc kind:bounty platform:hackerone sev:medium tech:windows technique:race-window vuln:misconfiguration vuln:path-traversal vuln:privilege-escalation

**Target:** Acronis True Image 2021 System Clean-up (TrueImageTools.exe)
**Root cause:** The privileged clean-up service resolves and deletes paths under user-writable Temp without rejecting directory junctions, so a junction redirects deletion to arbitrary protected directories.
**Steps:**
1. `mkdir %userprofile%\AppData\Local\Temp\deleteme`
2. Open System Clean-up, select the deleteme folder under Temporary files
4. `rmdir /S /Q %userprofile%\AppData\Local\Temp\deleteme`
5. `mklink /J %userprofile%\AppData\Local\Temp\deleteme C:\Windows\System32\drivers\etc`
5. Click Clean-up; TrueImageTools.exe deletes contents of the junction target
6. For single-file deletion: create `deleteme\hosts`, select it, replace folder with junction, run `python flock.py C:\Windows\System32\drivers\etc\hosts` to hold handles on other files, click Clean-up, choose Ignore All so only hosts is deleted
**How found:** Researcher noted the software defends against symlink attacks but reasoned that NTFS directory junctions are a distinct reparse-point type likely not covered, then tested by substituting a junction for the selected Temp folder.
**Exploitation:** A standard user plants a directory junction in their own Temp folder pointing at a privileged directory, then triggers the elevated System Clean-up. The privileged process follows the junction and deletes files it otherwise could not, enabling deletion of system files (e.g. hosts, drivers\etc contents) as a privilege escalation / DoS primitive.
**Escalation:** The flock.py handle-holding trick narrows deletion to a single chosen file, allowing targeted removal of specific protected files rather than whole directories.
**Insight:** When a privileged cleaner/installer claims symlink protection, test other reparse-point types (directory junctions, mount points) and use handle-locking (flock) to isolate deletion of a single target file inside a protected directory.

## Proof of concept (copied exactly from the original report)

**Directory junction to System32 etc then cleanup**

````
mklink /J %userprofile%\AppData\Local\Temp\deleteme C:\Windows\System32\drivers\etc```

{F1011683}

[ 6 ] - Click on the **Clean-up** option in the System Clean-up window.
````

**Python flock.py to delete single hosts file**

````
python flock.py C:\Windows\System32\drivers\etc\hosts```

{F1011787}

The python program will open a handle to all files except the target file and keep it open until user input is given which will prevent them from getting deleted.

[ 8 ] - Click on the **Clean-up** option in the System Clean-up window.
````

