
How to Detect Sneaky N.S.A. ‘Quantum Insert’ Attacks - jakobdabo
http://wired.com/2015/04/researchers-uncover-method-detect-nsa-quantum-insert-hacks
======
dtech
TLDR: Send spoofed TCP package with HTTP redirect to malicious site right
after victim does a GET request.

This attack, while impressive and nifty, would seem to be easily subverted by
SSL right?* Yet another example that shows that non-SSL HTTP should be phased
out.

* In the ideal situation where users check URL's and the CA system is good enough to keep the NSA out.

~~~
ilaksh
Why shouldn't we assume the NSA has subverted the CA system? Why would we all
rely on central authority for security if not to support centralized
surveillance?

~~~
Dylan16807
Because that subversion can be relatively easily detected, and then shouted to
the world.

~~~
motoboi
Given the episode where stolen Realtek certificates been used for years by a
government-made malware, I think we should not be so sure that they can't do
that.

A single request going through a bogus certificate emitted by NSA "acquired"
CA would be hardly detected.

Or, given the fact that they could indeed broke keys, they could simply do a
man-in-the-middle, instead of a man-in-the-side.

~~~
Dylan16807
A stolen key is a server-being-hacked problem, not a CA problem. If the server
is hacked, game over.

There are browser extensions that detect bogus certificates; there's a good
risk of catching them.

~~~
SG-
Should we pretend the NSA and various organizations don't have the means to
infiltrate a CA?

~~~
Karunamon
Again, pinning is a realistic countermeasure to this.

------
ilaksh
Why do we permit these groups to act as if they were in a James Bond movie?

Only incredible ignorance and lack of perspective could permit this.

Its just criminal activity excused by puerile worldviews shaped by propaganda
and elitist 18th century philosophies propagated by powerful thugs.

~~~
higherpurpose
Most people who support mass surveillance when asked in surveys only do it
because they don't fully understand what's happening. Let's go back to John
Oliver's recent show episode where people seem very concerned that the
government would have their naked pics - yet they were completely unaware that
the government _actually does that_ (as in collecting everything, _including_
their naked pics).

So most people just don't fully (or even partially) grasp the government's
surveillance power right now. The media doesn't help here. The media is
supposed to inform people about this, but instead either it doesn't talk too
much about it, or if it does, the mainstream media is usually _pro-mass
surveillance_ (because the powerful friends of the networks are).

~~~
pdkl95
While the Snowden leaks were being released, I made a habit of doing a few
very general searches to get a sampling of how the events were being reported.
I really wish I had taken it a step further and saved regular tables of those
observations, because I suspect it could have been made into a very
interesting paper.

Most of the time the lazy reprints of an AP/Reuters story.would dominate, as
expected. Once and a while - usually after a _really import_ release such as
COTRAVELER[1] - the story would happen... and then suddenly everybody is
talking about Prism and explaining how it is "just metadata". Any momentum the
new story had ended was redirected into topics that were already known. There
would be small-time media doing proper reporting, of course, but it was clear
who the "big media" worked for.

The media following the orders of those that sign their paychecks isn't really
news, but it was very interesting to watch it happen in realtime.

[1] I still believe that COTRAVELER is one of the most important thing we have
learned from Snowden, as it builds _relationship maps_ and it doesn't rely on
the target performing some specific action such as an HTTP requests that
QUANTUM can race. Bonus: it only relies on "metadata".

~~~
pakled_engineer
The discussion about COTRAVELER was usually totally poisonous too
[https://firstlook.org/theintercept/2014/02/24/jtrig-
manipula...](https://firstlook.org/theintercept/2014/02/24/jtrig-
manipulation/)

------
lawnchair_larry
I'm not sure why the comments here are focused on how the attack, as that is
not the news and was well known for quite some time. This article is about how
to thwart the attack.

tl;dr Watch for the site to appear to respond twice with the same sequence
number. One of those is the NSA trying to get in ahead of the real site.

~~~
pekk
If the attack exists in the wild, its use isn't in any way limited to the NSA.

~~~
tptacek
This attack has existed in the wild since the mid-1990s; it is literally the
reason SSH exists. We didn't call our TCP hijacking tools "quantum inserts"
back then, but that's exactly what they were. The only reason we didn't
redirect HTTP connections to malicious sites is that in the 1990s, that would
have been a waste of time; the r-commands were much lower hanging fruit.

~~~
schoen
An important example from that timeframe publicly documenting the risk you're
referring to:

[https://www.usenix.org/legacy/publications/library/proceedin...](https://www.usenix.org/legacy/publications/library/proceedings/security95/full_papers/joncheray.pdf)

~~~
tptacek
In fact, Joncheray "invented" this attack.

------
4096
The blog post with all the technical details: [http://blog.fox-
it.com/2015/04/20/deep-dive-into-quantum-ins...](http://blog.fox-
it.com/2015/04/20/deep-dive-into-quantum-insert/)

And the Github account with the tools to do this yourself, PCAP and rules for
snort, bro and suricata: [https://github.com/fox-
it/quantuminsert](https://github.com/fox-it/quantuminsert)

~~~
smellf
Thanks for the technical link. You gotta love Wired, paraphrasing down to get
gems like: “The first TCP packet will be the ‘inserted’ one while the other is
from the real server, but will be ignored by the [browser]”.

Oh my browser deals with TCP packets??

------
eyeareque
Are there any details on when Quantum Insert started to be used by the gov? I
wonder if the government built it off of the idea shared here:
[http://www.willhackforsushi.com/presentations/PenTest_Perfec...](http://www.willhackforsushi.com/presentations/PenTest_PerfectStorm_Part_1.pdf)
(See slide 11-14) These slides describe the wifi tool called AirCSRF, which
does basically the same attack, but over open wifi.

------
terminado
Hmmm, what a short article. All it says is:

    
    
      It's actually impossible to detect these kinds of 
      attacks. Please go about your business.

~~~
un1xl0ser
I completely agree. While theoretically possible to do given full packet
captures, it does not scale. IDS/IPS systems are not in a place to operate at
this level and keep this much state.

It's more likely that it would be detected based on the nature of the injected
malicious data.

------
nayuki
I found the title to be misleading. I thought it referred to the use of
quantum computing to break public key cryptography and inject data.

But instead, it's just some dumb TCP man-in-the-middle spoofing, only a bit
more sophisticated than Comcast's RST attacks.

~~~
schoen
QUANTUM is NSA's own name for its man-on-the-side attacks, so the infelicitous
naming started elsewhere, not with the author of this article.

------
yAnonymous
Aren't there firewall rules to prevent IP spoofing in most civilized
countries?

~~~
uulbiy
IP spoofing can be prevented by ISPs[1] but I don't thing there is an
incentive for them to do it. That could not stop the NSA anyway.

[1]: [http://security.stackexchange.com/questions/1062/why-dont-
is...](http://security.stackexchange.com/questions/1062/why-dont-isps-filter-
on-source-address-to-prevent-spoofing)

~~~
SCHiM
Also some (many?) ISPs have asymmetric routing, preventing an easy
implementation of anti-spoofing mechanisms.

------
tux
I think this type of attack will be useless if you use DNSCrypt + VPN
(encrypted OpenVPN/SSH traffic) not to mention TOR. Also, there is a new type
of VPN @
[https://www.goldenfrog.com/vyprvpn/chameleon](https://www.goldenfrog.com/vyprvpn/chameleon)

~~~
SG-
Tunneling is good if they are targeting you locally, but if they see tunnel
data going to a server which is easy to see they'll simply target you at the
other end.

~~~
tux
Good luck with that when there is thousands of people using the same VPN
service, also randomization of IP addresses. However this is only if
Evercookie are dealt with. @
[http://en.wikipedia.org/wiki/Evercookie](http://en.wikipedia.org/wiki/Evercookie)
Blocking Evercookie blocking is relatively easy now, if you disable JavaScript
and use things like NoScript and Random Agent Spoofer. But then also don't
forget about the recent VPN's ip leak through WebRTC which can be disabled
with setting media.peerconnection.enabled to false If you're paranoid you can
also use Qubes or Tails OS.

~~~
SCHiM
Hmm I'm not sure if a vpn will protect you from this attack. Your traffic will
need to cross out of the vpn somewhere/sometime. Unless you're connecting to a
hidden service or something.

It actually depends more on whether you use https on your first connection or
not. Because even if the server is set up to only accept https and it tries to
redirect you at the first opportunity you'll be vulnerable.

Generally a server configured to use https only will still listen on port 80,
and send a 302 to redirect you to it's https version. That redirection can be
hijacked by QI.

~~~
tux
Well if that true then everyone has much bigger problem. Because then any VPN
services becomes useless. It would be nice to see if Fox-IT could do similar
tests by using VPN/TOR. But I think that VyperVPN still is the most secure VPN
if it really does have this; "Chameleon scrambles OpenVPN packet metadata to
ensure it’s not recognizable via deep packet inspection (DPI)"

