How to check if the system was accessed remotely? What sort of remote connections is the attacker likely to be using?
*Are we looking for USB storage media activity or all USB devices? Like, cameras πΈ? Headphones π§? As for the timestamps, you’ll usually have first (setupapi log) and last connected. There are also OS specific timestamps, like first or last install, first connect since reboot etc. Windows USB artifacts, macOS. See Event Manager’s codes 20001 and 20002 for USB events for verification or if the registry was updated. Look at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\ and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\<hardware id>\<instance id>\Device Parameters. More.
Admins on payroll and those “magnanimous volunteers” often tread the very same path, albeit guided by different compasses of motivation. Once our cunning adversary ascends to the lofty heights of respect usually reserved for the admin on payroll, the misuse of these management tools becomes bound only by the limits of their mischievous imagination.
Think of the terminal as a magic wand πͺ of the attacker. The beauty for them is that they can do all sorts of nasty things remotely, but their beauty also lies with their forensics perks: one can review the history of this activity.
βοΈThese techniques require admin or higher privileges. βοΈCommon with ransomware
When the Security trail is deleted, 1102 is usually created afterwards. When all other trails are deleted, 104 EID is generated in the System trail.
Event logs are NOT designed to be deleted selectively, all or none. However, some tools are capable of circumventing this and can actually partially clear the logs.
Mimikatz - π event::drop can stop the event log process from writing Security events. It can’t restart it through, so, obvious.DanderSprite - (leaked by ShadowBrokers) change the pointers to the next events in the headers. So, the events are not deleted but are not visible either. Deep dive forensics to help here.Invoke-Phant0m - kill the threads of event logs.One can also suspend the event log process or make changes in RAM. However, all of these actions require π.
Two trails are of use are Microsoft-Windows-TaskScheduler/Operational π (disabled by default on the newer systems) and Security π‘οΈ.
| π | π‘οΈ | Info |
|---|---|---|
106 |
4698 |
Task created |
140 |
4702 |
updated |
141 |
4699 |
Deleted |
200/201 |
- | executed and completed |
| - | 4700/4701 |
enabled and disabled |
βπ» On older Win π΄πΌ it’s
602event. Also, config files are in bin format with.jobextension and can be parsed by ajobparser.pyscript.π€ How Do I Check For Reconnaisance Activity?
Windows
Event logs
Monitoring for these events will cause a lot of noise and false positives. You need to do it in a smart way:
- Filter for sensitive groups
- Whitelist those processes performing such activity legitimately:
mmc.exe,services.exe,taskhost.exe,explorer.exe,vsssvc.exe. Presume everything else to be unusual.- What accounts are NOT supposed to do recon?
- What group was queried?
Administratorsgroup (or other groups with higher privileges) is the most desirable piece of the pie.
4798- user’s local group membership enum.4799- security-enabled local group membership enum.π€ How do I check program execution?
Windows
You can use Prefetch which is the most reliable source. However, if the program is NOT there, it doesn’t mean it wasn’t executed.
Another artefact of use is AmCache. What’s great about it is that it stores hashes among all. Although it’s not proof of the program being executed, it can show the PRESENCE of files (exe and drivers) on the system.
ShimCache
It is ok to collect artefacts like that manually, but it’s better to do so at scale. Some tools were designed to process these artefacts and put everything in an SQL database.
π€ How Do I Check System Information?
Windows
Registry, of course.
AmCache, Registry ποΈ
You can see firmware, hardware and OS info there. Although the artefact has proved to be highly “volatile”, it might change from update to update.
macOS
Linux
iOS
Backups
π
/Users/username/Library/Application\ Support/MobileSync/Backup/<UDID>/:Info.plist,Manifest.plist,Status.plist.Lockdown files
π
/private/var/db/lockdownW-Fi MAC Address for the connected iPhoneReferences
Expand…
Something hereπ€ How Do I Find Malicious or Compromised Accounts?
Windows
Event logs
π
%system root%\System32\config\SecEvent.evtπ%system root%\System32\winevt\logs\Security.evtx
It starts with the event
4720(account created) and multiple4732events (member added to some security-enabled group). This account must be enabled (4722) before it can be used. You might see 4738 (account was changed) or even4724(password reset attempt).βπ»
4728- member was added to a security-enabled global group.βπ»
4732- member was added to a security-enabled local group.