
A Bind Shell Using the Fax Service and a DLL Hijack
A Proof-of-Concept bind shell using the Fax service and a DLL hijack based on Ualapi.dll.
See our writeup at: https://windows-internals.com/faxing-your-way-to-system/

Ualapi.dll and place in c:\windows\system32Fax service, which will load the DLL and call the export UalStart. UalStart will queue a thread pool work item that will open a handle to RpcSs, find a SYSTEM token, and then impersonate it. Afterward, it will create a socket on the local endpoint address, bind it to port 9299, and then asynchronously wait for a connection using a thread pool I/O completion port.nc(at).exe <ip> 9299) and then type let me in and press ENTER. If you're writing custom code, make sure to send the string let me in\n.Cmd.exe process under the DcomLaunch service with SYSTEM privileges, binding its input and output handles to the newly created socket.SYSTEM, reverting back to NETWORK SERVICE very quickly and after only doing one API call. This helps reduce the chance of getting caught by various scanners.DcomLaunch service (which is already a SYSTEM service) and not under the Fax service, making it look a lot more natural and avoiding a very suspicious-looking process tree.Fax service, and not to DcomLaunch or Cmd.exe. If we kill the Fax service it looks like socket belongs to System.This isn't meant to be a drop-in, undetectable, malicious, weaponized shell:
80 or 443 would work better.Spooler, also load Ualapi.dll. While the system behaves fine if the Fax service is "stuck" in the SERVICE_START_PENDING state, this will cause issues in Spoolsv.exe.