Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proc creation lnx webshell detection #5128

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CheraghiMilad
Copy link
Contributor

@CheraghiMilad CheraghiMilad commented Dec 13, 2024

Summary of the Pull Request

Some images added.

Changelog

Example Log Event

groups log

<Event>
  <System>
    <Provider Name="Linux-Sysmon" Guid="{ff032593-a8d3-4f13-b0d6-01fc615a0f97}"/>
    <EventID>1</EventID>
    <Version>5</Version>
    <Level>4</Level>
    <Task>1</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-12-01T11:07:26.551148000Z"/>
    <EventRecordID>286262</EventRecordID>
    <Correlation/>
    <Execution ProcessID="1258" ThreadID="1258"/>
    <Channel>Linux-Sysmon/Operational</Channel>
    <Computer>caldera-virtual-machine</Computer>
    <Security UserId="0"/>
  </System>
  <EventData>
    <Data Name="RuleName">-</Data>
    <Data Name="UtcTime">2024-11-26 18:50:45.939</Data>
    <Data Name="ProcessGuid">{36fe7a82-1885-6746-91ce-8c4be7550000}</Data>
    <Data Name="ProcessId">19678</Data>
    <Data Name="Image">/usr/bin/groups</Data>
    <Data Name="FileVersion">-</Data>
    <Data Name="Description">-</Data>
    <Data Name="Product">-</Data>
    <Data Name="Company">-</Data>
    <Data Name="OriginalFileName">-</Data>
    <Data Name="CommandLine">groups</Data>
    <Data Name="CurrentDirectory">/tmp</Data>
    <Data Name="User">caldera</Data>
    <Data Name="LogonGuid">{36fe7a82-0000-0000-e803-000000000000}</Data>
    <Data Name="LogonId">1000</Data>
    <Data Name="TerminalSessionId">3</Data>
    <Data Name="IntegrityLevel">no level</Data>
    <Data Name="Hashes">SHA256=175a52497e658e138f7dce3fbb3ba7d794f302dc7be29f9c9ca79a8cb377554c</Data>
    <Data Name="ParentProcessGuid">{36fe7a82-1381-6743-d526-4b5458550000}</Data>
    <Data Name="ParentProcessId">2249</Data>
    <Data Name="ParentImage">/usr/bin/bash</Data>
    <Data Name="ParentCommandLine">bash</Data>
    <Data Name="ParentUser">caldera</Data>
  </EventData>
</Event>

netstat log

<Event>
  <System>
    <Provider Name="Linux-Sysmon" Guid="{ff032593-a8d3-4f13-b0d6-01fc615a0f97}"/>
    <EventID>1</EventID>
    <Version>5</Version>
    <Level>4</Level>
    <Task>1</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-12-01T11:08:55.895691000Z"/>
    <EventRecordID>286269</EventRecordID>
    <Correlation/>
    <Execution ProcessID="1258" ThreadID="1258"/>
    <Channel>Linux-Sysmon/Operational</Channel>
    <Computer>caldera-virtual-machine</Computer>
    <Security UserId="0"/>
  </System>
  <EventData>
    <Data Name="RuleName">-</Data>
    <Data Name="UtcTime">2024-11-26 18:52:15.275</Data>
    <Data Name="ProcessGuid">{36fe7a82-18df-6746-7d0c-f4aabf550000}</Data>
    <Data Name="ProcessId">19688</Data>
    <Data Name="Image">/usr/bin/netstat</Data>
    <Data Name="FileVersion">-</Data>
    <Data Name="Description">-</Data>
    <Data Name="Product">-</Data>
    <Data Name="Company">-</Data>
    <Data Name="OriginalFileName">-</Data>
    <Data Name="CommandLine">netstat localgroup</Data>
    <Data Name="CurrentDirectory">/tmp</Data>
    <Data Name="User">caldera</Data>
    <Data Name="LogonGuid">{36fe7a82-0000-0000-e803-000000000000}</Data>
    <Data Name="LogonId">1000</Data>
    <Data Name="TerminalSessionId">3</Data>
    <Data Name="IntegrityLevel">no level</Data>
    <Data Name="Hashes">SHA256=7af5f6cda055b65e31298fe20ed4456a87d2ca92803552bc0d3422f0e1a1fda1</Data>
    <Data Name="ParentProcessGuid">{36fe7a82-1381-6743-d526-4b5458550000}</Data>
    <Data Name="ParentProcessId">2249</Data>
    <Data Name="ParentImage">/usr/bin/bash</Data>
    <Data Name="ParentCommandLine">bash</Data>
    <Data Name="ParentUser">caldera</Data>
  </EventData>
</Event>

getent log

