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

24
Abusing Google Apps & Data API Google is my C2.

description

This presentation is about abusing Google Apps to implement various attacks that ranges from Hostless Phishing to setting up a Botnet’s Command & Control Center.

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

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

Abusing Google Apps & Data

API Google is my C2.

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

#whoami

Information Security EnthusiastFounder of OWASP Xenotix XSS Exploit FrameworkStrong supporter of Free and Open Information

Security Education. Runs a DEFCON chapter at Kerala.Another Leaner.

www.opensecurity.in

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

disclaimer

All third party images are the property of their respective owners.

Just pointing out how some innocent services can be abused.

I am not responsible for anything.

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

Agenda

IntroAbusing AppScript for e-mail bombingData URI + Google Forms + TinyURL = Phishing VariantGoogle Spreadsheet + DATA API = A Botnet

Communication ChannelxBOT : A prototype BotConclude

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

Google Data API

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

Email Bombing: the old ways

Methods of e-bombingOpen Relay servers

PHP/ASP/JSP Mail Functions

Misconfigured Mail Sending features in Web Apps

Now blocked by services like Gmail, Live, Yahoo etc. E-bombs will end up in SPAM folder.

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

Google AppScript

Google Apps Script is a JavaScript cloud scripting language.

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

AppScript : Class MailApp

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

Little Mutation

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

DEMOhttp://www.youtube.com/watch?v=mTHIcdkdKXY

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

Data URI

data:text/html,<body>hi</body>

data:text/html;base64,PGJvZHk+aGk8L2JvZHk+

Data URI allows you to include data in-line in web pages via URL

Data URI Phishing was described by “Henning Klevjer” in his Paper

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

DATA URI + Google Forms + Tiny URL = Beauty

Combining all these stuff gives a beautiful Phishing Attack.

A Perfect addition to Social Engineering.

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

Basic Idea

FBServer

http://tinyurl.com/fb

data:text/html,<body>hi</body>

Injected with our JavaScript

credentials

Google Spreadsheet

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

JavaScript to do the work

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

DEMOhttp://www.youtube.com/watch?v=htoiNO50fBc

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

Channelizing Google SpreadSheet

Google SpreadSheet can store data online.You can export the contents of the spreadsheet as

json, rss and tsvRead and Write remotelySSL Hmmm!What else you want?

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

Selecting the right URL format

JSON RSS TSV Source0

100000

200000

300000

400000

500000

600000

Data Length

Data Length

JSON RSS TSV Source0

1

2

3

4

5

6

7

8

9

Execution Time

Execution Time

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

TSV

RSS

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

What is xBOT?

xBOT is a PoC bot.Uses Google Spreadsheet and Forms to

implement it’s Communication Channel.Uses Google DATA API to extract the commands.Use a third party server for file hosting.

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

xBOT Architecture

Google FormGoogle

Spreadsheet

xbot.py

xBOT VictimFile Hosting

File Upload

SendResponse

Get CommandsEvery 4 Sec

File URL

Send Commands

Command and Control

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

DEMOhttp://www.youtube.com/watch?v=TBP7ynUalOY

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

Conclusion

Nasty things can be built over Innocent stuffs.These are some possible ways an attacker could

use.Interesting Fact: There is no captcha for Google

Forms.That’s all

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

Thank You

@ajinabraham

[email protected]