Skip to content

Credential Access - Rules update - #356

Merged
banditopazzo merged 6 commits into
mainfrom
new-rules/credential_access
Jul 14, 2025
Merged

Credential Access - Rules update#356
banditopazzo merged 6 commits into
mainfrom
new-rules/credential_access

Conversation

@paolo9921

Copy link
Copy Markdown
Contributor

Credential Access - Rules update

  • Audit existing rules
  • Implement new rules

MITRE Tactic: Credential Access

I have

  • run cargo fmt;
  • run cargo clippy;
  • run cargo testand all tests pass;
  • linked to the originating issue (if applicable).

@paolo9921
paolo9921 requested review from banditopazzo and krsh July 2, 2025 08:17
@paolo9921
paolo9921 force-pushed the new-rules/credential_access branch from b5efb08 to 46d4d4e Compare July 11, 2025 10:34

@banditopazzo banditopazzo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please take a look a the review. I added also a few questions


- name: Network Connection to IMDS API
type: Connect
category: discovery

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it discovery or credential_access?

- name: Read SSH information
type: FileOpened
category: credential_access
category: execution

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it credential_access or execution?


- name: DHCP Network Discover
type: Send
category: impact

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it impact or credential_access?

payload.filename STARTS_WITH "/root/.cache/" OR
payload.filename STARTS_WITH "/root/.docker/")
)
OR (header.image IN [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe should be NOT

condition: header.image ENDS_WITH "/unshadow" AND payload.argc >= 2 No newline at end of file
condition: header.image ENDS_WITH "/unshadow" AND payload.argc >= 2

- name: strace execution with specific arguments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe the rule name should contain reference to init or pid 1


- name: Create sensitive files symlink
type: FileLink
category: execution

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why execution category?


- name: Create sensitive files hardlink
type: FileLink
category: execution

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why execution category?

Comment on lines +15 to +20
condition: (payload.destination IN ["/etc/shadow", "/etc/sudoers", "/etc/pam.conf", "/etc/security/pwquality.conf"] OR payload.destination STARTS_WITH "/etc/sudoers.d/" OR payload.destination STARTS_WITH "/etc/pam.d") AND payload.hard_link == "false"
condition: (
(payload.destination ENDS_WITH "/etc/shadow" OR
payload.destination ENDS_WITH "/etc/sudoers" OR
payload.destination ENDS_WITH "/etc/pam.conf" OR
payload.destination ENDS_WITH "/etc/security/pwquality.conf")
OR payload.destination STARTS_WITH "/etc/sudoers.d/" OR payload.destination STARTS_WITH "/etc/pam.d") AND payload.hard_link == "false"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the previous IN was more efficient and the new ENDS_WITH doesn't add any additional benefit

Comment on lines +23 to +32
condition: (payload.destination IN ["/etc/shadow", "/etc/sudoers", "/etc/pam.conf", "/etc/security/pwquality.conf"] OR payload.destination STARTS_WITH "/etc/sudoers.d/" OR payload.destination STARTS_WITH "/etc/pam.d") AND payload.hard_link == "true"
condition: (
(payload.destination ENDS_WITH "/etc/shadow" OR
payload.destination ENDS_WITH "/etc/sudoers" OR
payload.destination ENDS_WITH "/etc/pam.conf" OR
payload.destination ENDS_WITH "/etc/security/pwquality.conf")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the previous IN was more efficient and the new ENDS_WITH doesn't add any additional benefit

@banditopazzo
banditopazzo merged commit 02899d7 into main Jul 14, 2025
30 checks passed
@banditopazzo
banditopazzo deleted the new-rules/credential_access branch July 22, 2025 15:12
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.

2 participants