SlideShare a Scribd company logo
1 of 45
Download to read offline
●
●
○
○
●
●
○
○
●
○
http://i.w.inmobi.com/showad.asm?u-id-map=
iB7WTkCLJvNsaEQakKKXFhk8ZEIZlnL0jqbbYexcBA
XYHH4wSKyCDWVfp+q+FeLFTQV6jS2Xg97liEzDkw+X
NTghe9ekNyMnjypmgiu7xBS1TcwZmFxYOjJkgPOzkI
9j2lryBaLlAJBSDkEqZeMVvcjcNkx+Ps6SaTRzBbYf
8UY=&u-key-ver=2198564
String aid = class.getDeclaredMethod( "getAndroidId" ,
Context. class).invoke(context); // get Android ID by Reflection
MessageDigest sha1 = getInstance( "SHA-1"); // hash
sha1.update(aid.getBytes());
byte[] digest = sha1.digest();
Random random = new Random(); // generate random key
int key = random.nextint();
// XOR Android ID with the randomly generated key
byte[] xored = customXOR(digest, key);
String encoded = Base64.encode(xored);
// send the encrypted value and key to ad server
HttpURLConnection conn = url.openConnection();
conn.write(Base64.encode(encoded).getBytes());
conn.write(("key=" + key).getBytes());
String aid = class.getDeclaredMethod( "getAndroidId" ,
Context. class).invoke(context); // get Android ID by Reflection
MessageDigest sha1 = getInstance( "SHA-1"); // hash
sha1.update(aid.getBytes());
byte[] digest = sha1.digest();
Random random = new Random(); // generate random key
int key = random.nextint();
// XOR Android ID with the randomly generated key
byte[] xored = customXOR(digest, key);
String encoded = Base64.encode(xored);
// send the encrypted value and key to ad server
HttpURLConnection conn = url.openConnection();
conn.write(Base64.encode(encoded).getBytes());
conn.write(("key=" + key).getBytes());
String aid = class.getDeclaredMethod( "getAndroidId" ,
Context. class).invoke(context); // get Android ID by Reflection
MessageDigest sha1 = getInstance( "SHA-1"); // hash
sha1.update(aid.getBytes());
byte[] digest = sha1.digest();
Random random = new Random(); // generate random key
int key = random.nextint();
// XOR Android ID with the randomly generated key
byte[] xored = customXOR(digest, key);
String encoded = Base64.encode(xored);
// send the encrypted value and key to ad server
HttpURLConnection conn = url.openConnection();
conn.write(Base64.encode(encoded).getBytes());
conn.write(("key=" + key).getBytes());
String aid = class.getDeclaredMethod( "getAndroidId" ,
Context. class).invoke(context); // get Android ID by Reflection
MessageDigest sha1 = getInstance( "SHA-1"); // hash
sha1.update(aid.getBytes());
byte[] digest = sha1.digest();
Random random = new Random(); // generate random key
int key = random.nextint();
// XOR Android ID with the randomly generated key
byte[] xored = customXOR(digest, key);
String encoded = Base64.encode(xored);
// send the encrypted value and key to ad server
HttpURLConnection conn = url.openConnection();
conn.write(Base64.encode(encoded).getBytes());
conn.write(("key=" + key).getBytes());
String aid = class.getDeclaredMethod( "getAndroidId" ,
Context. class).invoke(context); // get Android ID by Reflection
MessageDigest sha1 = getInstance( "SHA-1"); // hash
sha1.update(aid.getBytes());
byte[] digest = sha1.digest();
Random random = new Random(); // generate random key
int key = random.nextint();
// XOR Android ID with the randomly generated key
byte[] xored = customXOR(digest, key);
String encoded = Base64.encode(xored);
// send the encrypted value and key to ad server
HttpURLConnection conn = url.openConnection();
conn.write(Base64.encode(encoded).getBytes());
conn.write(("key=" + key).getBytes());
String aid = class.getDeclaredMethod( "getAndroidId" ,
Context. class).invoke(context); // get Android ID by Reflection
MessageDigest sha1 = getInstance( "SHA-1"); // hash
sha1.update(aid.getBytes());
byte[] digest = sha1.digest();
Random random = new Random(); // generate random key
int key = random.nextint();
// XOR Android ID with the randomly generated key
byte[] xored = customXOR(digest, key);
String encoded = Base64.encode(xored);
// send the encrypted value and key to ad server
HttpURLConnection conn = url.openConnection();
conn.write(Base64.encode(encoded).getBytes());
conn.write(("key=" + key).getBytes());
●
●
●
●
IMEI: 12345678
●
●
IMEI: 12345678 http://host.com/?id=39979edb58
●
●
IMEI: 12345678 http://host.com/?id=39979edb58
IMEI: 98765432
●
●
IMEI: 12345678 http://host.com/?id=39979edb58
IMEI: 98765432 http://host.com/?id=bae6a29c9b
●
○
○
○
○
○
https://ads.com/show?data=7aca67bfc75d7816a1d907fb834c8f69
https://ads.com/register?id=732d064f-a465-0414-07f9-ff7d4c27544c
https://auth.domain.com/user/sign
UUIDs: [732d064f-a465-0414-07f9-ff7d4c27544c]
Timestamps: [146897456, 146897562]
Decryption map: {"7aca67bfc75d7816a1d907fb834c8f69"=>"146897456_c734f4ec"}
https://ads.com/show?data=<TIMESTAMP>_c734f4ec
https://ads.com/register?id=<RANDOM_UUID>
https://auth.domain.com/user/sign
https://ads.com/show?data=7aca67bfc75d7816a1d907fb834c8f69
https://ads.com/register?id=732d064f-a465-0414-07f9-ff7d4c27544c
https://auth.domain.com/user/sign
UUIDs: [732d064f-a465-0414-07f9-ff7d4c27544c]
Timestamps: [146897456, 146897562]
Decryption map: {"7aca67bfc75d7816a1d907fb834c8f69"=>"146897456_c734f4ec"}
https://ads.com/show?data=<TIMESTAMP>_c734f4ec
https://ads.com/register?id=<RANDOM_UUID>
https://auth.domain.com/user/sign
https://ads.com/show?data=7aca67bfc75d7816a1d907fb834c8f69
https://ads.com/register?id=732d064f-a465-0414-07f9-ff7d4c27544c
https://auth.domain.com/user/sign
UUIDs: [732d064f-a465-0414-07f9-ff7d4c27544c]
Timestamps: [146897456, 146897562]
Decryption map: {"7aca67bfc75d7816a1d907fb834c8f69"=>"146897456_c734f4ec"}
https://ads.com/show?data=<TIMESTAMP>_c734f4ec
https://ads.com/register?id=<RANDOM_UUID>
https://auth.domain.com/user/sign
https://ads.com/show?data=7aca67bfc75d7816a1d907fb834c8f69
https://ads.com/register?id=732d064f-a465-0414-07f9-ff7d4c27544c
https://auth.domain.com/user/sign
UUIDs: [732d064f-a465-0414-07f9-ff7d4c27544c]
Timestamps: [146897456, 146897562]
Decryption map: {"7aca67bfc75d7816a1d907fb834c8f69"=>"146897456_c734f4ec"}
https://ads.com/show?data=<TIMESTAMP>_c734f4ec
https://ads.com/register?id=<RANDOM_UUID>
https://auth.domain.com/user/sign
Instrumented Environment
#1
Run
App
Sources of Leak
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
#1
Run
App
Sources of Leak
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
Contextualized Trace
#1
Run
#n
Run
...
App
Sources of Leak
......
App
Sources of Leak Contextual Info
Network Trace
Instrumented Environment
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
Contextualized Trace
#1
Run
#n
Run
... Network Behavior
Summary
App
Sources of Leak
Phase 1: Network Behavior
Summary Extraction
......
App
Sources of Leak Contextual Info
Network Trace
Instrumented Environment
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
Contextualized Trace
#1
Run
#n
Run
... Network Behavior
Summary
Contextualized Trace
Final
Run
App
Sources of Leak
Phase 1: Network Behavior
Summary Extraction
......
App
Sources of Leak
App
Sources of Leak
Contextual Info
Network Trace
Contextual Info
Network Trace
Instrumented Environment
Instrumented Environment Phase 2: Differential Analysis
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
Contextualized Trace
#1
Run
#n
Run
... Network Behavior
Summary
Contextualized Trace
Final
Run
App
Sources of Leak
Differential
Analysis
Phase 1: Network Behavior
Summary Extraction
Phase 2: Differential Analysis
......
App
Sources of Leak
App
Sources of Leak
Contextual Info
Network Trace
Contextual Info
Network Trace
Instrumented Environment
Instrumented Environment
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
Contextualized Trace
#1
Run
#n
Run
... Network Behavior
Summary
Contextualized Trace
Final
Run
App
Sources of Leak
Differential
Analysis
Leaks
Phase 1: Network Behavior
Summary Extraction
Phase 2: Differential Analysis
......
App
Sources of Leak
App
Sources of Leak
Contextual Info
Network Trace
Contextual Info
Network Trace
Instrumented Environment
Instrumented Environment
Contextual Info
Network Trace
Contextualized TraceInstrumented Environment
Contextualized Trace
#1
Run
#n
Run
... Network Behavior
Summary
Contextualized Trace
Final
Run
App
Sources of Leak
Differential
Analysis
Leaks
Phase 1: Network Behavior
Summary Extraction
Phase 2: Differential Analysis
......
App
Sources of Leak
App
Sources of Leak
Contextual Info
Network Trace
Contextual Info
Network Trace
Instrumented Environment
Instrumented Environment
●
○
○
●
○
○
○
○
●
●
●
●
○
●
○
https://h.online-metrix.net/fp/clear.png?ja=33303426773f3a39
30643667663b33383831303d343526613f2d363830247a3f363026663d33
3539347a31323838266c603d687c7672253163253066253066616f6e7465
6e762f6a732c746370626f7926636f652466723f6a747670253161273266
253266616d6d2e65616f656b69726b7573267270697867636e617730266a
683d65616437613732316431353c65613a31386e67606563303736363936
34343363266d64643f6561633336303b64336a3935316663303666636137
3261363a61616335636761266d66733f353b32306d383230613230643b65
34643934383a31663636623b32323767616126616d65613d313933333133
3331333131333133312661743d6365656e765f6f6f6a696c6d26617e3f76
72777174666566676e6665722b6d6f606b6c652733632b392e3226342d3b
...
https://h.online-metrix.net/fp/clear.png?ja=33303426773f3a3930643667663b3338
3831303d343526613f2d363830247a3f363026663d333539347a31323838266c603d687c7672
253163253066253066616f6e74656e762f6a732c746370626f7926636f652466723f6a747670
253161273266253266616d6d2e65616f656b69726b7573267270697867636e617730266a683d
65616437613732316431353c65613a31386e6760656330373636393634343363266d64643f65
61633336303b64336a39353166633036666361373261363a61616335636761266d66733f353b
32306d383230613230643b6534643934383a31663636623b32323767616126616d65613d3139
333331333331333131333133312661743d6365656e765f6f6f6a696c6d26617e3f7672777174
666566676e6665722b6d6f606b6c652733632b392e3226342d3b...
https://github.com/ucsb-seclab/agrigento
andrea.continella@polimi.it
https://conand.me
@_conand

