SlideShare a Scribd company logo
Learning by Hacking 
Android application 
hacking tutorial Landice Fu! 
rusty.flower@gmail.com
About me 
Landice Fu 
Android system developer at ASUS! 
! 
FOSS user and promoter! 
! 
Android app hacker! 
! 
Ruby / JAVA / C / Qt
Android application hacking tutorial 
Background 
Knowledge 
❖ Java! 
❖ Android Application Design! 
❖ Using Android Logcat with 
Android Debug Bridge (ADB)! 
❖ Assembly syntax
My proclamation about this presentation 
❖ The application binary and 
decompiled code I use in this 
presentation are only for 
teaching and learning! 
! 
❖ After the presentation, I would 
not provide or use them in 
ANY circumstances and I will 
immediately delete them
You must be really bad! 
❖ Pirate! 
❖ Stealing accounts and data! 
❖ Mess up the device! 
❖ BitCoin mining using others’ device
Learning by hacking - android application hacking tutorial
What about… 
❖ UI Localization! 
❖ Ad. removal! 
❖ Resource extraction! 
❖ Wow, that’s cool! 
How did you do that?! 
❖ Fix the bug yourself! 
❖ Get to know your enemy and 
how to better protect your 
product! 
❖ Add some features to it 
Are you kidding?
Learning by hacking - android application hacking tutorial
APKTOOL 
❖ https://code.google.com/p/android-apktool/! 
❖ Command line tool for disassembling/assembling APK! 
❖ Decompile APK 
apktool d file_name.apk! 
❖ Rebuild APK 
apktool b folder_name
xxxxx!Free 
Localization Demo 
❖ You don’t even need to know how to 
write android app or JAVA! 
! 
❖ Android multi-language support 
mechanism [1][2]! 
! 
[1] http://developer.android.com/training/basics/supporting-devices/languages.html! ! 
[2] http://jjnnykimo.pixnet.net/blog/post/37831205-android%E5%A4%9A%E5%9C%8B%E8%AA 
%9E%E8%A8%80%E8%B3%87%E6%96%99%E5%A4%BE%E5%91%BD%E5%90%8D 
%E6%96%B9%E5%BC%8F
Localization Demo 
❖ Get the original APK! 
❖ AndroidAssistant (backup)! 
❖ /data/app/ (root access)! 
❖ Copy values folder to 
values-zh-rTW! 
❖ Localize the content of 
values-zh-rTW/strings.xml! 
❖ Build and sign the APK
Smali/Baksmali 
❖ Assembler/disassembler for the dex format used by Dalvik! 
❖ The syntax is loosely based on Jasmin’s dedexer's syntax! 
❖ Supports the full functionality of the dex format! 
❖ Annotations (@Override, @SuppressWarnings …)! 
❖ Debug Information! 
❖ Line Information! 
❖ Etc.! 
❖ https://code.google.com/p/smali/
Dalvik opcodes 
❖ Write a simple application and decompile it and see how it is 
turned into Dalvik operations! 
❖ http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html! 
❖ http://www.netmite.com/android/mydroid/dalvik/docs/ 
dalvik-bytecode.html
Types in smali 
Smali JAVA Primitive Type 
V void - can only be used for return types 
Z boolean 
B byte 
S short 
C char 
I int 
J long (64 bits) 
F float 
D double 
Class Object Lcom/lansion/myapp/xxxparser;
Framework Resource 
❖ Some code and resources that are built into the Android 
system on your device! 
❖ /system/framework/framework-res.apk! 
❖ Installing framework resource for apktool 
apktool if framework-res.apk
Integrated 
Development Hacking 
Environment
Virtuous Ten Studio (VTS) 
❖ Integrated Reverse Engineering Environment for APK! 
❖ Built-in ApkTool, ADB, Zipalign, Sign, dex2jar…! 
❖ Support for APKs and framework JARs! 
❖ Text editing of smali, xml files with syntax highlighting, live 
checking and code folding! 
❖ M10 file editing (HTC Sense)! 
❖ Unpack/ repack boot images! 
❖ Generate JAVA sources using multiple libraries! 
❖ http://virtuous-ten-studio.com/
Demo: Remove the ad. from xxxxx!free 
❖ What you need! 
❖ Know the API of libraries! 
❖ Know the API of Android! 
❖ Luck! 
❖ Patience! 
❖ Tip1 : When you don’t know how to do something in 
smali, just write it in JAVA and decompile it
Source Obfuscation 
❖ Make it really difficult for 
human to understand and time 
consuming to hack! 
❖ Make the names of variables, 
methods, classes and 
packages meaningless! 
❖ Remove debug information! 
❖ Complicated call flow! 
❖ Redundant source code! 
❖ …………..! 
❖ Penalty of obfuscation 
Stop laughing…! 
This is you!!
Learning by hacking - android application hacking tutorial
Learning by hacking - android application hacking tutorial
Build your own crack tool 
❖ Provide static functions! 
❖ Add logcat logs with variable states! 
❖ Add stack trace dump! 
❖ Do the complicated tricks out side of the original 
program (much easier in JAVA)
A more difficult task - ??????? 
❖ UI is always the key to find the 
starting point! 
❖ Resource ID (name) turns into 
constant value map! 
❖ Insert the snippets decompiled 
from your crack tool! 
❖ Most of the local license checking 
is not too complicated! 
❖ Altering one of the boolean-returning 
function does the trick 
in a majority of cases
Learning by hacking - android application hacking tutorial
Still a piece of cake 
❖ Knowing the system API is 
very helpful! 
❖ More complicated check 
might involve getting IMEI, 
MAC… from your device! 
❖ You still can trick the 
application by replacing the 
system API call to your own 
function
What I did to Age of Empires on Android 
❖ Modify the menu bar to provide control interface! 
❖ TCP server to communication with another Android 
device with the same hacked APK! 
❖ Add a robot state machine to get money, resource… 
from the other account without effort.
Protect your work 
❖ Design with NDK! 
❖ Using framework like cocos2d (generates native library)! 
❖ Don’t just use one method for checking! 
❖ Strong obfuscation! 
❖ Provide the content using web! 
❖ Find a way to mess up the decompiler
What you might be interested in 
❖ You can use the decompiled code from other apps in 
your application! 
❖ Embed a broadcast receiver to interact with external 
application
Thanks for your attention

Recommended

Hacking your Android (slides)
Hacking your Android (slides)
Justin Hoang
 
The art of android hacking
The art of android hacking
Abhinav Mishra
 
[Wroclaw #2] iOS Security - 101
[Wroclaw #2] iOS Security - 101
OWASP
 
Hacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
Android Hacking
Android Hacking
antitree
 
My Null Android Penetration Session
My Null Android Penetration Session
Avinash Sinha
 
Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]
Kuba Břečka
 
The Hookshot: Runtime Exploitation
The Hookshot: Runtime Exploitation
Prathan Phongthiproek
 
Android security and penetration testing | DIVA | Yogesh Ojha
Android security and penetration testing | DIVA | Yogesh Ojha
Yogesh Ojha
 
Android App Hacking - Erez Metula, AppSec
Android App Hacking - Erez Metula, AppSec
DroidConTLV
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop
OWASP
 
Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]
Prathan Phongthiproek
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensics
viaForensics
 
Android pen test basics
Android pen test basics
OWASPKerala
 
Drozer - An Android Application Security Tool
Drozer - An Android Application Security Tool
nullowaspmumbai
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
nullowaspmumbai
 
Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)
ClubHack
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
Aditya K Sood
 
Null 14 may_lesser_known_attacks_by_ninadsarang
Null 14 may_lesser_known_attacks_by_ninadsarang
Ninad Sarang
 
Android Security & Penetration Testing
Android Security & Penetration Testing
Subho Halder
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthinkspa
 
Andriod Pentesting and Malware Analysis
Andriod Pentesting and Malware Analysis
n|u - The Open Security Community
 
iOS Application Security
iOS Application Security
Egor Tolstoy
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
Andreas Kurtz
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testing
eightbit
 
Fuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 June
nullowaspmumbai
 
Hacking android apps by srini0x00
Hacking android apps by srini0x00
srini0x00
 
Making Enterprise-Ready Plugins - Kaj Kandler JUC West 2015
Making Enterprise-Ready Plugins - Kaj Kandler JUC West 2015
Black Duck by Synopsys
 
How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...
Christoph Matthies
 
Reverse Engineering Android Application
Reverse Engineering Android Application
n|u - The Open Security Community
 

More Related Content

What's hot (20)

Android security and penetration testing | DIVA | Yogesh Ojha
Android security and penetration testing | DIVA | Yogesh Ojha
Yogesh Ojha
 
Android App Hacking - Erez Metula, AppSec
Android App Hacking - Erez Metula, AppSec
DroidConTLV
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop
OWASP
 
Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]
Prathan Phongthiproek
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensics
viaForensics
 
Android pen test basics
Android pen test basics
OWASPKerala
 
Drozer - An Android Application Security Tool
Drozer - An Android Application Security Tool
nullowaspmumbai
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
nullowaspmumbai
 
Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)
ClubHack
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
Aditya K Sood
 
Null 14 may_lesser_known_attacks_by_ninadsarang
Null 14 may_lesser_known_attacks_by_ninadsarang
Ninad Sarang
 
Android Security & Penetration Testing
Android Security & Penetration Testing
Subho Halder
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthinkspa
 
Andriod Pentesting and Malware Analysis
Andriod Pentesting and Malware Analysis
n|u - The Open Security Community
 
iOS Application Security
iOS Application Security
Egor Tolstoy
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
Andreas Kurtz
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testing
eightbit
 
Fuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 June
nullowaspmumbai
 
Hacking android apps by srini0x00
Hacking android apps by srini0x00
srini0x00
 
Making Enterprise-Ready Plugins - Kaj Kandler JUC West 2015
Making Enterprise-Ready Plugins - Kaj Kandler JUC West 2015
Black Duck by Synopsys
 
Android security and penetration testing | DIVA | Yogesh Ojha
Android security and penetration testing | DIVA | Yogesh Ojha
Yogesh Ojha
 
Android App Hacking - Erez Metula, AppSec
Android App Hacking - Erez Metula, AppSec
DroidConTLV
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop
OWASP
 
Mobile Application Pentest [Fast-Track]
Mobile Application Pentest [Fast-Track]
Prathan Phongthiproek
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensics
viaForensics
 
Android pen test basics
Android pen test basics
OWASPKerala
 
Drozer - An Android Application Security Tool
Drozer - An Android Application Security Tool
nullowaspmumbai
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
nullowaspmumbai
 
Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)
ClubHack
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
Aditya K Sood
 
Null 14 may_lesser_known_attacks_by_ninadsarang
Null 14 may_lesser_known_attacks_by_ninadsarang
Ninad Sarang
 
Android Security & Penetration Testing
Android Security & Penetration Testing
Subho Halder
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthinkspa
 
iOS Application Security
iOS Application Security
Egor Tolstoy
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
Andreas Kurtz
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testing
eightbit
 
Fuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 June
nullowaspmumbai
 
Hacking android apps by srini0x00
Hacking android apps by srini0x00
srini0x00
 
Making Enterprise-Ready Plugins - Kaj Kandler JUC West 2015
Making Enterprise-Ready Plugins - Kaj Kandler JUC West 2015
Black Duck by Synopsys
 

Viewers also liked (20)

How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...
Christoph Matthies
 
Reverse Engineering Android Application
Reverse Engineering Android Application
n|u - The Open Security Community
 
Attacking and Defending Mobile Applications
Attacking and Defending Mobile Applications
Jerod Brennen
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
Gabor Paller
 
Hacking Mobile Apps
Hacking Mobile Apps
Sophos Benelux
 
Mobile Hacking
Mobile Hacking
Novizul Evendi
 
Reverse engineering android apps
Reverse engineering android apps
Pranay Airan
 
Practice of Android Reverse Engineering
Practice of Android Reverse Engineering
National Cheng Kung University
 
Dancing with dalvik
Dancing with dalvik
Thomas Richards
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
National Cheng Kung University
 
Hacking Tutorial for Apps
Hacking Tutorial for Apps
Grant Eaton
 
CyberLab CCEH Session -13 Hacking Web Applications
CyberLab CCEH Session -13 Hacking Web Applications
CyberLab
 
FIDO, PKI & beyond: Where Authentication Meets Identification
FIDO, PKI & beyond: Where Authentication Meets Identification
FIDO Alliance
 
Web Application Hacking
Web Application Hacking
SensePost
 
FIDO Webinar – A New Model for Online Authentication: Implications for Policy...
FIDO Webinar – A New Model for Online Authentication: Implications for Policy...
FIDO Alliance
 
Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)
ClubHack
 
Smali语法
Smali语法
xiaoshan8743
 
RoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails example
Railwaymen
 
Hacking ingress
Hacking ingress
Eran Goldstein
 
Toward Reverse Engineering of VBA Based Excel Spreadsheets Applications
Toward Reverse Engineering of VBA Based Excel Spreadsheets Applications
REvERSE University of Naples Federico II
 
How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...
Christoph Matthies
 