Dec 1 12:08:30 caldera-virtual-machine sysmon: 
<Event>
  <System>
    <Provider Name="Linux-Sysmon" Guid="{ff032593-a8d3-4f13-b0d6-01fc615a0f97}"/>
    <EventID>1</EventID>
    <Version>5</Version>
    <Level>4</Level>
    <Task>1</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-12-01T11:08:30.797177000Z"/>
    <EventRecordID>286268</EventRecordID>
    <Correlation/>
    <Execution ProcessID="1258" ThreadID="1258"/>
    <Channel>Linux-Sysmon/Operational</Channel>
    <Computer>caldera-virtual-machine</Computer>
    <Security UserId="0"/>
  </System>
  <EventData>
    <Data Name="RuleName">-</Data>
    <Data Name="UtcTime">2024-11-26 18:51:50.183</Data>
    <Data Name="ProcessGuid">{36fe7a82-18c6-6746-6570-640d07560000}</Data>
    <Data Name="ProcessId">19682</Data>
    <Data Name="Image">/usr/bin/getent</Data>
    <Data Name="FileVersion">-</Data>
    <Data Name="Description">-</Data>
    <Data Name="Product">-</Data>
    <Data Name="Company">-</Data>
    <Data Name="OriginalFileName">-</Data>
    <Data Name="CommandLine">getent group</Data>
    <Data Name="CurrentDirectory">/tmp</Data>
    <Data Name="User">caldera</Data>
    <Data Name="LogonGuid">{36fe7a82-0000-0000-e803-000000000000}</Data>
    <Data Name="LogonId">1000</Data>
    <Data Name="TerminalSessionId">3</Data>
    <Data Name="IntegrityLevel">no level</Data>
    <Data Name="Hashes">SHA256=b8c45799a591949d1728e7177fa14ddb110102dfe20d7b3610ce7f448e7bb902</Data>
    <Data Name="ParentProcessGuid">{36fe7a82-1381-6743-d526-4b5458550000}</Data>
    <Data Name="ParentProcessId">2249</Data>
    <Data Name="ParentImage">/usr/bin/bash</Data>
    <Data Name="ParentCommandLine">bash</Data>
    <Data Name="ParentUser">caldera</Data>
    host = caldera-virtual-machine
    source = Syslog:Linux-Sysmon/Operational
    sourcetype = sysmon_linux
  </EventData>
</Event>

id -Gn log

<Event>
  <System>
    <Provider Name="Linux-Sysmon" Guid="{ff032593-a8d3-4f13-b0d6-01fc615a0f97}"/>
    <EventID>1</EventID>
    <Version>5</Version>
    <Level>4</Level>
    <Task>1</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-12-09T07:17:20.100898000Z"/>
    <EventRecordID>375686</EventRecordID>
    <Correlation/>
    <Execution ProcessID="1252" ThreadID="1252"/>
    <Channel>Linux-Sysmon/Operational</Channel>
    <Computer>caldera-virtual-machine</Computer>
    <Security UserId="0"/>
  </System>
  <EventData>
    <Data Name="RuleName">-</Data>
    <Data Name="UtcTime">2024-12-08 17:03:58.251</Data>
    <Data Name="ProcessGuid">{36fe7a82-d17e-6755-e121-65502e560000}</Data>
    <Data Name="ProcessId">5294</Data>
    <Data Name="Image">/usr/bin/id</Data>
    <Data Name="FileVersion">-</Data>
    <Data Name="Description">-</Data>
    <Data Name="Product">-</Data>
    <Data Name="Company">-</Data>
    <Data Name="OriginalFileName">-</Data>
    <Data Name="CommandLine">id -Gn caldera</Data>
    <Data Name="CurrentDirectory">/home/caldera</Data>
    <Data Name="User">caldera</Data>
    <Data Name="LogonGuid">{36fe7a82-0000-0000-e803-000000000000}</Data>
    <Data Name="LogonId">1000</Data>
    <Data Name="TerminalSessionId">3</Data>
    <Data Name="IntegrityLevel">no level</Data>
    <Data Name="Hashes">SHA256=371021b0c9ab1a3c893ca98b1c648445e3cfe5c6883d9c0a5b1d0339c0d4cd2d</Data>
    <Data Name="ParentProcessGuid">{36fe7a82-6868-6755-d5d6-c908e8550000}</Data>
    <Data Name="ParentProcessId">2352</Data>
    <Data Name="ParentImage">/usr/bin/bash</Data>
    <Data Name="ParentCommandLine">bash</Data>
    <Data Name="ParentUser">caldera</Data>
  </EventData>
</Event>

Fixed Issues

SigmaHQ Rule Creation Conventions

  • If your PR adds new rules, please consider following and applying these conventions

@github-actions github-actions bot added Rules Linux Pull request add/update linux related rules labels Dec 13, 2024
Comment on lines +39 to +41
selection_4:
Image|endswith: '/netstat'
CommandLine|contains: 'localgroup'
Copy link
Member

@nasbench nasbench Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide logs related to the netstat selection with screenshots of expected output.

@nasbench
Copy link
Member

@CheraghiMilad you have to fill the template or this PR will get closed.

As it is stated the changelog and information is mandatory

@nasbench nasbench added the Author Input Required changes the require information from original author of the rules label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author Input Required changes the require information from original author of the rules Linux Pull request add/update linux related rules Rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants