Author Topic: XMPP & Ransomware  (Read 3559 times)

saipaman

  • Elite Boss
  • *****
  • Posts: 921
XMPP & Ransomware
« on: September 03, 2015, 05:37:27 PM »
Looks like someone for a "red side" use for XMPP.   According to this ARS Technica story, XMPP is being used as the command protocol for ransomware.

http://arstechnica.com/security/2015/09/android-ransomware-uses-xmpp-chat-to-call-home-and-claims-its-from-nsa/

Let's hope this doesn't lead to some mass filtering campaign.

Todogut

  • Boss
  • ****
  • Posts: 247
    • Todogut on deviantART
Re: XMPP & Ransomware
« Reply #1 on: September 03, 2015, 07:01:41 PM »
Sounds like there are criminal-minded folks in cyberspace who have worked long and hard at using XMPP for evil.

Meanwhile, Codewalker, Leandro, and everyone at Titan Network involved in Paragon Chat used their abilities for an altruistic labor of love with no expectation for financial remuneration. They are heroes, and this is what they do.

The guys described in the arstechnica article are criminals, and conspiring to defraud innocent people of money is what they do.

saipaman

  • Elite Boss
  • *****
  • Posts: 921
Re: XMPP & Ransomware
« Reply #2 on: September 03, 2015, 07:56:55 PM »
A classic 'red side' / 'blue side' situation.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: XMPP & Ransomware
« Reply #3 on: September 03, 2015, 08:10:29 PM »
Looks like someone for a "red side" use for XMPP.   According to this ARS Technica story, XMPP is being used as the command protocol for ransomware.

http://arstechnica.com/security/2015/09/android-ransomware-uses-xmpp-chat-to-call-home-and-claims-its-from-nsa/

Let's hope this doesn't lead to some mass filtering campaign.

Its only a matter of time before XMPP filtering of some type of stuff occurs, no differently than email filtering and HTTP filtering happens today.  Its part of the cat and mouse game malware writers play.  Also, this seems no different to me in principle than some older malware that used to use IRC as its C&C channel back in the day (and such malware still exists in some forms).

Leandro

  • Elite Boss
  • *****
  • Posts: 310
Re: XMPP & Ransomware
« Reply #4 on: September 04, 2015, 01:42:33 PM »
Bots (and the warez scene in general) have been using IRC as a "command protocol" for ages. One of XMPP's goals is to be a "better IRC", so of course it can do everything that IRC can do, including being used for bots. There's nothing new here.

What the article argues is that because XMPP encrypts communications by default, it makes it harder for antivirus software to detect; but antivirus software is so notoriously crap and misses so much stuff (while at the same time making such a big deal out of false alarms) that claiming that they would fail to detect it "because of XMPP" is laughable.

Antimalware is supposed to first and foremost look at what's running on your computer, not rely on snooping through all your network traffic to catch the malware communicating with a mothership; by the time ransomware is contacting their XMPP server, it has locked you out of your data and the damage is already done.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: XMPP & Ransomware
« Reply #5 on: September 04, 2015, 07:25:30 PM »
What the article argues is that because XMPP encrypts communications by default, it makes it harder for antivirus software to detect; but antivirus software is so notoriously crap and misses so much stuff (while at the same time making such a big deal out of false alarms) that claiming that they would fail to detect it "because of XMPP" is laughable.

I believe you're referring to this section of the article:

Quote
While posing as a legal or governmental authority to intimidate the victim into paying up is not new, the use of Extensible Messaging and Presence Protocol (XMPP), the instant messaging protocol used by Jabber and previously by GTalk, is a shift in tactics to evade detection by anti-malware tools. XMPP communication makes it more difficult for security and anti-malware tools to catch the ransomware before it can communicate with its command and control network because it conceals the communication in a form that looks like normal instant message communications.

Most previous ransomware packages have communicated with a website over HTTPS to obtain encryption keys; those websites can generally be identified by their URLs, IP addresses, or the signature of their Web requests and then blocked. An application making a secure HTTP request to a suspicious destination would be a good sign that something bad was afoot. But the XMPP communications channel used by the new Simplocker variant uses an external Android library to communicate with the command and control network through a legitimate messaging relay server. And these messages can be encrypted using Transport Layer Security (TLS). The messages were pulled from the command and control network by the operators of the scheme via Tor.

They aren't blaming encryption itself.  What they are saying is that in the past most ransomware that required a C&C connection to function used to connect directly to their C&C servers.  Because of that, if the C&C servers could be identified they could be blocked by a variety of means.  They mention URLs but that only works if you're using an SSL interceptor.  More likely you could block access to these C&C servers by DNS blackholes or by blocking their IP addresses.  That way, regardless of what sort of encryption the bot used or how it scrambled its control messages you could make it impossible for it to call home.

