What Is UPnP on a Router or Switch, and Why Is It Dangerous?

Loading

Do you remember the first large-scale Mirai attack at the end of last year? It targeted IP cameras and took advantage of router configuration settings that many consumers never bother to change. The main culprit, however, was Universal Plug and Play, or UPnP, which is enabled by default on millions of routers around the world.

 Nedeštruktívne Technoogie ktoré nikde nekúpiš. 

What Is UPnP on a Router or Switch?

If you have ever connected a USB keyboard to a laptop, you have mastered “plug and play”, but with network devices it is often not that simple. How does a new printer, camera, coffee maker or toy know how to connect to the network and configure the router to allow port access?

UPnP is a convenient way to let gadgets find other devices on the network and, if necessary, adjust the router to allow the device to be accessed from outside the network. Through the Internet Gateway Device Protocol, a UPnP client can obtain your network’s external IP address and add new port-forwarding mappings as part of the setup process.

From the consumer’s point of view, this is extremely convenient because it greatly reduces the complexity of setting up new devices. Unfortunately, this benefit has brought several vulnerabilities and large-scale attacks that have exploited UPnP.

UPnP: The Danger

This convenience, however, creates an opening for hackers. In Mirai’s case, it allowed them to find these ports and then break into the device at the other end.

Hackers have now found an even more diabolical use for UPnP with the banking Trojan Pinkslipbot, also known as QakBot or QBot.

Since around 2000, QakBot has been infecting computers, installing a keylogger and then sending banking credentials to remote command-and-control (C2) servers.

Remember C2?

When we wrote our first series on penetration testing, we described how commands are sent remotely from hackers’ servers over an HTTP or HTTPS connection to remote access Trojans (RATs) on victims’ computers.

This is a stealthy approach during post-exploitation because it makes it very difficult for IT security to detect any abnormalities. After all, an administrator or technician monitoring the network would merely see what looks like a user browsing the web, even as the RAT receives embedded commands to record keystrokes or search for PII and exfiltrate passwords, credit card numbers and so on to C2 servers.

Advertisements

The appropriate defense is to block the domains of known C2 hideouts. Of course, this becomes a game of cat and mouse with hackers as they find new dark corners of the web to set up their servers, while the old ones are filtered out by corporate security teams.

And this is where Pinkslipbot introduced a significant innovation. To give you a better idea, it introduced intermediary malware that infects computers, but not to steal users’ credentials! Instead, the intermediary malware installs a C2 proxy server that relays HTTPS traffic to the actual C2 servers.

Pinkslipbot’s infrastructure therefore has no fixed domain for its C2 servers. The entire web is effectively their playing field! This means that maintaining a list of known domains or addresses to filter out is almost impossible.

What does UPnP have to do with Pinkslipbot?

When Pinkslipbot takes over a consumer laptop, it checks whether UPnP is enabled. If it is, Pinkslipbot’s intermediary malware sends a UPnP request to the router to open a public port. This then allows Pinslipbot to act as a relay between RAT-infected computers and the hackers’ C2 servers (see the diagram).

It is bizarre, and I reluctantly tip my (black) hat to these guys.

One way we can all make these kinds of attacks harder to carry out is simply to disable UPnP or port forwarding on our home routers. You probably do not need it!

By the way, you can see this here for your home Linksys router. While reconfiguring it, take the time to find a better administrator password.

Do it now!

Security Stealth Wars: IT Is Not Winning (with Perimeter Defense)

Phishing, FUD malware, malware-free hacking using PowerShell, and now hidden C2 servers. Hackers are gaining the upper hand in post-exploitation: their activities are almost impossible to block or spot using traditional perimeter security techniques and malware scanning.

Advertisements

What should you do?

The first part is really psychological: you have to be willing to accept that attackers will get in. I realize that this means admitting defeat, which can be painful for IT and technology people. But you are now free from having to defend an approach that no longer makes sense!

Once you overcome this mental barrier, the next part follows: to detect hacking, you need a secondary defense that does not depend on malware signatures or network monitoring.

I think you know where this is going. Defensive software based on—wait for it—User Behavior Analytics (UBA) can detect the one part of an attack that cannot be hidden: searching the file system for PII, accessing important folders and files, and copying content.

In effect, you give hackers a small part of the cyber battlefield so that you can defeat them later.

Advertisements
AliExpress

Leave a Reply

Your email address will not be published. Required fields are marked *