44
Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah

Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

Creating a kewl and simple

Cheating Platform on Android

Milan Gabor & Danijel Grah

Page 2: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

/WhoAreWe

> Just two guys from Slovenia

> Having fun breaking stuff

> Love to play with apps

> BSidesLV, DEF CON Wall of Sheep,

BalcCon, Hacktivity, GrrCON, Hackito

Ergo Sum, DefCamp, Hek.si

Page 3: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Famous .si people

Page 4: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Famous .si people

Page 5: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Agenda

> Android mobile apps

> Analysis (static, dynamic)

> Vaccinating APK, Android

> DEMO

> DEMO

> DEMO

> The end

Page 6: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 7: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Status 2013/2014

Page 8: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 9: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Our story

Page 10: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

> YES, we can!

> We want something that works!

> We want to test mobile apps!

Page 11: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

> Living inside of APK

> Changing and accesing variables

> Executing code at runtime

> Effectively and easy to use

> Java based

Page 12: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Demo/Video

Page 13: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

> Java code is obfuscated

> Static analysis

> Dynamical analysis

> What if

> Hard time

Page 14: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 15: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Testing app/1

> Get the APK

> Unpack

> Decompile

> Check code

> Identify important segments

Page 16: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Demo 1

Page 17: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Testing app/2

> Start simulator with proxy

> Install app in emulator or device

> Use Wireshark, Fiddler &/|| Zap &/|| Burp

to monitor network

> Run app

> See logs, dump, crashes, files

Page 18: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Request

Page 19: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Reply

Page 20: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Dictionary

> Dynamical analysis

> Reflection

> BeanShell

> Combination of static/dynamic

Page 21: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Reflection

> "Reflection" is a language's

ability to inspect and

dynamically call classes,

methods, attributes, etc. at

runtime.

> Java looking Java

Page 22: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

BeanShell

> Java Interpreter

> Scripting Language

> Small

> Embeddable / Extensible

> A natural scripting language for

Java

Page 23: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 24: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 25: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 26: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Vaccine

Page 27: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

./vaccine i game.apk

Page 28: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

./vaccine i game.apk

Page 29: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

./vaccine i game.apk

Page 30: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Vaccine UI

Page 31: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Disclaimer

This presentation was created for

educational purposes. We will not take any

responsibility for any action you cause

using the information shown in this

presentation. Please do not contact us

with blackhat type hacking requests.

Thanks!

Original taken from: http://www.lo0.ro/

Page 32: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Demo(s)

./vaccine -i android.apk -p 8888

Page 33: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 34: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 35: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 36: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Dictionary

> ADBI, DDI

> Zygote

> Shared libraries

> Hooking

> JNI and native functions

Page 37: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Injecting vaccine at runtime

>

> Prepared shared library with DDI framework

> Zygote

> When Zygote specializes the shared libary is loaded

into target proces and executed

>

(hooks) android.app.Activity onStart method

> Native methods loads classes from /data/dalvi-

cache/vaclasses.dex (Vaccine service, Beanshell)

> Native method gives execution over to original method

> Connect and use Vaccine as before

Page 38: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Demo

> Is it possible to inject Vaccine

into Google Apps at runtime?

Page 39: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Pros/cons APK Android

> APK

» No need for rooted phone

» Untrusted sources

» Download, modify, upload

> Android

» No need for APK modification

» Rooted phone

» Injecting shared libs (more skills needed)

Page 40: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 41: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Possible usage

> Not only for Android

> Reflection is still NOT dead

> Tested with Oracle Foms

> Have idea to use it with other Java

apps/applets (Minecraft maybe)

> SIMPLE and Ultimate cheating platform

Page 42: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Final thoughts

> One script, small GUI tool (never

be finished)

> Help testers, researchers

(hackers, cheaters)

> Open for suggestions,

improvements, comments

Page 43: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

Page 44: Creating a kewl and simple Cheating Platform on Android · Creating a kewl and simple Cheating Platform on Android Milan Gabor & Danijel Grah. DeepSec 2014 /WhoAreWe > Just two guys

DeepSec 2014

www.github.com/viris

@MilanGabor

@alm8i