Attacking and Defending Mobile Applications
Attacking and Defending Mobile Applications
Jerod Brennen
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
Gabor Paller
 
Reverse engineering android apps
Reverse engineering android apps
Pranay Airan
 
Hacking Tutorial for Apps
Hacking Tutorial for Apps
Grant Eaton
 
CyberLab CCEH Session -13 Hacking Web Applications
CyberLab CCEH Session -13 Hacking Web Applications
CyberLab
 
FIDO, PKI & beyond: Where Authentication Meets Identification
FIDO, PKI & beyond: Where Authentication Meets Identification
FIDO Alliance
 
Web Application Hacking
Web Application Hacking
SensePost
 
FIDO Webinar – A New Model for Online Authentication: Implications for Policy...
FIDO Webinar – A New Model for Online Authentication: Implications for Policy...
FIDO Alliance
 
Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)
ClubHack
 
RoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails example
Railwaymen
 

Similar to Learning by hacking - android application hacking tutorial (20)

hashdays 2011: Tobias Ospelt - Reversing Android Apps - Hacking and cracking ...
hashdays 2011: Tobias Ospelt - Reversing Android Apps - Hacking and cracking ...
Area41
 
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
Stephan Chenette
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Who Needs Thumbs? Reverse Engineering Scramble with Friends v1.1
Who Needs Thumbs? Reverse Engineering Scramble with Friends v1.1
Apkudo
 
Decompiling Android
Decompiling Android
Godfrey Nolan
 
LinkedIn - Disassembling Dalvik Bytecode
LinkedIn - Disassembling Dalvik Bytecode
Alain Leon
 
Droidcon Greece '15 - Reverse Engineering in Android: Countermeasures and Tools
Droidcon Greece '15 - Reverse Engineering in Android: Countermeasures and Tools
Dario Incalza
 
Introduction to Android Development and Security
Introduction to Android Development and Security
Kelwin Yang
 
Android village @nullcon 2012
Android village @nullcon 2012
hakersinfo
 
Android tutorial
Android tutorial
Avinash Nandakumar
 
Android-Tutorial.ppt
Android-Tutorial.ppt
siddharthsingh496426
 
Android
Android
Jesus_Aguirre
 
Null Dubai Humla_Romansh_Yadav_Android_app_pentesting
Null Dubai Humla_Romansh_Yadav_Android_app_pentesting
Romansh Yadav
 
Android tutorial
Android tutorial
Techacademy Software
 
Android tutorial
Android tutorial
Ed Zel
 
Android tutorial
Android tutorial
katayoon_bz
 
Android tutorial
Android tutorial
Keshav Chauhan
 
Introduction to mobile reversing
Introduction to mobile reversing
jduart
 
Introduction to mobile reversing
Introduction to mobile reversing
zynamics GmbH
 
Android tutorial
Android tutorial
Alberto Jr Gaudicos
 
hashdays 2011: Tobias Ospelt - Reversing Android Apps - Hacking and cracking ...
hashdays 2011: Tobias Ospelt - Reversing Android Apps - Hacking and cracking ...
Area41
 
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
Stephan Chenette
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Who Needs Thumbs? Reverse Engineering Scramble with Friends v1.1
Who Needs Thumbs? Reverse Engineering Scramble with Friends v1.1
Apkudo
 
LinkedIn - Disassembling Dalvik Bytecode
LinkedIn - Disassembling Dalvik Bytecode
Alain Leon
 
Droidcon Greece '15 - Reverse Engineering in Android: Countermeasures and Tools
Droidcon Greece '15 - Reverse Engineering in Android: Countermeasures and Tools
Dario Incalza
 
Introduction to Android Development and Security
Introduction to Android Development and Security
Kelwin Yang
 
Android village @nullcon 2012
Android village @nullcon 2012
hakersinfo
 
Null Dubai Humla_Romansh_Yadav_Android_app_pentesting
Null Dubai Humla_Romansh_Yadav_Android_app_pentesting
Romansh Yadav
 
Android tutorial
Android tutorial
Ed Zel
 
Android tutorial
Android tutorial
katayoon_bz
 
Introduction to mobile reversing
Introduction to mobile reversing
jduart
 
Introduction to mobile reversing
Introduction to mobile reversing
zynamics GmbH
 

Recently uploaded (20)

