[BUG] Elevated Group Discovery with PowerView: the test sample windows-xml.log is declared as Sysmon but holds Security events

Open Beginner friendly
#4,418 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
powershell, yaml

Research direction

Start in the tests block of detections/endpoint/elevated_group_discovery_with_powerview.yml and compare the second attack_data entry with the descriptor in datasets/attack_techniques/T1069.002/AD_discovery/AD_discovery.yml, which declares windows-xml.log as XmlWinEventLog:Security. Run the grep commands from the issue on windows-xml.log to confirm it holds only Security 5145 events. Done means the second sample's source matches Security, or the sample is removed because the rule searches for event 4104 and the file has none; check which option the maintainers prefer before editing.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

In the tests block of detections/endpoint/elevated_group_discovery_with_powerview.yml (id 10d62950-0de5-4199-a710-cff9ea79b413, version 11), the second sample is declared as a Sysmon log. The file holds Security events, and the descriptor in attack_data says so.

tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1069.002/AD_discovery/windows-powershell-xml-powerview.log
          source: XmlWinEventLog:Microsoft-Windows-PowerShell/Operational
          sourcetype: XmlWinEventLog
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1069.002/AD_discovery/windows-xml.log
          source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
          sourcetype: XmlWinEventLog

The file datasets/attack_techniques/T1069.002/AD_discovery/windows-xml.log holds 8 events. All 8 are Security event 5145 (a network share object was checked), on the Security channel. The file has no mention of the Sysmon provider.

$ grep -o '<Channel>[^<]*</Channel>' windows-xml.log | sort | uniq -c
      8 <Channel>Security</Channel>
$ grep -o '<EventID>[0-9]*</EventID>' windows-xml.log | sort | uniq -c
      8 <EventID>5145</EventID>

The descriptor datasets/attack_techniques/T1069.002/AD_discovery/AD_discovery.yml in attack_data declares the same file as XmlWinEventLog:Security:

- name: windows-xml
  path: /datasets/attack_techniques/T1069.002/AD_discovery/windows-xml.log
  sourcetype: XmlWinEventLog
  source: XmlWinEventLog:Security

The rule itself searches PowerShell script block logging (powershell macro, EventCode=4104, data_source: Powershell Script Block Logging 4104). The first sample, windows-powershell-xml-powerview.log, holds 15 events, all 4104 on Microsoft-Windows-PowerShell/Operational. The second sample holds no event 4104.

Expected behavior

The source of each sample should name the log the file holds. For windows-xml.log that is XmlWinEventLog:Security.

Suggested change: change the source of the second sample to XmlWinEventLog:Security. Or remove the second sample, because the rule searches event 4104 and the file holds none.

Screenshots

None.

App Version:
  • ESCU: 6.10.0 (the tests block is the same in release v6.10.0 and on develop)
  • Splunk Security Essentials: Not applicable
Additional context

None.

Dominant language
Python
Stars
1.7k
Forks
507
Avg merge
2d 17h
Merged PRs (30d)
35

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from splunk/security_content

All issues in splunk/security_content

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.