Скачать презентацию Data Mining for Malware Detection Dr Mehedy Masud Скачать презентацию Data Mining for Malware Detection Dr Mehedy Masud

aed8a0c22694089127535a687b3eee5f.ppt

  • Количество слайдов: 45

Data Mining for Malware Detection Dr. Mehedy Masud Dr. Latifur Khan Dr. Bhavani Thuraisingham Data Mining for Malware Detection Dr. Mehedy Masud Dr. Latifur Khan Dr. Bhavani Thuraisingham The University of Texas at Dallas October 2014

3/16/2018 23: 33 Outline 0 Data mining overview 0 Intrusion detection, Malicious code detection, 3/16/2018 23: 33 Outline 0 Data mining overview 0 Intrusion detection, Malicious code detection, Buffer overflow detection, Email worm detection (worms and virus) 0 Novel Class Detection for polymorphic malware 0 Reference: - Data Mining Tools for Malware Detection - Masud, Khan and Thuraisingham - CRC Press/Taylor and Francis, 2011 2

3/16/2018 23: 33 3 What is Data Mining? Information Harvesting Knowledge Mining Data Mining 3/16/2018 23: 33 3 What is Data Mining? Information Harvesting Knowledge Mining Data Mining Knowledge Discovery in Databases Data Dredging Data Archaeology Data Pattern Processing Database Mining Siftware Knowledge Extraction The process of discovering meaningful new correlations, patterns, and trends by sifting through large amounts of data, often previously unknown, using pattern recognition technologies and statistical and mathematical techniques (Thuraisingham, Data Mining, CRC Press 1998)

3/16/2018 23: 33 What’s going on in data mining? 0 What are the technologies 3/16/2018 23: 33 What’s going on in data mining? 0 What are the technologies for data mining? - Database management, data warehousing, machine learning, statistics, pattern recognition, visualization, parallel processing 0 What can data mining do for you? - Data mining outcomes: Classification, Clustering, Association, Anomaly detection, Prediction, Estimation, . . . 0 How do you carry out data mining? - Data mining techniques: Decision trees, Neural networks, Market -basket analysis, Link analysis, Genetic algorithms, . . . 0 What is the current status? - Many commercial products mine relational databases 0 What are some of the challenges? - Mining unstructured data, extracting useful patterns, web mining, Data mining, security and privacy 4

3/16/2018 23: 33 Data Mining for Intrusion Detection: Problem 0 An intrusion can be 3/16/2018 23: 33 Data Mining for Intrusion Detection: Problem 0 An intrusion can be defined as “any set of actions that attempt to compromise the integrity, confidentiality, or availability of a resource”. 0 Attacks are: - Host-based attacks - Network-based attacks 0 Intrusion detection systems are split into two groups: - Anomaly detection systems - Misuse detection systems 0 Use audit logs - Capture all activities in network and hosts. - But the amount of data is huge! 5

3/16/2018 23: 33 Misuse Detection 0 Misuse Detection 6 3/16/2018 23: 33 Misuse Detection 0 Misuse Detection 6

3/16/2018 23: 33 Problem: Anomaly Detection 0 Anomaly Detection 7 3/16/2018 23: 33 Problem: Anomaly Detection 0 Anomaly Detection 7

3/16/2018 23: 33 8 Our Approach: Overview Training Data Class Hierarchical Clustering (DGSOT) SVM 3/16/2018 23: 33 8 Our Approach: Overview Training Data Class Hierarchical Clustering (DGSOT) SVM Class Training Testing DGSOT: Dynamically growing self organizing tree Testing Data

3/16/2018 23: 33 Our Approach: Hierarchical Clustering Our Approach Hierarchical clustering with SVM flow 3/16/2018 23: 33 Our Approach: Hierarchical Clustering Our Approach Hierarchical clustering with SVM flow chart 9

3/16/2018 23: 33 10 Results Training Time, FP and FN Rates of Various Methods 3/16/2018 23: 33 10 Results Training Time, FP and FN Rates of Various Methods Average FP Average FN Rate (%) Accuracy Total Training Time Random Selection 52% 0. 44 hours 40 47 Pure SVM 57. 6% 17. 34 hours 35. 5 42 SVM+Rocchio Bundling 51. 6% 26. 7 hours 44. 2 48 SVM + DGSOT 69. 8% 13. 18 hours 37. 8 29. 8 Methods Average