More Related Content

Similar to Obfuscation-Resilient Privacy Leak Detection for Mobile Apps

An Introduction to Game Programming with Flash: An Introduction to Flash and ...
An Introduction to Game Programming with Flash: An Introduction to Flash and ...An Introduction to Game Programming with Flash: An Introduction to Flash and ...
An Introduction to Game Programming with Flash: An Introduction to Flash and ...
Krzysztof Opałka
 
Google
GoogleGoogle
Google
soon
 
Software Attacks on Hardware Wallets
Software Attacks on Hardware WalletsSoftware Attacks on Hardware Wallets
Software Attacks on Hardware Wallets
Priyanka Aash
 

Similar to Obfuscation-Resilient Privacy Leak Detection for Mobile Apps (20)

Who moved my pixels?!
Who moved my pixels?!Who moved my pixels?!
Who moved my pixels?!
 
executive-mba-pune.pdf
executive-mba-pune.pdfexecutive-mba-pune.pdf
executive-mba-pune.pdf
 
Developing Google Glass
Developing Google GlassDeveloping Google Glass
Developing Google Glass
 
Li How To2 10
Li How To2 10Li How To2 10
Li How To2 10
 
Common Browser Hijacking Methods
Common Browser Hijacking MethodsCommon Browser Hijacking Methods
Common Browser Hijacking Methods
 
