Use Case With elk
ELK is an open source stack that consists of three applications (Elasticsearch, Logstash and Kibana)
Last updated
ELK is an open source stack that consists of three applications (Elasticsearch, Logstash and Kibana)
Last updated
ELK is an open source stack that consists of three applications (Elasticsearch, Logstash and Kibana) working in synergy to provide users with end-to-end search and visualization capabilities to analyze and investigate log file sources in real time.
ندخل ف الموضوع ع طول
This query searches for two types of events:
Windows process creation events with event code 4688, indicating a new process was created.
File creation events with event code 1, indicating a new file was created.
The query filters for events where the process name is "powershell.exe" and the process command line includes any of the well-known PowerShell offensive frameworks and commands, such as Empire, PowerSploit, Mimikatz, BloodHound, and others. The query uses the OR
operator to match any of the keywords within the command line.
This query searches for Windows process creation events with event code 4688, indicating a new process was created. It further filters for events where the process action is "created" and the parent process name is "explorer.exe". Additionally, the query looks for events where the new process is named "powershell.exe", indicating a potential instance of PowerShell being spawned by a suspicious parent process.
We can also expand the query to include additional fields or filters, such as the user who executed the process or the path of the executable.
This query searches for two types of events:
Windows process creation events with event code 4688, indicating a new process was created
File creation events with event code 1, indicating a new file was created
The query filters for events where the process name is "powershell.exe", but the process executable includes the words "rename" or "renamed", indicating a potential instance of PowerShell being renamed by an attacker. The NOT
operator is used to exclude events where the process executable is "powershell.exe" to avoid including legitimate instances of PowerShell.
This query searches for two types of events:
Windows process creation events with event code 4688, indicating a new process was created.
File creation events with event code 1, indicating a new file was created.
The query filters for events where the process name is "powershell.exe" and the process command line includes any of the following parameters: "-encodedcommand", "-enc", or "-encoded". Additionally, the query looks for events where the process command line includes the word "base64", indicating a potential instance of base64-encoded PowerShell commands.
This query searches for events with the code 4104 from the Microsoft-Windows-PowerShell provider with opcode 3 (which indicates the use of the PowerShell XOR operator). It then checks if the string "XOR" is present in the original field of the event, which includes the full raw message.
This query searches for events with the code 800 from the Microsoft-Windows-PowerShell provider. Code 800 indicates that an external module or assembly was loaded by PowerShell. The query checks if the strings "Assembly" and "LoadFrom" are present in the original field of the event, which includes the full raw message.
This query searches for events with the code 4103 or 4104 from the Microsoft-Windows-PowerShell provider, and checks if the string "Invoke-WebRequest", "Invoke-RestMethod", or "Net.WebClient" is present in the original field of the event. These are common PowerShell commands used for downloading content from the internet.
This query searches for events with the code 4103 or 4104 from the Microsoft-Windows-PowerShell provider. Code 4103 indicates that a PowerShell script block was executed, while code 4104 indicates that a PowerShell command was executed. The query checks if the string "EncodedCommand" is present in the original field of the event, which indicates that the PowerShell command was obfuscated.
or
This query searches for events with the code 4103 or 4104 from the Microsoft-Windows-PowerShell provider, and checks if the original field of the event contains the string "Out-String -Stream | %{$_ -replace". This string is commonly used to obfuscate PowerShell commands by converting them to a string, replacing certain characters, and then invoking them using the "&" operator.
or
This query searches for events with the code 4103 or 4104 from the Microsoft-Windows-PowerShell provider, and checks if the original field of the event contains the string "--NoP -sta -NonI -Win". This string is often used to obfuscate PowerShell commands by disabling PowerShell's default execution policy, running in a STA (Single-Threaded Apartment) mode, disabling interactive prompts, and running in a non-interactive session.
or
This query searches for events with the code 4103 or 4104 from the Microsoft-Windows-PowerShell provider, and checks if the original field of the event contains the string "$([Text.Encoding]::ASCII.GetString". This string is often used to obfuscate PowerShell commands by converting them to ASCII-encoded strings and then decoding them at runtime using the Text.Encoding class.
okay okay PowerShell has a number of techniques that can be utilized to circumvent detection and analysts.
If any query returns any events, they may indicate obfuscated PowerShell commands. You can then investigate these events further using other features of the ELK SIEM solution, such as visualization, timeline analysis, or threat intelligence lookups, to determine if they are indeed malicious.
------------------------------------------------------