3/16/2018 23: 33 Introduction: Detecting Malicious Executables using Data Mining 0 What are malicious 3/16/2018 23: 33 Introduction: Detecting Malicious Executables using Data Mining 0 What are malicious executables? - Harm computer systems - Virus, Exploit, Denial of Service (Do. S), Flooder, Sniffer, Spoofer, Trojan etc. - Exploits software vulnerability on a victim - May remotely infect other victims - Incurs great loss. Example: Code Red epidemic cost $2. 6 Billion 0 Malicious code detection: Traditional approach - Signature based - Requires signatures to be generated by human experts - So, not effective against “zero day” attacks 11

3/16/2018 23: 33 State of the Art in Automated Detection and Our new ideas 3/16/2018 23: 33 State of the Art in Automated Detection and Our new ideas OAutomated detection approaches: 0 Behavioural: analyse behaviours like source, destination address, attachment type, statistical anomaly etc. 0 Content-based: analyse the content of the malicious executable - Autograph (H. Ah-Kim – CMU): Based on automated signature generation process - N-gram analysis (Maloof, M. A. et. al. ): Based on mining features and using machine learning. ✗Our approach ✗Content -based approaches consider only machine-codes (byte-codes). ✗Is it possible to consider higher-level source codes for malicious code detection? ✗Yes: Diassemble the binary executable and retrieve the assembly program ✗Extract important features from the assembly program ✗Combine with machine-code features - 12

3/16/2018 23: 33 Feature Extraction and Hybrid Model ✗Features ✗Binary n-gram features = Sequence 3/16/2018 23: 33 Feature Extraction and Hybrid Model ✗Features ✗Binary n-gram features = Sequence of n consecutive bytes of binary executable ✗Assembly n-gram features = Sequence of n consecutive assembly instructions ✗System API call features 0 Collect training samples of normal and malicious executables. 0 Extract features 0 Train a Classifier and build a model 0 Test the model against test samples 13

3/16/2018 23: 33 Hybrid Feature Retrieval (HFR): Training and Testing 14 3/16/2018 23: 33 Hybrid Feature Retrieval (HFR): Training and Testing 14

3/16/2018 23: 33 Feature Extraction Binary n-gram features - Features are extracted from the 3/16/2018 23: 33 Feature Extraction Binary n-gram features - Features are extracted from the byte codes in the form of ngrams, where n = 2, 4, 6, 8, 10 and so on. Example: Given a 11 -byte sequence: 0123456789 abcdef 012345, The 2 -grams (2 -byte sequences) are: 0123, 2345, 4567, 6789, 89 ab, abcd, cdef, ef 01, 0123, 2345 The 4 -grams (4 -byte sequences) are: 01234567, 23456789, 456789 ab, . . . , ef 012345 and so on. . Problem: - Large dataset. Too many features (millions!). Solution: - Use secondary memory, efficient data structures - Apply feature selection 15

3/16/2018 23: 33 Feature Extraction Assembly n-gram features - Features are extracted from the 3/16/2018 23: 33 Feature Extraction Assembly n-gram features - Features are extracted from the assembly programs in the form of n-grams, where n = 2, 4, 6, 8, 10 and so on. Example: three instructions “push eax”; “mov eax, dword[0 f 34]” ; “add ecx, eax”; 2 -grams (1) “push eax”; “mov eax, dword[0 f 34]”; (2) “mov eax, dword[0 f 34]”; “add ecx, eax”; Problem: - Same problem as binary Solution: - Same solution 16

3/16/2018 23: 33 Feature Selection 0 Select Best K features 0 Selection Criteria: Information 3/16/2018 23: 33 Feature Selection 0 Select Best K features 0 Selection Criteria: Information Gain 0 Gain of an attribute A on a collection of examples S is given by 17

3/16/2018 23: 33 18 Experiments 0 0 0 Dataset - Dataset 1: 838 Malicious 3/16/2018 23: 33 18 Experiments 0 0 0 Dataset - Dataset 1: 838 Malicious and 597 Benign executables - Dataset 2: 1082 Malicious and 1370 Benign executables - Collected Malicious code from VX Heavens (http: //vx. netlux. org) Disassembly - Pedisassem ( http: //www. geocities. com/~sangcho/index. html ) Training, Testing - Support Vector Machine (SVM) - C-Support Vector Classifiers with an RBF kernel

3/16/2018 23: 33 19 Results 0 0 0 HFS = Hybrid Feature Set BFS 3/16/2018 23: 33 19 Results 0 0 0 HFS = Hybrid Feature Set BFS = Binary Feature Set AFS = Assembly Feature Set

3/16/2018 23: 33 20 Results 0 0 0 HFS = Hybrid Feature Set BFS 3/16/2018 23: 33 20 Results 0 0 0 HFS = Hybrid Feature Set BFS = Binary Feature Set AFS = Assembly Feature Set

3/16/2018 23: 33 21 Results 0 0 0 HFS = Hybrid Feature Set BFS 3/16/2018 23: 33 21 Results 0 0 0 HFS = Hybrid Feature Set BFS = Binary Feature Set AFS = Assembly Feature Set

3/16/2018 23: 33 22 Data Mining for Buffer Overflow Introduction 0 Goal - Intrusion 3/16/2018 23: 33 22 Data Mining for Buffer Overflow Introduction 0 Goal - Intrusion detection. - e. g. : worm attack, buffer overflow attack. 0 Main Contribution - 'Worm' code detection by data mining coupled with 'reverse engineering'. - Buffer overflow detection by combining data mining with static analysis of assembly code.

3/16/2018 23: 33 23 Buffer Overflow 0 What is 'buffer overflow'? - A situation 3/16/2018 23: 33 23 Buffer Overflow 0 What is 'buffer overflow'? - A situation when a fixed sized buffer is overflown by a larger sized input. 0 How does it happen? - example: . . . . char buff[100]; gets(buff); . . . . memory Input string buff Stack

3/16/2018 23: 33 24 Problem with Buffer Overflow buff memory. . . . char 3/16/2018 23: 33 24 Problem with Buffer Overflow buff memory. . . . char buff[100]; gets(buff); . . . . buff Stack Return address overwritten Attacker's code memory buff Stack New return address points to this memory location

3/16/2018 23: 33 Handling Buffer Overflow 0 Stopping buffer overflow - Preventive approaches - 3/16/2018 23: 33 Handling Buffer Overflow 0 Stopping buffer overflow - Preventive approaches - Detection approaches 0 Preventive approaches - Finding bugs in source code. Problem: can only work when source code is available. - Compiler extension. Same problem. - OS/HW modification 0 Detection approaches - Capture code running symptoms. Problem: may require long running time. - Automatically generating signatures of buffer overflow attacks. 25

3/16/2018 23: 33 Code. Blocker (Our approach with Penn State) 0 Detection Based on 3/16/2018 23: 33 Code. Blocker (Our approach with Penn State) 0 Detection Based on the Observation: Attack messages usually contain code while normal messages contain data. 0 Main Idea - Check whether message contains code 0 Problem to solve: - Distinguishing code from data 0 Formulate the problem as a classification problem (code, data) 0 Collect a set of training examples, containing both instances 0 Train the data with a machine learning algorithm, get the model 0 Test this model against a new message 0 Enhanced Penn State’s earlier model Sig. Free - 26

3/16/2018 23: 33 Code. Blocker Model 27 3/16/2018 23: 33 Code. Blocker Model 27

3/16/2018 23: 33 Feature extraction 28 0 Features are extracted using - N-gram analysis 3/16/2018 23: 33 Feature extraction 28 0 Features are extracted using - N-gram analysis - Control flow analysis 0 N-gram analysis What is an n-gram? -Sequence of n instructions Traditional approach: -Flow of control is ignored 2 -grams are: 02, 24, 46, . . . , CE Assembly program Corresponding IFG

3/16/2018 23: 33 Feature extraction (cont. . . ) 0 Control-flow Based N-gram analysis 3/16/2018 23: 33 Feature extraction (cont. . . ) 0 Control-flow Based N-gram analysis What is an n-gram? -Sequence of n instructions Proposed Control-flow based approach -Flow of control is considered 2 -grams are: 02, 24, 46, . . . , CE, E 6 Assembly program Corresponding IFG 29

3/16/2018 23: 33 Feature extraction (cont. . . ) 0 Control Flow analysis. Generated 3/16/2018 23: 33 Feature extraction (cont. . . ) 0 Control Flow analysis. Generated features - Invalid Memory Reference (IMR) - Undefined Register (UR) - Invalid Jump Target (IJT) 0 Checking IMR - A memory is referenced using register addressing and the register value is undefined - e. g. : mov ax, [dx + 5] 0 Checking UR - Check if the register value is set properly 0 Checking IJT - Check whether jump target does not violate instruction boundary 30

3/16/2018 23: 33 Putting it together 0 Why n-gram analysis? - Intuition: in general, 3/16/2018 23: 33 Putting it together 0 Why n-gram analysis? - Intuition: in general, disassembled executables should have a different pattern of instruction usage than disassembled data. 0 Why control flow analysis? - Intuition: there should be no invalid memory references or invalid jump targets. 0 Approach - Compute all possible n-grams - Select best k of them - Compute feature vector (binary vector) for each training example - Supply these vectors to the training algorithm 31

3/16/2018 23: 33 Experiments 0 Dataset - Real traces of normal messages - Real 3/16/2018 23: 33 Experiments 0 Dataset - Real traces of normal messages - Real attack messages - Polymorphic shellcodes 0 Training, Testing - Support Vector Machine (SVM) 32

3/16/2018 23: 33 Results 0 0 CFBn: Control-Flow Based n-gram feature CFF: Control-flow feature 3/16/2018 23: 33 Results 0 0 CFBn: Control-Flow Based n-gram feature CFF: Control-flow feature 33

3/16/2018 23: 33 Novelty, Advantages, Limitations, Future 0 0 Novelty - We introduce the 3/16/2018 23: 33 Novelty, Advantages, Limitations, Future 0 0 Novelty - We introduce the notion of control flow based n-gram - We combine control flow analysis with data mining to detect code / data - Significant improvement over other methods (e. g. Sig. Free) Advantages - Fast testing - Signature free operation - Low overhead - Robust against many obfuscations Limitations - Need samples of attack and normal messages. - May not be able to detect a completely new type of attack. Future - Find more features - Apply dynamic analysis techniques - Semantic analysis 34

3/16/2018 23: 33 Email Worm Detection using Data Mining Task: given some training instances 3/16/2018 23: 33 Email Worm Detection using Data Mining Task: given some training instances of both “normal” and “viral” emails, induce a hypothesis to detect “viral” emails. We used: Naïve Bayes SVM Outgoing Emails The Model Test data Feature extraction Machine Learning Classifier Training data Clean or Infected ? 35

3/16/2018 23: 33 Assumptions 0 Features are based on outgoing emails. 0 Different users 3/16/2018 23: 33 Assumptions 0 Features are based on outgoing emails. 0 Different users have different “normal” behaviour. 0 Analysis should be per-user basis. 0 Two groups of features - Per email (#of attachments, HTML in body, text/binary attachments) - Per window (mean words in body, variable words in subject) 0 Total of 24 features identified 0 Goal: Identify “normal” and “viral” emails based on these features 36

3/16/2018 23: 33 Feature sets - Per email features = Binary valued Features Presence 3/16/2018 23: 33 Feature sets - Per email features = Binary valued Features Presence of HTML; script tags/attributes; embedded images; hyperlinks; Presence of binary, text attachments; MIME types of file attachments = Continuous-valued Features Number of attachments; Number of words/characters in the subject and body - Per window features = Number of emails sent; Number of unique email recipients; Number of unique sender addresses; Average number of words/characters per subject, body; average word length: ; Variance in number of words/characters per subject, body; Variance in word length = Ratio of emails with attachments 37

3/16/2018 23: 33 Data set 0 Collected from UC Berkeley. - Contains instances for 3/16/2018 23: 33 Data set 0 Collected from UC Berkeley. - Contains instances for both normal and viral emails. 0 Six worm types: - bagle. f, bubbleboy, mydoom. m, - mydoom. u, netsky. d, sobig. f 0 Originally Six sets of data: - training instances: normal (400) + five worms (5 x 200) - testing instances: normal (1200) + the sixth worm (200) 0 Problem: Not balanced, no cross validation reported 0 Solution: re-arrange the data and apply cross-validation 38

3/16/2018 23: 33 Our Implementation and Analysis 0 Implementation - Naïve Bayes: Assume “Normal” 3/16/2018 23: 33 Our Implementation and Analysis 0 Implementation - Naïve Bayes: Assume “Normal” distribution of numeric and real data; smoothing applied - SVM: with the parameter settings: one-class SVM with the radial basis function using “gamma” = 0. 015 and “nu” = 0. 1. 0 Analysis - NB alone performs better than other techniques - SVM alone also performs better if parameters are set correctly mydoom. m and VBS. Bubbleboy data set are not sufficient (very low detection accuracy in all classifiers) - The feature-based approach seems to be useful only when we have identified the relevant features gathered enough training data Implement classifiers with best parameter settings 39

3/16/2018 23: 33 Directions 0 Malware is evolving continuously 0 Example: RAMAL; Reactively Adaptive 3/16/2018 23: 33 Directions 0 Malware is evolving continuously 0 Example: RAMAL; Reactively Adaptive Malware 0 Solution: Novel Class Detection 0 Our Tool: Stream-based Novel Class Detection (SNOD) 0 Applying for Malware: SNODMAL 40

3/16/2018 23: 33 41 The Problem 0 Signature-based antivirus protection is increasingly challenged - 3/16/2018 23: 33 41 The Problem 0 Signature-based antivirus protection is increasingly challenged - By polymorphic malware - By potential self-mutating malware* to be emerged in near future 0 Antivirus must adapt itself to the changing environment - For example, attackers’ strategies change over time - Therefore, characteristics of malware also change continuously 0 Signature must be generated automatically - To protect against polymorphic, self-mutating malware 0 New type of attacks should be detectable by the antivirus - To guard against zero-day attacks * Kevin W. Hamlen, Vishwath Mohan, Mohammad M. Masud, Latifur Khan, Bhavani M. Thuraisingham. “Exploiting an antivirus interface. ” Computer Standards & Interfaces 31(6), p. p. 1182 -1189, 2009

3/16/2018 23: 33 42 Our Approach (UTD/UIUC, Patent pending) 0 Data stream classification and 3/16/2018 23: 33 42 Our Approach (UTD/UIUC, Patent pending) 0 Data stream classification and novel class detection (SNOD) - Addresses the infinite-length, concept-drift, and featureevolution problem - Automatically detects novel classes in stream 0 We are developing SNODMAL, a malware detector using SNOD Table 1: Differences among different malware detectors Functionality Signature-based Traditional Data mining based SNODMAL Automated signature generation X Addresses zero-day attack X Addresses polymorphism and metamorphism Addresses the evolution of malware and benign executables over time Designed to detect new kind of attack X X X

3/16/2018 23: 33 Ensemble Classification of Data Streams 0 Divide the data stream into 3/16/2018 23: 33 Ensemble Classification of Data Streams 0 Divide the data stream into equal sized chunks - Train a classifier from each data chunk - Keep the best L such classifier-ensemble - Example: for L= 3 Note: Di may contain data points from different classes Labeled chunk Data chunks Classifiers D 1 C 1 D 2 C 2 4 5 Ensemble C 1 C 2 C 3 D 3 5 4 C 5 4 3 D 4 6 5 Unlabeled chunk Addresses infinite length and concept-drift Prediction 43

3/16/2018 23: 33 44 Architecture of the SNODMAL Framework Stream of benign & malicious 3/16/2018 23: 33 44 Architecture of the SNODMAL Framework Stream of benign & malicious executables Unknown executable Feature extraction Temporary training buffer Feature extraction and selection Train new model Classify Ensemble of L models Ensemble update Malware/Benign/Novel Mohammad M. Masud, Jing Gao, Latifur Khan, Jiawei Han, and Bhavani Thuraisingham. “Integrating Novel Class Detection with Classification for Concept-Drifting Data Streams”. In Proceedings of 2009 European Conf. on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML/PKDD’ 09), Bled, Slovenia, 7 -11 Sept, 2009, pp 79 -94 (extended version appeared in IEEE Transaction on Knowledge and Data Engineering (TKDE)).

3/16/2018 23: 33 Usefulness of SNODMAL 0 Capable of handling massive volumes of training 3/16/2018 23: 33 Usefulness of SNODMAL 0 Capable of handling massive volumes of training data - Also handles concept-drift 0 Capable of detecting novel classes (new type of malware) - Existing techniques may fail to detect new type of malware - SNODMAL should be able to detect the new type as a “novel class” - SNODMAL will then quarantine the malware and raise alarm - The quarantined binary would be analyzed by human experts - The classification model would be updated with the new malware 0 Therefore, reduces damage caused by zero-day attacks 0 Use of cloud computing for feature extraction - Makes it more applicable to large volumes of data and optimizes running time 45