grade 9 science q1 quiz.pptx science quiz
grade 9 science q1 quiz.pptx science quiz
norfapangolima
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
Machine Learning - Classification Algorithms
Machine Learning - Classification Algorithms
resming1
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
IntroSlides-June-GDG-Cloud-Munich community [email protected]
IntroSlides-June-GDG-Cloud-Munich community [email protected]
Luiz Carneiro
 
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
Taqyea
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
samueljackson3773
 
OCS Group SG - HPHT Well Design and Operation - SN.pdf
OCS Group SG - HPHT Well Design and Operation - SN.pdf
Muanisa Waras
 
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
 
Great power lithium iron phosphate cells
Great power lithium iron phosphate cells
salmankhan835951
 
NALCO Green Anode Plant,Compositions of CPC,Pitch
NALCO Green Anode Plant,Compositions of CPC,Pitch
arpitprachi123
 
社内勉強会資料_Chain of Thought .
社内勉強会資料_Chain of Thought .
NABLAS株式会社
 
20CE601- DESIGN OF STEEL STRUCTURES ,INTRODUCTION AND ALLOWABLE STRESS DESIGN
20CE601- DESIGN OF STEEL STRUCTURES ,INTRODUCTION AND ALLOWABLE STRESS DESIGN
gowthamvicky1
 
Microwatt: Open Tiny Core, Big Possibilities
Microwatt: Open Tiny Core, Big Possibilities
IBM
 
Cadastral Maps
Cadastral Maps
Google
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
Modern multi-proposer consensus implementations
Modern multi-proposer consensus implementations
François Garillot
 
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Alexandra N. Martinez
 
grade 9 science q1 quiz.pptx science quiz
grade 9 science q1 quiz.pptx science quiz
norfapangolima
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
Machine Learning - Classification Algorithms
Machine Learning - Classification Algorithms
resming1
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
最新版美国圣莫尼卡学院毕业证(SMC毕业证书)原版定制
Taqyea
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
samueljackson3773
 
OCS Group SG - HPHT Well Design and Operation - SN.pdf
OCS Group SG - HPHT Well Design and Operation - SN.pdf
Muanisa Waras
 
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
 
Great power lithium iron phosphate cells
Great power lithium iron phosphate cells
salmankhan835951
 
NALCO Green Anode Plant,Compositions of CPC,Pitch
NALCO Green Anode Plant,Compositions of CPC,Pitch
arpitprachi123
 
社内勉強会資料_Chain of Thought .
社内勉強会資料_Chain of Thought .
NABLAS株式会社
 
20CE601- DESIGN OF STEEL STRUCTURES ,INTRODUCTION AND ALLOWABLE STRESS DESIGN
20CE601- DESIGN OF STEEL STRUCTURES ,INTRODUCTION AND ALLOWABLE STRESS DESIGN
gowthamvicky1
 
Microwatt: Open Tiny Core, Big Possibilities
Microwatt: Open Tiny Core, Big Possibilities
IBM
 
Cadastral Maps
Cadastral Maps
Google
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
Modern multi-proposer consensus implementations
Modern multi-proposer consensus implementations
François Garillot
 
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Montreal Dreamin' 25 - Introduction to the MuleSoft AI Chain (MAC) Project
Alexandra N. Martinez
 