An Introduction to Game Programming with Flash: An Introduction to Flash and ...
An Introduction to Game Programming with Flash: An Introduction to Flash and ...An Introduction to Game Programming with Flash: An Introduction to Flash and ...
An Introduction to Game Programming with Flash: An Introduction to Flash and ...
 
Smashing the stats for fun (and profit)
Smashing the stats for fun (and profit)Smashing the stats for fun (and profit)
Smashing the stats for fun (and profit)
 
Security Vulnerabilities: How to Defend Against Them
Security Vulnerabilities: How to Defend Against ThemSecurity Vulnerabilities: How to Defend Against Them
Security Vulnerabilities: How to Defend Against Them
 
Detecting Malicious Websites using Machine Learning
Detecting Malicious Websites using Machine LearningDetecting Malicious Websites using Machine Learning
Detecting Malicious Websites using Machine Learning
 
使用 Passkeys 打造無密碼驗證服務
使用 Passkeys 打造無密碼驗證服務使用 Passkeys 打造無密碼驗證服務
使用 Passkeys 打造無密碼驗證服務
 
Google
GoogleGoogle
Google
 
Software Attacks on Hardware Wallets
Software Attacks on Hardware WalletsSoftware Attacks on Hardware Wallets
Software Attacks on Hardware Wallets
 
