Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter...

31
Andrea Marcelli (@_S0nn1_)

Transcript of Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter...

Page 1: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Andrea Marcelli (@_S0nn1_)

Page 2: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Twitter

Email

Web

PhD Student

Security Researcher

Page 3: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

The signature generation problem

The algorithm

Introducing YaYaGen

Demo

Page 4: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 5: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

A unique pattern

Syntactic signatures* this is where the most of the existing tools and researches focus on

Semantic signatures

Android malware

Page 6: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Reduce Automate 100% recall Save

Page 7: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

“YARA is to files what Snort is to network traffic”

de-facto standard

syntactic signatures

Semantic signatures

Page 8: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

rule YaYaSyringe {

meta: author = "DEF CON 26"

strings: $a = “text here” $b = { E2 34 A1 C8 23 FB }

condition: $a and $b and androguard.filter("action.BATTERYCHECK") and androguard.number_of_services == 3 …

}

Page 9: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 10: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

APK Unsupervised Automatic

Page 11: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Each block is an attribute extracted through the analysis

quality of the analysis

static

dynamic

url: “malware.xxx”

permission: “ACCESS_FINE_LOCATION”

Page 12: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Sample 1 Sample 2

=

Signature

Page 13: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 Sample 6

Sample 7 Sample 8 Sample 9 Sample 10 Sample 11 Sample 12

Page 14: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

dynamic greedy algorithm

+ + + +

Page 15: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

clause literal

Page 16: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

DNF

clause weighed

is the lowest

Page 17: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

weighting system

higher the weight, the less FP

lower the weight, the more FP

Page 18: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

TMIN TMAX

Page 19: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

over-specific

Basic optimizer

Evo optimizer

TMAX

Raw Optimized

Page 20: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 21: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

From

application analysis reports

YARA rules

to

Page 22: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

2 algorithms 2 optimizers heuristics

YARA rule parser

FP exclusion

Koodous

Page 23: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 24: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 25: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 26: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

Rule Name Original YaYaGen Improvement

1,004 +86.3%

315 +43.2%

257 +89.0%

652 +16.6%

172 +8.2%

430 +131.2%

Page 27: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm

perform better 100 apps is less 5 minutes

Page 28: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 29: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 30: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm
Page 31: Andrea Marcelli (@ S0nn1 ) - DEF CON CON 26/DEF CON 26... · Andrea Marcelli (@_S0nn1_) Twitter Email Web PhD Student Security Researcher . The signature generation problem The algorithm