Sans Study Flashcards
Keyword
Description
PsExec
> New PsExec service installations are run each time PsExec is used.
When started as a service, it is obvious to view malicious use, as you will see it being run by a user account rather than SYSTEM or LOCAL SERVICE accounts.
Service name is PSEXESVC on remote system.
Malicious PsExec usage is also typically encoded, such as when deployed via MetaSploit. You can also look for strange service names.
Also see Per-User Service (2.100)
Scheduled Task
> Logged in Microsoft-Windows-Task Scheduler/Operational log. Not tracked by default and can be enabled via group policy, the wevutil command-line tool, or the GUI Task Scheduler application.
Scheduled task logging in the Security log requires Object access auditing to be enabled.
Tasks can be scheduled remotely, but the logs do not differentiate. To find remote tasks you must look for Type 3 (network) logon occuring near task creation.
Logged in Security logs and Microsoft-Windows-Task Scheduler/Operational log. Security logs will provide more detail info like trigger info, account name, and full path.
When a task is created, a config (or .job) file is deposited into %SystemRoot%\System32|Tasks or %SystemRoot%\SysWOW64 for 32-bit code (which is rare). You can use these to identfy the account and system name used to schedule the task. Not on XP/Win2003, the .job file is written in binary.
make_token
Part of Cobalt Strike and used to create a new logon session using a stolen auth token.
pth
Part of Cobalt Strike and used to create a new logon session using pass the hash.
Explicit Credentials
> Logged as EID 4624 Logon Type 9 and EID 4648 “Explicit Credentials” events: Use crdentials not logged in memory (new creds) to impersonate another user to access a resource or service on a network.
These events (runas) are typically recorded on the origionating system instead of the target. This allows us to determine where a user was heading.
You can determine whether a 4648 event was logged on the origional system or a target system by looking at the “Target Server” information: If localhost, it is inbound, if includes IP address, it is outbound.
Can also capture outbound RDP sessions on the source system if network level authentication is enabled. This will include: current logged-on user name, alternate user name, destination host name/IP, process name.
Admin$
Network share containing network administration tools such as software patches (this is a legacy way to patch systems).
IPC$
Inter-Process Communication connection: This share must be authenticated to facilitate communication between two devices on a network. Includes account name, SID, domain, and Logon ID, as well as source IP and port. IPC$ shares cannot be used to move files, it is simply an auth mechanism.
Event log explorer
See Tools tab
Account enumeration
> TAs commonly deploy tools belonging to attack frameworks like Empire and PowerSploit to enumerate sensitive accounts and groups in an enterprise. Windows have introduced a new series of EID to track this activity.
This is enabled at the GPO level using the “Audit Security Group Management” and “Audit User Account Management” audits.
Although these events can be noisy, you should look out for PowerShell, WMI, or netuse via cmd.exe, as these are not common in an enterprise environment. Services like mmc.exe, services.exe, taskhostw.exe, explorer.exe and VSSSVC.exe are common.
Enumeration (see account enumeration)
Pass-the-hash attack
> Rely on NTLM logons
Often appear as EID 4624 Type 3 network logon events.
Allows Tas to perform SMB-based actions like mapping shares, executing code with PsExec (this relies on SMB).
Although most modern environment are set up to block this, attackers can modify the LocalAccount TokenFilterPolicy with a one-liner to re-enable the capability.
Logon error codes
Kerberos
Kerberos works by a user supplying credentials to the authentication server (often the domain controller). If correct, a Tiget Granting Ticket (TGT) is issued to the user for a period of time. This is like a passport. To access resources on another system, such as a server, a “Service Ticket” is requested.
> If the auth fails, an EID 4771 will be written to the authentication servers logs. This will include date/time, hostname, client IP address, username, Error Code (see Logon error codes).
Ticket Granting Ticket
Part of the Kerberos authentication process. A user granted a TGT when authenticated correctly to an auth server like a domain controller.
Service Ticket
Part of the Kerberos authentication process. A user granted a Service Ticket when authenticated correctly to a networked resource.
NTLM Auth
Although less common than Kerberos, NTLM logons do still occur. For example, local account will record logons as NTLM. Pass-the-hash attacks also rely on NTLM (which will record EID 4776).
Logon Events (as oposed to account logon events)
Login/Logoff activity happening on the actual system being logged into. Stored locally. Note that for local accounts where the auth is happening via the local SAM database, you will see account logon and logon events. This can indicate rouge accounts, as it is rare in an enterprise environment.
Account Logon Events (as opposed to logon events)
Third-party authentication of credentials provided during that logon session. For example, users that need to authenticate via a Domain Controller. Note that before a user can authenticate, their credentials need to be validated by the domain controller using either NTLM or Kerberos. These events are stored on the domain controller. The one exception is local account auth, where an account logon is generated for a local only account (see Logon Events).
RDP logs (Security + Custom)
> Source: TerminalServices-RDPClient: EID 1024,1102
Source: Security logs: EID 4648 (if NLA enabled and alternate creds used)
Destination: Security 4624 Type 3,7,10 & 4778/4779
Destination: Remote Desktop Services-RDPCoreTS: EID 98,131
Destination: TerminalServices-RemoteConnectionManager: EID 1149
TerminalServices-LocalSession Manager: EID 21,22,25,41
RDP Use in EID
EID 4624 (Logon Types 3,7,10) are the best indicators of RDP usage. You should also cross reference the RDPCoreTS and TerminalServices-RdpClient logs. EID 131 in RDPCoreTS and EID 1024/1102 in the TerminalServices-RdpClient log record outbound RDP connections and include destination hostname and IP.
Account creation
Local admins can create local accounts and domain admins can create domain-wide accounts. EID 4720 logs date, time, computer, account used to create.
Built-In Accounts
System: This used to be the primary non-user related account prior to Windows 2003. The accounts below were added to provide additional layers of security.
> Local Service: Used for services that do not require network access. Cannot authenticate with network resources.
> Network Service: Similar to local service but with slightly higher privileges, which allow it to impersonate standard computer accounts and authenticate over the network. Assigned for processes or services that require network access.
> <Hostname>$: The computer account provides the means for the computer to be authenticated when communicating with Active Directory and accessing network and domain resources. The account is named according to the system name.
> DWM / UMFD: Related to the Windows Manager (DWM) and driver activity (UMFD), but little used.
> Anonymous Logon:</Hostname>
Brute force attacks
> Typically indicated by failure codes C0000064 for unknown users and C000006A for bad passwords