Gmail hacking, a mine of data for phishing and spam attacks

Pierluigi Paganini June 12, 2014

An Israeli researcher disclosed a Gmail vulnerability, fixed by Google, that exposes an indefinite number of Gmail addresses and business emails.

Google company has fixed a critical vulnerability, disclosed by the Israeli researcher Oren Hafif,  that exposes an indefinite number of Gmail addresses. Technically the experts has discovered that it is possible to bruteforce a token in a Gmail URL used in delegation process to retrieve a list of Google email addresses.

“I bruteforced a token in a Gmail URL to extract all of email addresses hosted on Google,” Hafif wrote.

Hafif, the researcher at Trustwave’s SpiderLabs, disclosed details on how he was able to abuse a token exposed in a URL to reveal every Gmail address, Google assigned him $500 as remuneration for the bug bounty program.

The access to the entire list of Gmail account could give the attackers the needed information for phishing campaigns and targeted attacks.

Hafif started testing the Google’s Gmail delegation feature which allows an account holder to delegate the access to others by adding another account in the settings tab.

Google Gmail account delegation

At this point the verification process implemented by Google returns an email indicating that access is pending. The delegated have to click on an “accept” or “rejection” link embedded in the email to complete the verification process. The URLs composed by Google for Accept and Reject action are nearly identical, minus a couple of important differences that Hafif was able to take advantage of.

Accept: https://mail[.]google[.]com/mail/mdd-f560c0c4e1-oren.hafif%40gmail.com-bbD8J0t6P6JNOUO36vY6S_pZJy4

Reject: https://mail[.]google[.]com/mail/mda-f560c0c4e1-oren.hafif%40gmail.com-bbD8J0t6P6JNOUO36vY6S_pZJy4

The researcher made a detailed analysis of the URLs used by Google

https://mail.google.com/mail/mdd-f560c0c4e1-oren.hafif%40gmail.com-bbD8J0t6P6JNOUO36vY6S_pZJy4

  1. The first part “https://mail.google.com/mail/”, is just the normal mapping to the Gmail application.
  2. The second “/mdd” is the mapping for the mail delegation deny servlet.
  3. What does “f560c0c4e1” stand for? It looks like a token. There is some hope here, as this one is so short and it’s hexadecimal
  4. My email address – probably not relevant.
  5. What does “bbD8J0t6P6JNOUO36vY6S_pZJy4” stand for? It looks like an encoded blob. This is normally a BAD sign as Google loves to HMAC request URLs and that could be a giant “pain in the scans”.

Resuming the mdd and mda piece distinguish mail delegation actions (accept or deny), following the researcher noticed the sequence of characters used as authentication token. The sequence of characters at the end of the URL is a sort of “encoded blob.”

“So I start a bruteforce – and what do you know… I get email addresses, lots of lots of email addresses. So many email addresses that every single tool I use for the bruteforce collapses,” “So I write my own multithreaded script in ruby – which is not as fast as I want.” Hafif wrote.

Hafif, who is a researcher with Trustwave’s SpiderLabs, also noticed another the within the amount of email addresses retrieved there were also not Gmail addresses, the circumstance suggests that they were businesses using Google Apps as a mail service.

“That is actually a pretty hot topic right now. Should we move to the cloud? Should we use Gmail as our organizational email manager?”  “As the argument about the future of enterprise email goes on with a focus on security – leakage of organizational emails might assist attackers in their spear-phishing attacks and eventually expose the company to advance persistent threats.” added Hafif.

Hafif used the OWASP tool DirBuster as URL fuzzer, he provided to the tool a custom-built Ruby dictionary of all 10-HEX character long token combinations to generate all valid tokens. From each generated token the researcher has accessed to the valid associated email addresses with Burp Intruder attack tool.

E-mails are precious commodities in the underground, their knowledge allows attackers to improve phishing and spam campaigns, let’s remember that email addresses are often used as a user name.

Pierluigi Paganini

(Security Affairs –  Google, hacking)  



you might also like

leave a comment