-
Notifications
You must be signed in to change notification settings - Fork 68
Credential Access - Rules update #356
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Title: DHCP Network Manipulation and Attack Detection | ||
|
|
||
| # Creation Date: 2025/04/10 | ||
|
|
||
| # MITRE ATT&CK Tactic: TA0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | ||
|
|
||
| # MITRE ATT&CK Technique: T1580 - Adversary-in-the-middle - https://attack.mitre.org/techniques/T1557/002/ | ||
|
|
||
| - name: DHCP Network Discover | ||
| type: Send | ||
| category: credential_access | ||
| severity: low | ||
| description: Detects DHCP starvation attempts by monitoring excessive DISCOVER packets to broadcast addresses. | ||
| Adversaries may exhaust the IP address pool by rapidly requesting many leases using spoofed MAC addresses. | ||
| condition: payload.is_tcp == "false" AND | ||
| (payload.destination.port == 67 OR payload.destination.port == 547) AND | ||
| payload.len <= 400 AND | ||
| payload.destination.ip IN ["255.255.255.255"] | ||
| AND NOT ( | ||
| header.image ENDS_WITH "/dhcpd" OR | ||
| header.image ENDS_WITH "/dhclient" OR | ||
| header.image ENDS_WITH "/dnsmasq" OR | ||
| header.image ENDS_WITH "/isc-dhcp-server" OR | ||
| header.image ENDS_WITH "/NetworkManager" OR | ||
| header.image ENDS_WITH "/systemd-networkd" | ||
| ) | ||
|
|
||
| # DHCP Server Spoofing Detection | ||
| - name: Unauthorized DHCP Server | ||
| type: Bind | ||
| category: credential_access | ||
| severity: medium | ||
| description: Detects processes binding to DHCP server ports, which may indicate rogue DHCP services. | ||
| Adversaries may run malicious DHCP servers to redirect victim network traffic, leading to attacks like man-in-the-middle (MITM) or traffic interception. | ||
| condition: payload.is_tcp == "false" AND | ||
| (payload.address.port == 67 OR payload.address.port == 68 OR payload.address.port == 546 OR payload.address.port == 547) | ||
| AND NOT ( | ||
| header.image ENDS_WITH "/dhcpd" OR | ||
| header.image ENDS_WITH "/dhclient" OR | ||
| header.image ENDS_WITH "/dnsmasq" OR | ||
| header.image ENDS_WITH "/isc-dhcp-server" OR | ||
| header.image ENDS_WITH "/NetworkManager" OR | ||
| header.image ENDS_WITH "/systemd-networkd" | ||
| ) | ||
|
|
||
| # DHCP Attack Tools Detection | ||
| - name: DHCP Attack Tools | ||
| type: Exec | ||
| category: credential_access | ||
| severity: high | ||
| description: Detects execution of known DHCP spoofing tools or suspicious command-line arguments that suggest malicious intent. | ||
| condition: | ||
| payload.filename ENDS_WITH "ettercap" OR | ||
| payload.filename ENDS_WITH "bettercap" OR | ||
| payload.filename ENDS_WITH "yersinia" OR | ||
| payload.filename ENDS_WITH "responder" OR | ||
| payload.filename ENDS_WITH "mitmf" OR | ||
| (payload.argv CONTAINS "dhcp" AND ( | ||
| payload.argv CONTAINS "spoof" OR | ||
| payload.argv CONTAINS "poison" OR | ||
| payload.argv CONTAINS "hijack" OR | ||
| payload.argv CONTAINS "--dhcp" OR | ||
| payload.argv CONTAINS "-dhcp" OR | ||
| payload.argv CONTAINS "--dhcp-spoof" | ||
| )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Title: Archive Collected Data, Archive via Utility | ||
|
|
||
| # Creation date: 2025/04/09 | ||
|
|
||
| # MITRE ATT&CK Tactic: TA0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | ||
|
|
||
| # MITRE ATT&CK Technique: T1560 - Archive via Utility - https://attack.mitre.org/techniques/T1560/001/ | ||
|
|
||
| - name: Sensitive file compression | ||
| type: FileOpened | ||
| category: credential_access | ||
| severity: medium | ||
| description: Identifies the use of a compression utility to collect known files containing sensitive information, such as credentials | ||
| and system configurations. | ||
| condition: (header.image ENDS_WITH "/zip" OR header.image ENDS_WITH "/tar" OR header.image ENDS_WITH "/gzip" | ||
| OR header.image ENDS_WITH "/hdiutil" OR header.image ENDS_WITH "/7z" OR header.image ENDS_WITH "/pigz" | ||
| OR header.image ENDS_WITH "/xz" OR header.image ENDS_WITH "/bzip2") | ||
| AND ( | ||
| payload.filename STARTS_WITH "/root/.ssh/" | ||
| OR payload.filename STARTS_WITH "/root/.bash_history" | ||
| OR payload.filename STARTS_WITH "/root/.aws/" | ||
| OR payload.filename STARTS_WITH "/root/.docker/config" | ||
| OR payload.filename STARTS_WITH "/etc/hosts" | ||
| OR payload.filename STARTS_WITH "/etc/group" | ||
| OR payload.filename STARTS_WITH "/etc/passwd" | ||
| OR payload.filename STARTS_WITH "/etc/shadow" | ||
| OR payload.filename STARTS_WITH "/etc/gshadow" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,44 @@ | ||
| # Title: Create files under /root | ||
| # Title: Creation of Suspicious Files in Restricted Directories | ||
|
|
||
| # Creation date: 2024/04/18 | ||
| # Creation Date: 2022/10/21 | ||
|
|
||
| # MITRE ATT&CK Tactic: TA0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | ||
|
|
||
| # MITRE ATT&CK Technique: T1552.001 - Credentials in Files - https://attack.mitre.org/techniques/T1552/001/ | ||
| # MITRE ATT&CK Technique: TT1552 - Unsecured Credentials - https://attack.mitre.org/techniques/T1552/ | ||
|
|
||
| - name: Create files below /root | ||
| type: FileCreated | ||
| category: credential_access | ||
| severity: medium | ||
| severity: low | ||
| description: Detects the creation of files below /root. Adversaries may create files below /root to gain access to information or to escalate | ||
| privileges. | ||
| condition: payload.filename STARTS_WITH "/root" AND NOT payload.filename IN [ | ||
| "/root/.auth_tokens", | ||
| "/root/.bash_history", | ||
| "/root/.ash_history", | ||
| "/root/.aws/credentials", | ||
| "/root/.viminfo.tmp", | ||
| "/root/.lesshst", | ||
| "/root/.bzr.log", | ||
| "/root/.gitconfig.lock", | ||
| "/root/.babel.json", | ||
| "/root/.localstack", | ||
| "/root/.wget-hsts" | ||
| ] | ||
| condition: payload.filename STARTS_WITH "/root" | ||
| AND NOT ( | ||
| payload.filename IN [ | ||
| "/root/.auth_tokens", | ||
| "/root/.bash_history", | ||
| "/root/.ash_history", | ||
| "/root/.aws/credentials", | ||
| "/root/.viminfo.tmp", | ||
| "/root/.lesshst", | ||
| "/root/.bzr.log", | ||
| "/root/.gitconfig.lock", | ||
| "/root/.babel.json", | ||
| "/root/.localstack", | ||
| "/root/.wget-hsts", | ||
| "/root/.vimrc", | ||
| "/root/.bashrc", | ||
| "/root/.profile", | ||
| "/root/.ssh/authorized_keys", | ||
| "/root/.ssh/known_hosts", | ||
| ] | ||
| OR ( | ||
| payload.filename STARTS_WITH "/root/.config/" OR | ||
| payload.filename STARTS_WITH "/root/.cache/" OR | ||
| payload.filename STARTS_WITH "/root/.docker/") | ||
| OR (header.image IN [ | ||
| "/usr/bin/apt", "/usr/bin/apt-get","/usr/bin/dpkg", "/usr/bin/yum", "/usr/bin/opkg", | ||
| "/usr/bin/pacman", "/usr/bin/rpm", "/usr/bin/zypper", "/usr/bin/emerge", "/usr/bin/nix-env"] | ||
| OR header.image STARTS_WITH "/usr/bin/dnf" | ||
| ) | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Title: Access to AWS Credentials File | ||
|
|
||
| # Creation date: 2025/04/17 | ||
|
|
||
| # MITRE ATT&CK Tactic: TA0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | ||
|
|
||
| # MITRE ATT&CK Technique: T1552.001 - Credentials in Files - https://attack.mitre.org/techniques/T1552/001/ | ||
|
|
||
| - name: Access to AWS credentials file | ||
| type: FileOpened | ||
| category: credential_access | ||
| severity: low | ||
| description: Detects direct access to the AWS credentials file, a common source of cloud access tokens. | ||
| condition: payload.filename ENDS_WITH "/.aws/credentials" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Title: SSH Brute-force via sshpass and credential file | ||
|
|
||
| # Creation date: 2025/04/17 | ||
|
|
||
| # MITRE ATT&CK Tactic: TA0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | ||
|
|
||
| # MITRE ATT&CK Technique: T1110.004 - Credential Stuffing - https://attack.mitre.org/techniques/T1110/004/ | ||
|
|
||
| - name: SSH Brute-force attempt | ||
| type: Exec | ||
| category: credential_access | ||
| severity: medium | ||
| description: Detects usage of sshpass in loops with credential files to brute-force SSH access, typically indicative of credential stuffing or lateral movement testing. | ||
| condition: (header.image ENDS_WITH "sshpass" AND payload.argv CONTAINS "ssh" AND payload.argv CONTAINS "-p") | ||
| OR (payload.filename ENDS_WITH "/hydra" AND payload.argv CONTAINS "-P") | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Title: SSHD Config Tampering | ||
|
|
||
| # Creation Date: 2025/04/09 | ||
|
|
||
| # MITRE ATT&CK Tactic: T0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | ||
|
|
||
| # MITRE ATT&CK Technique: T1098 - Account Manipulation - https://attack.mitre.org/techniques/T1098/ | ||
|
|
||
| - name: SSHD config modification | ||
| type: FileOpened | ||
| category: credential_access | ||
| severity: high | ||
| description: Detects changes to /etc/ssh/sshd_config, which may indicate attempts to bypass authentication controls or enable unauthorized access. | ||
| condition: payload.filename STARTS_WITH "/etc/ssh/sshd_config" | ||
| AND (payload.flags CONTAINS "O_WRONLY" OR payload.flags CONTAINS "O_RDWR") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe should be
NOT