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

Add rule for device driver discovery #5113

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

Conversation

CheraghiMilad
Copy link
Contributor

@CheraghiMilad CheraghiMilad commented Dec 8, 2024

Summary of the Pull Request

This rule detects the use of commands such as 'lsmod' and 'modinfo' for device driver discovery on Linux systems.

Changelog

Example Log Event

dmesg 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-08T09:48:20.375109000Z"/>
        <EventRecordID>364496</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 09:48:21.265</Data>
        <Data Name="ProcessGuid">{36fe7a82-6b65-6755-316c-de2afe550000}</Data>
        <Data Name="ProcessId">2884</Data>
        <Data Name="Image">/usr/bin/dmesg</Data>
        <Data Name="FileVersion">-</Data>
        <Data Name="Description">-</Data>
        <Data Name="Product">-</Data>
        <Data Name="Company">-</Data>
        <Data Name="OriginalFileName">-</Data>
        <Data Name="CommandLine">dmesg</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=541c7a0f0e41098205751d19196ca78eed3e399b09807bad2fccacc0ca2e5f43</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>

modinfo 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-08T09:37:08.656012000Z"/>
        <EventRecordID>364455</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 09:37:09.548</Data>
        <Data Name="ProcessGuid">{36fe7a82-68c5-6755-b508-16649d550000}</Data>
        <Data Name="ProcessId">2846</Data>
        <Data Name="Image">/usr/bin/kmod</Data>
        <Data Name="FileVersion">-</Data>
        <Data Name="Description">-</Data>
        <Data Name="Product">-</Data>
        <Data Name="Company">-</Data>
        <Data Name="OriginalFileName">-</Data>
        <Data Name="CommandLine">modinfo /usr/lib/modules/5.15.0-124-generic/kernel/mm/z3fold.ko</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=b053785f6308f16a0d3259c4f925a78b761ff5e922b2529079a579581a82cfca</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>

lsmod 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-08T09:35:53.221560000Z"/>
        <EventRecordID>364185</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 09:35:54.116</Data>
        <Data Name="ProcessGuid">{36fe7a82-687a-6755-b5d8-0937a6550000}</Data>
        <Data Name="ProcessId">2567</Data>
        <Data Name="Image">/usr/bin/kmod</Data>
        <Data Name="FileVersion">-</Data>
        <Data Name="Description">-</Data>
        <Data Name="Product">-</Data>
        <Data Name="Company">-</Data>
        <Data Name="OriginalFileName">-</Data>
        <Data Name="CommandLine">lsmod</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=b053785f6308f16a0d3259c4f925a78b761ff5e922b2529079a579581a82cfca</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>

device driver discovery

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 8, 2024
@nasbench nasbench added Work In Progress Some changes are needed Author Input Required changes the require information from original author of the rules labels Dec 8, 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 Work In Progress Some changes are needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants