How Nightwatch caught a trojanized FileZilla two weeks before threat intel flagged it.
Written by detections.ai · Organizer

DLL side-loading hides malware inside a program people already trust. The attacker leaves the real, signed program untouched and puts a library beside it with a name the program asks for.
Windows then loads the planted file from the program's own folder, and the malware runs inside a process with a clean signature.
Today, we’ll take a look at a Nightwatch hunt that started with an Intel Exchange report that covered a different threat. Nightwatch was ran against a Threat Report on the Intel Exchange about Luna Moth, a callback-phishing crew that talks employees into installing remote-access tools and then copies data out to cloud storage. To test it, Nightwatch checked where the company's file-transfer tools were connecting, looking for:
…a file-transfer tool calling a server that is considered rare for the host.
As it turned out, two copies of FileZilla were doing exactly that. Each ran from an employee's own profile, loaded an unsigned library named zlib1.dll and called an Amazon API Gateway address every day. About 40 other FileZilla installs at the company never called one.
No SIEM or EDR alert named the activity when Nightwatch reported it. A threat intelligence indicator tied one of the servers to an identified threat group on November 1, two weeks later, when the implant's last successful connection to it was already two weeks old. Alerts caught up within days.
The figure below shows how the hunt got from a phishing report to the implant:

Why a signed program makes a good hiding place
Side-loading is an old technique, tracked by MITRE ATT&CK as Hijack Execution Flow: DLL (T1574.001), and FileZilla has carried it this year. In March, Malwarebytes described a trojanized FileZilla on a fake download site: the genuine application with one malicious DLL added to its folder.
In September, Unit 42 described a fake IT-support campaign that dropped signed programs, FileZilla among them, beside a planted DLL that kept its command channel open to an AWS API Gateway endpoint.
Both used different DLL names from this case, and nothing here ties the two PCs to either campaign. The Sauron Loader report on the Intel Exchange pairs the same IT-support social engineering with a side-loaded signed program and has community detections attached.
Defenders usually look for signed programs loading unsigned DLLs from user folders, a noisy search because ordinary per-user apps do it every day. Default API Gateway endpoints all share Amazon's execute-api.amazonaws.com domain, so blocking the domain isn't an option either. Nightwatch came at it from a telemetry side
Check where the transfer tools connect
The first hunt executed by Nightwatch found no sign of Luna Moth. Rclone never ran on a Windows machine, and the WinSCP and FileZilla runs were scheduled transfers and staff using the company's FTP server. Nightwatch kept five of the hunt's searches running every six hours for a week.
The next day, one of those searches returned new WinSCP and FileZilla telemetry. Most were routine, such as an employee opening the installed FileZilla to reach the company FTP server, as in days past. To rule out cloud storage, Nightwatch listed where transfer tools on those hosts had connected over the previous two days.
Follow FileZilla to Amazon
On two corporate PCs, FileZilla had been reaching Amazon API Gateway hosts. Going back a month, Nightwatch found the same per-user copy of FileZilla 3.70.6 in each user's AppData folder, calling its gateway every day. No other FileZilla install in the fleet contacted API Gateway at all.
Next, Nightwatch checked the program itself. The per-user filezilla.exe carried a valid signature, like the copies in Program Files, so Nightwatch reasoned that the traffic had to come from a library (DLL) it loaded.
Read what the program loads
The module list answered it and this was where it started to appear malicious. FileZilla was loading an unsigned zlib1.dll from its own folder, with a renamed zlib2c.dll beside it signed by FileZilla's author.
That is the layout of a proxy side-load. The planted library takes the name the program asks for and usually passes the program's normal calls through to the real one, so FileZilla keeps working as normal. The unsigned zlib1.dll appeared on no other machine which performing comparative analysis to similar hosts.
Test the spread
Nightwatch then asked which machines and processes had ever reached either gateway host or loaded the library. The answer was the same two PCs, each with its own gateway hostname, and nothing else in the fleet back a month.
It also looked for how the copies arrived, through file writes into the FileZilla folder and autorun entries pointing at it. None appeared in the month of records, so the install predates the window or was never recorded.
Nightwatch reported a side-loaded FileZilla beaconing to AWS API Gateway on two PCs at high severity, with an impact report: isolate both PCs and collect the FileZilla folders.
Keep watching after the report
When malware is identified, it’s also critical to identify potential persistence mechanisms present on the host. Both copies made their last successful connection on October 18, the day after the report. One PC went on looking up its gateway hundreds of times a day with failed answers, an implant still retrying.
Weeks later, a later hunt flagged the laptop again, and the team opened an incident from that report the same day. The indicator for one gateway was published on November 1, and from November 4 alerts matched the activity, starting with a threat intelligence match on the DLL.
The threat was identified as a true positive and both PCs looked up their gateways again over the next two days, and once again the laptop started the side-loaded FileZilla process.
Tell a trojanized program from a per-user install
Signed programs in user folders with unusual DLLs beside them are common. A two-week sweep of rare DLLs in user folders at this company turned up Git for Windows, Python, Firefox, Citrix Workspace, LINE and Opera, each DLL written by the app's own installer or updater. These signals set the trojanized copy apart:
• The DLL's signature against its neighbors. The program and the renamed zlib were signed by FileZilla's author, and zlib1.dll had no signature. The other FileZilla installs all loaded one standard zlib1.dll.
• A renamed copy of the real library. A second zlib with an odd name sitting beside the program is the proxy layout.
• Who wrote the file. Legitimate per-user apps write their DLLs through their own installer or updater. Nothing recorded wrote this one.
• Where the program talks. FileZilla elsewhere in the fleet never contacts API Gateway. Here, within two seconds of starting, it reached a gateway host that no other device had reached.
Turn the finding into coverage
The later hunts added detection proposals, and two passed every check, including a second review.
• Look-alike DLL, then a rare destination. This one separates best. A program in a user folder loads an unsigned DLL found on that device alone, where the same program loads a standard copy everywhere else, then connects within seconds to a host no other device reaches. Run against a month of the team's telemetry, it caught the laptop's FileZilla, and the review found it keyed on behavior, with none of this case's indicators.
• Re-check old traffic when new indicators arrive. Indicators often land weeks after the traffic they describe. This proposal joins current actor-attributed indicators to a month of connections from user-folder programs, so a new indicator still finds a beacon that stopped weeks ago. Back a month, it caught the desktop's FileZilla and its gateway.
Evidence scope
The material establishes that:
• A per-user FileZilla on two PCs loaded an unsigned zlib1.dll next to a renamed, signed copy of the real library.
• Both copies called their own Amazon API Gateway host every day until October 18, then kept trying to resolve it for weeks.
• No other device reached those hosts or carried the DLL in the month searched.
• No SIEM or EDR alert named the activity when Nightwatch reported it.
• The side-loaded FileZilla ran again after the team closed the incident.
It doesn't establish how the copies arrived or what the implant did beyond calling home, including whether data left, since bytes sent on allowed connections aren't recorded. The FileZilla folders and file-creation records older than a month would settle that.
The indicator links one gateway to a tracked threat group, and nothing here links the PCs to Luna Moth.
Examine signed programs in your own telemetry
Adaptive Threat Discovery used the Luna Moth report as a place to start. When the transfer-tool search turned up something the report never described, Nightwatch followed it and found the implant from its behavior, two weeks before an indicator for its server existed.
The free Nightwatch Risk Assessment includes a 30-day backtest of available telemetry. For this behavior, a good first question is which signed programs in your users' folders load a DLL that nothing else in your fleet loads.
Talk to us about a free Nightwatch Risk Assessment.