Fact, Fiction, and FP
Fact, Fiction, and FPFact, Fiction, and FP
Fact, Fiction, and FP
 
smartdc by Ruby
smartdc by Rubysmartdc by Ruby
smartdc by Ruby
 
The Ring programming language version 1.9 book - Part 70 of 210
The Ring programming language version 1.9 book - Part 70 of 210The Ring programming language version 1.9 book - Part 70 of 210
The Ring programming language version 1.9 book - Part 70 of 210
 
Bitcoin developer guide
Bitcoin developer guideBitcoin developer guide
Bitcoin developer guide
 
CouchDB Getting Start
CouchDB Getting StartCouchDB Getting Start
CouchDB Getting Start
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
Fighting fraud: finding duplicates at scale (Highload+ 2019)
Fighting fraud: finding duplicates at scale (Highload+ 2019)Fighting fraud: finding duplicates at scale (Highload+ 2019)
Fighting fraud: finding duplicates at scale (Highload+ 2019)
 

More from NECST Lab @ Politecnico di Milano

Embedding based knowledge graph link prediction for drug repurposing
Embedding based knowledge graph link prediction for drug repurposingEmbedding based knowledge graph link prediction for drug repurposing
Embedding based knowledge graph link prediction for drug repurposing
NECST Lab @ Politecnico di Milano
 

More from NECST Lab @ Politecnico di Milano (20)

Mesticheria Team - WiiReflex
Mesticheria Team - WiiReflexMesticheria Team - WiiReflex
Mesticheria Team - WiiReflex
 
Punto e virgola Team - Stressometro
Punto e virgola Team - StressometroPunto e virgola Team - Stressometro
Punto e virgola Team - Stressometro
 
BitIt Team - Stay.straight
BitIt Team - Stay.straight BitIt Team - Stay.straight
BitIt Team - Stay.straight
 
BabYodini Team - Talking Gloves
BabYodini Team - Talking GlovesBabYodini Team - Talking Gloves
BabYodini Team - Talking Gloves
 
printf("Nome Squadra"); Team - NeoTon
printf("Nome Squadra"); Team - NeoTonprintf("Nome Squadra"); Team - NeoTon
printf("Nome Squadra"); Team - NeoTon
 
BlackBoard Team - Motion Tracking Platform
BlackBoard Team - Motion Tracking PlatformBlackBoard Team - Motion Tracking Platform
BlackBoard Team - Motion Tracking Platform
 
#include<brain.h> Team - HomeBeatHome
#include<brain.h> Team - HomeBeatHome#include<brain.h> Team - HomeBeatHome
#include<brain.h> Team - HomeBeatHome
 
