Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hunting for Unfriendly Easter Eggs Capturing evidence of APT attacks Michael Robinson & Craig Astrich.

Similar presentations


Presentation on theme: "Hunting for Unfriendly Easter Eggs Capturing evidence of APT attacks Michael Robinson & Craig Astrich."— Presentation transcript:

1 Hunting for Unfriendly Easter Eggs Capturing evidence of APT attacks Michael Robinson & Craig Astrich

2 Michael RobinsonCraig Astrich Introductions Page 2

3 Term originated within the U.S. Air Force in Originally used so Air Force personnel could discuss a series of attacks attributed to a specific set of actors located in Asia-Pacific region with uncleared partners. The term appeared more publicly in in conferences. The term has hit mainstream media in 2010 with the announcement of Operation Aurora. Attacks from foreign adversaries occurred before Defining Advanced Persistent Threat (APT) Historical Note Page 3

4 Model created in Desire to break the chain as far to the left as possible. Clopperts Kill Chain APT Model Page 4 Defensive/protective measures Clean-up costs

5 Recognized, but the model has limitations. Not effective in defining all of the characteristics of the life cycle. Clopperts Kill Chain APT Model Page 5 Lots of activity grouped together

6 ATTRIBUTION Specific attacker/actor Shift in Terms Meaning New de facto Model Page 6 Attack with specific characteristics

7 Tremendous Confusion Over the Terms Meaning New de facto Model Page 7 Is it a person or an attack type? Are the attackers nation states, terrorists, organizations or individuals? Does it necessarily involve zero day exploitation? Is customized malware always involved? Do these attacks frequently use social networking/phishing attacks? Are targets information resources or financial repositories? Is it marketing hype?

8 AdvancedSkills that run the full gamut. Capable of using basic tools and writing custom code. PersistentLong-term interest and continued targeting. ThreatA person who mans the console behind the attack, rather the pre-configured malware (set it and forget it). As a Proper Noun? APT Definition – What do these terms mean? Page 8 Combined, do the terms clearly articulate the challenge? It isnt detected by AV. It survives reboots. It that could steal data that would be harmful to the organization. As malware?

9 Expand APT attacks into a full life cycle to obtain a better understanding. The lifecycle recognizes the iterative process where an adversary obtains a deeper foothold into the network through lateral movement. Move from the APT Kill Chain to the APT Life Cycle Redefining the Model Page 9

10 Interpreting data associated with each step to be based on use cases rather opinion. Move from the APT Kill Chain to the APT Life Cycle Redefining the Model Page 10

11 Typical Attack Page 11 Mail ServerDomain Controller SMTP Relay; Botnet C2 Server

12 Mail Server Indicators of Compromise (IOCs) Inbound with attachment Attachment cached in OLK folder Attachment executed – Prefetch Outbound connection established File downloaded File cached - Change Journal entry File executed - Prefetch file created New DLL created Autostart/autorun locations modified Restore Point modified Service restarted with injected DLL Example of an Attack Page 12 Domain Controller SMTP Relay; Botnet C2 Server Indicators of Compromise (IOCs) Outbound connection New file downloaded Lateral traffic Query of Domain Controller Existing accounts modified

13 Example of an Attack Page 13 What a mess.

14 Review of each step… Redefining the Model Page 14

15 Redefining the Model Page 15 …produces a comprehensive list of indicators.

16 300+ Indicators of Compromise (IOCs) were identified. IOCs were identified from multiple sources, i.e., disk, files, memory, and network traffic. The appearance of an individual IOC is likely to be insignificant. When multiple IOCs appear within close proximity of each other, i.e., clustering of events, the severity of an incident increases and the likelihood of a false positive decreases. Many IOCs are not monitored by typical security controls. Results of Analysis Redefining the Model Page 16

17 Step 1-1: Initial Reconnaissance APT Life Cycle Page 17 Profile information is acquired about the organization and its employees. Sources of information about primary/secondary targets may come from the following sources: -Press releases -Corporate websites -Job postings -Tech forums -DNS records and registration -Social network sites, e.g., Facebook, LinkedIn, Spokeo -Pastebin

