News for hackers. Stuff that matters.
Re:The closest I've ever come to falling for a Gmail phishin... by dankohn1 on Wednesday January 11, 2017 @08:01AM (#13373609)
No. A man-in-the-middle phishing attack can ask you for your second factor and pass it through to Gmail.
Re:The closest I've ever come to falling for a Gmail phishin... by acdha on Wednesday January 11, 2017 @08:37AM (#13373772)
This is definitely true of TOTP but U2F was designed to prevent phishing attacks by incorporating the hostname in the protocol[1], which means the attacker needs to successfully compromise SSL as well.

1. https://security.stackexchange.com/questions/71316/how-secur...

Re:The closest I've ever come to falling for a Gmail phishin... by wopwopwop on Wednesday January 11, 2017 @09:03AM (#13373895)
Very clever, thanks for sharing.

However I wouldn't want my second-factor to be attached to my browser. Seems way too volatile for me. Personally I'd rather keep TOTP and be vulnerable to time-of-use phishing.

Maybe if the browser had an OS API that a YubiKey could query...

Re:The closest I've ever come to falling for a Gmail phishin... by acdha on Wednesday January 11, 2017 @11:12AM (#13374931)
Just to extend on what jon-wood said, that's definitely the other way around: U2F is an open standard and the intelligence lives on the USB/NFC device. Any browser which implements that standard[1] can login and, especially nice for security, the browser never gets access to the keys or, with devices like the YubiKeys which require you to touch a button for each request, even the ability to authenticate without user approval.

1. Currently Chrome has this, Firefox is close (50.1 shipped it but it only works in the e10s mode), and there are extensions for Safari and older versions of Firefox.

Re:The closest I've ever come to falling for a Gmail phishin... by wopwopwop on Wednesday January 11, 2017 @12:36PM (#13375702)
sigh read my response to the other guy
Re:The closest I've ever come to falling for a Gmail phishin... by jon-wood on Wednesday January 11, 2017 @09:54AM (#13374267)
It's actually the other way round, the YubiKey (or other U2F token) has an API the browser queries, generally triggering the token requesting some sort of physical interaction.
Re:The closest I've ever come to falling for a Gmail phishin... by wopwopwop on Wednesday January 11, 2017 @11:07AM (#13374895)
I know how it is now, but that's not what I'm talking about. Currently the URL is not included in the hash, that's my point. It could be by having those two talk to each other. Who's the server and who's the client is beside my point.
Re:The closest I've ever come to falling for a Gmail phishin... by Ajedi32 on Wednesday January 11, 2017 @12:53PM (#13375852)
Huh? What are you even talking about? This comment makes no sense to me in the context of what jon-wood said.

> the URL is not included in the hash

What hash? Nobody even mentioned a hash. The crypto keys used for U2F are indeed domain-specific, if that's what you're trying to ask.

> It could be by having those two talk to each other.

Who's "those two"? And what's "it"? I'm very confused.

Re:The closest I've ever come to falling for a Gmail phishin... by wopwopwop on Wednesday January 11, 2017 @04:49PM (#13377799)
> What hash? Nobody even mentioned a hash.

I mentioned a hash. The secret is hashed together with the time. _That_ hash.

> The crypto keys used for U2F are indeed domain-specific, if that's what you're trying to ask.

I know the secret is domain-specific. What I was describing is taking the secret, and the time AND THE DOMAIN and use them to produce the hash. This would break MITM. One of the comments above me mentioned this and I run with it. But you're talking to me like you didn't read anything above....

> Who's "those two"?

Those two are the yubikey and the browser.

Re:The closest I've ever come to falling for a Gmail phishin... by Ajedi32 on Wednesday January 11, 2017 @07:51PM (#13378962)
> I mentioned a hash.

I think you're confused. You have not mentioned the word "hash" even once in this thread prior to the previous comment I replied to.

Anyway, I think you're confusing U2F with TOTP. U2F does not rely on the time at all AFAIK; it uses public key cryptography, and authenticates by signing a data structure containing the domain name of the site and a server-provided nonce (among other things).

> What I was describing is taking the secret, and the time AND THE DOMAIN and use them to produce the hash.

I think there's still some sort of disconnect here, because up until this this comment you've described nothing of the sort in this thread. Could you link the comment you're referring to where you explained all this?

> One of the comments above me mentioned this and I run with it.

If you're referring to acdha's comment about U2F, as acdha and others in this thread have explained, U2F (aka Universal 2nd Factor) is an entirely different protocol from TOTP (aka Time-based One Time Password). U2F does not use hashing or the system time in the way you seem to be envisioning, but it is also not vulnerable to phishing like TOTP is.

