热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

APT29ATTCK知识库评测分析指南

ATT&CK真实情况分析报告本报告结合真实数据对ATT&CK的技术矩阵情况和APT29评测进行数据统计分析In[1]:fromattackctiimportattack_cl

ATT&CK真实情况分析报告

本报告结合真实数据对ATT&CK的技术矩阵情况和APT29评测进行数据统计分析

In [1]:

from attackcti import attack_client
import pandas as pd
import matplotlib.pyplot as plt
import numpy as nppd.set_option('max_colwidth',3000)
pd.set_option('display.max_rows', None)
pd.set_option('precision',2) lift = attack_client()
all_techniques= lift.get_techniques(stix_format=False)

ATT&CK矩阵数量

ATT&CK一共有535个技术矩阵,每个技术矩阵都是一个攻防检测点。

In [2]:

techniques_normalized = pd.json_normalize(all_techniques)
techniques = techniques_normalized.reindex( \['matrix','platform','tactic','technique','technique_id','data_sources'], axis=1)
techniques.shape[0]

Out[2]:

535

ATT&CK的技术矩阵涉及平台分类

ATT&CK现按平台分为windows、linux、macos、office365、saas共5类技术矩阵,其中windows平台涉及222个技术矩阵。

附:柱状统计图

In [3]:

platform = {'Windows':'Windows','Linux':'Linux','macOS':'macOS','office365':'Office 365','SaaS':'SaaS'}counts_list = []
for (data_key,data_str) in platform.items():counts_df = techniques[ (techniques['platform'].apply(str).str.contains(data_str)) ]counts_list.append( ( data_key, counts_df.shape[0] ) )platforms_df = pd.DataFrame( counts_list ).sort_values(1,ascending=False)
platforms_df = platforms_df.rename(columns={0:'platforms',1:'techniques'})ax = platforms_df.plot( kind='bar',figsize=(10,8), fontsize=20 ,x=0, y=1, rot=360 )
for p in ax.patches:ax.annotate(str(p.get_height()), (p.get_x() + 0.1 , p.get_height() + 2 ) ,size= 20 )
plt.show()


ATT&CK检测建议数据源

ATT&CK的每个技术矩阵的检测,都建议了对应的数据源,其中windows平台建议了56种数据源。安全人员可以参考建议的数据源,检测ATT&CK技术矩阵归类的攻击活动。

In [4]:

win_data = techniques[ (techniques['platform'].apply(str).str.contains('Windows'))
]
win_data = pd.DataFrame(win_data[['technique','data_sources']])
win_data = pd.DataFrame(win_data.explode('data_sources'))
source_data = win_data.groupby(by='data_sources') \.count() \.sort_values(by='technique',ascending=True)
source_data.reset_index(inplace=True)
source_data.shape[0]

Out[4]:

56

56个数据源可以对应检测出不同的技术矩阵。


  1. Process monitoring (进程监控)
  2. Process command-line parameters (进程命令参数)
  3. File monitoring (文件读写监控)
  4. API monitoring (API调用监控)
  5. Process use of network (进程网络关联)
  6. Windows Registry (Windows注册表)
  7. Packet capture (本机抓包)
  8. Netflow/Enclave netflow (网络流量)
  9. Windows event logs (windows事件日志)
  10. Authentication logs (身份认证日志)
  11. Network protocol analysis (网络协议分析)
  12. DLL monitoring (DLL加载监控)
  13. Binary file metadata (二进制文件元数据)
  14. Loaded DLLs (已加载dll文件)
  15. SSL/TLS inspection (SSL/TLS检查)
  16. Azure activity logs (Azure活动日志)
  17. PowerShell logs (Powershell日志)
  18. Network intrusion detection system (网络入侵检测系统)
  19. Malware reverse engineering (病毒逆向工程)
  20. AWS CloudTrail logs (AWS云日志)
  21. Anti-virus (杀毒软件)
  22. Network device logs (网络设备日志)
  23. Application logs (程序日志)
  24. Kernel drivers (驱动文件)
  25. Stackdriver logs (Stackdriver日志)
  26. System calls (系统调用)
  27. Data loss prevention (数据泄漏防护)
  28. Web proxy (网页代理)
  29. Email gateway (邮件网关)
  30. Office 365 account logs (Office365账户日志)
  31. Host network interface (主机网络接口)
  32. User interface (用户接口)
  33. Web logs (网页日志)
  34. Mail server (邮件服务器)
  35. Services (服务)
  36. Windows Error Reporting (Windows错误报告)
  37. Web application firewall logs (网页防火墙日志)
  38. BIOS (主板系统)
  39. Third-party application logs (第三方程序日志)
  40. MBR (磁盘主引导记录)
  41. DNS records (DNS记录)
  42. Detonation chamber (引爆作业)
  43. Office 365 trace logs (Office365跟踪日志)
  44. Sensor health and status (传感器健康状态)
  45. Component firmware (固件组件)
  46. VBR (卷引导记录)
  47. Access tokens (访问令牌)
  48. Environment variable (环境变量)
  49. Asset management (资产管理平台)
  50. EFI (可扩展固件接口)
  51. Named Pipes (命名管道)
  52. Disk forensics (磁盘取证)
  53. WMI Objects (WMI对象)
  54. Browser extensions (浏览器扩展)
  55. Digital certificate logs (数字证书日志)
  56. OAuth audit logs (OAuth审计日志)

附:56个检测数据源对应的技术矩阵数横向柱状统计

可以看到排名靠前的进程监控、进程命令参数、文件读写监控、API调用监控、进程网络关联等这些EDR类产品的重点关注数据。

In [5]:

tlist = source_data['data_sources'].tolist()
ax = source_data.plot(kind='barh',figsize=(110,70),x=0, y=1, fontsize=65)
for i in ax.patches:ax.text(i.get_width(), i.get_y(), str(i.get_width()), fontsize=70)
my_x_ticks = np.arange(0, 160, 40)
plt.xticks(my_x_ticks)
plt.show()


ATT&CK的APT29攻击模拟评估

此次评估一共有21家安全厂商参与,评估数据公开透明,非常适合安全人员分析研究安全厂商的真实能力。

数据来源: https://attackevals.mitre.org

In [6]:

import json,glob,osfiles =[]
for infile in sorted(glob.glob(os.path.join('data', '*json'))):files.append(infile)
print(len(files))
files

21

Out[6]:

['data/Bitdefender.1.APT29.1_Results.json','data/CrowdStrike.1.APT29.1_Results.json','data/Cybereason.1.APT29.1_Results.json','data/Cycraft.1.APT29.1_Results.json','data/Cylance.1.APT29.1_Results.json','data/Elastic.1.APT29.1_Results.json','data/F-Secure.1.APT29.1_Results.json','data/FireEye.1.APT29.1_Results.json','data/GoSecure.1.APT29.1_Results.json','data/HanSight.1.APT29.1_Results.json','data/Kaspersky.1.APT29.1_Results.json','data/Malwarebytes.1.APT29.1_Results.json','data/McAfee.1.APT29.1_Results.json','data/Microsoft.1.APT29.1_Results.json','data/PaloAltoNetworks.1.APT29.1_Results.json','data/ReaQta.1.APT29.1_Results.json','data/Secureworks.1.APT29.1_Results.json','data/SentinelOne.1.APT29.1_Results.json','data/Symantec.1.APT29.1_Results.json','data/TrendMicro.1.APT29.1_Results.json','data/VMware.1.APT29.1_Results.json']

In [7]:

from natsort import index_natsorted, order_by_index
import copyall_data = {}for f_path in files:vendor = f_path.split(os.sep, 2)[-1]vendor = vendor.split('.', 1)[0]with open(f_path, 'r', encoding='utf-8') as infile:data=infile.read()obj = json.loads(data)['Techniques']df = pd.json_normalize(obj,'Steps', ['TechniqueId','TechniqueName', 'Tactics'])all_data.update({ vendor: df })

APT29评估方法

此次评估一共有140个攻击动作步骤,每个步骤对应不同的战术Tactics和技术Technique。


  • 战术Tactics (攻击动作的意图分类)
  • 技术Technique (攻击动作的技术分类)
  • 标准Criteria (攻击动作的详细过程)
  • 程序Procedure (攻击动作的技术细节)

In [8]:

test_data = copy.deepcopy(all_data)
test_data = test_data.values()
test_data = list(test_data)[0]
eval_step = test_data.reindex(index=order_by_index(test_data.index, index_natsorted(test_data['SubStep'])))
eval_step.reset_index(drop=True, inplace=True)
eval_step['TacticsName']=eval_step['Tactics'].apply(lambda x: x[0]['TacticName'])
eval_step = eval_step.reindex(['SubStep','TacticsName','TechniqueName','Criteria','Procedure'], axis=1)
eval_step

Out[8]:


 SubStepTacticsNameTechniqueNameCriteriaProcedure