Flipflops Team - Wave U
Flipflops Team - Wave UFlipflops Team - Wave U
Flipflops Team - Wave U
 
Bug(atta) Team - Little Brother
Bug(atta) Team - Little BrotherBug(atta) Team - Little Brother
Bug(atta) Team - Little Brother
 
#NECSTCamp: come partecipare
#NECSTCamp: come partecipare#NECSTCamp: come partecipare
#NECSTCamp: come partecipare
 
NECSTCamp101@2020.10.1
NECSTCamp101@2020.10.1NECSTCamp101@2020.10.1
NECSTCamp101@2020.10.1
 
NECSTLab101 2020.2021
NECSTLab101 2020.2021NECSTLab101 2020.2021
NECSTLab101 2020.2021
 
TreeHouse, nourish your community
TreeHouse, nourish your communityTreeHouse, nourish your community
TreeHouse, nourish your community
 
TiReX: Tiled Regular eXpressionsmatching architecture
TiReX: Tiled Regular eXpressionsmatching architectureTiReX: Tiled Regular eXpressionsmatching architecture
TiReX: Tiled Regular eXpressionsmatching architecture
 
Embedding based knowledge graph link prediction for drug repurposing
Embedding based knowledge graph link prediction for drug repurposingEmbedding based knowledge graph link prediction for drug repurposing
Embedding based knowledge graph link prediction for drug repurposing
 
PLASTER - PYNQ-based abandoned object detection using a map-reduce approach o...
PLASTER - PYNQ-based abandoned object detection using a map-reduce approach o...PLASTER - PYNQ-based abandoned object detection using a map-reduce approach o...
PLASTER - PYNQ-based abandoned object detection using a map-reduce approach o...
 
EMPhASIS - An EMbedded Public Attention Stress Identification System
 EMPhASIS - An EMbedded Public Attention Stress Identification System EMPhASIS - An EMbedded Public Attention Stress Identification System
EMPhASIS - An EMbedded Public Attention Stress Identification System
 
Luns - Automatic lungs segmentation through neural network
Luns - Automatic lungs segmentation through neural networkLuns - Automatic lungs segmentation through neural network
Luns - Automatic lungs segmentation through neural network
 
BlastFunction: How to combine Serverless and FPGAs
BlastFunction: How to combine Serverless and FPGAsBlastFunction: How to combine Serverless and FPGAs
BlastFunction: How to combine Serverless and FPGAs
 
Maeve - Fast genome analysis leveraging exact string matching
Maeve - Fast genome analysis leveraging exact string matchingMaeve - Fast genome analysis leveraging exact string matching
Maeve - Fast genome analysis leveraging exact string matching
 

Recently uploaded

一比一原版(UofT毕业证)多伦多大学毕业证成绩单
一比一原版(UofT毕业证)多伦多大学毕业证成绩单一比一原版(UofT毕业证)多伦多大学毕业证成绩单
一比一原版(UofT毕业证)多伦多大学毕业证成绩单
tuuww
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
AbrahamGadissa
 

Recently uploaded (20)

"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Attraction and Repulsion type Moving Iron Instruments.pptx
Attraction and Repulsion type Moving Iron Instruments.pptxAttraction and Repulsion type Moving Iron Instruments.pptx
Attraction and Repulsion type Moving Iron Instruments.pptx
 
Peek implant persentation - Copy (1).pdf
Peek implant persentation - Copy (1).pdfPeek implant persentation - Copy (1).pdf
Peek implant persentation - Copy (1).pdf
 
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
Lect 2 - Design of slender column-2.pptx
Lect 2 - Design of slender column-2.pptxLect 2 - Design of slender column-2.pptx
Lect 2 - Design of slender column-2.pptx
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单
一比一原版(UofT毕业证)多伦多大学毕业证成绩单一比一原版(UofT毕业证)多伦多大学毕业证成绩单
一比一原版(UofT毕业证)多伦多大学毕业证成绩单
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
Dairy management system project report..pdf
Dairy management system project report..pdfDairy management system project report..pdf
Dairy management system project report..pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 

Obfuscation-Resilient Privacy Leak Detection for Mobile Apps