Let’s Learn: Trickbot Banking Trojan Adds Credential Stealer to Inject Module & Targets Windows 10 Edge Browser

Goal: Reverse the latest Trickbot’s module called “testnewinj32Dll” and its methods to steal authentication banking data via methods known as webinjects, web fakes, and redirection attacks.
Source (*already decoded modules):

While analyzing one of the latest Trickbot group tag “mac1” email spam campaign (subject: “Emailed Invoice – {rand}”) with @James_inthe_box, identified a newly deployed “testwebinj32Dll,” which was meant to substitute the previous “inject32Dll” module.
The new decoded module contains four usual Trickbot exported functions:

  • Start
  • Control
  • FreeBuffer
  • Release
The observed Trickbot main config module was as follows:
If we compare the older “inject32Dll” and “newtestinj32Dll,” we observe the new added functions targeting Google Chrome, Mozilla Firefox, Internet Explorer, and Microsoft Edge.

The new observed methods in the testnewinj3Dll module are as follows:
I. Internet Explorer browser credential grabber
Obtains login data from from Internet Explorer in from the registry key HKCU\Software\Microsoft\Internet Explorer\IntelliForms\Storage2 based on the key Microsoft_WinInet_* (format: %2.2X)
II. Google Chrome browser credential grabber
Obtains login data from Google Chrome browser in %APPDATA%\Google\Chrome\User Data\Default:
\Login Data.bak:
select origin_url, username_value, password_value, length(password_value) from logins where blacklisted_by_user = 0
select u.url,v.visit_time from visits as v join urls as u on u.id = v.url
III. Microsoft Edge browser credential grabber
Obtains login data from the latest Windows 10 using native undocumented functions of Windows Vault API to enumerate and extract credentials stored by Microsoft Windows Vault.
IV. Mozilla Firefox browser credential grabber
Obtains Mozilla Firefox credentials in %APPDATA%\Mozilla\Firefox\Profiles:
  • “hostname”:”
  • “encryptedUse:”
  • rname”:”
  • “encryptedPassword”:”
  • select url, last_visit_date from moz_places where last_visit_date > 0 order by last_visit_date desc
Primer on Trickbot Injects
Trickbot targets the following processes:
  • chrome.exe
  • iexplore.exe
  • firefox.exe
  • microsoftedgecp.exe
  • runtimebroker.exe
Trickbot’s reflective injection works as follows:
  • Open target process and allocate memory address in remote process via VirtualAllocEx
  • Copy function WriteProcessMemory into the allocated memory space
  • Copy shellcode WriteProcessMemoryinto the allocated memory space
  • Call FlushInstructionCache API to make sure our changes are written right away
  • Call inject RemoteThread functioncall
  • Call ResumeThread
  • Else, call undocumented API function RtlCreateUserThreadto start execution in the remote process, using the offset address of the reflective loader function as the entry point

Hooks Internet Explorer and Microsoft Edge in wininet.dll library API calls:
  • HttpSendRequestA
  • HttpSendRequestW
  • HttpSendRequestExA
  • HttpSendRequestExW
  • InternetCloseHandle
  • InternetReadFile
  • InternetReadFileExA
  • InternetQueryDataAvailable
  • HttpQueryInfoA
  • InternetWriteFile
  • HttpEndRequestA
  • HttpEndRequestW
  • InternetQueryOptionA
  • InternetQueryOptionW
  • InternetSetOptionA
  • InternetSetOptionW
  • HttpOpenRequestA
  • HttpOpenRequestW
  • InternetConnectA
  • InternetConnectW 
Hooks Mozilla Firefox Browser in nspr4.dll library API calls:
  • PR_OpenTCPSocket
  • PR_Connect
  • PR_Close
  • PR_Write
  • PR_Read 
Hooks Chrome in chrome.dll library API calls:
  • ssl_read
  • ssl_write
Template webinject configuration in XML format is as follows:
Since Windows 10 comes with a new browser, “Microsoft Edge,” Trickbot operators need their banking Trojan to operate on that software. To implement form grabbing and webinjections in the Windows 10 Edge browser, Trickbot’s rogue rtlbroker hooks the microsoftedgecp.exe process. Normally, runtimebroker.exe is the parent process of the Microsoft Edge browser on Windows 10 machines. 
The following four API calls being hooked are in child Microsoft Edge via rogue rtlbroker.dll allowing Trickbot operators to intercept and manipulate Microsoft Edge calls:
  • CreateProcess
  • CreateProcessW
  • CreateProcessAsUserA
  • CreateProcessAsUserW

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: