Anatomy of a Malware Injection

David E. Weekly
HackerNoon.com
19 min readAug 10, 2017

--

Today I got a number of pretty questionable “friend requests” from young females on Facebook with zero mutual friends and with very racy profile pics. Of course they were fake, but I was curious to (safely) explore what was at the bottom of the rabbit hole. It was an exciting trip.

The journey touches Facebook, Google, and Amazon along with dozens of other web hosts and registrars, and spans the globe from the US to Indonesia to Germany and elsewhere. It’s a bizarrely elegant integration of touchpoints from a range of technology stacks and services, all conspiring to get a lonely guy eager for a sex massage to accidentally install some software in his browser.

Here’s “Blanca Aline Laine” (made up name)

Above we see the fake profile, since taken down by Facebook. I’m still friends with the fraud team there, which is helpful. Racy images (but not NSFW, like some of the other ones) with profile text indicating she A) lives in my city (Redwood City) and B) can drive to a client’s house and give a “sex massage package for $5.00”. What a good deal, eh?

Most of these fake profiles I saw today have included goo.gl URL shortened links to try and mask the destination, and include this as part of their profile picture caption. I wondered if Facebook automatically alerts Google when it finds goo.gl shortlinks it needs to blackhole.

I dove in on the command line to try and index where this went.

Caution: please do not follow any of these links below in your browser. They are operated by malware vendors and may harm your computer.

First stop was Google (yay!)

Simple 301 permanent redirect (note the QUIC advertisement!). Redirect is to a .top TLD — wait, what? I don’t think I’ve ever seen a legit .top website. Yep, check Spam Haus — .top is a “top 10” spam TLD. .top indeed! The TLD operated by the prestigious “jiangsu bangning science and technology company”. [sigh] Okay, I wonder who owns the domain.

Ah, it’s a NameCheap registered domain and protected by WhoisGuard. And the site main page insists it’s “down for maintenance”. Mmhmm…

Here’s the holding page:

Here’s a 200 page returned from a .do file (usually Java web struts)…but only with a meta refresh to a PHP script on the same domain, on a machine hosted by DigitalOcean. Odd. Okayyyy…

Okay…another weird TLD here. With another NameCheap WhoisGuard domain. Hosted by DigitalOcean. With the same“Down for Maintenance” page on both the domain and IP. Oddly familiar...

Here we’ve got a meta-refresh to yet another domain, with a charming tracker script & image (“CLick Factory@The Genz”) hosted by SoftLayer and operated by Indonesians(?!), returning a 1x1 JPG (why not .GIF?) created by gd-jpeg.

Looks like this domain is registered by key-systems.net (German) and has DNS service provided by AWS.

And sure enough, the site itself is hosted on AWS as well.

And here’s a 302 to cdprivate.com…

Also registered by key-systems.net and hosted on AWS with Route53 DNS.

And the same set of IPs. odd. Wonder why they need the extra redirect and domain…?

Here’s another 302, this time to a UniRegistrar-registered throwaway domain (2587812.com), hosted at Linode (a VPS provider).

And now…

And here we get a fascinating auto-POST of a form with a fairly lengthy payload — or a simple meta refresh for folks without JS enabled. To a .GDN TLD, which I had also never heard of. Guess where .GDN ranks in SpamHaus’s “Top 10” spam TLDs? It’s #1. You’ve never heard of a legit .GDN site for a reason, kids. The registry is run by a Dubai-based corp and Epik domains seems to have registered this particular “hapc.gdn” domain.

This fine, upstanding website is hosted by VULTR, a VPS host. VULTR is in a subset of IPs owned by Choopa in New Jersey.

Let’s see what’s in store for us!

Now we again see an attempt to set a large payload, this time via cookie, and refresh to a “privacy assist” page. Hm, I think we’re getting closer to the actual payload…

Weirdly enough the “admin config” link seems empty; perhaps there’s a special code that needs to be input, or only certain IPs can access it.

Whee, off we go again with a 302 redirect to n3xt.io; registered by GoDaddy, DNS by Amazon Route53, and again dual-homed IPs to AWS. Seems a lot of these scammers like hosting on Amazon infrastructure with second-tier VPS hosts layered between for indirection.

Let’s see what’s here.

Okay, now we get our final client redirect to the “client” site, PrivacyAssistant.net which “provides additional information to your search results”. Got it; we’re going to have an extension that injects new ads in our search results. And so here comes the money shot, complete with the attempted drive-by Firefox auto-install of their plugin:

The funny part here is of course that they’re attempting to rail against the tracking infrastructure of big companies while themselves exhaustively using tracking and referral services from a very wide range of companies large and small.

An adware install like this makes more economic sense as a spam endpoint than trying to convince clients to put in a credit card number for an actual porn video; the conversion rates for paid content are very low (there’s lots of free content out there) and porn suffers a problem of chargebacks “Um, Chase Bank, yeah, that charge was totally not mine…”. So instead of having a 1% shot at a $30 conversion, worth $0.30, they go for a 10% shot at a $0.01/search conversion — at 10 searches a day that’s $35.00 if you keep the client for a year, so a probabilistic value of $3.50. While my math may be a bit off here, the point stands that adware converts reasonably well vs actual commercial porn upsell. But you can still get a dumb guy to click on something next to a cute girl’s picture, so that’s your high conversion on lead-gen…

The tragic part is that chasing down the abuse reporting endpoints for all of these services is exhausting. I’m sure the fine folks at Amazon (and Google, and Facebook!) don’t want to play such a key role in enabling this stuff, but it’s a lot to keep tracking down and the automated tools are clearly not quite keeping up.

Feedback welcome: what I missed, what I screwed up, and ways we can collectively crack down on this crap as an industry.

--

--

David E. Weekly
HackerNoon.com

Founder+CEO: Medcorder, ex-GOOG, FB. Started: Drone.VC, Mexican.VC, Neuron.VC, PBwiki, DevHouse, and Hacker Dojo. Startup advisor. Chopper pilot. Dad. ❤