ForeScout Secure Connector Local Privilege Escalation
The ForeScout Secure Connector logs directory allowed Everyone Full Control, letting a low-privileged user create a symbolic link so that log entries overwrote a system DLL. The attacker could then replace that DLL with a malicious one, gaining code execution as SYSTEM.
jordanpotti.com
Published on jordanpotti.com
Due to this, a low privileged user can create a symbolic link in the sc.log location, and point it at a privileged location such as c:\Windows\System32. The log entries will be created in a file at the receiving end of the symbolic link.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application stored its log file in a directory with overly permissive permissions (Everyone Full Control), allowing a low-privileged user to redirect writes via a symbolic link.
Impact
A low-privileged user could gain code execution as SYSTEM, but the attack requires the ability to create junctions and symbolic links and to wait for the spooler service to restart or reboot.
What the attacker needed
Low-privileged local user; ability to create junctions and symlinks; spooler service restart or reboot
The fix
The vulnerability was fixed by ForeScout in CounterACT version 8.1.4.
How it was found
- Observe that the SecureConnector creates a log file as SYSTEM in the ProgramData directory.
- Check the permissions of the Logs directory and find that Everyone has Full Control.
- Delete the Logs directory and create an NTFS junction pointing to \RPC Control\.
- Create a symbolic link named sc.log pointing to a target system DLL such as ualapi.dll.
- Wait for log entries to overwrite the target DLL, then replace it with a malicious DLL.
- Restart the spooler service or reboot to trigger execution of the malicious DLL as SYSTEM.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A program running with high privileges wrote its log file into a folder that any user could change. By making that log file actually point to an important system file, the attacker could overwrite it and then put their own malicious file in its place. When the system later loaded that file, the attacker's code ran with the highest permissions.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.