U2F interfaces with your browser, and uses a set of public and private keys (that is stored on the U2F device, not in your browser) to authenticate to sites in a way which can't be phished. It's not theoretical; it exists and can be used today with many popular sites, including Google, GitHub, Dropbox, and more. You just need a USB device which supports U2F (YubiKey is one, but there are many others).

Re:The closest I've ever come to falling for a Gmail phishin... by acdha on Wednesday January 11, 2017 @05:13PM (#13377982)
I think most of us are having trouble understanding exactly the question which you're trying to ask – could you try to state it clearly and precisely?
Re:The closest I've ever come to falling for a Gmail phishin... by midgetjones on Wednesday January 11, 2017 @08:03AM (#13373616)
That's assuming the attacker could log in with it before it expired, isn't it?
Re:The closest I've ever come to falling for a Gmail phishin... by danieldk on Wednesday January 11, 2017 @08:05AM (#13373624)
Yes, but as per the standard TOTP codes are valid for a window of 1 minute.

TOTP barely protects against phishing. What you want is an U2F key as the second factor. It's not like they are expensive anyway (usually 7-15 Euro) and quite some large services support U2F tokens already (Google, Dropbox, GitHub, Fastmail, etc.).

Re:The closest I've ever come to falling for a Gmail phishin... by midgetjones on Wednesday January 11, 2017 @08:11AM (#13373656)
Thanks!

Is the 1 minute window always the case? In the authenticator app, it seems like codes expire after ~30 seconds. If I wait till the last few seconds before using the code, does that make me any safer?

Re:The closest I've ever come to falling for a Gmail phishin... by garrettr_ on Wednesday January 11, 2017 @10:56AM (#13374801)
If the codes are time-based (TOTP), they are typically generated with a rolling window of 30 seconds (as you saw in Google Authenticator). The 30s rolling window is the recommended (and widely implemented) default value from the TOTP RFC [0].

It is common but not universal for sites to accept, at a given time, 1) the current U2F token, 2) the U2F token from the previous window, 3) the U2F token for the next window. This is done as a partial mitigation for potential clock skew issues on the client that's generating the TOTP codes (e.g. your phone). In practice this means every code is valid for 1m30s, although sites may customize this (with or without changing the window size, which is typically not done because that parameter must be consistent system-wide).

> If I wait till the last few seconds before using the code, does that make me any safer?

Maybe, but this is not practicable security advice. The latency of a MITM attack on a 2-factor TOTP login depends on the attack infrastructure and design, but can easily be made to be on the order of tens or hundreds or milliseconds. Reducing the window seems like it might help your security, but it can never be perfect and there is a direct tradeoff with usability because users need time to look up the codes on one device and enter them on another.

Folks often say "enable 2FA" in response to news of new and sophisticated phishing attack campaigns, but it's critical to note that most commonly deployed 2FA (TOTP, HOTP, SMS) is trivially phish-able. 2FA is not an automatic defense against phishing, although some newer designs achieve this and were created specifically with this goal in mind: U2F is a good example.

[0]: https://tools.ietf.org/html/rfc6238

Re:The closest I've ever come to falling for a Gmail phishin... by danieldk on Wednesday January 11, 2017 @10:42AM (#13374683)
The RFC recommends a time step of 30 seconds + permitting at most one previous time step for handling out of sync clocks and slow/late entry:

The validation system should compare OTPs not only with the receiving timestamp but also the past timestamps that are within the transmission delay. A larger acceptable delay window would expose a larger window for attacks. We RECOMMEND that at most one time step is allowed as the network delay.

[...]

We RECOMMEND a default time-step size of 30 seconds. This default value of 30 seconds is selected as a balance between security and usability.

Since the client's clock could be in the behind or ahead of the server's clock, I have to correct myself and the window would be 90 seconds.

One could be a bit strict and e.g. the previous time step only until 1/2-way the current time step, which would bring the window make to 60 seconds.

At any rate, all these timeframes are far to large to avoid real-time phishing attacks.

Re:The closest I've ever come to falling for a Gmail phishin... by jpalomaki on Wednesday January 11, 2017 @08:23AM (#13373701)
In some cases the server is configured to accept multiple codes (prev, current, next) to handle timesync issues between server and client (where the app is running).
Re:The closest I've ever come to falling for a Gmail phishin... by wopwopwop on Wednesday January 11, 2017 @08:58AM (#13373874)
No. How long does it take from you entering the code to the code reaching Google? A few tens of miliseconds? With a phisher in the middle it's a couple extra miliseconds.