Upload
trancong
View
216
Download
0
Embed Size (px)
Citation preview
SOFTWARETECHNIK
Bytecode kenntkeine Geheimnisse
Eric BoddenSiegfried Rasthofer
Steven ArztRobert Hahn
Max Kolhagen
SOFTWARETECHNIK
Agenda
• Einführung in BaaS
• Sicherheitsanalyse
• Unsere Entdeckungen
• Gegenmaßnahmen
• Wunschliste
6
← Festhalten!
SOFTWARETECHNIK
10
DB connection
BaaS SDK
AmazonS3Client s3Client = new AmazonS3Client(new BasicAWSCredentials(“ACCESS_KEY_ID“, “SECRET_KEY“) );
SOFTWARETECHNIK
11
DB connectionAmazonS3Client s3Client = new AmazonS3Client(
new BasicAWSCredentials(“ACCESS_KEY_ID“, “SECRET_KEY“) );
BaaS SDK
“When you access AWS programmatically, you use an access key to verify your identity and the identity of your applications. An access key consists of an access key ID and a secret access key.
Anyone who has your access key has the same level of access to your AWS resources that you do.“ Source: http://docs.aws.amazon.com/
“ACCESS_KEY_ID“, “SECRET_KEY“
SOFTWARETECHNIK
12
DB connectionAmazonS3Client s3Client = new AmazonS3Client(
new BasicAWSCredentials(“ACCESS_KEY_ID“, “SECRET_KEY“) );
BaaS SDK
“…The AWS SDKs use your access keys to sign requests for you so that you don't have to handle the signing process…” http://docs.aws.amazon.com/
“…Secret access keys are, as the name implies, secrets, like your password…”
Jim Scharf Director, AWS Identity and Access Management
(username) (password)“ACCESS_KEY_ID“, “SECRET_KEY“
SOFTWARETECHNIK
IT-Security 101
13
Peter
“Hi, I am Peter”Identification
“My password is Secret123”Authentication
"I am allowed to access foo.txt”Authorization
Server
SOFTWARETECHNIK
=??
App-Authentisierungsmodell
14
App“Hi, I am app <Application ID>”Identification
“My <Secret Key> is in the app” ???Authentication
Server
SOFTWARETECHNIK
Was Entwickler dazu sagen
16
[...]“The App-Secret key should be kept private - but when releasing the app they can be reversed by some guys. I want to know what is the best thing to encrypt, obfuscate or whatever to make this secure.“[...] (Source: stackoverflow.com)
“Few ideas, in my opinion only first one gives some guarantee: 1. Keep your secrets on some server on internet, and when needed just
grab them and use. 2. Put your secrets in jni code 3. use obfuscator 4. Put your secret key as last pixels of one of your image in assets “
(Source: stackoverflow.com)
Q:
R:
NO!!!!
SOFTWARETECHNIK
Manual Pre-Analysis (here: Parse)
18
public void onCreate() { java.lang.String $S1, $S2; $S1 = “34lI1wgISkIUpTunWRAzXei20H3NAL7W6buKTe7e"; $S2 = “pB7OlNi0jsEp3fpJfq9wvHBoOWgaOQCSW98BF7e3"; staticinvoke <Parse: void initialize(Context, String, String)>(this, $S1, $S2); }
+
”Users” Table
SOFTWARETECHNIK
19
Ergebnisse der Voranalyse: • Konnten auf alle Records zugreifen • Nur wenige Entwickler nutzen überhaupt Obfuscation
SOFTWARETECHNIK
APK Informations-Extraktion
23
$S1 = “34lI1wgISkIUpTunWRAzXei20H3NAL7W6buKTe7e";$S2 = “pB7OlNi0jsEp3fpJfq9wvHBoOWgaOQCSW98BF7e3";staticinvoke <Parse: void initialize(Context, String, String)>(this, $S1, $S2);
1. API-Aufrufe identifizieren
2. Strings extrahieren:
Statisch Dynamisch Hybrid
SOFTWARETECHNIK
HARVESTER (Hybride Daten-Extraktion)
24
Harvesting Runtime Data in Android Applications for Identifying Malware and Enhancing Code Analysis Siegfried Rasthofer, Steven Arzt, Marc Miltenberger, Eric Bodden Technical Report, February 2015.
Hybrid
SOFTWARETECHNIK
Datenzugriff
25
“34lI1wgISkIUpTunWRAzXei20H3NAL7W6buKTe7e"
“pB7OlNi0jsEp3fpJfq9wvHBoOWgaOQCSW98BF7e3"
“CreditCardDataTable"
“ContactDataTable"
...
BaaS API
SOFTWARETECHNIK
Ergebnisse Parse: Goldware
27
Infos zu Käufen
Ortungsdaten
Facebook-Infos - “Freunde” - Geblockte “Freunde”
KontaktdatenGültige
Emailadressen
Geburtstage Telefonnummern
FotosMeldungen zuAutounfällen
SOFTWARETECHNIK
Ergebnisse Parse: Malware
28
We know what you did this summer: Android Banking Trojan exposing its sins in the cloud Siegfried Rasthofer, Eric Bodden, Carlos Castillo, Alex Hinchliffe VirusBulletin 2015, AVAR 2015
Abgefangene SMS-nachrichten C&C Tasks
C&C KommandosEntwendete Daten
SOFTWARETECHNIK
Responsible Disclosure-Prozess – Parse (Facebook)
29
Vollzugriff auf 100 Tabellen Teilweiser Zugriff auf 32 Tabellen ( ~56 Mio Datensätze)
Facebook mit ein paar Beispielslogins kontaktiert
Facebook bestätigt Problem und fragt nach näheren Infos
Wir liefern alle Informationen an Facebook
28th April 2015
5th Mai 2015
18th Mai 2015
12th Nov 2015 Vollzugriff auf 99 Tabellen Teilweiser Zugriff auf 33 Tabellen
20th Mai 2015 Facebook leitet Infos weiter an Parse (welche wiederum - hoffentlich - die Entwickler kontaktierten)
SOFTWARETECHNIK
Recap: App-Authentisierung
34
Server
Peter
Howard
Peter?
Howard? Eve?
Access Key ID
Secret Key
SOFTWARETECHNIK
Zwei BaaS-Nutzungsszenarien
35
Authenticated User
Private DataUser
App
Public Data
Anonymous Users
SOFTWARETECHNIK
ACLs in The App Security
37
Peter
Howard
Peter‘s stuff
Howard’s stuff
Anonymous UsersPublic stuff
X X
SOFTWARETECHNIK
Amazon Key Hierarchy (2)
39
Root Account (AWS Account)
App1 Account App2 Account
Peter‘s Account Howard‘s Account
SOFTWARETECHNIK
Amazon Token Vending Machine
40
Beispiel verfügbar,mehr aber auch nicht
Erfordert Hosting. Tomcat, Elasticbeanstalk anyone?
SOFTWARETECHNIK
Amazon Token Vending Machine
41
Although you will need to use your AWS account credentials to deploy the TVM, we recommend that you do not run the TVM under your AWS account. Instead, create an IAM user and configure the TVM to use the credentials of this IAM user, which we will call the TVM user.
Brauchen also S3, TVM, IAM, Elastic Beanstalk…
SOFTWARETECHNIK
Und wie bekomme ich ACLs?
42
You would need to modify the provided samples in order to implement these user-specific policy objects. For more information about policy objects, see the Identity and Access Management (IAM) documentation
SOFTWARETECHNIK
Amazon Cognito
• Fertige Implementierung für Identity Management
Mit fertigem Nutzermanagement
Erlaubt “Anonyme Nutzer”
• Ziemlich neuer Dienst
Noch nicht weithin benutzt
43
So … let‘s try t
o
use it
SOFTWARETECHNIK
Amazon CognitoNote: If you created your identity pool before February 2015, you will need to reassociate your roles with your identity pool in order to use this constructor without the roles as parameters. To do so, open the Amazon Cognito Console, select your identity pool, click Edit Identity Pool, specify your authenticated and unauthenticated roles, and save the changes.
44
SOFTWARETECHNIK
Amazon Cognito
45
(1) Nutzer-Credentials (optional)
Amazon Cognito
(2) Temporäre AWS Credentials
S3(3) Temporäre AWS Credentials
SOFTWARETECHNIK
Takeaway Messages
• Wenn etwas zu schön klingt um wahr zu sein, dann ist es das in der Regel auch
• Sichere Cloud-Authentifizierung kostet
• Nichtbeachtung kann katastrophale Folgen haben: Datendiebstahl und -manipulation
Also: Sichert Eure Apps! Und fangt heute an!
(wir helfen gerne)
50
Prof. Dr. Eric BoddenFachgebiet SoftwaretechnikHeinz Nixdorf Institut Zukunftsmeile 1 33102 Paderborn
Telefon: +49 5251 60-3313 [email protected]
https://www.hni.uni-paderborn.de/swt/
https://blogs.uni-paderborn.de/sse/
SOFTWARETECHNIK
51