Insidious Gmail Phishing Attacks: New Variants Leveraging An Old Scheme

Pierluigi Paganini
January 23, 2017 by
Pierluigi Paganini

The recent Gmail Phishing attacks

Recently security experts warned of a new insidious Gmail phishing campaign that can also trick tech-savvy people. Cyber-criminals leverage specially crafted URLs to trick victims into providing their Gmail credentials via a phishing page.

Victims receive a malicious an email from one of their contacts; the message pretends to carry a PDF document that can be previewed directly from Gmail. When the victim clicks on the "attachment" image included in the body of the email, he is redirected to a fake Gmail page.

Role-appropriate training to your entire workforce

Role-appropriate training to your entire workforce

Get a free year of cybersecurity skills training with your security awareness training purchase.  

Giving a close look at the URI associated with the image in the email message we can notice that at first glance it could appear as legitimate and linked to the official Google domain.

The URI to which the images of attachments point is crafted to appear legitimate:


It is interesting to note that the web browser does not display any certificate warning, but a deep inspection of the URI associated with the image reveals that the legitimate part of the URI is followed by a sequence of white spaces that prevents the victims from seeing suspicious strings at the end of the address. This string is an obfuscated script that opens a Gmail phishing page in a new tab. A technical description of the Chrome/Gmail attack has been published on Github.

Figure 1 - Image of attachment included in the phishing messages

Figure 2 - Analysis of the URI associated with the image

"You click on the image, expecting Gmail to give you a preview of the attachment. Instead, a new tab opens up, and you are prompted by Gmail to sign in again. You glance at the location bar, and you see in there. It looks like this…." states a blog post published by WordFence. "Once you complete sign-in, your account has been compromised."

This technique is not new; several victims already reported similar attacks on July 2014.

One of the main characteristics of the recent string of Gmail phishing attacks is that cyber criminals immediately accessed the compromised accounts and used them to send out phishing emails to all the victim's contacts.

At the time I was writing there aren't further information about the attacks, it is not clear if attackers have found a way to automate the process to access the victim's account once he has provided its Gmail login credentials via the phishing page.

As usual, let me suggest enabling the Two-Factor Authentication (2FA) on Gmail to avoid being victims of this phishing scheme. In this way, even if the attacker has your credentials, he also needs the verification code to access the account.

However, hackers can obtain this code if he uses a Gmail phishing page that also requests the verification code and uses it immediately after the victim provides it.

"2FA would make it harder to exploit, but phishing attacks are getting fancier. They capture the 2FA code you enter and immediately start a session elsewhere with your password and 2FA. Hardware 2FA, a security key, (such as a Yubikey) is the only likely way to prevent phishing (excluding targets of state actors)" wrote a user in a discussion on Hacker News.

Another important suggestion for users to avoid such phishing attacks is to inspect the address bar every time they sign into any web service. It is necessary to verify the protocol and the hostname. Be sure that there is nothing before the hostname '' other than 'https://' and verify the presence of the lock symbol.

You should also take special note of the green color and lock symbol that appears on the left. If you cannot verify the protocol and verify the hostname, do not attempt to sign in.

Google has been aware of this new phishing tactic since at least March 2016. For this reason, the Chrome security team suggested introducing a "Not Secure" tag in the address bar for data: blob: and other URLs that may be exploited by phishers in hacking campaigns.

I include the response provided by Google to a customer asking for more information:

"The address bar remains one of the few trusted UI components of the browsers and is the only one that can be relied upon as to what origin are the users currently visiting. If the users pay no attention to the address bar, phishing and spoofing attack are – obviously – trivial. Unfortunately, that's how the web works, and any fix that would to try to e.g. detect phishing pages based on their look would be easily bypassable in hundreds of ways. The data: URL part here is not that important as you could have a phishing on any http[s] page just as well."

Similar cases in the wild

In September 2016, experts at the phishing observatory D3Lab monitored a new phishing attack against the users of a small Italian bank, the Banca Popolare di Spoleto.

Figure 3 - Phishing attack against an Italian Bank

Attackers leveraged base64 encoding to obfuscate the website used for the phishing attack.

Victims receive an email that includes a short link that points to a PHP page hosted on a compromised website. The page is used to redirect the users to a local page that is created by the browser decoding the base64 code in the URI.

Figure 4 - Phishing attacks against an Italian bank.

The phishing attack is similar to the one observed in the last campaign against Google users. Also, in this case, hackers used a specially crafted URI that includes a portion of a legitimate URL of the bank… and the encoded phishing page.

A very old technique

It is not the first time that Google users are targeted with this technique, in 2014 phishing attack based on data URI (uniform resource identifier) targeted the accounts of the tech giant.

Below an example of the phishing messages sent to the victims:

Figure 5. Gmail phishing attack 2014

The attack leveraged on the URI scheme based on the 'data:' ta. This technique has been known since 2007 and was detailed in a paper titled "Phishing by data URI" published by the student Henning Klevjer in 2012.

The paper describes how attackers can use data URI in a phishing attack, the content of the phishing page is encoded in Base64. Experts also dubbed the technique a page-less Phishing attack that doesn't need to host the phishing content on a server.

Klevjer demonstrated how to compose a phishing page of 24,682 characters using 26-character link by using a URL shortening service.

The result was a Wikipedia login page, the URI format he adopted was:


Unfortunately, phishing attacks with data URI are very tricky because it would bypass many anti-phishing checks and victims are not able to recognize the malicious content due to Base64 encoding.

This specific phishing scheme, and its variants was used by crooks to target users of major web services, including Yahoo, Hotmail, and AOL.


See Infosec IQ in action

See Infosec IQ in action

From gamified security awareness to award-winning training, phishing simulations, culture assessments and more, we want to show you what makes Infosec IQ an industry leader.

Pierluigi Paganini
Pierluigi Paganini

Pierluigi is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group, member of Cyber G7 Workgroup of the Italian Ministry of Foreign Affairs and International Cooperation, Professor and Director of the Master in Cyber Security at the Link Campus University. He is also a Security Evangelist, Security Analyst and Freelance Writer.

Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US.

Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines.