TWI640891B - Method and apparatus for detecting malware - Google Patents

Method and apparatus for detecting malware Download PDF

Info

Publication number
TWI640891B
TWI640891B TW106145575A TW106145575A TWI640891B TW I640891 B TWI640891 B TW I640891B TW 106145575 A TW106145575 A TW 106145575A TW 106145575 A TW106145575 A TW 106145575A TW I640891 B TWI640891 B TW I640891B
Authority
TW
Taiwan
Prior art keywords
suspicious
file
sample
malicious program
malicious
Prior art date
Application number
TW106145575A
Other languages
Chinese (zh)
Other versions
TW201928746A (en
Inventor
施汎勳
張光宏
詹偉銘
Original Assignee
中華電信股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中華電信股份有限公司 filed Critical 中華電信股份有限公司
Priority to TW106145575A priority Critical patent/TWI640891B/en
Application granted granted Critical
Publication of TWI640891B publication Critical patent/TWI640891B/en
Publication of TW201928746A publication Critical patent/TW201928746A/en

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本發明係揭露一種偵測惡意程式的方法和裝置。本裝置以不間斷的方式蒐集主機檔案活動軌跡或網路流量,並針對儲存的資料進行可疑行為的分析。當惡意攻擊行為被偵測時,受駭資料與攻擊發生時間點可被明確地指出。接著,可從網路流量或主機活動紀錄中還原出可疑的檔案,以進行惡意程式分析及判別檔案是否為惡意程式。若分析的結果是惡意程式,便將惡意程式的情資製作成偵測規則並將其回饋到可疑行為偵測與惡意程式偵測的模組中。本發明利用上述方法,還原第一時間未被防毒軟體偵測且已被抹除的長時間潛伏惡意程式,協助釐清攻擊事件原貌。The present invention discloses a method and apparatus for detecting a malicious program. The device collects host file activity tracks or network traffic in an uninterrupted manner, and performs suspicious behavior analysis on the stored data. When a malicious attack is detected, the time at which the data is received and the time at which the attack occurred can be clearly indicated. Then, suspicious files can be recovered from the network traffic or host activity records for malware analysis and whether the files are malicious. If the result of the analysis is a malicious program, the malware's sentiment is made into a detection rule and fed back to the module for suspicious behavior detection and malware detection. The invention utilizes the above method to restore a long-term latent malicious program that has not been detected by the anti-virus software and has been erased for the first time, and helps to clarify the original appearance of the attack event.

Description

偵測惡意程式的方法和裝置Method and apparatus for detecting malware

本發明是有關於一種偵測惡意程式的方法和裝置。The present invention relates to a method and apparatus for detecting a malicious program.

隨著網路的蓬勃發展,現代人的生活已經與網路密不可分。行動網路的普及使得人們可以隨時隨地的透過智慧型手機或平板電腦存取網路。近年來,有越來越多的惡意程式被包裝於資料流之中,並且伴隨著資料流侵入電腦主機。惡意程式會對電腦主機帶來諸多不良的影響。因應於此,市面上出現越來越多的防毒軟體,用以偵測或抹除主機中的惡意程式。With the rapid development of the Internet, the lives of modern people are inseparable from the Internet. The popularity of mobile networks allows people to access the Internet from anywhere on the smartphone or tablet. In recent years, more and more malicious programs have been packaged in the data stream, and the data stream has invaded the computer host. Malware can have a lot of bad effects on the host computer. In response to this, more and more anti-virus software is on the market to detect or erase malicious programs in the host.

然而,防毒軟體往往無法在第一時間偵測出所有種類的惡意程式,且駭客也會透過各種方式抹除惡意程式的軌跡。除此之外,對所有資料流進行惡意程式偵測通常需要耗費大量的時間以及運算能力。However, anti-virus software often cannot detect all kinds of malicious programs in the first time, and hackers also erase the trajectory of malicious programs in various ways. In addition, malware detection of all data streams typically takes a lot of time and computing power.

本發明提供一種偵測惡意程式的裝置,包括:儲存單元以及處理器。儲存單元記錄多個模組。處理器,耦接該儲存單元,且存取並執行該儲存單元所儲存的該些模組,該些模組包括:可疑行為分析模組以及惡意程式分析模組。可疑行為分析模組,包括:保存模組,記錄資料流並且建立該資料流的索引。可疑行為偵測模組,依據可疑行為偵測規則偵測存在於該資料流的可疑行為並記錄該可疑行為的時間點。檔案萃取模組,基於該時間點與該索引,從該資料流萃取出可疑檔案樣本。惡意程式分析模組判斷該可疑檔案樣本是否為惡意程式。The invention provides an apparatus for detecting a malicious program, comprising: a storage unit and a processor. The storage unit records a plurality of modules. The processor is coupled to the storage unit and accesses and executes the modules stored in the storage unit. The modules include: a suspicious behavior analysis module and a malware analysis module. The suspicious behavior analysis module includes: saving a module, recording a data stream, and establishing an index of the data stream. The suspicious behavior detection module detects the suspicious behavior of the data stream and records the time point of the suspicious behavior according to the suspicious behavior detection rule. The file extraction module extracts a suspicious file sample from the data stream based on the time point and the index. The malware analysis module determines whether the suspicious file sample is a malicious program.

本發明提供一種偵測惡意程式的方法,包括:記錄資料流並且建立該資料流的索引。依據可疑行為偵測規則偵測存在於該資料流的可疑行為並記錄該可疑行為的時間點。基於該時間點與該索引,從該資料流萃取出可疑檔案樣本。以及判斷該可疑檔案樣本是否為惡意程式。The present invention provides a method for detecting a malicious program, comprising: recording a data stream and establishing an index of the data stream. A point in time at which suspicious behavior exists in the data stream and the suspicious behavior is recorded based on the suspicious behavior detection rule. Based on the time point and the index, a suspicious file sample is extracted from the data stream. And determine whether the suspicious file sample is a malicious program.

基於上述,本發明可透過可疑行為偵測規則篩選出可疑的檔案樣本,並僅針對可疑的樣本進行惡意程式分析。如此,可降低惡意程式分析耗費的時間以及運算能力,減輕系統的負擔。此外,本發明可從終端軌跡中還原出可能受過攻擊的檔案,並且基於該些檔案訂定新的可疑行為或惡意程式的偵測規則,藉此偵測下一次類似的攻擊行為。Based on the above, the present invention can screen suspicious file samples through suspicious behavior detection rules and perform malware analysis only on suspicious samples. In this way, the time and computing power of malware analysis can be reduced, and the burden on the system can be reduced. In addition, the present invention can recover potentially attacked files from the terminal track and set new suspicious behavior or malware detection rules based on the files to detect the next similar attack behavior.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。The above described features and advantages of the invention will be apparent from the following description.

本發明係揭露一種偵測惡意程式的方法和裝置。防毒軟體通常在感染的第一時間並無法偵測長時間潛伏的惡意程式。等到防毒軟體更新偵測規則時,通常惡意程式已透過自我刪除來規避偵測。本發明透過網路流量收容技術與主機檔案活動軌跡收容技術,將資料封存並建立索引。當監控環境中偵測到可疑攻擊行動,便可利用檔案萃取模組針對特定時間與資料範圍的進行檔案復原,藉此讓事件處理人員能夠取回惡意樣本,協助還原攻擊事件全貌。針對還原的檔案,本發明亦可自動化地進行惡意程式分析,進一步確認該檔案為惡意程式,並將樣本內包含的關鍵資料回饋至惡意程式情資資料庫,增加或更新惡意程式偵測規則。The present invention discloses a method and apparatus for detecting a malicious program. Anti-virus software usually does not detect long-term latent malware during the first time of infection. When the anti-virus software updates the detection rules, usually the malicious program has evaded detection by self-delete. The invention seals and indexes the data through the network traffic accommodating technology and the host file activity trajectory accommodating technology. When a suspicious attack is detected in the monitoring environment, the file extraction module can be used to recover the file for a specific time and data range, thereby enabling the event handler to retrieve the malicious sample and assist in restoring the attack event. For the restored file, the present invention can also automatically perform malware analysis, further confirm that the file is a malicious program, and feed back the key data contained in the sample to the malware information database, and add or update the malicious program detection rule.

圖1是依照本發明的實施例的偵測惡意程式的裝置10,裝置10包括但不限於處理器20以及儲存單元30。儲存單元30可以係任何型態的固定或可移動隨機存取記憶體(RAM)、唯讀記憶體(ROM)、快閃記憶體(flash memory)、傳統硬碟(hard disk drive)、固態硬碟(solid-state drive)或類似元件或上述元件的組合,並用以記錄多個主要的模組,該些模組包括可疑行為分析模組310、惡意程式分析模組320、保存資料庫330、可疑行為偵測規則資料庫340、可疑樣本資料庫350以及惡意程式情資資料庫360。1 is an apparatus 10 for detecting a malicious program, including but not limited to a processor 20 and a storage unit 30, in accordance with an embodiment of the present invention. The storage unit 30 can be any type of fixed or removable random access memory (RAM), read only memory (ROM), flash memory, hard disk drive, solid state hard A solid-state drive or the like or a combination of the above components, and used to record a plurality of main modules, including a suspicious behavior analysis module 310, a malware analysis module 320, a save database 330, The suspicious behavior detection rule database 340, the suspicious sample database 350, and the malware situation database 360.

處理器20耦接儲存單元30,並可以是中央處理單元(CPU),或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位信號處理器(DSP)、可程式化控制器、特殊應用積體電路(ASIC)或其他類似元件或上述元件的組合。在本發明實施例中,處理單元20用以執行偵測惡意程式的裝置10的所有功能,且可存取並執行儲存單元30中記錄的模組。The processor 20 is coupled to the storage unit 30 and may be a central processing unit (CPU) or other programmable general purpose or special purpose microprocessor (Microprocessor), digital signal processor (DSP), and programmable. Controller, Special Application Integrated Circuit (ASIC) or other similar component or combination of the above. In the embodiment of the present invention, the processing unit 20 is configured to perform all functions of the device 10 for detecting malicious programs, and can access and execute the modules recorded in the storage unit 30.

可疑行為分析模組310用以判別資料流是否存在可疑行為,並萃取出可疑行為發生時點的可疑檔案樣本,以利進行後續的惡意程式分析。可疑行為分析模組310包括多個子模組,其分別為保存模組311、可疑行為偵測模組312、檔案萃取模組313。The suspicious behavior analysis module 310 is used to determine whether there is suspicious behavior in the data stream, and extracts suspicious file samples at the time when the suspicious behavior occurs, so as to facilitate subsequent malware analysis. The suspicious behavior analysis module 310 includes a plurality of sub-modules, which are a save module 311, a suspicious behavior detection module 312, and a file extraction module 313.

保存模組311係用以記錄資料流並且建立索引。當資料流的類型為主機檔案時,保存模組311透過監控程式蒐集主機系統上的檔案活動軌跡。檔案活動軌跡包含但不限於檔案異動歷程、主機程式呼叫應用程式介面(application programming interface,API)、程序執行API呼叫與自動啟動設定值/機碼等,詳如表一所示。 表一、主機活動軌跡蒐集資料表<TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td><b>蒐集標的</b></td><td><b>蒐集內容</b></td></tr><tr><td> 檔案移除API呼叫 </td><td> 檔案路徑與檔案內容 </td></tr><tr><td> 檔案執行API呼叫 </td><td> 執行檔檔案路徑與檔案內容 </td></tr><tr><td> 自動啟動設定值/機碼修改 </td><td> 檔案路徑與檔案內容 </td></tr><tr><td> Powershell執行呼叫 </td><td> Powershell腳本路徑與內容 </td></tr><tr><td> 符合自訂檔案路經偵測規則之檔案 </td><td> 檔案路徑與檔案內容 </td></tr><tr><td> 符合自訂Yara規則特徵之檔案 </td><td> 檔案路徑與檔案內容 </td></tr><tr><td> 符合自訂雜湊值之檔案 </td><td> 檔案路徑與檔案內容 </td></tr></TBODY></TABLE>當資料流的類型為網路流量時,保存模組311透過網路流量鏡像側錄,以PCAP檔案格式儲存網路流量。保存模組311並可針對TCP/IP層通訊協定與常用應用層通訊協定,如TELNET、FTP、HTTP、POP3、SMTP或DNS等協定進行解析與記錄。保存模組311針對上述蒐集的資訊、日期時間以及受監控環境中主機的UID(Unique ID)建立索引,並且儲存於保存資料庫330。 The save module 311 is used to record the data stream and build an index. When the type of the data stream is the host file, the save module 311 collects the file activity track on the host system through the monitoring program. The file activity track includes, but is not limited to, the file transaction history, the host program call application interface (API), the program execution API call and the auto start setting/machine code, as shown in Table 1. Table 1. Host activity track collection data table <TABLE border="1"borderColor="#000000"width="85%"><TBODY><tr><td><b>Collectiontarget</b></td><td><b>CollectingContent</b></td></tr><tr><td> File Removal API Call</td><td> File Path and File Content</td></ Tr><tr><td> File Execution API Call</td><td> Execution File Path and File Content</td></tr><tr><td> Automatically Start Setpoint/Machine Code Modification</ Td><td> File Path and Archive Content</td></tr><tr><td> Powershell Execution Call</td><td> Powershell Script Path and Content</td></tr><tr><td> Files that conform to custom file path detection rules</td><td> File path and file contents</td></tr><tr><td> Files that match the characteristics of custom Yara rules</ Td><td> file path and file content</td></tr><tr><td> file matching custom hash value</td><td> file path and file content</td></tr ></TBODY></TABLE> When the type of the data stream is network traffic, the save module 311 stores the network traffic in the PCAP file format through the network traffic mirroring. The save module 311 can be parsed and recorded for protocols such as TELNET, FTP, HTTP, POP3, SMTP or DNS for TCP/IP layer protocols and common application layer communication protocols. The save module 311 indexes the collected information, the date and time, and the UID (Unique ID) of the host in the monitored environment, and stores the data in the save database 330.

可疑行為偵測模組312係用以依據可疑行為偵測規則資料庫340中的可疑行為偵測規則來比對資料流(即上述的主機活動軌跡或網路流量),並且偵測資料流中的可疑行為或攻擊事件。可疑行為偵測模組312還會記錄可疑行為或攻擊事件發生的時間點。當資料流的類型為網路流量時,可疑行為偵測規則所比對的資料可包括但不限於IP位址、連接埠、通訊協定標頭(諸如HTTP/ SMTP/ POP3/ FTP/ DNS)以及封包內容特徵比對等。當資料流的類型為主機檔案時,可疑行為偵測規則所比對的資料可包括但不限於檔案建立API、程序啟動API、系統排程啟動變更與自動啟動設定值/機碼等。當發現可疑行為時,可疑行為偵測模組312將記錄受監控之主機的主機名稱或網路流量對應的IP,以及記錄事件發生的日期時間。The suspicious behavior detection module 312 is configured to compare the data stream (ie, the host activity track or network traffic) according to the suspicious behavior detection rule in the suspicious behavior detection rule database 340, and detect the data stream. Suspicious behavior or attack. The suspicious behavior detection module 312 also records the point in time at which suspicious behavior or an attack event occurs. When the type of data stream is network traffic, the data of the suspicious behavior detection rule may include, but is not limited to, an IP address, a port, a protocol header (such as HTTP/SMTP/POP3/FTP/DNS), and Packet content features are compared. When the type of the data stream is a host file, the data of the suspicious behavior detection rule may include, but is not limited to, a file creation API, a program startup API, a system schedule start change, and an automatic startup setting/machine code. When suspicious behavior is found, the suspicious behavior detection module 312 will record the host name of the monitored host or the IP corresponding to the network traffic, and record the date and time when the event occurred.

檔案萃取模組313係用以基於可疑事件發生的日期時間與索引,從資料流萃取出可疑檔案樣本。檔案萃取模組313根據可疑行為偵測模組312比對出的主機名稱/IP與可疑事件發生時間。接著,檔案萃取模組313從保存資料庫330中進行檔案還原萃取,萃取出的可疑檔案樣本以壓縮檔格式儲存。例如,檔案萃取模組313可依據所還原之可疑檔案樣本的SHA256雜湊值命名並建立索引,並且將其儲存於可疑樣本資料庫350之中。接著,惡意程式分析模組320便可針對可疑檔案樣本執行自動化的惡意程式分析。裝置10可透過此方法降低檔案萃取所耗費的系統運算資源與萃取所需時間。The file extraction module 313 is configured to extract suspicious file samples from the data stream based on the date and time and index of the suspicious event. The file extraction module 313 compares the host name/IP and the suspicious event occurrence time according to the suspicious behavior detection module 312. Then, the file extraction module 313 performs file reduction extraction from the saved database 330, and the extracted suspicious file samples are stored in a compressed file format. For example, the file extraction module 313 can name and index the SHA256 hash value of the restored suspicious file sample and store it in the suspect sample database 350. The malware analysis module 320 can then perform automated malware analysis on the suspect file samples. The device 10 can reduce the amount of system computing resources and extraction time required for file extraction by this method.

惡意程式分析模組320係基於惡意程式偵測規則分析可疑檔案樣本是否為惡意程式。惡意程式分析模組320包括多個子模組,其分別為信譽評等模組321、靜態分析模組322、動態分析模組323以及情資回饋模組324,其中信譽評等模組321、靜態分析模組322以及動態分析模組323可基於不同的惡意程式偵測規則分析可疑檔案樣本是否為惡意程式。The malware analysis module 320 analyzes whether the suspicious file sample is a malicious program based on the malware detection rule. The malware analysis module 320 includes a plurality of sub-modules, which are a credit rating module 321 , a static analysis module 322 , a dynamic analysis module 323 , and an emotional feedback module 324 , wherein the reputation evaluation module 321 , static The analysis module 322 and the dynamic analysis module 323 can analyze whether the suspicious file sample is a malicious program based on different malware detection rules.

信譽評等模組321係惡意程式分析模組320首先執行的模組。信譽評等模組321以可疑檔案樣本的SHA256雜湊值向情資系統進行查詢,其中情資系統可例如是來自外部的惡意程式資料庫或是來自惡意程式情資資料庫360。若可疑檔案樣本已有惡意程式的相關紀錄,則直接讀取紀錄並且判斷該可疑檔案樣本惡意程式,不須執行後續分析(即:不須執行靜態分析模組322以及動態分析模組323的惡意程式分析功能)。若信譽評等模組321判定可疑檔案樣本並非惡意程式,則由靜態分析模組322對該可疑檔案樣本執行進一步的分析。The reputation rating module 321 is a module that the malware analysis module 320 first executes. The reputation rating module 321 queries the information system with the SHA256 hash value of the suspicious file sample, wherein the information system can be, for example, an external malware database or a malware repository. If there is a related record of the malicious program in the sample of the suspicious file, the record is directly read and the malicious file of the suspect file is determined, and no subsequent analysis is performed (ie, the static analysis module 322 and the dynamic analysis module 323 are not required to be executed. Program analysis function). If the reputation rating module 321 determines that the suspicious file sample is not a malicious program, the static analysis module 322 performs further analysis on the suspect file sample.

靜態分析模組322可透過YARA特徵規則、執行檔Mutex資訊、執行檔程式資料庫(program database)資訊與執行檔簽章內容等進行靜態分析特徵比對,藉以判斷可疑檔案樣本是否為惡意程式。靜態分析模組322的執行速度較動態分析模組323快速、誤判率(false positive)較低、漏判率(false negative)較高。若符合靜態分析特徵比對,則直接將可疑檔案樣本歸類為惡意程式,不須執行後續其他分析(即:不須執行動態分析模組323的惡意程式分析功能)。The static analysis module 322 can perform static analysis feature comparison through the YARA feature rule, the execution file Mutex information, the execution program database information and the execution file signature content, so as to determine whether the suspicious file sample is a malicious program. The execution speed of the static analysis module 322 is faster than the dynamic analysis module 323, the false positive rate is lower, and the false negative rate is higher. If the static analysis feature comparison is met, the suspicious file sample is directly classified as a malicious program, and no subsequent analysis is performed (ie, the malicious program analysis function of the dynamic analysis module 323 is not required).

動態分析模組323係透過沙箱(sandbox)分析技術記錄可疑檔案樣本的可疑行為並進行動態分析。此技術的執行較耗費時間,但可詳細記錄可疑檔案樣本的所有行為,供後續特徵偵測規則使用。動態分析模組323記錄的項目如下表二所示。 表二、惡意程式動態分析記錄項目表<TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td><b>類型</b></td><td><b>紀錄項目名稱</b></td><td><b>實際紀錄內容範例</b></td></tr><tr><td> 產生檔案行為 </td><td> 產生之檔案類型 </td><td> </td></tr><tr><td> 產生之檔案路徑 </td><td> C:\windows\system32\a.exe </td></tr><tr><td> 產生之檔案惡意程式分析結果 </td><td> 惡意等級評分:0.7 </td></tr><tr><td> 網路連線行為 </td><td> 連線IP與服務埠 </td><td> 168.95.1.1:53 </td></tr><tr><td> ICMP通訊協定內容 </td><td> 8.8.8.8 </td></tr><tr><td> HTTP 通訊協定內容 </td><td> http://www.cht.com.tw </td></tr><tr><td> DNS通訊協定內容 </td><td> www.google.com </td></tr><tr><td> SMTP通訊協定內容 </td><td> HELO MAIL FROM annie@company.com; RCPT TO bob@company.com </td></tr><tr><td> 關鍵API呼叫 </td><td> 網路行為API </td><td> getaddrinfo函數 </td></tr><tr><td> 檔案系統API </td><td> FindFirstFile函數 </td></tr><tr><td> 註冊機碼API </td><td> RegOpenKeyEx函數 </td></tr><tr><td> 程序相關API </td><td> CreateProcess函數 </td></tr><tr><td> 系統服務相關API </td><td> OpenService函數 </td></tr></TBODY></TABLE>The dynamic analysis module 323 records the suspicious behavior of the suspicious file samples and performs dynamic analysis through sandbox analysis technology. The implementation of this technique is time consuming, but all the behavior of the suspicious file samples can be recorded in detail for subsequent feature detection rules. The items recorded by the dynamic analysis module 323 are as shown in Table 2 below. Table 2, malicious program dynamic analysis record project table <TABLE border="1"borderColor="#000000"width="85%"><TBODY><tr><td><b>type</b></td><td><b>Record Project Name</b></td><td><b>Example of Actual Record Content</b></td></tr><tr><td> Generate File Behavior </td><td> File Type Generated</td><td></td></tr><tr><td> File Path Generated</td><td> C:\windows\system32\a .exe </td></tr><tr><td> Generated malware analysis results</td><td> Malicious rating: 0.7 </td></tr><tr><td> Road Connection Behavior</td><td> Connection IP and Service埠</td><td> 168.95.1.1:53 </td></tr><tr><td> ICMP Protocol Contents</td ><td> 8.8.8.8 </td></tr><tr><td> HTTP Protocol Contents</td><td> http://www.cht.com.tw </td></tr ><tr><td> DNS Protocol Contents</td><td> www.google.com </td></tr><tr><td> SMTP Protocol Contents</td><td> HELO MAIL FROM annie@company.com; RCPT TO bob@company.com </td></tr><tr><td> Key API Calls</td><td> Network Behavior API </td><td> getaddrinfo Function</td></tr><tr><td> File System API </td><td> FindFirstFile Function</td ></tr><tr><td> Registered Code API </td><td> RegOpenKeyEx Function</td></tr><tr><td> Program Related API </td><td> CreateProcess Function </td></tr><tr><td> System Service Related APIs </td><td> OpenService Functions</td></tr></TBODY></TABLE>

當可疑檔案樣本經過上述三個模組執行惡意程式分析後,惡意程式分析模組320將給予一個惡意等級評分(例如:介於0.0~1.0分)。當惡意等級評分高於閥值,則判定該可疑檔案樣本為惡意程式並將其標記。接著,由情資回饋模組324萃取惡意程式的關鍵資訊。關鍵資訊包括但不限於連線中繼站、特定目錄或檔案路徑,註冊機碼變更等。情資回饋模組324並自動產出對應於該可疑檔案樣本的可疑行為偵測規則及/或惡意程式偵測規則,並將可疑行為偵測規則回饋至可疑行為偵測規則資料庫340及/或將惡意程式偵測規則回饋至惡意程式情資資料庫360。可疑行為分析模組310可藉由更新後的可疑行為偵測規則重新起始分析流程,藉此發現其它未被發現的可疑檔案或惡意程式。After the suspicious file sample is subjected to malware analysis by the above three modules, the malware analysis module 320 will give a malicious rating (for example, between 0.0 and 1.0 points). When the malicious rating score is higher than the threshold, the suspicious file sample is determined to be a malicious program and marked. Then, the emotional feedback module 324 extracts key information of the malicious program. Key information includes, but is not limited to, connection relay stations, specific directory or file paths, registration code changes, and more. The emotive feedback module 324 automatically generates a suspicious behavior detection rule and/or a malicious program detection rule corresponding to the suspicious file sample, and feeds the suspicious behavior detection rule back to the suspicious behavior detection rule database 340 and/or Or return the malware detection rules to the malware repository. The suspicious behavior analysis module 310 can restart the analysis process by the updated suspicious behavior detection rule to discover other undiscovered suspicious files or malicious programs.

圖2是依照本發明的實施例的偵測惡意程式的方法200的主流程之流程圖,其可由本發明的裝置10實施。2 is a flow diagram of a main flow of a method 200 of detecting a malicious program, which may be implemented by the apparatus 10 of the present invention, in accordance with an embodiment of the present invention.

在步驟S210,保存模組311記錄資料流並且建立該資料流的索引。例如,保存模組311可用於蒐集受監控主機之TCP/IP層網路封包與系統上的檔案活動軌跡。In step S210, the save module 311 records the data stream and establishes an index of the data stream. For example, the save module 311 can be used to collect the TCP/IP layer network packet of the monitored host and the file activity track on the system.

在步驟S220,可疑行為偵測模組312依據可疑行為偵測規則來偵測存在於資料流的可疑行為,並且記錄該可疑行為發生的時間點。例如,當資料流的類型為主機檔案時,可疑行為偵測模組312可以從主機活動軌跡資料中偵測系統上是否有可疑的檔案建立、刪除與執行動作。比對內容包含但不限於檔案類型、檔案雜湊值、檔案建立來源、檔案被執行的父程序與系統註冊機碼等資訊。當資料流的類型為網路流量時,可疑行為偵測模組312執行比對黑名單IP地址、高風險通訊協定、可疑檔案下載或是傳輸之行為等。若發現可疑行為之風險評分超過系統制定的風險評分閥值則進入步驟S230,否則直接結束。In step S220, the suspicious behavior detection module 312 detects suspicious behavior existing in the data stream according to the suspicious behavior detection rule, and records the time point at which the suspicious behavior occurs. For example, when the type of the data stream is a host file, the suspicious behavior detection module 312 can detect whether there is suspicious file creation, deletion, and execution on the system from the host activity track data. The comparison content includes, but is not limited to, the file type, the file hash value, the file creation source, the parent program of the file execution, and the system registration code. When the type of the data stream is network traffic, the suspicious behavior detection module 312 performs a blacklist IP address, a high-risk communication protocol, a suspicious file download, or a transmission behavior. If the risk score of the suspicious behavior is found to exceed the system-set risk score threshold, the process proceeds to step S230, otherwise the process ends directly.

在步驟S230,檔案萃取模組313基於可疑行為發生的時間點與索引,從資料流萃取出可疑檔案樣本。例如,檔案萃取模組313可從步驟S220獲得報可疑行為發生之主機名稱、IP地址與日期時間,並以此作為索引至可疑行為分析模組310進行搜尋。檔案萃取模組313並利用檔案還原技術還原可疑檔案樣本,然後將可疑檔案樣本派送至惡意程式分析模組320進行自動化的分析。In step S230, the file extraction module 313 extracts a suspicious file sample from the data stream based on the time point and index of the suspicious behavior. For example, the file extraction module 313 can obtain the host name, IP address, and date and time of the occurrence of the suspicious behavior from step S220, and use the index as the index to the suspicious behavior analysis module 310 to perform the search. The file extraction module 313 restores the suspicious file sample by using the file restoration technology, and then sends the suspicious file sample to the malware analysis module 320 for automated analysis.

在步驟S240,透過惡意程式分析模組320對可疑檔案樣本進行惡意程式分析。分析惡意程式的方法將於後續的圖3說明。惡意程式分析模組320執行完惡意程式的分析後,會給予可疑檔案樣本惡意等級評分(例如:介於0.0~10.0分),當評分高於閥值,則將其判定為惡意程式並進入步驟S250,否則直接建檔後結束流程。In step S240, the malware analysis module 320 performs malicious program analysis on the suspicious file samples. The method of analyzing malware will be explained in the following Figure 3. After the malware analysis module 320 performs the analysis of the malicious program, it will give a suspicious file sample malicious rating (for example, between 0.0 and 10.0 points). When the score is higher than the threshold, it will be determined as a malicious program and enter the step. S250, otherwise the process is completed after the file is directly created.

在步驟S250,情資回饋模組324擷取被判定為惡意程式之可疑檔案樣本的資訊,並且將惡意程式之資訊製作成偵測規則(例如:可疑行為偵測規則或惡意程式偵測規則),並將偵測規則回饋至可疑行為分析模組310並進行檢索,重新啟動新一輪分析流程,藉此發現其它未被發現的可疑檔案或惡意程式。情資回饋模組324所萃取的惡意程式資訊請參照下表三。 表三、惡意程式資訊擷取表<TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td><b>類型</b></td><td><b>惡意程式內容資訊</b></td></tr><tr><td> 靜態檔案內容 </td><td> 特殊字串 </td></tr><tr><td> SHA-256雜湊值 </td></tr><tr><td> 模糊雜湊值 </td></tr><tr><td> 執行檔Mutex字串 </td></tr><tr><td> 執行檔PDB資訊 </td></tr><tr><td> 網路連線行為 </td><td> 連線IP位址 </td></tr><tr><td> HTTP URL網址 </td></tr><tr><td> DNS查詢域名 </td></tr><tr><td> 作業系統行為 </td><td> 自動啟動設定值/機碼 </td></tr><tr><td> 寫入系統檔案名稱 </td></tr><tr><td> 寫入工作排程名稱 </td></tr><tr><td> 建立子程序名稱 </td></tr></TBODY></TABLE>In step S250, the emotive feedback module 324 retrieves the information of the suspicious file sample determined to be a malicious program, and generates the information of the malicious program into a detection rule (for example, a suspicious behavior detection rule or a malicious program detection rule). And the detection rule is fed back to the suspicious behavior analysis module 310 and retrieved, and a new round of analysis process is restarted to discover other undiscovered suspicious files or malicious programs. Please refer to Table 3 below for the malware information extracted by the emotive feedback module 324. Table 3, malicious program information retrieval table <TABLE border="1"borderColor="#000000"width="85%"><TBODY><tr><td><b>type</b></td><td><b>Madware Content Information</b></td></tr><tr><td> Static File Content</td><td> Special Strings</td></tr><Tr><td> SHA-256 hash value</td></tr><tr><td> fuzzy hash value</td></tr><tr><td> execution file Mutex string</td></tr><tr><td> Execution file PDB information</td></tr><tr><td> Network connection behavior</td><td> Connection IP address</td></tr><tr><td> HTTP URL </td></tr><tr><td> DNS Query Domain Name</td></tr><tr><td> Operating System Behavior</td><td> Auto Start Set/Machine Code</td></tr><tr><td> Write System File Name</td></tr><tr><td> Write Work Schedule Name</td></tr><tr><td> Create subroutine name</td></tr></TBODY></TABLE>

圖3是依照本發明的實施例的進一步說明步驟S220的可疑行為分析的流程圖,其可由本發明的裝置10實施。步驟S220可透過定期排程(例如:將預設頻率設為1次/1天)檢查的方式被執行,用以監控環境中是否存在可疑行為。3 is a flow diagram further illustrating the suspicious behavior analysis of step S220, which may be implemented by apparatus 10 of the present invention, in accordance with an embodiment of the present invention. Step S220 can be performed by means of periodic scheduling (for example, setting the preset frequency to 1 time/1 day) to monitor whether there is suspicious behavior in the environment.

在步驟S310,透過可疑行為偵測模組312進行網路的流量可疑行為比對,若某主機之流量行為符合可疑行為偵測規則,則將該主機之IP與可疑行為發生之日期時間記錄下來,傳送至步驟S330,否則進入步驟S320以檢視主機上是否存在可疑檔案行為。In step S310, the suspicious behavior detection module 312 is used to compare the traffic suspicious behavior of the network. If the traffic behavior of a host complies with the suspicious behavior detection rule, the date and time of the IP and suspicious behavior of the host are recorded. And the process goes to step S330, otherwise it goes to step S320 to check whether there is suspicious file behavior on the host.

在步驟S320,透過可疑行為偵測模組312進行主機的檔案可疑行為比對,若符合可疑行為偵測規則,則將符合的主機名稱與可疑行為發生之日期時間記錄下來,傳送至步驟S430,否則直接結束。In step S320, the suspicious behavior detection module 312 is used to perform the suspicious behavior comparison of the host file. If the suspicious behavior detection rule is met, the matching host name and the date and time when the suspicious behavior occurs are recorded, and the process proceeds to step S430. Otherwise it ends directly.

在步驟S330,檔案萃取模組313可將主機之IP、主機名稱與日期時間作為參數,藉以從資料流中還原出可疑檔案樣本,並將可疑檔案樣本送至惡意程式分析模組320進行自動化分析。In step S330, the file extraction module 313 can use the IP, host name and date and time of the host as parameters to restore the suspicious file sample from the data stream, and send the suspicious file sample to the malware analysis module 320 for automatic analysis. .

圖4是依照本發明的實施例的進一步說明步驟S240的惡意程式分析的流程圖,其可由本發明的裝置10實施。4 is a flow diagram further illustrating the malware analysis of step S240, which may be implemented by apparatus 10 of the present invention, in accordance with an embodiment of the present invention.

在步驟S410,信譽評等模組321透過計算可疑檔案樣本的SHA256雜湊值,並向情資系統進行資料查詢,其中情資系統可例如是來自外部的惡意程式資料庫或是來自惡意程式情資資料庫360。若可疑檔案樣本在資料庫中已有相關資訊,則可直接標示成惡意程式,不需執行後續分析。若樣本為未知樣本,則進入步驟S420。In step S410, the reputation rating module 321 calculates the SHA256 hash value of the suspicious file sample and performs data query to the information system, wherein the information system can be, for example, an external malicious program database or from a malicious program. Database 360. If the suspicious file sample already has relevant information in the database, it can be directly marked as a malicious program without performing subsequent analysis. If the sample is an unknown sample, it proceeds to step S420.

在步驟S420,靜態分析模組322透過YARA規則、執行檔Mutex、執行等PDB資訊與執行檔簽章內容等靜態內容進行靜態分析特徵比對。靜態分析特徵比對的執行速度相對步驟S430的動態分析較為快速。若符合靜態分析特徵比對則直接將可疑檔案樣本歸類為惡意程式,若不符合則由進入步驟S430。In step S420, the static analysis module 322 performs static analysis feature comparison through static content such as YARA rule, execution file Mutex, execution and other PDB information and execution file signature content. The execution speed of the static analysis feature alignment is relatively fast compared to the dynamic analysis of step S430. If the static analysis feature comparison is met, the suspicious file sample is directly classified as a malicious program, and if not, the process proceeds to step S430.

在步驟S430,動態分析模組323透過沙箱分析技術(sandbox)進行動態分析。分析過程中會記錄可疑檔案樣本在監控的沙箱環境中的所有行為,行為紀錄表可參考下表四。 表四、惡意程式動態分析行為紀錄表<TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td><b>類型</b></td><td><b>紀錄項目名稱</b></td><td><b>實際紀錄內容範例</b></td></tr><tr><td> 產生檔案行為 </td><td> 產生之檔案類型 </td><td> </td></tr><tr><td> 產生之檔案路徑 </td><td> C:\windows\system32\a.exe </td></tr><tr><td> 產生之檔案惡意程式分析結果 </td><td> 惡意等級:6.2 </td></tr><tr><td> 網路連線行為 </td><td> 連線IP與服務埠 </td><td> 168.95.1.1:53 </td></tr><tr><td> ICMP通訊協定內容 </td><td> 8.8.8.8 </td></tr><tr><td> HTTP 通訊協定內容 </td><td> http://www.cht.com.tw </td></tr><tr><td> DNS通訊協定內容 </td><td> www.google.com </td></tr><tr><td> SMTP通訊協定內容 </td><td> HELO MAIL FROM annie@company.com; RCPT TO bob@company.com </td></tr><tr><td> 關鍵API呼叫 </td><td> 網路行為API </td><td> getaddrinfo函數 </td></tr><tr><td> 檔案系統API </td><td> FindFirstFile函數 </td></tr><tr><td> 註冊機碼API </td><td> RegOpenKeyEx函數 </td></tr><tr><td> 程序相關API </td><td> CreateProcess函數 </td></tr><tr><td> 系統服務相關API </td><td> OpenService函數 </td></tr></TBODY></TABLE>In step S430, the dynamic analysis module 323 performs dynamic analysis through a sandbox analysis technology (sandbox). All the behaviors of the suspicious file samples in the monitored sandbox environment are recorded during the analysis. The behavior record table can be found in Table 4 below. Table 4, malicious program dynamic analysis behavior record table <TABLE border="1"borderColor="#000000"width="85%"><TBODY><tr><td><b>type</b></td><td><b>Record Project Name</b></td><td><b>Example of Actual Record Content</b></td></tr><tr><td> Generate File Behavior </td><td> File Type Generated</td><td></td></tr><tr><td> File Path Generated</td><td> C:\windows\system32\a .exe </td></tr><tr><td> Generated malware analysis results</td><td> Malicious rating: 6.2 </td></tr><tr><td> Network Connection Behavior</td><td> Connection IP and Service埠</td><td> 168.95.1.1:53 </td></tr><tr><td> ICMP Protocol Contents</td><td> 8.8.8.8 </td></tr><tr><td> HTTP Protocol Contents</td><td> http://www.cht.com.tw </td></tr><tr><td> DNS Protocol Contents</td><td> www.google.com </td></tr><tr><td> SMTP Protocol Contents</td><td> HELO MAIL FROM Annie@company.com; RCPT TO bob@company.com </td></tr><tr><td> Key API Calls</td><td> Network Behavior API </td><td> getaddrinfo Function </td></tr><tr><td> File System API </td><td> FindFirstFile Function</td></tr><tr><td> Registered Code API </td><td> RegOpenKeyEx Function</td></tr><tr><td> Program Related API </td><td> CreateProcess Function</td></tr><tr><td> System Service Related APIs </td><td> OpenService Functions</td></tr></TBODY></TABLE>

在步驟S440,惡意程式分析模組320會對進行惡意等級評分。具體來說,每筆行為偵測規則有一分數值(例如:介於0.0 ~ 1.0),範例格式如下表五。若可疑檔案樣本的行為與偵測規則相符則得分。假使可疑檔案樣本同時符合多筆規則,則以累加方式計算總分。當總分超過預定義之閥值(例如:預設為0.6),則將可疑檔案標示為惡意程式。若總分低於閥值,代表該可疑檔案經過上述模組分析後皆無明顯惡意程式特徵,因此標示為正常程式。 表五、惡意程式偵測規則格式表<TABLE border="1" borderColor="#000000" width="85%"><TBODY><tr><td><b>欄位名稱</b></td><td><b>說明</b></td><td><b>實際內容範例</b></td></tr><tr><td> 名稱 </td><td> 特徵的名稱 </td><td> 勒索軟體可疑檔案行為 </td></tr><tr><td> 描述 </td><td> 惡意程式的詳細描述 </td><td> 分析的可疑檔案執行後有類似勒索軟體大量開啟、修改、另存新檔的動作。 </td></tr><tr><td> 惡意程度 </td><td> 惡意程度 (0.0至1.0) </td><td> 0.6 </td></tr><tr><td> 類別 </td><td> 惡意程式的類別 </td><td> 勒索軟體 </td></tr><tr><td> 家族 </td><td> 惡意程式所屬的家族 </td><td> cryptolocker病毒 </td></tr><tr><td> 參考資料 </td><td> 一些外部連結輔助說明 </td><td> https://zh.wikipedia.org/wiki/CryptoLocker </td></tr><tr><td> 撰寫者 </td><td> 特徵碼撰寫者 </td><td> 無 </td></tr><tr><td> 啟用 </td><td> 若為真:此特徵生效 若為假:此特徵失效 </td><td> 真 </td></tr><tr><td> 警報 </td><td> 若為真:此特徵顯示在報告中 若為假:此特徵不顯示在報告中 </td><td> 真 </td></tr></TBODY></TABLE>At step S440, the malware analysis module 320 scores the malicious rating. Specifically, each behavior detection rule has a score (for example, between 0.0 and 1.0). The sample format is shown in Table 5. Score if the behavior of the suspicious file sample matches the detection rule. If the suspicious file sample meets multiple rules at the same time, the total score is calculated in an accumulated manner. When the total score exceeds a predefined threshold (for example, the default is 0.6), the suspicious file is marked as a malicious program. If the total score is lower than the threshold, it means that the suspicious file has no obvious malware characteristics after the above module analysis, so it is marked as a normal program. Table 5, malware detection rule format table <TABLE border="1"borderColor="#000000"width="85%"><TBODY><tr><td><b>fieldname</b></td><td><b>Description</b></td><td><b>Example of actual content</b></td></tr><tr><td>Name</td><td> Name of the feature</td><td> Blackmail suspicious file behavior</td></tr><tr><td>Description</td><td> Detailed description of the malware</td>< After the td> analysis of the suspicious file is executed, there is a similar operation of the ransomware to open, modify, and save the new file. </td></tr><tr><td>Maliciousness</td><td> Maliciousness (0.0 to 1.0) </td><td> 0.6 </td></tr><tr><Td>category</td><td> category of malware</td><td>ransomware</td></tr><tr><td>family</td><td> family of malware </td><td> cryptolocker virus</td></tr><tr><td>References</td><td> Some external links help instructions</td><td> https://zh. wikipedia.org/wiki/CryptoLocker </td></tr><tr><td>Writer</td><td> Signature Writer</td><td>None</td></tr><tr><td>Enabled</td><td> If true: This feature is valid if false: This feature is invalid</td><td>True</td></tr><tr><td>Alert</td><td> If true: This feature is displayed as false in the report: this feature is not displayed in the report</td><td>True</td></tr></TBODY></TABLE>

在步驟S450,惡意程式分析模組320以SHA-256雜湊值為主要索引,將可疑檔案樣本標示為惡意程式。In step S450, the malware analysis module 320 marks the suspicious file sample as a malicious program with a SHA-256 hash value as the main index.

在步驟S460,惡意程式分析模組320以SHA-256雜湊值為主要索引,將可疑檔案樣本標示為正常程式。In step S460, the malware analysis module 320 marks the suspicious file sample as a normal program with the SHA-256 hash value as the main index.

圖5是依照本發明的偵測惡意程式的裝置10實際應用於一系統的範例。Figure 5 is an illustration of an example of an apparatus 10 for detecting malware that is actually applied to a system in accordance with the present invention.

步驟一:進行系統設定。在一公司的伺服器與主機內執行監控程式60。將主機上之活動軌跡回傳至可疑行為分析模組A。並在路由器鏡像分流網路流量至可疑行為分析模組B,藉以分析網路流量並確保設定正確後即開始網路流量監控。可疑行為分析模組A與可疑行為分析模組B均可由本發明的可疑行為分析模組310實施。Step 1: Make system settings. The monitoring program 60 is executed in a server and a host of a company. The activity track on the host is transmitted back to the suspicious behavior analysis module A. The router mirrors the traffic to the suspicious behavior analysis module B to analyze the network traffic and ensure that the network traffic monitoring starts after the settings are correct. Both the suspicious behavior analysis module A and the suspicious behavior analysis module B can be implemented by the suspicious behavior analysis module 310 of the present invention.

步驟二:進行活動軌跡收容。同時收容伺服器的流量與檔案活動軌跡,並以日期與系統IP/主機名稱建立索引,以便日後調用存查。Step 2: Carry out the activity track accommodation. At the same time, it stores the traffic of the server and the track of the file activity, and indexes the date and the system IP/host name so that the check can be called later.

步驟三:進行可疑行為分析。預設分析周期為每日一次。可疑行為分析模組A以及可疑行為分析模組B自動地分析主機或網路流量中是否有可疑行為。當可疑行為之風險評分超過閥值則進行可疑樣本萃取,否則直接結束。Step 3: Conduct suspicious behavior analysis. The preset analysis period is once a day. The Suspicious Behavior Analysis Module A and the Suspicious Behavior Analysis Module B automatically analyze whether there is suspicious behavior in the host or network traffic. Suspicious sample extraction is performed when the risk score of suspicious behavior exceeds the threshold, otherwise it ends directly.

步驟四:進行可疑樣本萃取。偵測惡意程式的裝置10可從流量與主機活動軌跡系統中以可疑行為發生之日期時間、相關主機IP與主機名稱進行索引,利用檔案還原技術還原可疑檔案並進行自動化分析。Step 4: Perform a suspicious sample extraction. The device 10 for detecting malicious programs can index the date and time of the suspicious behavior, the relevant host IP and the host name from the traffic and host activity track system, and use the file restoration technology to restore the suspicious files and perform automatic analysis.

步驟五:進行可疑樣本。對惡意檔案進行靜態分析、動態分析與情資信譽評分析,並回報管理者在分析後,是否惡意程式,管理者可根據此報表進行追蹤或資安事件調查。若未發現可疑程式則結束。Step 5: Conduct a suspicious sample. Static analysis, dynamic analysis and emotional reputation evaluation of malicious files, and return to the manager after analysis, whether malicious programs, managers can follow this report for tracking or security incident investigation. End if no suspicious programs are found.

步驟六:進行樣本情資回饋。從被發現的惡意程式行為中萃取關鍵資訊,如惡意程式連線中繼站、惡意程式執行過程中寫入特定目錄或建立特定檔案,寫入註冊機碼等。並將上述資訊製作成可疑行為偵測規則與惡意程式偵測規則。Step 6: Conduct sample emotional feedback. Extract key information from the behavior of discovered malware, such as malware connection relay stations, writing specific directories during the execution of malicious programs, or creating specific files, writing registration code, and so on. The above information is made into suspicious behavior detection rules and malware detection rules.

步驟七:產生威脅情資。分別將可疑行為偵測規則與惡意程式偵測規則匯入可疑行為分析模組與惡意程式分析模組進行檢測,並透過保存的流量查閱過去已被植入的其他惡意程式,找出其它已受駭主機,提升管理員對內部資訊系統的可視性。Step 7: Generate threats. Suspicious behavior detection rules and malware detection rules are sent to the suspicious behavior analysis module and the malware analysis module for detection. The saved traffic is used to check other malicious programs that have been implanted in the past to find out that other骇 Hosting to improve administrator visibility into internal information systems.

綜上所述,本發明可透過可疑行為偵測規則篩選出可疑的檔案樣本,並僅針對可疑的樣本進行惡意程式分析。如此,可降低惡意程式分析耗費的時間以及運算能力,減輕系統的負擔。此外,本發明可從終端軌跡中還原出可能受過攻擊的檔案,並且基於該些檔案訂定新的可疑行為或惡意程式的偵測規則,藉此偵測下一次類似的攻擊行為。In summary, the present invention can screen suspicious file samples through suspicious behavior detection rules and perform malware analysis only on suspicious samples. In this way, the time and computing power of malware analysis can be reduced, and the burden on the system can be reduced. In addition, the present invention can recover potentially attacked files from the terminal track and set new suspicious behavior or malware detection rules based on the files to detect the next similar attack behavior.

本發明之特點及功效:The features and effects of the invention:

本發明實施例所提供之偵測惡意程式方法,與前述引證案及其他習用技術相互比較時,更具有下列之優點: 1.透過本發明中的樣本回溯機制,可以還原已被攻擊者抹除的惡意程式樣本,對於資安事件調查有極大助益。 2.透過本發明中的可疑行為偵測機制,可從大量紀錄中篩選出少量的受駭主機與攻擊發生時間,再從這些原始資料去還原檔案,而不是直接從所有收容的紀錄中去還原所有檔案。這樣的做法可大幅降低系統運算資源與儲存空間的耗損。 3.本發明所提出之惡意程式分析方法,包含使用外部信譽評等情資、靜態特徵偵測與動態行為分析,當惡意程式變形、加殼或程式碼混淆的情況下亦可正確偵測。 4.本發明之系統具備將惡意程式樣本關鍵資訊轉換為偵測規則之功能,並回饋到可疑行為偵測規則資料庫與惡意程式特徵資料庫,可協助使用者產生在地化資安威脅情資。The method for detecting malware provided by the embodiment of the present invention has the following advantages when compared with the foregoing citations and other conventional techniques: 1. The sample backtracking mechanism in the present invention can be restored by the attacker. The sample of malicious programs is of great help to the investigation of the security incident. 2. Through the suspicious behavior detection mechanism in the present invention, a small number of hosted hosts and attack time can be selected from a large number of records, and then the files are restored from the original data, instead of being directly restored from all the contained records. All files. This approach can significantly reduce the loss of system computing resources and storage space. 3. The malware analysis method proposed by the present invention includes using external credit rating, static feature detection and dynamic behavior analysis, and can be correctly detected when malware is deformed, packed, or coded. 4. The system of the present invention has the function of converting the key information of the malicious program sample into the detection rule, and feedbacks the suspicious behavior detection rule database and the malicious program feature database, which can help the user to generate the threat of geopolitical security. Capital.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of the invention is defined by the scope of the appended claims.

10‧‧‧裝置10‧‧‧ device

20‧‧‧處理器20‧‧‧ processor

200‧‧‧方法200‧‧‧ method

30‧‧‧儲存單元30‧‧‧ storage unit

310‧‧‧可疑行為分析模組310‧‧‧Suspicious Behavior Analysis Module

311‧‧‧保存模組311‧‧‧Save module

312‧‧‧可疑行為偵測模組312‧‧‧Suspicious Behavior Detection Module

313‧‧‧檔案萃取模組313‧‧‧File Extraction Module

320、A、B‧‧‧惡意程式分析模組320, A, B‧‧‧ malware analysis module

321‧‧‧信譽評等模組321‧‧‧Reputation rating module

322‧‧‧靜態分析模組322‧‧‧Static Analysis Module

323‧‧‧動態分析模組323‧‧‧Dynamic Analysis Module

324‧‧‧情資回饋模組324‧‧‧Emotional feedback module

330‧‧‧保存資料庫330‧‧‧Save the database

340‧‧‧可疑行為偵測規則資料庫340‧‧‧Suspicious Behavior Detection Rules Database

350‧‧‧可疑樣本資料庫350‧‧‧Suspicious sample database

360‧‧‧惡意程式情資資料庫360‧‧‧ Malware program database

60‧‧‧主機監控程式60‧‧‧Host monitor program

S210、S220、S230、S240、S250、S310、S320、S330、S410、S420、S430、S440、S450、S460‧‧‧步驟S210, S220, S230, S240, S250, S310, S320, S330, S410, S420, S430, S440, S450, S460‧‧ steps

圖1是依照本發明的實施例的偵測惡意程式的裝置。 圖2是依照本發明的實施例的偵測惡意程式的方法的主流程之流程圖。 圖3是依照本發明的實施例的進一步說明步驟S220的可疑行為分析的流程圖。 圖4是依照本發明的實施例的進一步說明步驟S240的惡意程式分析的流程圖。 圖5是依照本發明的偵測惡意程式的裝置實際應用於一系統的範例。1 is an apparatus for detecting a malicious program in accordance with an embodiment of the present invention. 2 is a flow diagram of a main flow of a method of detecting a malicious program in accordance with an embodiment of the present invention. 3 is a flow chart further illustrating the suspicious behavior analysis of step S220, in accordance with an embodiment of the present invention. 4 is a flow chart further illustrating the malware analysis of step S240, in accordance with an embodiment of the present invention. Figure 5 is a diagram showing an example of a device for detecting a malicious program actually applied to a system in accordance with the present invention.

Claims (10)

一種偵測惡意程式的裝置,包括:儲存單元,記錄多個模組;以及處理器,耦接該儲存單元,且存取並執行該儲存單元所儲存的該些模組,該些模組包括:可疑行為分析模組,包括:保存模組,記錄資料流並且建立該資料流的索引;可疑行為偵測模組,依據可疑行為偵測規則偵測存在於該資料流的可疑行為並記錄該可疑行為的時間點;以及檔案萃取模組,基於該時間點與該索引,從該資料流萃取出可疑檔案樣本,其中該索引包括對應於該可疑行為的日期、網際網路協定位址以及主機名稱;以及惡意程式分析模組,判斷該可疑檔案樣本是否為惡意程式。An apparatus for detecting a malicious program, comprising: a storage unit, recording a plurality of modules; and a processor coupled to the storage unit and accessing and executing the modules stored by the storage unit, the modules including The suspicious behavior analysis module includes: saving a module, recording a data stream and establishing an index of the data stream; the suspicious behavior detection module detects the suspicious behavior existing in the data stream according to the suspicious behavior detection rule and records the a point in time for suspicious behavior; and a file extraction module that extracts a sample of suspicious files from the data stream based on the time point and the index, wherein the index includes a date corresponding to the suspicious behavior, an internet protocol address, and a host Name; and a malware analysis module to determine whether the suspicious file sample is a malicious program. 如申請專利範圍第1項所述的裝置,其中該惡意程式分析模組基於惡意程式偵測規則分析該可疑檔案樣本是否為惡意程式,且該惡意程式分析模組包括:信譽評等模組,查詢該可疑檔案樣本是否為已知的惡意程式,若是,則判斷該可疑檔案樣本為惡意程式;靜態分析模組,透過YARA特徵規則、執行檔Mutex資訊、執行檔程式資料庫以及執行檔簽章內容的至少其中之一來判斷該可疑檔案樣本是否為惡意程式;以及動態分析模組,透過沙箱(sandbox)分析技術來判斷該可疑檔案樣本是否為惡意程式。The device of claim 1, wherein the malware analysis module analyzes whether the suspicious file sample is a malicious program based on a malware detection rule, and the malware analysis module comprises: a reputation rating module. Check whether the suspicious file sample is a known malicious program. If yes, determine that the suspicious file sample is a malicious program; the static analysis module passes the YARA feature rule, executes the file Mutex information, executes the file program database, and executes the file signature. At least one of the content determines whether the suspicious file sample is a malicious program; and the dynamic analysis module determines whether the suspicious file sample is a malicious program through a sandbox analysis technology. 如申請專利範圍第2項所述的裝置,其中該惡意程式分析模組執行:對由該惡意程式偵測規則分析過的該可疑檔案樣本進行惡意等級評分,若該可疑檔案樣本的惡意等級高過閾值,則判定該可疑檔案樣本為惡意程式。The device of claim 2, wherein the malware analysis module performs: performing a malicious rating on the suspicious file sample analyzed by the malware detection rule, if the suspicious file sample has a high malicious level If the threshold is exceeded, the suspect file sample is determined to be a malicious program. 如申請專利範圍第3項所述的裝置,其中該惡意程式分析模組更包括:情資回饋模組,回報被判定為惡意程式的該可疑檔案樣本的資訊,並且產生與該可疑檔案樣本相關的可疑行為偵測規則,或產生與該可疑檔案樣本相關的惡意程式偵測規則。The device of claim 3, wherein the malware analysis module further comprises: an emotional feedback module, reporting information of the suspicious file sample determined to be a malicious program, and generating a correlation with the suspicious file sample Suspicious behavior detection rules, or malware detection rules related to the suspicious file sample. 如申請專利範圍第1項所述的裝置,其中該可疑行為偵測規則關聯於檔案類型、檔案雜湊值、檔案建立來源、檔案被執行的父程序、系統註冊機碼、黑名單IP地址、高風險通訊協定、可疑檔案下載以及可疑檔案傳輸的至少其中之一。The device of claim 1, wherein the suspicious behavior detection rule is associated with a file type, a file hash value, a file creation source, a parent program for executing the file, a system registration code, a blacklist IP address, and a high value. At least one of a risk communication protocol, a suspicious file download, and a suspicious file transfer. 一種偵測惡意程式的方法,包括:記錄資料流並且建立該資料流的索引;依據可疑行為偵測規則偵測存在於該資料流的可疑行為並記錄該可疑行為的時間點;基於該時間點與該索引,從該資料流萃取出可疑檔案樣本,其中該索引包括對應於該可疑行為的日期、網際網路協定位址以及主機名稱;以及判斷該可疑檔案樣本是否為惡意程式。A method for detecting a malicious program, comprising: recording a data stream and establishing an index of the data stream; detecting a suspicious behavior existing in the data stream according to the suspicious behavior detection rule and recording a time point of the suspicious behavior; And the index, extracting a suspicious file sample from the data stream, wherein the index includes a date corresponding to the suspicious behavior, an internet protocol address, and a host name; and determining whether the suspicious file sample is a malicious program. 如申請專利範圍第6項所述的方法,該方法更包括基於惡意程式偵測規則分析該可疑檔案樣本是否為惡意程式,其包括:查詢該可疑檔案樣本是否為已知的惡意程式,若是,則判斷該可疑檔案樣本為惡意程式;透過YARA特徵規則、執行檔Mutex資訊、執行檔程式資料庫以及執行檔簽章內容的至少其中之一來判斷該可疑檔案樣本是否為惡意程式;以及透過沙箱(sandbox)分析技術來判斷該可疑檔案樣本是否為惡意程式。The method of claim 6, wherein the method further comprises: analyzing whether the suspicious file sample is a malicious program based on the malware detection rule, comprising: querying whether the suspicious file sample is a known malicious program, and if so, Determining whether the suspicious file sample is a malicious program through at least one of the YARA feature rule, the execution file Mutex information, the execution file program database, and the execution file signature content; and determining whether the suspicious file sample is a malicious program; A sandbox analysis technique is used to determine whether the suspicious file sample is a malicious program. 如申請專利範圍第7項所述的方法,更包括:對由該惡意程式偵測規則分析過的該可疑檔案樣本進行惡意等級評分,若該可疑檔案樣本的惡意等級高過閾值,則判定該可疑檔案樣本為惡意程式。The method of claim 7, further comprising: performing a malicious rating on the suspicious file sample analyzed by the malware detection rule, and if the malicious level of the suspicious file sample is higher than a threshold, determining the The suspicious file sample is a malicious program. 如申請專利範圍第8項所述的方法,更包括:回報被判定為惡意程式的該可疑檔案樣本的資訊,並且產生與該可疑檔案樣本相關的可疑行為偵測規則,或產生與該可疑檔案樣本相關的惡意程式偵測規則。The method of claim 8, further comprising: reporting information of the suspicious file sample determined to be a malicious program, and generating a suspicious behavior detection rule related to the suspicious file sample, or generating the suspicious file Sample related malware detection rules. 如申請專利範圍第6項所述的方法,其中該可疑行為偵測規則關聯於檔案類型、檔案雜湊值、檔案建立來源、檔案被執行的父程序、系統註冊機碼、黑名單IP地址、高風險通訊協定、可疑檔案下載以及可疑檔案傳輸的至少其中之一。The method of claim 6, wherein the suspicious behavior detection rule is associated with a file type, a file hash value, a file creation source, a parent program for executing the file, a system registration code, a blacklist IP address, and a high value. At least one of a risk communication protocol, a suspicious file download, and a suspicious file transfer.
TW106145575A 2017-12-25 2017-12-25 Method and apparatus for detecting malware TWI640891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106145575A TWI640891B (en) 2017-12-25 2017-12-25 Method and apparatus for detecting malware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106145575A TWI640891B (en) 2017-12-25 2017-12-25 Method and apparatus for detecting malware

Publications (2)

Publication Number Publication Date
TWI640891B true TWI640891B (en) 2018-11-11
TW201928746A TW201928746A (en) 2019-07-16

Family

ID=65034143

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106145575A TWI640891B (en) 2017-12-25 2017-12-25 Method and apparatus for detecting malware

Country Status (1)

Country Link
TW (1) TWI640891B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI712912B (en) * 2019-09-27 2020-12-11 財團法人資訊工業策進會 Intrusion detection device and intrusion detection method
TWI740627B (en) * 2019-08-29 2021-09-21 新加坡商豐立有限公司 Methods and systems using an ai co-processor to detect anomalies caused by malware in storage devices

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201120635A (en) * 2009-12-02 2011-06-16 Inst Information Industry Monitor method, monitor apparatus and computer program product thereof for monitoring a data of a hardware
TW201224836A (en) * 2010-12-15 2012-06-16 Inst Information Industry Malware detection apparatus, malware detection method and computer program product thereof
TW201705035A (en) * 2015-07-23 2017-02-01 Chunghwa Telecom Co Ltd Method and system for rapidly screening information security risk hosts rapidly screening hosts with high hacking risks through various hacking indexes analyzed by a hacking risk analysis module
CN107247902A (en) * 2017-05-10 2017-10-13 深信服科技股份有限公司 Malware categorizing system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201120635A (en) * 2009-12-02 2011-06-16 Inst Information Industry Monitor method, monitor apparatus and computer program product thereof for monitoring a data of a hardware
TW201224836A (en) * 2010-12-15 2012-06-16 Inst Information Industry Malware detection apparatus, malware detection method and computer program product thereof
TW201705035A (en) * 2015-07-23 2017-02-01 Chunghwa Telecom Co Ltd Method and system for rapidly screening information security risk hosts rapidly screening hosts with high hacking risks through various hacking indexes analyzed by a hacking risk analysis module
CN107247902A (en) * 2017-05-10 2017-10-13 深信服科技股份有限公司 Malware categorizing system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI740627B (en) * 2019-08-29 2021-09-21 新加坡商豐立有限公司 Methods and systems using an ai co-processor to detect anomalies caused by malware in storage devices
TWI712912B (en) * 2019-09-27 2020-12-11 財團法人資訊工業策進會 Intrusion detection device and intrusion detection method

Also Published As

Publication number Publication date
TW201928746A (en) 2019-07-16

Similar Documents

Publication Publication Date Title
US10218740B1 (en) Fuzzy hash of behavioral results
US10867034B2 (en) Method for detecting a cyber attack
US8935779B2 (en) Network-based binary file extraction and analysis for malware detection
US8572740B2 (en) Method and system for detection of previously unknown malware
CN111460445B (en) Sample program malicious degree automatic identification method and device
US20150047034A1 (en) Composite analysis of executable content across enterprise network
US20190141061A1 (en) Methods and devices for automatically detecting attack signatures and generating attack signature identifications
EP3646218A1 (en) Cyber-security system and method for weak indicator detection and correlation to generate strong indicators
KR101132197B1 (en) Apparatus and Method for Automatically Discriminating Malicious Code
CN108369541B (en) System and method for threat risk scoring of security threats
WO2016121348A1 (en) Anti-malware device, anti-malware system, anti-malware method, and recording medium in which anti-malware program is stored
TWI640891B (en) Method and apparatus for detecting malware
CN113965419B (en) Method and device for judging attack success through reverse connection
JP2015132942A (en) Connection destination information determination device, connection destination information determination method and program
CN116346442A (en) Threat detection method and device based on threat information
CN115913634A (en) Network security abnormity detection method and system based on deep learning
CN115001724B (en) Network threat intelligence management method, device, computing equipment and computer readable storage medium
CN110874474A (en) Lessocian virus defense method, Lessocian virus defense device, electronic device and storage medium
US11763004B1 (en) System and method for bootkit detection
US11770388B1 (en) Network infrastructure detection
TW202205116A (en) Method for detecting malicious attacks and network security management device
KR101754964B1 (en) Method and Apparatus for Detecting Malicious Behavior
CN114301689B (en) Campus network security protection method and device, computing equipment and storage medium
US20240070268A1 (en) Aggregate Event Profiles for Detecting Malicious Mobile Applications
US12079335B2 (en) System context database management