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

Regex Changes fpr msauth #129

Closed
wants to merge 0 commits into from
Closed

Regex Changes fpr msauth #129

wants to merge 0 commits into from

Conversation

ervet
Copy link

@ervet ervet commented May 2, 2018

Changed the regex as suggested here ...

#125 ... Works perfectly for German Version. Try to check more language version clients soon.

@frgv frgv requested a review from jesuslinares May 4, 2018 14:14
@jesuslinares
Copy link
Contributor

Hi @ervet ,

We already added the PR #125.

So, your change would be:
from:

ID:\s+%{S-1-1-0}| ID:\s+S-1-1-0

to:

ID:\s+%{S-1-1-0}|\s*ID:\s+S-1-1-0

The \s* is not really needed because both regexes are going to match if there is at least one space before "ID".

Thanks,
Jesus.

@ervet
Copy link
Author

ervet commented May 16, 2018 via email

@jesuslinares
Copy link
Contributor

Hi @ervet,

OK, I see your point, the goal is to capture Security ID: and Sicherheits-ID:. I will check it.

Thanks!.
Jesus.

@jesuslinares jesuslinares reopened this May 16, 2018
@jesuslinares jesuslinares requested review from SitoRBJ and removed request for jesuslinares June 25, 2018 13:21
@jesuslinares jesuslinares self-assigned this Jun 25, 2018
@SitoRBJ
Copy link
Contributor

SitoRBJ commented Jul 13, 2018

Hello @ervet,

We have been testing the rules and they are right, great job. We greatly appreciate the efforts and contributions the community makes to help us improve.

We have to consider the option of also changing the decoders because even if the rules work well and are activated correctly, the information we get in the decoder is wrong and we should check it.

For example:

  • Security ID:
2018 Jul 07 00:11:46 WinEvtLog: Security: AUDIT_SUCCESS(4732): Microsoft-Windows-Security-Auditing: (no user): no domain: Sanitized: A member was added to a security-enabled local group.    Subject:   Security ID:  S-1-5-18   Account Name:  SANITIZED$   Account Domain:  SANITIZED   Logon ID:  0x3E7    Member:   Security ID:  S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx   Account Name:  -    Group:   Security ID:  S-1-5-32-544   Group Name:  Administrators   Group Domain:  Builtin    Additional Information:   Privileges:  -


**Phase 1: Completed pre-decoding.
       full event: '2018 Jul 07 00:11:46 WinEvtLog: Security: AUDIT_SUCCESS(4732): Microsoft-Windows-Security-Auditing: (no user): no domain: Sanitized: A member was added to a security-enabled local group.    Subject:   Security ID:  S-1-5-18   Account Name:  SANITIZED$   Account Domain:  SANITIZED   Logon ID:  0x3E7    Member:   Security ID:  S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx   Account Name:  -    Group:   Security ID:  S-1-5-32-544   Group Name:  Administrators   Group Domain:  Builtin    Additional Information:   Privileges:  -'
       timestamp: '2018 Jul 07 00:11:46'
       hostname: 'manager'
       program_name: 'WinEvtLog'
       log: 'Security: AUDIT_SUCCESS(4732): Microsoft-Windows-Security-Auditing: (no user): no domain: Sanitized: A member was added to a security-enabled local group.    Subject:   Security ID:  S-1-5-18   Account Name:  SANITIZED$   Account Domain:  SANITIZED   Logon ID:  0x3E7    Member:   Security ID:  S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx   Account Name:  -    Group:   Security ID:  S-1-5-32-544   Group Name:  Administrators   Group Domain:  Builtin    Additional Information:   Privileges:  -'

**Phase 2: Completed decoding.
       decoder: 'windows'
       type: 'Security'
       status: 'AUDIT_SUCCESS'
       id: '4732'
       extra_data: 'Microsoft-Windows-Security-Auditing'
       dstuser: '(no user)'
       system_name: 'Sanitized'
       subject.security_id: 'S-1-5-18'
       subject.account_name: 'SANITIZED$'
       subject.account_domain: 'SANITIZED'
       subject.logon_id: '0x3E7'
       security_id: 'S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx'
       account_domain: 'SANITIZED'

**Phase 3: Completed filtering (rules).
       Rule id: '18217'
       Level: '12'
       Description: 'Windows: Administrators Group Changed'
       Info - Text: 'http://support.microsoft.com/kb/243330'
**Alert to be generated.

  • Security-ID:
