Skip to content
StalkPhish
Thomas Damonneville··5 min read

[Phishing kit] 'Moha' kit, targeting DEWA suppliers

Title card: "Phishing kit analysis Moha", StalkPhish

At StalkPhish we like dissecting Phishing kits, first because we create Yara rules for detection, secondly because we must continually keep up to date with new developments in terms of phishing kits, finally because we like to pass on to the general public knowledge about this type of threat.

The phishing kit we go to analyze this time is a kit targeting Dubai Electricity and Water Authority suppliers:

Phishing page “Welcome to DEWA” imitating the Dubai Electricity and Water Authority supplier login, with username and password fields

Moha kit targeting DEWA suppliers

The kit Zip archive was left on the server by the scammer. We named this kit ‘Moha’ from the name of his potential developer (Moha404), even if some pages are taken from other kits:

Kit configuration file with the comment “config by me moha404” next to a moha404 directory: a Yandex e-mail address, a Telegram bot token and chat id

First observations

The code is pretty big for a phishing kit with 1.2MB size. What we can observe first it is the fact that all the files necessary for the good functioning of the kit are embedded in the kit. This excludes any detection by the target’s infrastructure using HTTP referers for example. All files are embedded in the kit, but this kit uses Google analytics to retrieve data about connections, after verification, it seems the Google analytics tracker ID is the same than the legitimate one, from the real DEWA website.

Browser network panel showing a POST request to google-analytics.com/collect with a tracking id

Google analytics HTTP POST

We can observe that all connections to the phishing site are also logged into a HTML file (visit.html) with a little bit of enrichment as the IP address of the visitor device and its geographic location:

PHP source: the visitor’s IP is geolocated through extreme-ip-lookup.com, logged into visit.html and redirected to the Login page with a random site from sites.txt

visits logged into visit.html

Then the scammer can easily retrieve data through his browser (note that API keys are not configured, so it does not work as expected in this case, particularly the geographical data):

Content of visit.html: a list of “DESKTOP VISIT FROM” lines with dates, times and blurred IP addresses

visits logs

As many times, the purpose of this kit is to… steal credit cards data…

Phishing page “Confirm Your Card” asking for the card number, expiry date and security code

Credit card data gathering

… as the victim’s email address and password, twice, to be sure it is not fake data:

Phishing page “Confirm Your Email Address” with Outlook, Gmail, Hotmail, Yahoo and AOL logos, asking for e-mail and password

Email data gathering

Then it will politely thank you before redirecting the victim on the legitimate DEWA website:

Final page “Thanks for Providing Your Info” with a green check mark and a Continue button

Bots and crawlers filtering tricks

As many phishing kits, this one embed filtering functions to prevent crawlers and bots to gather data, this kit contains a bunch of functions and files dedicated to this purpose.

The “locker” directory contains all files needed to filter some access:

Content of the locker directory: .htaccess, Bots.php, Bots2.php, Crawler.php, lock.php, Mobile_Detect.php, The-blacklist.php and a crawler-detect vendor library

Files dedicated to access filtering

Several tricks are used there:

  • a .htaccess file containing RewriteRules and deny filters
  • a robots.txt file which disallow search engines indexing
  • several files filtering strings contained in HTTP User-Agent
  • several files filtering IP addresses
  • calls to online IP address whois platforms
  • implementation of an OSS crawler detection tool (https://github.com/JayBizzle/Crawler-Detect)

Once detected, the connection considered as a bot connection is write into a bots.txt file and a HTTP 404 Not Found error message is sent to this bot:

PHP source: visitors referred by phishtank.com are logged into bots.txt and receive an HTTP 404 Not Found error

HTTP 404 error message

Then the crawler is prompt for a redirect to a random site appearing in a list (sites.txt):

Extract of sites.txt: a list of harmless websites used as random redirection targets for bots

a small part of sites.txt file

Phishing kit configuration

Phishing kits often present several vectors for exfiltrating stolen data and configuration files are there in order to indicate where to send the stolen data.

This kit uses 2 ways for exfiltration, first by e-mail and the second one uses Telegram (you can check our dedicated blog post about Telegram use by phishing kits):

hamza.php: the kit configuration with the comment “config by me moha404”, a Yandex e-mail address, a Telegram bot token and chat id

hamza.php

Configured variables are then used for exfiltration:

PHP source of the exfiltration: the stolen login is formatted with emojis, e-mailed with the subject “USPS RZT - Created By Moha404”, then sent to a Telegram bot

E-mail and Telegram exfiltration code

There is also a specific configuration file allowing to store, even to exfiltrate, the data in an obfuscated way, but again this functionality is badly implemented and it does not work:

Content of proxy.ini: reportmail, namer, naemv, dirnam, faker, color and apikey parameters

proxy.ini file

PHP source reading proxy.ini with parse_ini_file and building obfuscated variable names from the visitor’s IP address

data obfuscation code

Affiliated kits

By observing the source code of this kit, we see several strings appearing which do not relate to the rest of the code, this means that, as in many other phishing kits, pieces have been extracted from other already existing kits.

Beginning of proxyblock.php with the comment “scampage by devilscream” and a getUserIPs() function

From proxyblock.php

We can find this string (‘scampage by devilscream’) in others kit’s source code, as a Apple 16shop kit:

Search result for a Pastebin paste “16Shop-Apple-V1.8.2 Manage” containing the same “scampage by devilscream” comment

Detection

As seen before, the Google analytics tracker ID was left into the index page by the phishing kit creator, this should be a good start for investigating where this kit was deployed.

There is also several online tools you can use for detection, we use StalkPhish.io API to monitor particular strings and brand names that may appear in domain names or URIs used by phishing kits:

StalkPhish.io API result for the kit URL: domain, page title, first-seen date, IP address, ASN, extracted e-mail addresses and targeted brand DEWA

Stalkphish.io API extraction

For the phishing kit zip file detection and triage you can use our dedicated Yara rule we published on our GitHub repository: https://github.com/t4d/PhishingKit-Yara-Rules/blob/master/PK_DEWA_moha.yar

The PK_DEWA_moha YARA rule: metadata, strings such as the Login and moha404 directories, The-blacklist.php, zayan.php and hamza.php, and the condition on ZIP archives

Phishing kit Yara rule

IOCs

Kit’s zip file hash {SHA256}: f15264cc66c82fcc71642cc3cf7b9347072ad6617352e1937f6a174d8681c744

Exfiltration e-mail: ‘pegasiss8\\@yandex[.]com’

Thank you

Of course we contacted the company to provide them with all the information we have in our possession for the takedown.

Thank you for having read this report until the end, hoping that it will be useful to you, do not hesitate to subscribe to our mailing-list if you want to be kept informed of our news and to try our Stalkphish.io phishing URL enrichment detection and brand tool.

Related articles

Title card of a fisherman casting a net at dusk: "Hunting for phishing pages, a use case", StalkPhish
· CERT

[Use case] Hunting for phishing pages

Use case: detect phishing campaigns early by hunting phishing pages with StalkPhish, combining several data sources to find and take down sites faster.

Phishing campaigns move fast. So should you.

Start with a free search, or talk to us about API access and custom intelligence for your brand.