01.A.1ExecutionUser ExecutionThe rcs.3aka3.doc process spawning from explorer.exeUser Pam executed payload rcs.3aka3.doc
11.A.2Defense EvasionMasqueradingEvidence of the right-to-left override character (U+202E) in the rcs.3aka.doc process ​OR the original filename (cod.3aka.scr)Used unicode right-to-left override (RTLO) character to obfuscate file name rcs.3aka3.doc (originally cod.3aka.scr)
21.A.3Command and ControlUncommonly Used PortEstablished network channel over port 1234Established C2 channel (192.168.0.5) via rcs.3aka3.doc payload over TCP port 1234
31.A.4Command and ControlStandard Cryptographic ProtocolEvidence that the network data sent over the C2 channel is encryptedUsed RC4 stream cipher to encrypt C2 (192.168.0.5) traffic
41.B.1ExecutionCommand-Line Interfacecmd.exe spawning from the rcs.3aka3.doc​ processSpawned interactive cmd.exe
51.B.2ExecutionPowerShellpowershell.exe spawning from cmd.exeSpawned interactive powershell.exe
62.A.1DiscoveryFile and Directory Discoverypowershell.exe executing (Get-)ChildItemSearched filesystem for document and media files using PowerShell
72.A.2CollectionAutomated Collectionpowershell.exe executing (Get-)ChildItemScripted search of filesystem for document and media files using PowerShell
82.A.3CollectionData from Local Systempowershell.exe reading files in C:\Users\Pam\Recursively collected files found in C:\Users\Pam\ using PowerShell
92.A.4ExfiltrationData Compressedpowershell.exe executing Compress-ArchiveCompressed and stored files into ZIP (Draft.zip) using PowerShell
102.A.5CollectionData Stagedpowershell.exe creating the file draft.zipStaged files for exfiltration into ZIP (Draft.zip) using PowerShell
112.B.1ExfiltrationExfiltration Over Command and Control ChannelThe rcs.3aka3.doc process reading the file draft.zip while connected to the C2 channelRead and downloaded ZIP (Draft.zip) over C2 channel (192.168.0.5 over TCP port 1234)
123.A.1Command and ControlRemote File CopyThe rcs.3aka3.doc process creating the file monkey.pngDropped stage 2 payload (monkey.png) to disk
133.A.2Defense EvasionObfuscated Files or InformationEvidence that a PowerShell payload was within monkey.pngEmbedded PowerShell payload in monkey.png using steganography
143.B.1Defense EvasionComponent Object Model HijackingAddition of the DelegateExecute ​subkey in ​HKCU\Software\Classes\Folder\shell\open\​​command​​Modified the Registry to enable COM hijacking of sdclt.exe using PowerShell
153.B.2Privilege EscalationBypass User Account ControlHigh integrity powershell.exe spawning from control.exe​​ (spawned from sdclt.exe)Executed elevated PowerShell payload
163.B.3Command and ControlCommonly Used PortEstablished network channel over port 443Established C2 channel (192.168.0.5) via PowerShell payload over TCP port 443
173.B.4Command and ControlStandard Application Layer ProtocolEvidence that the network data sent over the C2 channel is HTTPSUsed HTTPS to transport C2 (192.168.0.5) traffic
183.B.5Command and ControlStandard Cryptographic ProtocolEvidence that the network data sent over the C2 channel is encryptedUsed HTTPS to encrypt C2 (192.168.0.5) traffic
193.C.1Defense EvasionModify RegistryDeletion of of the HKCU\Software\Classes\Folder\shell\Open\command subkeyModified the Registry to remove artifacts of COM hijacking
204.A.1Command and ControlRemote File Copypowershell.exe creating the file SysinternalsSuite.zipDropped additional tools (SysinternalsSuite.zip) to disk over C2 channel (192.168.0.5)
214.A.2ExecutionPowerShellpowershell.exe spawning from powershell.exeSpawned interactive powershell.exe
224.A.3Defense EvasionDeobfuscate/Decode Files or Informationpowershell.exe executing Expand-ArchiveDecompressed ZIP (SysinternalsSuite.zip) file using PowerShell
234.B.1DiscoveryProcess Discoverypowershell.exe executing Get-ProcessEnumerated current running processes using PowerShell
244.B.2Defense EvasionFile Deletionsdelete64.exe deleting the file rcs.3aka3.docDeleted rcs.3aka3.doc on disk using SDelete
254.B.3Defense EvasionFile Deletionsdelete64.exe deleting the file draft.zipDeleted Draft.zip on disk using SDelete
264.B.4Defense EvasionFile Deletionsdelete64.exe deleting the file SysinternalsSuite.zipDeleted SysinternalsSuite.zip on disk using SDelete
274.C.1DiscoveryFile and Directory Discoverypowershell.exe executing $env:TEMPEnumerated user's temporary directory path using PowerShell
284.C.2DiscoverySystem Owner/User Discoverypowershell.exe executing $env:USERNAMEEnumerated the current username using PowerShell
294.C.3DiscoverySystem Information Discoverypowershell.exe executing $env:COMPUTERNAMEEnumerated the computer hostname using PowerShell
304.C.4DiscoverySystem Network Configuration Discoverypowershell.exe executing $env:USERDOMAINEnumerated the current domain name using PowerShell
314.C.5DiscoveryProcess Discoverypowershell.exe executing $PIDEnumerated the current process ID using PowerShell
324.C.6DiscoverySystem Information Discoverypowershell.exe executing​ Gwmi Win32_OperatingSystemEnumerated the OS version using PowerShell
334.C.7DiscoverySecurity Software Discoverypowershell.exe executing​ Get-WmiObject ...​ -Class AntiVirusProductEnumerated anti-virus software using PowerShell
344.C.8DiscoverySecurity Software Discoverypowershell.exe executing Get-WmiObject ...​​ -Class FireWallProductEnumerated firewall software using PowerShell
354.C.9DiscoveryPermission Groups Discoverypowershell.exe executing the NetUserGetGroups APIEnumerated user's domain group membership via the NetUserGetGroups API
364.C.10ExecutionExecution through APIThe NetUserGetGroups API function loaded into powershell.exe from Netapi32.dllExecuted API call by reflectively loading Netapi32.dll
374.C.11DiscoveryPermission Groups Discoverypowershell.exe executing the NetUserGetLocalGroups APIEnumerated user's local group membership via the NetUserGetLocalGroups API
384.C.12ExecutionExecution through APIThe NetUserGetLocalGroups API function loaded into powershelle.exe from Netapi32.dllExecuted API call by reflectively loading Netapi32.dll
395.A.1PersistenceNew Servicepowershell.exe creating the Javamtsup serviceCreated a new service (javamtsup) that executes a service binary (javamtsup.exe) at system startup
405.B.1PersistenceRegistry Run Keys / Startup Folderpowershell.exe creating the file hostui.lnk in the Startup folderCreated a LNK file (hostui.lnk) in the Startup folder that executes on login
416.A.1Credential AccessCredentials in Filesaccesschk.exe reading files within %APPDATALOCAL%\Google\chrome\user data\default\Read the Chrome SQL database file to extract encrypted credentials
426.A.2Credential AccessCredential Dumpingaccesschk.exe executing the CryptUnprotectedData APIExecuted the CryptUnprotectedData API call to decrypt Chrome passwords
436.A.3Defense EvasionMasqueradingEvidence that accesschk.exe is not the legitimate Sysinternals toolMasqueraded a Chrome password dump tool as accesscheck.exe, a legitimate Sysinternals tool
446.B.1Credential AccessPrivate Keyspowershell.exe creating a certificate file exported from the systemExported a local certificate to a PFX file using PowerShell
456.C.1Credential AccessCredential Dumpingpowershell.exe injecting into lsass.exe OR lsass.exe reading Registry keys under HKLM:\SAM\SAM\Domains\Account\Users\Dumped password hashes from the Windows Registry by injecting a malicious DLL into Lsass.exe
467.A.1CollectionScreen Capturepowershell.exe executing the CopyFromScreen function from System.Drawing.dllCaptured and saved screenshots using PowerShell
477.A.2CollectionClipboard Datapowershell.exe executing Get-ClipboardCaptured clipboard contents using PowerShell
487.A.3CollectionInput Capturepowershell.exe executing the GetAsyncKeyState APICaptured user keystrokes using the GetAsyncKeyState API
497.B.1CollectionData from Local Systempowershell.exe reading files in C:\Users\pam\Downloads\Read data in the user's Downloads directory using PowerShell
507.B.2ExfiltrationData Compressedpowershell.exe creating the file OfficeSupplies.7zCompressed data from the user's Downloads directory into a ZIP file (OfficeSupplies.7z) using PowerShell
517.B.3ExfiltrationData Encryptedpowershell.exe executing Compress-7Zip with the password argument used for encryptionEncrypted data from the user's Downloads directory using PowerShell
527.B.4ExfiltrationExfiltration Over Alternative Protocolpowershell executing Copy-Item pointing to an attack-controlled WebDav network share (192.168.0.4:80)Exfiltrated collection (OfficeSupplies.7z) to WebDAV network share using PowerShell
538.A.1DiscoveryRemote System Discoverypowershell.exe making LDAP queries over port 389 to the Domain Controller (10.0.0.4)Enumerated remote systems using LDAP queries
548.A.2ExecutionWindows Remote ManagementNetwork connection to Scranton (10.0.1.4) over port 5985Established WinRM connection to remote host Scranton (10.0.1.4)
558.A.3DiscoveryProcess Discoverypowershell.exe executing Get-ProcessEnumerated processes on remote host Scranton (10.0.1.4) using PowerShell
568.B.1Command and ControlRemote File CopyThe file python.exe created on Scranton (10.0.1.4)Copied python.exe payload from a WebDAV share (192.168.0.4) to remote host Scranton (10.0.1.4)
578.B.2Defense EvasionSoftware PackingEvidence that the file python.exe is packedpython.exe payload was packed with UPX
588.C.1Defense EvasionValid AccountsSuccessful logon as user Pam on Scranton (10.0.1.4)Logged on to remote host Scranton (10.0.1.4) using valid credentials for user Pam
598.C.2Lateral MovementWindows Admin SharesSMB session to Scanton (10.0.1.4) over TCP port 445/135 OR evidence of usage of a Windows shareEstablished SMB session to remote host Scranton's (10.0.1.4) IPC$ share using PsExec
608.C.3ExecutionService Executionpython.exe spawned by PSEXESVC.exeExecuted python.exe using PSExec
619.A.1Command and ControlRemote File Copypython.exe creating the file rar.exeDropped rar.exe to disk on remote host Scranton (10.0.1.4)
629.A.2Command and ControlRemote File Copypython.exe creating the file sdelete64.exeDropped sdelete.exe to disk on remote host Scranton (10.0.1.4)
639.B.1ExecutionPowerShellpowershell.exe​ spawning from python.exeSpawned interactive powershell.exe
649.B.2DiscoveryFile and Directory Discoverypowershell.exe executing (Get-)ChildItem​Searched filesystem for document and media files using PowerShell
659.B.3CollectionAutomated Collectionpowershell.exe executing (Get-)ChildItem​Scripted search of filesystem for document and media files using PowerShell
669.B.4CollectionData from Local Systempowershell.exe reading files in C:\Users\Pam\Recursively collected files found in C:\Users\Pam\ using PowerShell
679.B.5CollectionData Stagedpowershell.exe creating the file working.zipStaged files for exfiltration into ZIP (working.zip in AppData directory) using PowerShell
689.B.6ExfiltrationData Encryptedpowershell.exe executing rar.exe with the -a parameter for a password to use for encryptionEncrypted staged ZIP (working.zip in AppData directory) into working.zip (on Desktop) using rar.exe
699.B.7ExfiltrationData Compressedpowershell.exe executing rar.exeCompressed staged ZIP (working.zip in AppData directory) into working.zip (on Desktop) using rar.exe
709.B.8ExfiltrationExfiltration Over Command and Control Channelpython.exe reading the file working.zip while connected to the C2 channelRead and downloaded ZIP (working.zip on Desktop) over C2 channel (192.168.0.5 over TCP port 8443)
719.C.1Defense EvasionFile Deletionsdelete64.exe deleting the file rar.exeDeleted rar.exe on disk using SDelete
729.C.2Defense EvasionFile Deletionsdelete64.exe deleting the file \Desktop\working.zipDeleted working.zip (from Desktop) on disk using SDelete
739.C.3Defense EvasionFile Deletionsdelete64.exe deleting the file \AppData\Roaming\working.zipDeleted working.zip (from AppData directory) on disk using SDelete
749.C.4Defense EvasionFile Deletioncmd.exe deleting the file sdelete64.exeDeleted SDelete on disk using cmd.exe del command
7510.A.1ExecutionService Executionjavamtsup.exe spawning from services.exeExecuted persistent service (javamtsup) on system startup
7610.B.1PersistenceRegistry Run Keys / Startup FolderEvidence that the file hostui.lnk (which executes hostui.bat as a byproduct) was executed from the Startup FolderExecuted LNK payload (hostui.lnk) in Startup Folder on user login
7710.B.2ExecutionExecution through APIhostui.exe executing the\nCreateProcessWithToken APIExecuted PowerShell payload via the CreateProcessWithToken API
7810.B.3Defense EvasionAccess Token Manipulationhostui.exe manipulating the token of powershell.exe via the CreateProcessWithToken API OR \npowershell.exe executing with the stolen token of explorer.exeManipulated the token of the PowerShell payload via the CreateProcessWithToken API
7911.A.1ExecutionUser Executionpowershell.exe spawning from explorer.exeUser Oscar executed payload 37486-the-shocking-truth-about-election-rigging-in-america.rtf.lnk
8011.A.2Defense EvasionNTFS File Attributespowershell.exe executing the schemas ADS via Get-Content and IEXExecuted an alternate data stream (ADS) using PowerShell
8111.A.3DiscoveryVirtualization/Sandbox Evasionpowershell.exe executing a Get-WmiObject\nquery for Win32_BIOSChecked that the BIOS version and serial number are not associated with VirtualBox or VMware using PowerShell
8211.A.4DiscoverySystem Information Discoverypowershell.exe executing a Get-WmiObject gwmi queries for Win32_BIOS and Win32_ComputerSystemEnumerated computer manufacturer, model, and version information using PowerShell
8311.A.5DiscoveryPeripheral Device Discoverypowershell.exe executing a Get-WmiObject query for Win32_PnPEntityEnumerated devices/adapters to check for presence of VirtualBox driver(s) using PowerShell
8411.A.6DiscoverySystem Owner/User Discoverypowershell.exe executing a Get-WmiObject query for Win32_ComputerSystemChecked that the username is not related to admin or a generic value (ex: user) using PowerShell
8511.A.7DiscoverySystem Network Configuration Discoverypowershell.exe executing a Get-WmiObject query for Win32_ComputerSystemChecked that the computer is joined to a domain using PowerShell
8611.A.8DiscoveryProcess Discoverypowershell.exe executing a Get-WmiObject query for Win32_ProcessChecked that processes such as procexp.exe, taskmgr.exe, or wireshark.exe are not running using PowerShell
8711.A.9DiscoveryFile and Directory Discoverypowershell.exe executing (Get-Item -Path ".\" -Verbose).FullNameChecked that the payload is not inside a folder path that contains "sample" or is the length of a hash value using PowerShell
8811.A.10Defense EvasionDeobfuscate/Decode Files or Informationcertutil.exe decoding kxwn.lockDecoded an embedded DLL payload to disk using certutil.exe
8911.A.11PersistenceRegistry Run Keys / Startup FolderAddition of the Webcache subkey in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunEstablished Registry Run key persistence using PowerShell
9011.A.12ExecutionPowerShellpowershell.exe spawning from from the schemas ADS (powershell.exe)Executed PowerShell stager payload
9111.A.13Command and ControlCommonly Used PortEstablished network channel over port 443Established C2 channel (192.168.0.4) via PowerShell payload over port 443
9211.A.14Command and ControlStandard Application Layer ProtocolEstablished network channel over the HTTPS protocolUsed HTTPS to transport C2 (192.168.0.4) traffic
9311.A.15Command and ControlStandard Cryptographic ProtocolEvidence that the network data sent over the C2 channel is encryptedUsed HTTPS to encrypt C2 (192.168.0.4) traffic
9412.A.1DiscoveryFile and Directory Discoverypowershell.exe executing (gci ((gci env:windir).Value + '\system32')Enumerated the System32 directory using PowerShell
9512.A.2Defense EvasionTimestomppowershell.exe modifying the creation, last access, and last write times of kxwn.lockModified the time attributes of the kxwn.lock persistence payload using PowerShell
9612.B.1DiscoverySecurity Software Discoverypowershell.exe executing a Get-WmiObject query for AntiVirusProductEnumerated registered AV products using PowerShell
9712.C.1DiscoveryQuery Registrypowershell.exe executing a Registry query for HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\UninstallEnumerated installed software via the Registry (Wow6432 Uninstall key) using PowerShell
9812.C.2DiscoveryQuery Registrypowershell.exe executing a Registry query for HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\UninstallEnumerated installed software via the Registry (Uninstall key) using PowerShell
9913.A.1DiscoverySystem Information Discoverypowershell.exe executing the GetComputerNameEx APIEnumerated the computer name using the GetComputerNameEx API
10013.B.1DiscoverySystem Network Configuration Discoverypowershell.exe executing the NetWkstaGetInfo APIEnumerated the domain name using the NetWkstaGetInfo API
10113.C.1DiscoverySystem Owner/User Discoverypowershell.exe executing the GetUserNameEx APIEnumerated the current username using the GetUserNameEx API
10213.D.1DiscoveryProcess Discoverypowershell.exe executing the CreateToolhelp32Snapshot APIEnumerated running processes using the CreateToolhelp32Snapshot API
10314.A.1Defense EvasionComponent Object Model HijackingAddition of the DelegateExecute subkey in HKCU\Software\Classes\Folder\shell\open\commandModified the Registry to enable COM hijacking of sdclt.exe using PowerShell
10414.A.2Privilege EscalationBypass User Account ControlHigh integrity powrshell.exe spawning from control.exe​​ (spawned from sdclt.exe)Executed elevated PowerShell payload
10514.A.3Defense EvasionModify RegistryDeletion of the HKCU\Software\Classes\Folder\shell\Open\command subkeyModified the Registry to remove artifacts of COM hijacking using PowerShell
10614.B.1ExecutionWindows Management InstrumentationWMI Process (WmiPrvSE.exe) executing powershell.exeCreated and executed a WMI class using PowerShell
10714.B.2DiscoveryProcess Discoverypowershell.exe executing Get-ProcessEnumerated and tracked PowerShell processes using PowerShell
10814.B.3Command and ControlRemote File Copypowershell.exe downloading and/or the file write of m.exeDownloaded and dropped Mimikatz (m.exe) to disk
10914.B.4Credential AccessCredential Dumpingm.exe injecting into lsass.exe to dump credentialsDumped plaintext credentials using Mimikatz (m.exe)
11014.B.5Defense EvasionObfuscated Files or Informationpowershell.exe executing Set-WmiInstanceEncoded and wrote Mimikatz output to a WMI class property using PowerShell
11114.B.6Defense EvasionDeobfuscate/Decode Files or Informationpowershell.exe executing Get-WmiInstanceRead and decoded Mimikatz output from a WMI class property using PowerShell
11215.A.1DiscoverySystem Owner/User Discoverypowershell.exe executing $env:UserNameEnumerated logged on users using PowerShell
11315.A.2PersistenceWindows Management Instrumentation Event Subscriptionpowershell.exe creating the WindowsParentalControlMigration WMI filter, consumer, and binding created in root/subscriptionEstablished WMI event subscription persistence using PowerShell
11416.A.1DiscoveryRemote System Discoverypowershell.exe making LDAP queries over port 389 via functions from System.DirectoryServices.dllEnumerated the domain controller host NewYork (10.0.0.4) using LDAP queries
11516.B.1DiscoverySystem Owner/User Discoverypowershell.exe executing the ConvertSidToStringSid APIEnumerated the domain SID (from current user SID) using the ConvertSidToStringSid API
11616.B.2ExecutionExecution through APIpowershell.exe executing the ConvertSidToStringSid API function by loading Advapi32.dllExecuted the ConvertSidToStringSid API call by reflectively loading Advapi32.dll
11716.C.1ExecutionWindows Remote ManagementNetwork connection to NewYork (10.0.0.4) over port 5985Established a WinRM connection to the domain controller host NewYork (10.0.0.4)
11816.C.2Defense EvasionValid AccountsSuccessful logon as user MScott on NewYork (10.0.0.4)Logged on to the domain controller host NewYork (10.0.0.4) using valid credentials for user MScott
11916.D.1Command and ControlRemote File CopyFile write of m.exe by the WinRM process (wsmprovhost.exe)Dropped Mimikatz (m.exe) to disk on the domain controller host NewYork (10.0.0.4) over a WinRM connection
12016.D.2Credential AccessCredential Dumpingm.exe injecting into lsass.exe to dump credentialsDumped the KRBTGT hash on the domain controller host NewYork (10.0.0.4) using Mimikatz (m.exe)
12117.A.1CollectionEmail Collectionoutlook.exe spawning from svchost.exe or powershell.exeDumped messages from the local Outlook inbox using PowerShell
12217.B.1CollectionData from Local Systempowershell.exe reading the file MITRE-ATTACK-EVALS.HTMLRead and collected a local file using PowerShell
12317.B.2CollectionData Stagedpowershell.exe creating the file \WindowsParentalControlMigration\MITRE-ATTACK-EVALS.HTMLStaged collected file into directory using PowerShell
12417.C.1ExfiltrationData Compressedpowershell.exe executing the ZipFile.CreateFromDirectory .NET methodCompressed a staging directory using PowerShell
12517.C.2Defense EvasionObfuscated Files or Informationpowershell.exe executing Set-ContentPrepended the GIF file header to a compressed staging file using PowerShell
12618.A.1Defense EvasionWeb Servicenet.exe with command-line arguments then making a network connection to a public IP over port 443Mapped a network drive to an online OneDrive account using PowerShell
12718.A.2ExfiltrationExfiltration Over Alternative Protocolpowershell.exe executing Copy-Item pointing to drive mapped to an attack-controlled OneDrive accountExfiltrated staged collection to an online OneDrive account using PowerShell
12819.A.1Defense EvasionFile DeletionFile delete event for C:\Windows\System32\m.exeDeleted Mimikatz (m.exe) on disk using SDelete
12919.A.2Defense EvasionProcess InjectionInjection into PowerShell via Invoke-ReflectivePEInjectionReflectively injected SDelete binary into PowerShell
13019.B.1Defense EvasionFile DeletionFile delete event for C:\Windows\Temp\WindowsParentalControlMigration.tmpDeleted exfiltrated data on disk using SDelete
13119.B.2Defense EvasionProcess InjectionInjection into PowerShell via Invoke-ReflectivePEInjectionReflectively injected SDelete binary into PowerShell
13219.C.1Defense EvasionFile DeletionFile delete event for C:\Windows\Temp\WindowsParentalControlMigration\MITRE-ATTACK-EVALS.HTMLDeleted staged data on disk using SDelete
13319.C.2Defense EvasionProcess InjectionInjection into PowerShell via Invoke-ReflectivePEInjectionReflectively injected SDelete binary into PowerShell
13420.A.1ExecutionRundll32rundll32.exe executing kxwn.lockExecuted Run key persistence payload on user login using RunDll32
13520.A.2PersistenceWindows Management Instrumentation Event SubscriptionThe WMI process (wmiprvse.exe) executing powershell.exeExecuted WMI persistence on user login
13620.A.3ExecutionPowerShellSYSTEM-level powershell.exe spawned from the powershell.exeExecuted PowerShell payload from WMI event subscription persistence
13720.B.1Lateral MovementPass the Ticketpowershell.exe executing Invoke-Mimikatz with command-line arguments to create a golden ticketCreated Kerberos Golden Ticket using Invoke-Mimikatz
13820.B.2ExecutionWindows Remote ManagementNetwork connection to Scranton (10.0.1.4) over port 5985Established a WinRM connection to the remote host Scranton (10.0.1.4) using the Golden Ticket as credentials
13920.B.3PersistenceCreate Accountnet.exe adding the user TobyAdded a new user to the remote host Scranton (10.0.1.4) using net.exe

关于如何评测APT29模拟攻击的检出数据

APT29攻击的测试环境工具已经完全开源 https://github.com/mitre-attack/attack-arsenal

厂商的检出结果公开透明,MITRE ATT&CK官方的评估标准颗粒度较细,检出结果类型分主要检测类型和修饰检测类型。修饰检测类型相当于附加描叙,可以算是加分项。

由于MITRE ATT&CK官方只给出统计数据,而各方的评分标准不统一,导致各路分析师和厂商对应检测成绩的评定过于两极化,同时如果过多关注检测类型组合情况反而复杂化了评估,反应不出厂商真实水平,所以我以一线技术人员的理解给出了评估方法。


主要按如下方法评估厂商


  • 非None类型都可认为是检出情况,可统计技术矩阵覆盖度。
  • Telemetry和MSSP两种类型告警进行统计,可统计需要分析师运营跟进的模糊告警数据。
  • General、Tactic、Technique三种类型进行统计,可统计明确的恶意告警数据。
  • 按主要检测类型的价值梯度进行打分,以检出结果的运营价值得出厂商排名。

主要检测类型


  • None (无检出)
  • Telemetry (遥测型检出,仅作为打点数据,无上下文参考或明确恶意标记的告警)
  • MSSP (安全运营型检出,需要分析师进一步关联分析判断才能确认威胁的告警)
  • General (通用型检出,标记为通用的恶意行为告警,无准确的技战术分类)
  • Tactic (战术型检出,向分析师提供了攻击动作潜在意图信息的告警)
  • Technique (技术型检出,向分析师提供了攻击动作的详细技战术信息的告警)

修饰检测类型


  • Alert (告警)
  • Correlated (相关)
  • Delayed (延迟)
  • Host Interrogation (主机响应)
  • Residual Artifact (残留工件)
  • Configuration Change (配置更改)
  • Innovative (创新检测)

此次APT29评估一共涉及了ATT&CK共58个技术矩阵,每个技术矩阵涉及多个模拟攻击动作步骤。

附:统计列表

In [9]:

tech_count = eval_step.reindex(['TechniqueName','SubStep'],axis=1)
tech_count = tech_count.groupby(['TechniqueName']).count(). \sort_values(by='SubStep',ascending=False)
tech_count.reset_index(inplace=True)
tech_count
#tech_count.to_csv('tech_count.csv',encoding='utf_8_sig')

Out[9]:


 TechniqueNameSubStep
0File Deletion10
1Remote File Copy7
2Process Discovery6
3PowerShell5
4System Owner/User Discovery5
5File and Directory Discovery5
6Execution through API4
7System Information Discovery4
8Credential Dumping4
9Data Compressed4
10Data from Local System4
11Obfuscated Files or Information3
12Process Injection3
13Registry Run Keys / Startup Folder3
14Security Software Discovery3
15Windows Remote Management3
16Data Staged3
17Standard Cryptographic Protocol3
18System Network Configuration Discovery3
19Deobfuscate/Decode Files or Information3
20Service Execution2
21Automated Collection2
22Remote System Discovery2
23Standard Application Layer Protocol2
24Query Registry2
25User Execution2
26Valid Accounts2
27Windows Management Instrumentation Event Subscription2
28Permission Groups Discovery2
29Data Encrypted2
30Component Object Model Hijacking2
31Bypass User Account Control2
32Modify Registry2
33Masquerading2
34Exfiltration Over Command and Control Channel2
35Exfiltration Over Alternative Protocol2
36Commonly Used Port2
37Windows Management Instrumentation1
38Windows Admin Shares1
39Web Service1
40Virtualization/Sandbox Evasion1
41Clipboard Data1
42Command-Line Interface1
43Uncommonly Used Port1
44Timestomp1
45Peripheral Device Discovery1
46Create Account1
47Credentials in Files1
48Pass the Ticket1
49Software Packing1
50Email Collection1
51Screen Capture1
52Rundll321
53Input Capture1
54NTFS File Attributes1
55New Service1
56Private Keys1
57Access Token Manipulation1

挑一个厂商的File Deletion技术矩阵检出日志查看一下检出类型

检出类型有Telemetry类型,有MSSP类型,也有Technique类型,以及具有争议的N/A无类型检出。

In [10]:

from IPython.display import JSON
import warnings
warnings.filterwarnings('ignore')cy = all_data['Cycraft'][ (all_data['Cycraft']['TechniqueName']=='File Deletion')
]print(list(all_data.keys()))
JSON(cy['Detections'].to_json(),expanded=True)

['Bitdefender', 'CrowdStrike', 'Cybereason', 'Cycraft', 'Cylance', 'Elastic', 'F-Secure', 'FireEye', 'GoSecure', 'HanSight', 'Kaspersky', 'Malwarebytes', 'McAfee', 'Microsoft', 'PaloAltoNetworks', 'ReaQta', 'Secureworks', 'SentinelOne', 'Symantec', 'TrendMicro', 'VMware']

Out[10]:


APT29评估检出覆盖度统计

对应140个步骤的检测结果,在不考虑检测类型即准确性和误报的情况下,仅对厂商有检出结果的技术矩阵覆盖度进行统计排名。

结论: 绝大多数厂商都已经覆盖了100个以上攻击动作步骤的检出,说明各厂商产品对ATT&CK技术矩阵分类的攻击动作相关告警跟进力度都很大。

In [11]:

def check_all_Detection(): flag_list = []flag_data = copy.deepcopy(all_data)def check_deep_Detection(DetectionNote):Detection = 0for xl in DetectionNote:if xl['DetectionType']=='None':Detection = 0else:Detection = +1return Detectionfor i,d in flag_data.items():d['Detections'] = d['Detections'].apply(lambda x: check_deep_Detection(x)) d_count =d['Detections'].sum() flag_list.append( (i,d_count) )return flag_listflag_list =check_all_Detection()
flag_df = pd.DataFrame( flag_list ).sort_values(1,ascending=True)
ax = flag_df.plot(kind='barh',figsize=(110,70),x=0, y=1, fontsize=65)
for i in ax.patches:#ax.text(i.get_width(), i.get_y() + 0.2, '{:.0%}'.format(i.get_width()/140), fontsize=70)ax.text(i.get_width(), i.get_y() + 0.2, i.get_width() , fontsize=70)
my_x_ticks = np.arange(0, 160, 40)
plt.xticks(my_x_ticks)
plt.show()


APT29评估遥测和安全运营类型检出数据统计

厂商的遥测运营能力统计,只统计每个攻击动作步骤中厂商检出的Telemetry和MSSP类型告警数据。

结论:在140个攻击动作步骤检出结果里,厂商的检出数据绝大多数都是遥测运营类数据,这类检出数据都需要分析师进一步关联分析才能确认威胁,可以看出厂商的产品路线都是在走分析师参与的重运营路线。

In [12]:

def check_custom_Detection( check_list ): flag_list = []flag_data = copy.deepcopy(all_data)def check_deep1_Detection(DetectionNote):Detection = 0for xl in DetectionNote:for cl in check_list:if xl['DetectionType']== cl:Detection = +1return Detectionfor i,d in flag_data.items():d['Detections'] = d['Detections'].apply(lambda x: check_deep1_Detection(x)) d_count =d['Detections'].sum() flag_list.append( (i,d_count) )tel_df = pd.DataFrame( flag_list ).sort_values(1,ascending=True).round(1)ax = tel_df.plot(kind='barh',figsize=(110,70),x=0, y=1, fontsize=65)for i in ax.patches:ax.text(i.get_width(), i.get_y() + 0.2, i.get_width() , fontsize=70)my_x_ticks = np.arange(0, 100, 20)plt.xticks(my_x_ticks)plt.show()

In [13]:

check_custom_Detection(['Telemetry','MSSP'])


APT29评估厂商的精准检出统计

对General、Technique、Tactic类型的检出数据进行统计。

结论:此类数值并不是越大就代表厂商越牛,仅能反应厂商对部分低误报、低噪点的技术矩阵跟进力度。

In [14]:

check_custom_Detection(['General','Technique','Tactic'])


APT29评估厂商按照主要检测类型的价值进行打分排名

打分标准:


  • None 无检出 0分
  • Telemetry 遥测型检出 0.5分
  • MSSP 安全运营型检出 0.6分
  • General 通用型检出 0.7分
  • Tactic 战术型检出和Technique 技术型检出 均为1分

结论:

60分以上的形成第一梯队,厂商只有微小差距

60分以下至55分形成第二梯队,厂商以1分左右形成梯度差距

55分以下的厂商形成第三梯队,开始完全掉队

In [15]:

def check_flag_Detection(): flag_list = []flag_data = copy.deepcopy(all_data)def check_deep1_Detection(DetectionNote):Detection = 0for xl in DetectionNote:if xl['DetectionType']=='None':Detection = 0elif xl['DetectionType']=='N/A':Detection = 0elif xl['DetectionType']== 'Telemetry':Detection = 0.5elif xl['DetectionType']== 'MSSP':Detection = 0.6elif xl['DetectionType']== 'General':Detection = 0.7elif xl['DetectionType']== ('Tactic' or 'Technique'):Detection = 1return Detectionfor i,d in flag_data.items():d['Detections'] = d['Detections'].apply(lambda x: check_deep1_Detection(x)) d_count =d['Detections'].sum() flag_list.append( (i,d_count) )tel_df = pd.DataFrame( flag_list ).sort_values(1,ascending=True).round(1)ax = tel_df.plot(kind='barh',figsize=(110,70),x=0, y=1, fontsize=65)for i in ax.patches:ax.text(i.get_width(), i.get_y() + 0.2, i.get_width() , fontsize=70)my_x_ticks = np.arange(0, 100, 20)plt.xticks(my_x_ticks)plt.show()

In [16]:

check_flag_Detection()

 

https://nbviewer.jupyter.org/github/raystyle/REPORT/blob/master/attck_report.ipynb

 

 

 

 

 


推荐阅读
  • 本文讨论了Kotlin中扩展函数的一些惯用用法以及其合理性。作者认为在某些情况下,定义扩展函数没有意义,但官方的编码约定支持这种方式。文章还介绍了在类之外定义扩展函数的具体用法,并讨论了避免使用扩展函数的边缘情况。作者提出了对于扩展函数的合理性的质疑,并给出了自己的反驳。最后,文章强调了在编写Kotlin代码时可以自由地使用扩展函数的重要性。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 本文介绍了在MFC下利用C++和MFC的特性动态创建窗口的方法,包括继承现有的MFC类并加以改造、插入工具栏和状态栏对象的声明等。同时还提到了窗口销毁的处理方法。本文详细介绍了实现方法并给出了相关注意事项。 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • Android JSON基础,音视频开发进阶指南目录
    Array里面的对象数据是有序的,json字符串最外层是方括号的,方括号:[]解析jsonArray代码try{json字符串最外层是 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 如何查询zone下的表的信息
    本文介绍了如何通过TcaplusDB知识库查询zone下的表的信息。包括请求地址、GET请求参数说明、返回参数说明等内容。通过curl方法发起请求,并提供了请求示例。 ... [详细]
  • 本文介绍了如何使用JSONObiect和Gson相关方法实现json数据与kotlin对象的相互转换。首先解释了JSON的概念和数据格式,然后详细介绍了相关API,包括JSONObject和Gson的使用方法。接着讲解了如何将json格式的字符串转换为kotlin对象或List,以及如何将kotlin对象转换为json字符串。最后提到了使用Map封装json对象的特殊情况。文章还对JSON和XML进行了比较,指出了JSON的优势和缺点。 ... [详细]
author-avatar
鱼mm不会游泳456
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有