+44 (0)203 88 020 88

Menu

Search

Cyber Security News & Articles

 

Cyber Security
News & Articles

Trusted Cyber Security Experts
25+ Years Industry Experience
Ethical, Professional & Pragmatic

NAT Slipstream attack defeats NAT firewalls

NAT Slipstream allows an attacker outside the firewall to remotely access any TCP or UDP services running on a local machine, behind a NAT firewall, simply by tricking the victim into visiting a malicious website.

Yes, you read that correctly- by using the NAT Slipstream attack, an attacker is able to send arbitrary traffic to any open TCP/IP port on your PC simply by getting you to run Javascript in your browser, for example by visiting a website serving a malicious advert controlled by the attacker.  By using this technique, the attacker is able to open any port on your NAT router and map it to their choice of port on your local PC – and then send traffic over that link.

To understand how this is possible, we first need to understand how NAT routers work.

How do NAT routers work?

NAT stands for Network Address Translation, which is a mechanism for mapping between two different ranges of IP addresses – such as those on the public internet and those on a private network in your office.  The NAT function is provided by a router or firewall that sits on the perimeter of the network and it protects the private network by blocking, by default, all unexpected incoming traffic.  The NAT router modifies the TCP/IP packets as they pass through the router so that all traffic appears to originate from the router itself when it is forwarded onto the Internet.  When a response is received to a transmitted request, the NAT router maps the response back to the original internal TCP/IP address and port that made the request and forwards it to that  device on the internal network.

For some protocols, such as FTP, SIP or IRC – there are two ports open – one outbound and one inbound. This presents a problem for the NAT router as incoming traffic is blocked because the router has no idea which internal IP address and port the incoming data should be forwarded to.  This problem is solved with the Application Layer Gateway (ALG) which is a logical function added to all NAT routers.

The ALG monitors outbound traffic and when it spots an attempt to establish a connection using a protocol that requires an inbound port as well, it adjust the contents of the TCP/IP request header so that the remote server makes the connection back to the IP address of NAT router itself.  When this expected incoming connection is then received, the NAT router can forward the traffic to the IP address and port on the internal network that made the original request.  This occurs automatically and transparently to both ends of the communication.

NAT Slipstream works by abusing the ALG to trick it into opening ports and mapping them to internal IP addresses and ports which the external attacker can then use to target that device.

How does NAT Slipstream work?

The NAT Slipstream attack uses Javascript running in the browser of the target machine to send specially crafted HTTP requests which trick the Application Layer Gateway to open a firewall port and map it back to the target device.  It does this by crafting a fake SIP request as if a VOIP session were being started and the ALG opens a port on the NAT router and maps it back to the source device in order to complete the incoming VOIP call.  However, the open port is then abused by the attacker to send arbitrary network traffic to the victim device – potentially targeting other vulnerabilities in order to secure a foothold on that device and so breach the network.

A web browser is designed to open HTTP(S) ports and send HTTP(S) packets.  In order to trick it into sending a valid SIP request, a specially crafted large HTTP request is created which is so large it will be segmented into several packets before transmission.  The SIP request is embedded within the data body of the HTTP request. By noticing where the packet boundaries fall, the HTTP data can be constructed so that one of the segmented packets starts exactly with the SIP request.  The ALG code is not smart enough to realise the SIP request is actually a part of a larger segmented HTTP message – it simply sees a packet which starts with a byte-stream that matches what it is looking for and processes it accordingly as an outbound SIP request.

The malicious Javascript that is doing all this work is loaded into the victims browser simply by visiting a specially crafted webpage or even through a malicious advert served on an otherwise trusted site.

For now, the NAT Slipstream attacks works across almost all NAT routers that support SIP (and almost all do) and all modern web browsers.

In order to prevent widespread exploitation of this technique, the browser vendors have indicated they will add the well-known SIP ports 5060 and 5061 to the browsers restricted list – this will stop JavaScript being able to initiate any HTTP or HTTPS connections using those port numbers.  This could, however, have some unintended consequences as any test web applications that happen to be published to those port numbers (for example https://testapp.com:5061) will suddenly become inaccessible as the browsers roll out the change to the restricted port list.

The NAT Slipstream technique was developed by security researcher Samy Kamkar who summarises it like this in his detailed GitHub project documentation:

Once the SIP packet lands on the packet boundary, the NAT will be deceived, believing this is a legitimate SIP registration and from a SIP client on the victim’s machine. Once our server responds with a proper SIP response (nested inside of a proper HTTP response to allow the browser to not detect anything fishy), the NAT will open up the port in the original packet we had the victim send and the router will now forward any port the attacker chooses back to the internal victim, all from simply browsing to a website.

 

 

 

Subscribe to our monthly newsletter today

If you’d like to stay up-to-date with the latest cyber security news and articles from our technical team, you can sign up to our monthly newsletter. 

We hate spam as much as you do, so we promise not to bombard you with emails. We’ll send you a single, curated email each month that contains all of our cyber security news and articles for that month.

Why Choose SecureTeam?

CREST
CCS
ISO9001
ISO27001
CE-PLUS

Customer Testimonials

“We were very impressed with the service, I will say, the vulnerability found was one our previous organisation had not picked up, which does make you wonder if anything else was missed.”

Aim Ltd Chief Technology Officer (CTO)

"Within a very tight timescale, SecureTeam managed to deliver a highly professional service efficiently. The team helped the process with regular updates and escalation where necessary. Would highly recommend"

IoT Solutions Group Limited Chief Technology Officer (CTO) & Founder

“First class service as ever. We learn something new each year! Thank you to all your team.”

Royal Haskoning DHV Service Delivery Manager

“We’ve worked with SecureTeam for a few years to conduct our testing. The team make it easy to deal with them; they are attentive and explain detailed reports in a jargon-free way that allows the less technical people to understand. I wouldn’t work with anyone else for our cyber security.”

Capital Asset Management Head of Operations

“SecureTeam provided Derbyshire's Education Data Hub with an approachable and professional service to ensure our schools were able to successfully certify for Cyber Essentials. The team provided a smooth end-to-end service and were always on hand to offer advice when necessary.”

Derbyshire County Council Team Manager Education Data Hub

“A very efficient, professional, and friendly delivery of our testing and the results. You delivered exactly what we asked for in the timeframe we needed it, while maintaining quality and integrity. A great job, done well.”

AMX Solutions IT Project Officer

“We were very pleased with the work and report provided. It was easy to translate the provided details into some actionable tasks on our end so that was great. We always appreciate the ongoing support.”

Innovez Ltd Support Officer

Get in touch today

If you’d like to see how SecureTeam can take your cybersecurity posture to the next level, we’d love to hear from you, learn about your requirements and then send you a free quotation for our services.

Our customers love our fast-turnaround, “no-nonsense” quotations – not to mention that we hate high-pressure sales tactics as much as you do.

We know that every organisation is unique, so our detailed scoping process ensures that we provide you with an accurate quotation for our services, which we trust you’ll find highly competitive.

Get in touch with us today and a member of our team will be in touch to provide you with a quotation. 

0

No products in the basket.

No products in the basket.