Section 2.4: Intrusion Analysis: Command Line, Powershell, and WMI Analysis Flashcards

1
Q

It’s not always than an enterprise will enable process tracking in the Security log. What alternative log can analysts use to search it?

A

System logs. They can trigger Critical, Warning, and Error events for system, reboots and process crashing if malware fails.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the Application Event log IDs

A

1000- application errors
1001- Windows Error Reports (WER)(Report.wer)
1002- hangs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where can I find WER files? What can I find inside the files?

A

C:\Program Data\Microsoft\Windows\WER. Application name, SHA1, and the modules running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why is process tracking important?

A

It can track potential malware execution and record the full command line used to launch the process (includes cmd.exe and powershell.exe). It is usually off because it records alot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Process tracking event log IDs

A

4688- New process created (includes path)
4689- Process exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do I enable process tracking?

A

Group Policy Management -> Computer Configuration -> Policies -> Administrative Templates -> System -> Audit Process Creation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

WMI commands that can be used for Recon

A

[wmic process get][wmic (useraccount, group, or netuse) list full][wmic qfe get][wmic startup get]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can adversaries do priviledge escalation using WMI?

A

By using scripts like PowerUp.ps1. The script looks for unquoted paths set to autostart with service binary not present under windows folder. It can also find high privileged processes for attack. Finally, it finds all service paths that aren’t quoted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

WMI commands to find and spread to remote shares.

A

NetEnum & NetAdd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does WMI “Process Call Create” do?

A

It runs a legitimate process to run code from a different location that benefits the adversary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can I track WMI commands?

A

By turning on process tracking 4688 and enabling command line auditing. Download Sysmon as an alternative.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

WMI persistence event log IDs

A

[WMI-Activity/Operational log]
5858- query errors on host & username
5857-5860- filter/consumer activity
5861- new permanent event consumer
*Look for commandlineventconsumer or vbseventconsumer if 5861 is logged.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Uncommon keywords to identify anomalies inside the WMI%4Operational file

A

eval, ps1, vbs, scrcons, ActiveScript, ActiveXObject, powershell, CommandLine, and wbemcons.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Powershell event log IDs

A

4103- module logging and pipeline output
4104- script block logging
4105/4106- script start/stop (avoid)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Is it possible for adversaries to avoid Powershell logging?

A

Yes, by downgrading Powershell to v2. Find it in the Windows Powershell.evtx under ID 400 and look at the host/engine versions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What other log should be enabled for Powershell logging?

A

Transcription logs

17
Q

Where can I enable Powershell logging?

A

Group Policy Management -> Computer Configuration -> Policies -> Administrative Template -> Windows Components -> Windows Powershell

18
Q

Where can I enable Powershell logging?

A

Group Policy Management -> Computer Configuration -> Policies -> Administrative Template -> Windows Components -> Windows Powershell. To add all modules, use (*).

19
Q

In log ID 4104, what should analyst do?

A

Search for words in the command that describe certain actions that are suspicious. Ex: “key.log”.

20
Q

Keywords to search inside Powershell/Operational log

A

download, IEX, rundll32, http, Start-Process, Invoke-Expression, Invoke-Command, syswow64, FromBase64String, WebClient, bitstransfer, Reflection, powershell -version, Invoke-WmiMethod, and Invoke-CimMethod

21
Q

For what purpose do adversaries obfuscate keywords in Powershell? What tools can be used to counter this?

A

So that security won’t trigger alarms when certain keywords were used to run a script. Tools to counter obfuscation are: Invoke-Obfuscation & Revoke-Obfuscation

22
Q

Besides Invoke/Revoke-Obfuscation tools, what other alternative tools are there?

A

CyperChef and PSDecode for decoding scripts.

23
Q

How do I turn on Powershell Transcription logs? Where are the files saved?

A

Group Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Windows Powershell -> Turn on Transcription. Files saved at: \Users\ <acct>\Documents</acct>

24
Q

What is one thing to keep in mind when reviewing transcription logs?

A

The date is set in system local time so they need conversion to UTC to match native event log times.

25
Q

Where can I find ConsoleHost_history_txt?

A

User\Roaming\Microsoft\Windows\Powershell\PsReadline

26
Q

How are event logs collected and what tools are used in order to do so?

A

One option is using Event Viewer (right-click log of interest and save log in file extension of choosing. Another option is the PsLogList tool that can dump live logs to text or .csv files. Velociraptor and F-Response are two other options.

27
Q

What tools can be used to forward logs?

A

Window’s Event Forwarding (WEF) tool is frequently used. Another tool, that’s free, is Winlogbeat. It can send to Elasticsearch.

28
Q

How can I download evtx files from Powershell?

A

Use Get-WinEvent and use [-ComputerName][-Path][-Logname]. Also use export. Its recommended to use hashtable to be more specific.

29
Q

What is Sysmon by Microsoft?

A

Its a logging extension to the already set logs inside Windows. It can filter specific logs for investigations. It can scale and be forwarded to a SIEM. Think of it as a lightweight detection endpoint for free.