18 Step 1-2: External Weaponization APT Life Cycle Page 18 Two sets of tools may be leverages as weapons. Custom malware may be developed based on targeted intelligence obtained during the initial reconnaissance phase that leverages the use of carefully choreographed social engineering. Generic tools to be used during a shotgun approach could be used to blast all of the users of a network, as in a large spam/phishing campaign.

19 Step 1-3: External Delivery APT Life Cycle Page 19 Malicious payload is delivered to a victim via online or physical means. The attack vectors may include: -Spam/Phishing -Spoofed /Spear Phishing/Whaling -Social networking sites -External media (USB storage media, CD/DVDs) -Network probe via Wi-Fi -An external resource, such as DNS cache, is modified.

20 Step 1-3: External Delivery APT Life Cycle Page 20 Indicators of Compromise may include: -Identical spam in multiple users mailboxes - where origin SMTP IP address does not match domain name (reverse lookup) - s SMTP address originates from an open relay (which accounts for 20% of spam on the Internet) -Unauthorized use of USB ports -Unauthorized network traffic -Unauthorized CD/DVDs in the workplace -Connections to websites with malicious content or sites with known drive-by attacks

21 Step 1-4: Initial Exploitation APT Life Cycle Page 21 The malicious content has been sent to the target(s) and the payload is executed locally. Examples of an initial exploitation activity include: -A link that has been clicked by the user. -An attachment that is opened. -An object on a web page that is automatically executed by a browser or browser helper object (BHO). -A CD/DVD is inserted into a computer and a file is open or executed. Indicators of Compromise may include: -Unresolved IP address and SMTP server - Redirects to hostile websites -Malicious JavaScript in a users cached Internet files -Executable files in a users cached Internet files, which may include.exe files, Flash files, etc. -PDFs with malicious content with OLK cache -Changes to the MUI cache -Modifications to the local HOSTS file -LNK file appears

22 Tangent: LNK Files Page 22 MAC address of NIC on the computer where the shortcut was created. Location of the target file. Volume Serial Number This should match the volume serial number of this particular drive, because the target path is C:\... These timestamps are of the target file. (Remember, these are stored within the LNK file. EnCase didnt query the target file.)

23 Step 1-5: Initial Installation APT Life Cycle Page 23 Malicious software is installed on the system that has been targeted and exploited. This could result in the download and installation of a second-stage piece of malware. The running of the malicious software may result in a new application running or a new file being injected into a running process. Indicators of Compromise may include: -Objects in the Internet cache -Files in OLK cache folder -Attachments with executable code within s -Files with MZ header in the temp folder of the users profile or within C:\Windows\Temp. -New Prefetch files which include references to new drivers or recently downloaded files -Modifications to existing software drivers -Artifacts for persistence, e.g., addition to the autorun locations within the Windows Registry -Changes to $USN_Journal, especially code 0x0100 -Outbound network traffic in the form of a beacon or DNS lookup to confirm network connectivity. (Lookups may use hostile sites, but may also use well-known sites with high up-time).

24 Tangent: $USN Journal Codes Page 24 0x01Data in one or more named data streams for the file was overwritten. 0x02The file or directory was added to. 0x04The file or directory was truncated. 0x10Data in one or more named data streams for the file was overwritten. 0x20One or more named data streams for the file were added to. 0x40One or more named data streams for the file was truncated. 0x100The file or directory was created for the first time. 0x200The file or directory was deleted. 0x400The user made a change to the file's or directory's extended attributes. These NTFS attributes are not accessible to Windows-based applications. 0x800A change was made in the access rights to the file or directory. 0x1000The file or directory was renamed, and the file name in this structure is the previous name. 0x2000The file or directory was renamed, and the file name in this structure is the new name. 0x4000A user changed the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. That is, the user changed the file or directory from one that can be content indexed to one that cannot, or vice versa. 0x8000A user has either changed one or more file or directory attributes or one or more time stamps. 0x200000A named stream has been added to or removed from the file, or a named stream has been renamed. 0x The file or directory was closed. Reference:http://www.forensickb.com/2008/09/enscript-to-parse-usnjrnl.html 0x100 indicates a file was created. 0x200 indicates a file was deleted. 0x2000 indicates a file was renamed. 0x indicates a file was closed.