2018 Jul 07 00:11:46 WinEvtLog: Security: AUDIT_SUCCESS(4732): Microsoft-Windows-Security-Auditing: (no user): no domain: Sanitized: A member was added to a security-enabled local group.    Subject:   Security-ID:  S-1-5-18   Account Name:  SANITIZED$   Account Domain:  SANITIZED   Logon ID:  0x3E7    Member:   Security-ID:  S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx   Account Name:  -    Group:   Security-ID:  S-1-5-32-544   Group Name:  Administrators   Group Domain:  Builtin    Additional Information:   Privileges:  -


**Phase 1: Completed pre-decoding.
       full event: '2018 Jul 07 00:11:46 WinEvtLog: Security: AUDIT_SUCCESS(4732): Microsoft-Windows-Security-Auditing: (no user): no domain: Sanitized: A member was added to a security-enabled local group.    Subject:   Security-ID:  S-1-5-18   Account Name:  SANITIZED$   Account Domain:  SANITIZED   Logon ID:  0x3E7    Member:   Security-ID:  S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx   Account Name:  -    Group:   Security-ID:  S-1-5-32-544   Group Name:  Administrators   Group Domain:  Builtin    Additional Information:   Privileges:  -'
       timestamp: '2018 Jul 07 00:11:46'
       hostname: 'manager'
       program_name: 'WinEvtLog'
       log: 'Security: AUDIT_SUCCESS(4732): Microsoft-Windows-Security-Auditing: (no user): no domain: Sanitized: A member was added to a security-enabled local group.    Subject:   Security-ID:  S-1-5-18   Account Name:  SANITIZED$   Account Domain:  SANITIZED   Logon ID:  0x3E7    Member:   Security-ID:  S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx   Account Name:  -    Group:   Security-ID:  S-1-5-32-544   Group Name:  Administrators   Group Domain:  Builtin    Additional Information:   Privileges:  -'

**Phase 2: Completed decoding.
       decoder: 'windows'
       type: 'Security'
       status: 'AUDIT_SUCCESS'
       id: '4732'
       extra_data: 'Microsoft-Windows-Security-Auditing'
       dstuser: '(no user)'
       system_name: 'Sanitized'
       account_name: 'SANITIZED$'
       account_domain: 'SANITIZED'

**Phase 3: Completed filtering (rules).
       Rule id: '18217'
       Level: '12'
       Description: 'Windows: Administrators Group Changed'
       Info - Text: 'http://support.microsoft.com/kb/243330'
**Alert to be generated.

As we can see, in both cases we get the same rule activated in front of each event, but in phase two "complete decoding" we do not get the information correctly when we have a dash. This is because of the decoders.

For example:

<decoder name="windows_fields">
  <type>windows</type>
  <parent>windows</parent>
  <regex>Subject\s*:\t*\s*Security ID:\t*\s*(\S\S+)\t*\s*Account Name:\t*\s*(\S\S+)\t*\s*Account Domain:\t*\s*(\S\S+)\t*\s*Logon ID:\t*\s*(\S\S+)</regex>
  <order>subject.security_id, subject.account_name, subject.account_domain, subject.logon_id</order>
</decoder>

<decoder name="windows_fields">
  <type>windows</type>
  <parent>windows</parent>
  <regex offset="after_regex">Security ID:\t*\s*(\S\S+)</regex>
  <order>security_id</order>
</decoder>

Most probably we will merge this PR with a parallel branch that we will create specifically. Then we will change the decoders and merge the branch with the Master. We can not say for sure because in the future we will get the windows events in JSON format and the obtaining of each field will be trivial, facilitating and improving the functioning of the ruleset #905.

Thank you very much for your collaboration.

Kind regards,

Alfonso Ruiz-Bravo

@SitoRBJ SitoRBJ changed the base branch from master to 3.7 September 12, 2018 09:42
@jesuslinares jesuslinares requested review from jesuslinares and migruiz4 and removed request for SitoRBJ October 16, 2018 12:57
@Lopuiz Lopuiz changed the base branch from 3.7 to 3.10 June 17, 2019 16:19
@Lopuiz Lopuiz requested a review from bah07 June 21, 2019 10:55
@vikman90 vikman90 changed the base branch from 3.10 to develop July 31, 2020 12:13
@vikman90 vikman90 changed the base branch from develop to master September 25, 2020 08:22
@ervet ervet closed this Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants