ESET researchers have discovered strategic web compromise (aka watering hole) attacks against high‑profile websites in the Middle East
Our curiosity was aroused by the nature of the targeted website and in the following weeks we noticed that other websites with connections to the Middle East started to be targeted. We traced the start of the campaign back to March 2020, when the piwiks[.]com domain was re-registered. We believe that the strategic web compromises only started in April 2020 when the website of the Middle East Eye (middleeasteye.net), a London-based digital news site covering the region, started to inject code from the piwiks[.]com domain.
At the end of July or the beginning of August 2020, all remaining compromised websites were cleaned; it is probable that the attackers themselves removed the malicious scripts from the compromised websites. The threat group went quiet until January 2021, when we observed a new wave of compromises. This second wave lasted until August 2021, when all websites were cleaned again. A few indicators from this second wave were shared on Twitter by a fellow researcher, which allows us to make a link with what Kaspersky tracks as Karkadann.
We detail the inner working of the compromises in the Technical analysis section, below, but it is worth noting that the final targets are specific visitors of those websites, who are likely to receive a browser exploit. The compromised websites are only used as a hop to reach the final targets.
We also uncovered interesting links with Candiru, detailed in the section Links between the watering holes, spearphishing documents and Candiru. Candiru is a private Israeli spyware firm that was recently added to the Entity List (entities subject to licensing restrictions) of the US Department of Commerce. This may prevent any US‑based organization from doing business with Candiru without first obtaining a license from the Department of Commerce.
At the time of writing, it seems that the operators are taking a pause, probably in order to retool and make their campaign stealthier. We expect to see them back in the ensuing months.
Our tracking shows that the operators are mostly interested in the Middle East, with a particular emphasis on Yemen. Table 1 shows the known targets in 2020 and 2021.
Table 1. Domains compromised during the first wave
middleeasteye.netpiwiks[.]com2020‑04‑042020‑04‑06A UK-based online newspaper covering the Middle East.
piaggioaerospace.itpiwiks[.]com2020-07-082020-11-05An Italian aerospace company.
medica-tradefair[.]corebrandly[.]site2020-07-092020-10-13Fake website impersonating a German medical trade fair in Düsseldorf.
mfa.gov.irpiwiks[.]com2020-07-112020-07-13Ministry of Foreign Affairs of Iran.
almanar.com.lbrebrandly[.]site2020-07-242020-07-30Television channel linked to Hezbollah.
Ministry of Interior of Yemen.
Yemeni Television channel linked to the Ansar Allah movement (Houthis).
casi.gov.syhotjar[.]net2021-02-01UnknownCentral Authority for the Supervision and Inspection of Syria.
moe.gov.syhotjar[.]net2021-02-01UnknownSyrian Ministry of Electricity.
Television channel linked to Hezbollah.
manartv.com.lbwebfx[.]bz2021-02-032021-03-22Television channel linked to Hezbollah.
mof.gov.yehotjar[.]net2021-02-112021-07-14Ministry of Finance of Yemen.
scs-net.orghotjar[.]net2021-03-07UnknownInternet Service Provider in Syria.
customs.gov.yelivesesion[.]bid2021-03-242021-06-16Customs agency of Yemen.
A South African state-owned aerospace and military technology conglomerate.
yemen.net.yehotjar[.]net2021-04-152021-08-04Internet service provider in Yemen.
yemenparliament.gov.yehotjar[.]net2021-04-202021-07-05Parliament of Yemen.
yemenvision.gov.yehotjar[.]net2021-04-212021-06-13Yemeni government website.
mmy.yehotjar[.]net2021-05-042021-08-19Yemeni media linked to the Houthis.
thesaudireality.combootstrapcdn[.]net2021-06-162021-07-23Likely dissident media outlet in Saudi Arabia.
saba.yeaddthis[.]events2021-06-18UnknownYemeni news agency linked to Houthis. However, it seems it was taken over by the Southern Transitional Council in early June 2021, just before this website was compromised.
medica-tradefair[.]co is the outlier in this list, as it was not compromised but was operated by the attackers themselves. It was hosted at ServerAstra, as were all the other C&C servers used in 2020.
As seen in Figure 2, the content doesn’t seem to have been modified. It is likely that attackers were not able to compromise the legitimate website and had to set up a fake one in order to inject their malicious code.
It is interesting to note that the malicious domains mimic genuine web analytics, URL shortener or content delivery network domains and URLs. This is a characteristic of this threat actor.
Technical analysis – Strategic web compromises
First wave – 2020
First stage – Injected script
In the cases of rebrandly[.]site injections, the additional scripts are loaded using HTML script tags, as seen in Figure 4.
Second stage – Fingerprinting script
reconnects.js and recon-api.js are almost identical; only the order of some lines or functions are changed. As shown in Figure 5, the malware authors tried to avoid raising suspicions by prepending their script with a copy of the jQuery Browser Plugin header. They were probably hoping that malware analysts would not scroll further.
The script first implements a function named geoip. It is automatically called by the GeoJS library, previously loaded, as mentioned on the official GeoJS website. The variable json contains the IP geolocation information. The script sends this JSON via an HTTP POST request to the C&C server at the URL https://rebrandly[.]site/reconnect-api.php. If the server returns an HTTP 200 status code, then the script proceeds to a function named main.
First, main gathers information such as the operating system version and the browser version using custom functions shown in Figure 6. They simply parse the browser User-Agent to extract information.
As shown in Figure 7, the function then checks whether the operating system is either Windows or macOS and only continues if so. This is interesting because it suggests that this operation is intended to compromise computers and not mobile devices such as smartphones. It also checks for a list of common web browsers: Chrome, Firefox, Opera, IE, Safari and Edge.
The script also encrypts a hardcoded value, 1122, although we don’t know for what purpose. Despite the function being named decrypt, it actually encrypts using RSA and the library JSEncrypt. The 1024-bit RSA key is hardcoded and set to:
—–BEGIN PUBLIC KEY—–
—–END PUBLIC KEY—–
Then, the script sends an HTTPS GET request to the C&C server rebrandly[.]site. The id parameter contains the fingerprint data and the last parameter value contains the country provided by the GeoJS library.
If the server returns a reply, it is decrypted using AES from the CryptoJS library, and a hardcoded key flcwsfjWCWEcoweijwf@#$@#$@#499299234@#$!@2. This key stayed the same, even after we tried a few requests.
The decrypted value is supposedly a URL and a new iframe pointing to this URL is created. We were unable to get any valid answer but we believe it leads to a browser remote code execution exploit that allows an attacker to take control of a machine.
Second wave – 2021
First stage – Injected script
In order to be a bit stealthier still, in this second wave, they started to modify scripts that were already on the compromised website. So instead of adding code to the main HTML page, they modified libraries such as wp-embed.min.js, as seen in Figure 8. They simply added a few lines at the end of https://www.smc.gov.ye/wp-includes/js/wp-embed.min.js to load a script from a server they control: https://visitortrack[.]net/sliders.js.
Another strategy used to limit their exposure is to create a cookie the first time the visitor executes the malicious script, as shown in Figure 9. As the script is conditionally injected depending on whether the cookie already exists, this will prevent further injections. This specific code was found on the website of the Syrian Central Authority for the [sic] Supervision and Inspection (casi.gov.sy).
From January to March 2021, for the second-stage script, the operators used a script based on the minAjax library. This is not a fingerprinting script per se as it doesn’t send any information about the browser or the operating system to the C&C server – an example is shown in Figure 10. It should be noted that very similar scripts are used by the LNKR adware, so a detection on this might lead to a high volume of false positives.
This script contains the current timestamp, t0, an expiration timestamp, ex, and two hashes juh and cs, whose significance we don’t know at present. These values are sent to the C&C server https://webfex[.]bz/f/gstats. If the reply is a JSON object and contains the fw key, the script issues a redirection to the URL contained in fw using parent.top.window.location.href. As with the first wave, we were not able to get any valid redirect.
In April 2021, this script was changed to FingerprintJS Pro. This is a commercial product whose developers have an official website shown in Figure 11.
As with the previous cases, we never got a valid redirect. We still believe it leads to a browser exploit and it shows that this campaign is highly targeted.
Spearphishing documents and links with Candiru
Reminder of the Citizen Lab publication
In the Citizen Lab Candiru blogpost, there is a section called A Saudi-Linked Cluster?. It mentions a spearphishing document that was uploaded to VirusTotal.
The C&C server used by this document is https://cuturl[.]space/lty7uw and VirusTotal captured a redirection from this URL to https://useproof[.]cc/1tUAE7A2Jn8WMmq/api. The domain useproof[.]cc was resolving to 109.70.236[.]107 and, according to the Citizen Lab, this server matched their so-called CF3 fingerprint for Candiru C&C servers. This domain was registered via Porkbun, as are most Candiru-owned domains.
Two domains resolving to the same IP address caught our attention:
The same second-level domains, with a different TLD, were used in the second wave of strategic web compromises. These two domains in the .cc TLD are most likely operated by Candiru too.
The Citizen Lab report mentions a few domains similar to cuturl[.]space, which we detail in Table 2.
Table 2. Domains similar to cuturl[.]space
instagrarn[.]coTLD Registrar Solutions83.97.20[.]89M247
cuturl[.]appTLD Registrar Solutions83.97.20[.]89M247
url-tiny[.]coTLD Registrar Solutions83.97.20[.]89M247
These domain names mimic URL shorteners and the Instagram social media website and were registered through Njalla and TLD Registrar Solutions Ltd. This reminds us of the domains used for the strategic web compromises that are all variations of genuine web analytics websites and were also registered via Njalla.
We also independently confirmed that the servers to which these domains were resolving were configured in a similar fashion.
Thus, we believe that this set of websites is controlled by the same threat group that created the documents. Conversely, the domain useproof[.]cc is most likely operated in-house by Candiru and is used to deliver exploits.
Links between the watering holes, spearphishing documents and Candiru
Table 3 summarizes the characteristics of the watering holes, the documents found by Citizen Lab, and Candiru.
Table 3. Summary of links between the three clusters (watering holes, documents found by Citizen Lab and Candiru)
Watering holesCluster of documentsCandiru
RegistrarsMainly NjallaNjalla and TLD Registrar SolutionsPorkbun
Hosting providersServerAstra, Droptop, Neterra, Net Solutions, The Infrastructure Group, Sia Nano and FlokiNETDroptop, M247 and DotsiM247, QuadraNet, etc.
Domain themesAnalytics and URL shortener servicesURL shortener servicesAnalytics, URL shortener services, media outlets, tech companies, government contractors, etc.
VictimologyMiddle EastMiddle EastMiddle East, Armenia, Albania, Russia, Uzbekistan, etc.
Targeted platformsWindows and macOSWindowsWindows and macOS
TTPsStrategic web compromisesMalicious documents with Document_Open macrosMalicious documents and fake shortened URLs redirecting to exploits and the DevilsTongue implant.
What is interesting to note is that the watering holes are limited to a quite narrow victimology. We also noted that domains known to be operated by Candiru (webfx[.]cc for example) are very similar to domains used for the watering holes (webfx[.]bz). However, they were not registered in the same fashion and their servers are configured very differently.
In July 2021, Google published a blogpost providing details on exploits used by Candiru. It includes CVE‑2021-21166 and CVE-2021-30551 for Chrome and CVE-2021-33742 for Internet Explorer. They are full remote code execution exploits that allow an attacker to take control of a machine by making the victim visit a specific URL that then delivers the exploit. This shows Candiru has the capabilities to exploit browsers in a watering hole attack.
Hence, we believe that the watering holes behave similarly to the documents. The first C&C server, injected in the compromised websites, would redirect to another C&C server, owned by a spyware firm such as Candiru and delivering a browser exploit.
Based on this information, we assess:
with low confidence that the creators of the documents and the operators of the watering holes are the same.
with medium confidence that the operators of the watering holes are customers of Candiru.
This report describes two strategic web compromise campaigns targeting high-profile organizations in the Middle East, with a strong focus on Yemen. We also revealed links to Candiru, a spyware firm, that sells state‑of‑the‑art offensive software tools and related services to government agencies.
We were unable to get an exploit and the final payload. This shows that the operators choose to narrow the focus of their operations and that they don’t want to burn their zero-day exploits.
We stopped seeing activity from this operation at the end of July 2021, shortly after the release of blogposts by the Citizen Lab, Google and Microsoft detailing the activities of Candiru.
A comprehensive list of Indicators of Compromise (IoCs) and samples can be found in our GitHub repository.
For any inquiries, or to make sample submissions related to the subject, contact us at email@example.com.
Indicators of Compromise
Legitimate, historically compromised websites
Compromised websiteFromTo (treat as a lower bound)
DomainIPFirst seenLast seenDetails
piwiks[.]com91.219.236[.]382020-03-312020-07-29Watering hole C&C server.
Watering hole C&C server.
medica-tradefair[.]co220.127.116.112021-06-282021-10-20Fake website impersonating a German medical conference.
site-improve[.]net185.165.171[.]1052021-01-062021-07-21Watering hole C&C server.
visitortrack[.]net87.121.52[.]2522021-01-062021-10-06Watering hole C&C server.
webfx[.]bz94.140.114[.]2472021-01-062021-03-24Watering hole C&C server.
hotjar[.]net5.206.224[.]2262021-01-072021-08-02Watering hole C&C server.
webffx[.]bz83.171.236[.]32021-02-212021-03-27Watering hole C&C server.
livesesion[.]bid87.120.37[.]2372021-03-172021-07-28Watering hole C&C server.
webfex[.]bz45.77.192[.]332021-02-26N/AWatering hole C&C server.
bootstrapcdn[.]net188.93.233[.]1622021-04-282021-07-28Watering hole C&C server.
addthis[.]events83.171.236[.]2472021-04-292021-07-28Watering hole C&C server.
cuturl[.]app83.97.20[.]892020-11-022021-01-20Malicious document C&C server.
cuturl[.]space83.171.236[.]1662021-01-252021-04-23Malicious document C&C server.
useproof[.]cc109.70.236[.]1072020-11-252021-02-19Candiru exploit delivery server.
4F824294BBECA4F4ABEEDE8648695EE1D815AD53N/Ahttps://cuturl[.]app/sot2qqDocument with VBA macro.
96AC97AB3DFE0458B2B8E58136F1AAADA9CCE30Bcopy_02162021q.dochttps://cuturl[.]space/lty7uwDocument with malicious VBA macro.
DA0A10084E6FE57405CA6E326B42CFD7D0255C79seeIP.dochttps://cuturl[.]space/1hm39tDocument with VBA macro.
MITRE ATT&CK techniques
This table was built using version 10 of the MITRE ATT&CK framework.
Resource DevelopmentT1583.001Acquire Infrastructure: DomainsThe operators bought domain names from multiple registrars, including Njalla.
T1583.004Acquire Infrastructure: ServerThe operators rented servers from multiple hosting companies. In 2020, they rented servers mainly from ServerAstra.
T1584.004Compromise Infrastructure: ServerThe operators compromised several high-profile websites.
T1588.001Obtain Capabilities: MalwareThe operators probably bought access to Candiru implants.
T1588.005Obtain Capabilities: ExploitsThe operators probably bought access to Candiru exploits.
Initial AccessT1189Drive-by CompromiseVisitors to compromised websites may have received an exploit after their browser was fingerprinted.
T1566.001Phishing: Spearphishing AttachmentThe operators sent spearphishing emails with malicious Word documents.
ExecutionT1059.005Command and Scripting Interpreter: Visual BasicThe Word documents contain a VBA macro running code using the Document_Open function.
Command and ControlT1071.001Application Layer Protocol: Web ProtocolsThe watering hole scripts communicate via HTTPS with the C&C servers.