25 Tangent: $USN Journal Example Page 25 A new file is created on the drive with the name badcode.exe. badcode.exe 0x100 Content is added to badcode.exe.badcode.exe 0x x02 0x Action NameCodeFile ID badcode.exe is closed.badcode.exe 0x x x The file is renamed from badcode.exe to svchost.exe badcode.exe 0x svchost.exe 0x svchost.exe 0x x x The same file identifier was used throughout the process. Renames should always appear in pairs. At this point, the file is closed and there is no activity on the disk. 05/28/12 09:28:25 Time 05/28/12 09:28:27 05/28/12 09:28:29

26 Step 1-6: Command & Control Activity APT Life Cycle Page 26 The infected computer establishes a connection with a remote computer. While this may involve creation of listener that responds to an inbound connection, it will likely be an executable or injected process that creates an outbound connection to a remote host. The remote host may be a command and control server, it could be a proxy server, or an infected computer that is part of a botnet. Indicators of Compromise may include: -New running processes -Restarted running processes which contain injected code -New Prefetch files which include references to new drivers or recently downloaded files -Disabling of normal services, e.g., anti-virus engines or the local firewall -Outbound network traffic -Network connections stored on the infected computer to non-legitimate sources.

27 Tangent: Prefetch Files Page 27 08/19/09 01:22:19PM

28 Prefetch File Analysis: WinPrefetchView Page 28

29 Step 2-1: Internal Reconnaissance APT Life Cycle Page 29 Information is gained about the infected computer and LAN. Sources of information used during reconnaissance may include: -OS footprint -User name and profile information -IP addresses/DHCP information -Domain name -Names of network, e.g., list of domain controllers, internal DNS servers, and network services -Network connections Indicators of Compromise may include: -Connectivity to an Internet-based resource used to deliver commands to the infected computer -Lateral network traffic and PINGs -Connections to network shares -Abnormal running services/processes -Creation of Prefetch files for network diagnostic tools, such as netstat -Additions to the UserAssist Registry keys -Installation of administrator tools on the infected computer to perform reconnaissance activities

30 Step 2-2: Internal Weaponization APT Life Cycle Page 30 The tools used to internally compromised are not necessarily the same as those used to gain initial access to the system. These tools may be administrator tools, such as PSEXEC. Some may be customized. Indicators of Compromise may include: -Connectivity to an Internet-based resource used to deliver commands to the infected computer -Installation of new executable files to the users profile or C:\Windows\System32 directory. -Changes to $USN_Journal, especially code 0x0100 -Creation of Prefetch files to indicate existing administration tools were run.

31 Step 2-3: Internal Delivery APT Life Cycle Page 31 Tools used for the advancement throughout the network are copied to the infected computer. Indicators of compromise may include: -Connectivity to an Internet-based resource used to deliver commands to the infected computer -New files on the file system -Modifications to timestamps; inconsistencies between $SIA and $FN portions of the $MFT -Changes to the $USN_Journal, especially code 0x0100 -Changes to the list of network connections maintained within memory of the infected computers -Internal, lateral network traffic

32 Tangent: Timestamps Page 32 All eight timestamps are in $MFT. $STANDARD_INFORMATION Type: 0x10 Min Size: 0x30 Max Size: 0x48 Read offset to attribute content and add: Created ( 0x00 ) Last Modified ( 0x08 ) MFT Entry Modified ( 0x10 ) Last Accessed ( 0x18 ) $FILE_NAME Type: 0x30 Min Size: 0x44 Max Size: 0x242 Read offset to attribute content and add: Created ( 0x08 ) Last Modified ( 0x10 ) MFT Entry Modified ( 0x18 ) Last Accessed ( 0x20 )

33 Tangent: Timestamps Page 33 Standard Information Attribute File Name Attribute Standard Information Attribute Created: 12/29/2011 9:00:00AM Last Modified: 12/29/2011 9:00:00AM Last Access: 12/29/2011 9:00:00AM MFT Entry: 01/13/ :15:30AM File Name Attribute Created: 01/13/ :13:18AM Last Modified: 01/13/ :13:18AM Last Access: 01/13/ :13:18AM MFT Entry: 01/13/ :13:18AM

