Search engine are a strategic component in the successful execution of any attacks, we saw in the past Black SEO campaigns conducted with the primary intent to provide results that help the attackers to spread the malicious agents.
The security community in the past has detected numerous malware that was specifically designed to target search engine results, many of them work as browser extensions and are able to modify realtime the results. Recently security experts at F-Secure has detected a new family of malware, named Coremex, which exploits plugin functionality provided by common browsers to hijack the results proposed by principal search engine.
The Coremex malware uses a single NullsoftInstaller executable file which performs the dual function dropper and downloader that was used by attackers also to collect basic information (e.g. username, computer name, processor, memory) from the infected machine. The experts discovered within the source code of Coremex the IP address of the C&C server (18.104.22.168), the information gathered by the malicious agent is encrypted with RC4 with a key of “2AJQ8NA4” and the final result will be encoded with Base64.
The authors of the Coremex have also implemented anti-sandbox features to prevent the execution of the malware in virtual environment to study its composition and behavior.
“There are some anti-sandbox features implemented by Coremex that prevents it from downloading the main payloads, such as the browser extension scripts, from the C&C server. These features consist of checking blacklisted process names and looking for well-known sandbox fingerprints such as a “VMware” string on the infected machine by using Windows Management Instrumentation (WMI).”
The expert at F-Secure noted that the malware once in execution download additional payloads from the multiple C&C servers:
Coremex used to hijack victims to the following bogus search engine websites:
The callback function triggered by the second listener analyzes search queries entered by the victims using the following search engines:
The malware analyzes the requests made by victims and uses a JSON structure to compose the query that it encrypts with RC4 algorithm with key “http”, encoding the results with Base64. The Base64 encoded string will be sent to a search engine platform managed by attackers:
The platform responds with an encrypted JSON structure containing the destination websites that will determine where a webpage that has ads-like URL will be redirected to.
The decrypted JSON object might look like:
The following screenshot shows Coremex script in action when an ad’s URL is clicked by the victim, which leads to the ad’s page being hijacked and redirected to author’s intended destination website.
The attacker also used IFRAME injection to the hijacked ad’s page, the intent of malware authors was to take advantage of popular online advertising services.
(Security Affairs – search engine, malware)