The routeable nature of XMPP adds a new layer of obfuscation to the mix.  Now, malware could connect to a legitimate XMPP server that has no relationship to the malware writer but send it an XMPP message that the XMPP server would relay to the malware's C&C server.  Unless you can decrypt the actual C&C channel and block it by content, the only way to prevent the malware from calling home would be to block access to every open XMPP relay server in the world which is impractical.  That's why the article states that Checkpoint created filtering documents for XMPP relay server operators to use - because they are in a position to filter the XMPP messages they receive, unencrypted (the servers obviously see the raw unencrypted versions of all messages they receive because they have to see them to understand how to deliver them).

Quote
Antimalware is supposed to first and foremost look at what's running on your computer, not rely on snooping through all your network traffic to catch the malware communicating with a mothership; by the time ransomware is contacting their XMPP server, it has locked you out of your data and the damage is already done.

Unfortunately, that's not really technically feasible for a number of reasons.  Which is to say, antimalware software does look at the running state of the programs running on your computer, but traffic analysis of the network traffic of those processes is a significant and important part of that analysis.

Also, many (not all) forms of ransomware rely on an initial call-home to initialize their encryption with an encryption key generated by the C&C system (so it can give that key back to you if you pay the ransom) and not by the bot (so reverse engineering can't reverse the process of making the keys, which would allow people to theoretically break the encryption).  If you can block access to the C&C network, you can prevent the malware from encrypting your files indefinitely and cripple its ability to damage your system.

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: XMPP & Ransomware
« Reply #6 on: September 04, 2015, 08:14:07 PM »
the use of Extensible Messaging and Presence Protocol (XMPP), the instant messaging protocol used by Jabber and previously by GTalk, is a shift in tactics to evade detection by anti-malware tools.

That article is behind the times if they think using XMPP to do this represents a shift in tactics. Advanced malware (the kind written by government-funded agents) has been obfuscating its C&C by piggybacking it on legitimate protocols for years.

The use of uncompromised third-party relays isn't even new or novel. The same thing can be done with DNS messages that look like regular queries but actually form a covert channel. Hint: the subdomain being queried is actually an encoded message, and the authoritative DNS server for the parent domain returns arbitrary data masked as IP addresses. And that technique is at least 7 or 8 years old and fairly well known, and despite that it's extremely hard to block or even detect.

Arcana

  • Sultaness of Stats
  • Elite Boss
  • *****
  • Posts: 3,672
Re: XMPP & Ransomware
« Reply #7 on: September 04, 2015, 09:39:38 PM »
That article is behind the times if they think using XMPP to do this represents a shift in tactics. Advanced malware (the kind written by government-funded agents) has been obfuscating its C&C by piggybacking it on legitimate protocols for years.

The use of uncompromised third-party relays isn't even new or novel. The same thing can be done with DNS messages that look like regular queries but actually form a covert channel. Hint: the subdomain being queried is actually an encoded message, and the authoritative DNS server for the parent domain returns arbitrary data masked as IP addresses. And that technique is at least 7 or 8 years old and fairly well known, and despite that it's extremely hard to block or even detect.

I don't know what the article writer themselves think, but while the fundamental idea behind using XMPP is old, the actual use of XMPP itself is, to the best of my knowledge, relatively novel.

Using DNS in the way you describe was first discussed a long time ago, but its actually not common for widespread ransomware explicitly because while its technically feasible, its logistically tricky these days for a number of reasons.  In APT (i.e. specifically targeted) attacks it works well, but in wideband attacks it gives itself up too easily.  You also have the current state of the art moving to things like OpenDNS which are in effect DNS proxies which can and do filter for such traffic.  Distributed IPS can also spot that stuff a little too easily now.

True story about DNS: I was traveling years ago and was stopped in LAX when I noticed they had recently started deploying Wifi at the airport, which of course redirected you to captive portal to force you to pay.  Whoever set that up didn't do their job correctly: they designed the captive portal by only allowing DNS, setting up the wifi hotspots to send their DNS server in the DHCP, and redirecting all names to their captive portal.  A quick test showed that while the DHCP server was setting my DNS server to their server, in actuality their firewall was allowing DNS to everywhere - it basically had a "any any DNS accept" rule.  For giggles I asked someone I knew to reconfigure their VPN system to encapsulate on port 53, and yep, you can guess the rest.

I quickly shut it down after proof of concept was working: my days of "borrowing" internet access were over by then.  But still: it took a long time to beat it into people that "ports != service" and you still see people making that fundamental security error.  LAX did eventually fix that glitch, but I don't honestly know if they fixed it because they deployed a different system that lacked that flaw (they did change system vendor a few years later) or if someone actually discovered the error and deliberately fixed it.