34 Step 2-4: Internal Exploitation APT Life Cycle Page 34 During internal exploitation an attacker positions himself to move laterally by compromising the integrity of another system within the network. This may involve obtaining escalated privileges, exploiting the operating system, user application, or implanting code that will execute. Indicators of compromise may include: -Connectivity to an Internet-based resource used to deliver commands from the infected computer -New files on the file system -Modifications to timestamps; inconsistencies between $SIA and $FN portions of the $MFT -Changes to the $USN_Journal, especially code 0x0100 -Modifications to the autorun locations, which would allow an executable to launch or inject malicious code with a known process, e.g., explorer.exe -Internal, lateral network traffic

35 Lateral Connections within the LAN Page 35 C:\Users\robinson>netstat -ano Active Connections ProtoLocal AddressForeign AddressStatePID TCP : :0LISTENING964 TCP : :0LISTENING4 TCP : :0LISTENING3624 TCP : :0LISTENING1492 TCP : :0LISTENING4 TCP : :5061ESTABLISHED5708 TCP : :8080ESTABLISHED7340 TCP : :80ESTABLISHED1320 TCP : :2310CLOSE_WAIT4784 TCP : :0LISTENING3136 TCP : :52444TIME_WAIT0 This IP address is for a neighboring PC. Why?

36 Step 2-5: Internal Installation APT Life Cycle Page 36 During the internal installation phase an attacker compromises the integrity of another system within the network. This may involve exploiting the operating system, exploiting a user application, or implanting malicious code that will execute. The insertion of this code would circumvent intrusion detection systems. The use of known, legitimate administration tools would not be captured by anti-virus software. Indicators of compromise may include: -Connectivity to an Internet-based resource from the initially infected computer. -Connectivity to an Internet-based resource used to deliver commands to the newly infected computer -New running processes -Restart of existing processes to include injected code -Creation of Prefetch files to indicate existing administration or malicious tools were run. -Internal, lateral network traffic

37 Step 2-6: Persistence APT Life Cycle Page 37 An attacker establishes persistence on a network when he maintains a presence in the network as various machines go offline or as incident response procedures are implemented. This will frequently involve establishing connectivity with multiple hosts on the compromised network. Indicators of compromise may include: -Connectivity to an Internet-based resource from the initially infected computer. -Connectivity to an Internet-based resource from the multiple computers. This may be a beacon to test connectivity, e.g., DNS lookups, etc. -Outbound network traffic from computers that dont typically communicate to the Internet, e.g., print servers, domain controllers -New running processes -Restart of existing processes to include injected code -Addition of Prefetch files -Internal, lateral network traffic -New user accounts on local hosts or within a domain controller -Change of permissions/rights/roles of existing network accounts.

38 Iterative Process APT Life Cycle Page 38 Once inside the network, the attacker engages in an iterative process to retain a foothold within the compromised network. This can result in: -New malware being launched within the network to upgrade existing malware that may be detected by anti-virus software -Disabling network security safeguards to avoid detection -Erasing artifacts, such as log files, etc. -Lateral traffic between computers.

39 Iterative Process APT Life Cycle Page 39 Indicators of Compromise may include: -Connectivity to an Internet-based resource from the multiple computers. -Outbound network traffic from computers that dont typically communicate to the Internet, e.g., print servers, domain controllers -New running processes -Restart of existing processes to include injected code -Creation of Prefetch files to indicate existing administration or malicious tools were run. -Internal, lateral network traffic -New user accounts on local hosts or within a domain controller -Change of permissions/rights/roles of existing network accounts. -Reinfection of previously cleaned computers -Exfiltration data files on computers. This may include the presence of empty files that are re-used.

40 2-7: Mission Fulfillment APT Life Cycle Page 40 An attacker successfully fulfills his mission, which may include: -the exfiltration of data from the network -launching a denial of service attack -incorporate infected computers into a botnet Indicators of compromise may include: -Connectivity to an Internet-based resource from the multiple computers. -Outbound network traffic from computers that dont typically communicate to the Internet, e.g., print servers, domain controllers -New running processes -Restart of existing processes to include injected code -Addition of Prefetch files -Internal, lateral network traffic -New user accounts on local hosts or within a domain controller -Change of permissions/rights/roles of existing network accounts.

41 Hunting for Unfriendly Easter Eggs Capturing evidence of APT attacks Michael Robinson & Craig Astrich


Download ppt "Hunting for Unfriendly Easter Eggs Capturing evidence of APT attacks Michael Robinson & Craig Astrich."

Similar presentations


Ads by Google