Learning by hacking - android application hacking tutorial

  • 1. Learning by Hacking Android application hacking tutorial Landice Fu! [email protected]
  • 2. About me Landice Fu Android system developer at ASUS! ! FOSS user and promoter! ! Android app hacker! ! Ruby / JAVA / C / Qt
  • 3. Android application hacking tutorial Background Knowledge ❖ Java! ❖ Android Application Design! ❖ Using Android Logcat with Android Debug Bridge (ADB)! ❖ Assembly syntax
  • 4. My proclamation about this presentation ❖ The application binary and decompiled code I use in this presentation are only for teaching and learning! ! ❖ After the presentation, I would not provide or use them in ANY circumstances and I will immediately delete them
  • 5. You must be really bad! ❖ Pirate! ❖ Stealing accounts and data! ❖ Mess up the device! ❖ BitCoin mining using others’ device
  • 7. What about… ❖ UI Localization! ❖ Ad. removal! ❖ Resource extraction! ❖ Wow, that’s cool! How did you do that?! ❖ Fix the bug yourself! ❖ Get to know your enemy and how to better protect your product! ❖ Add some features to it Are you kidding?
  • 9. APKTOOL ❖ https://code.google.com/p/android-apktool/! ❖ Command line tool for disassembling/assembling APK! ❖ Decompile APK apktool d file_name.apk! ❖ Rebuild APK apktool b folder_name
  • 10. xxxxx!Free Localization Demo ❖ You don’t even need to know how to write android app or JAVA! ! ❖ Android multi-language support mechanism [1][2]! ! [1] http://developer.android.com/training/basics/supporting-devices/languages.html! ! [2] http://jjnnykimo.pixnet.net/blog/post/37831205-android%E5%A4%9A%E5%9C%8B%E8%AA %9E%E8%A8%80%E8%B3%87%E6%96%99%E5%A4%BE%E5%91%BD%E5%90%8D %E6%96%B9%E5%BC%8F
  • 11. Localization Demo ❖ Get the original APK! ❖ AndroidAssistant (backup)! ❖ /data/app/ (root access)! ❖ Copy values folder to values-zh-rTW! ❖ Localize the content of values-zh-rTW/strings.xml! ❖ Build and sign the APK
  • 12. Smali/Baksmali ❖ Assembler/disassembler for the dex format used by Dalvik! ❖ The syntax is loosely based on Jasmin’s dedexer's syntax! ❖ Supports the full functionality of the dex format! ❖ Annotations (@Override, @SuppressWarnings …)! ❖ Debug Information! ❖ Line Information! ❖ Etc.! ❖ https://code.google.com/p/smali/
  • 13. Dalvik opcodes ❖ Write a simple application and decompile it and see how it is turned into Dalvik operations! ❖ http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html! ❖ http://www.netmite.com/android/mydroid/dalvik/docs/ dalvik-bytecode.html
  • 14. Types in smali Smali JAVA Primitive Type V void - can only be used for return types Z boolean B byte S short C char I int J long (64 bits) F float D double Class Object Lcom/lansion/myapp/xxxparser;
  • 15. Framework Resource ❖ Some code and resources that are built into the Android system on your device! ❖ /system/framework/framework-res.apk! ❖ Installing framework resource for apktool apktool if framework-res.apk
  • 17. Virtuous Ten Studio (VTS) ❖ Integrated Reverse Engineering Environment for APK! ❖ Built-in ApkTool, ADB, Zipalign, Sign, dex2jar…! ❖ Support for APKs and framework JARs! ❖ Text editing of smali, xml files with syntax highlighting, live checking and code folding! ❖ M10 file editing (HTC Sense)! ❖ Unpack/ repack boot images! ❖ Generate JAVA sources using multiple libraries! ❖ http://virtuous-ten-studio.com/
  • 18. Demo: Remove the ad. from xxxxx!free ❖ What you need! ❖ Know the API of libraries! ❖ Know the API of Android! ❖ Luck! ❖ Patience! ❖ Tip1 : When you don’t know how to do something in smali, just write it in JAVA and decompile it
  • 19. Source Obfuscation ❖ Make it really difficult for human to understand and time consuming to hack! ❖ Make the names of variables, methods, classes and packages meaningless! ❖ Remove debug information! ❖ Complicated call flow! ❖ Redundant source code! ❖ …………..! ❖ Penalty of obfuscation Stop laughing…! This is you!!
  • 22. Build your own crack tool ❖ Provide static functions! ❖ Add logcat logs with variable states! ❖ Add stack trace dump! ❖ Do the complicated tricks out side of the original program (much easier in JAVA)
  • 23. A more difficult task - ??????? ❖ UI is always the key to find the starting point! ❖ Resource ID (name) turns into constant value map! ❖ Insert the snippets decompiled from your crack tool! ❖ Most of the local license checking is not too complicated! ❖ Altering one of the boolean-returning function does the trick in a majority of cases
  • 25. Still a piece of cake ❖ Knowing the system API is very helpful! ❖ More complicated check might involve getting IMEI, MAC… from your device! ❖ You still can trick the application by replacing the system API call to your own function
  • 26. What I did to Age of Empires on Android ❖ Modify the menu bar to provide control interface! ❖ TCP server to communication with another Android device with the same hacked APK! ❖ Add a robot state machine to get money, resource… from the other account without effort.
  • 27. Protect your work ❖ Design with NDK! ❖ Using framework like cocos2d (generates native library)! ❖ Don’t just use one method for checking! ❖ Strong obfuscation! ❖ Provide the content using web! ❖ Find a way to mess up the decompiler
  • 28. What you might be interested in ❖ You can use the decompiled code from other apps in your application! ❖ Embed a broadcast receiver to interact with external application
  • 29. Thanks for your attention