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

fpr: regex bug fix; lots of fprs #453

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions detection/c2/unexpected-dns-traffic-events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ WHERE
'msedge,8.8.8.8,53',
'node,149.22.90.225,5353',
'nuclei,1.0.0.1,53',
'ollama,104.21.75.227,53', -- registry.olama.ai (2025-01-27)
'Pieces OS,208.67.222.222,53',
'Pieces OS,8.8.4.4,53',
'plugin-container,8.8.8.8,53',
Expand Down
1 change: 1 addition & 0 deletions detection/evasion/hidden-executable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ WHERE
'~/node_modules/.bin',
'~/thinkorswim/.install4j'
)
AND NOT f.directory = '/nix/store/.links'
AND NOT f.directory LIKE '%/.terraform/%'
AND NOT f.directory LIKE '%/anchore/grype/.tool%'
AND NOT f.directory LIKE '%/Applications/PSI Bridge Secure Browser.app/Contents/Resources/.apps/darwin/%'
Expand Down
3 changes: 2 additions & 1 deletion detection/evasion/parent-missing-from-disk-linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ WHERE
AND p1.cgroup_path NOT LIKE '/system.slice/docker-%'
AND p1.cgroup_path NOT IN (
'/system.slice/containerd.service',
'/system.slice/docker.service'
'/system.slice/docker.service',
'/system.slice/gdm.service'
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like an extremely special case - maybe add the binary path instead?

)
AND p1.cgroup_path NOT LIKE '/lxc.monitor.n%'
AND p1.cgroup_path NOT LIKE '/user.slice/user-1000.slice/[email protected]/app.slice/app-steam@%'
Expand Down
4 changes: 3 additions & 1 deletion detection/evasion/unexpected-hidden-system-paths.sql
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ WHERE
'/lib/jvm/.java-1.17.0-openjdk-amd64.jinfo',
'/tmp/._contentbarrier_installed',
'/tmp/.accounts-agent/',
'/tmp/.aqua/',
Copy link
Contributor

Choose a reason for hiding this comment

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

Any context?

'/tmp/.audio-agent/',
'/tmp/.bazelci/',
'/tmp/.BBE72B41371180178E084EEAF106AED4F350939DB95D3516864A1CC62E7AE82F', -- Xcode
Expand Down Expand Up @@ -221,7 +222,8 @@ WHERE
AND file.path NOT LIKE '/tmp/.%.gcode'
AND file.path NOT LIKE '/tmp/.cdx.json%'
AND file.path NOT LIKE '/tmp/.com.google.Chrome.%'
AND file.path NOT LIKe '/tmp/.com.microsoft.Edge.%'
AND file.path NOT LIKE '/tmp/.com.microsoft.Edge.%'
AND file.path NOT LIKE '/tmp/.com.valvesoftware.Steam.%/'
AND file.path NOT LIKE '/tmp/.dropbox-dist-%'
AND file.path NOT LIKE '/tmp/.io.nwjs.%'
AND file.path NOT LIKE '/tmp/.lark_cache_%'
Expand Down
4 changes: 4 additions & 0 deletions detection/execution/unexpected-chmod-exec-event-linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ WHERE
AND cmdline NOT LIKE 'chmod +x /home/%/bin/%'
AND cmdline NOT LIKE '%chmod 755 /home/%/.local/share/cinnamon/applets/download-and-upload-speed@cardsurf/translation.sh'
)
AND NOT (
f_path = '/usr/local/bin/kubectl'
AND f_mode = '0755'
)
AND pe.time > (strftime('%s', 'now') -300)
AND pe.syscall = "execve"
AND f.type != 'directory'
Expand Down
4 changes: 4 additions & 0 deletions detection/execution/unexpected-executable-permissions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ WHERE
f.path LIKE '/home/%/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox'
AND f.mode = '0744'
)
AND NOT (
f.path LIKE '/home/%/.cache/JetBrains/%/semantic-search/server/%/embeddings-server'
AND f.mode = '0764'
)
AND NOT (
f.path LIKE '/Users/%/Applications (Parallels)/%.app/Contents/MacOS/WinAppHelper'
AND f.mode = '0777'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SELECT
signature.identifier,
signature.authority,
ea.value AS url,
REGEX_MATCH (ea.value, '/[\w_-]+\.([\w\._-]+)[:/]', 1) AS domain,
REGEX_MATCH (ea.value, '/([\w-]+\.[\w-]+)(?=[:/]|$)', 1) AS domain,
tstromberg marked this conversation as resolved.
Show resolved Hide resolved
REGEX_MATCH (ea.value, '/([\w_-]+\.[\w\._-]+)[:/]', 1) AS host
FROM
mdfind
Expand Down Expand Up @@ -95,6 +95,7 @@ WHERE
'google.ca',
'google.com',
'grammarly.com',
'granola.ai',
'imazing.com',
'integodownload.com',
'irccloud.com',
Expand Down Expand Up @@ -130,6 +131,7 @@ WHERE
'overwolf.com',
'pathofexile.com',
'perforce.com',
'plugable.com',
'poecdn.com',
'pqrs.org',
'proxmox.com',
Expand Down Expand Up @@ -228,6 +230,7 @@ WHERE
'openai.com',
'packages.openvpn.net',
'persistent.oaistatic.com',
'plugable.com',
'portswigger-cdn.net',
'posit.co',
'prerelease.keybase.io',
Expand Down Expand Up @@ -258,6 +261,7 @@ WHERE
'wavebox.io',
'welcome.adguard.com',
'www.google.com',
'www.granola.ai',
'www.messenger.com',
'www.raycast.com',
'www.talos.dev',
Expand Down
1 change: 1 addition & 0 deletions detection/persistence/listening-from-unusual-location.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ WHERE
'node',
'nuclei',
'ollama',
'ping',
'qemu-system-aarch64',
'qemu-system-x86',
'rootlessport',
Expand Down
5 changes: 5 additions & 0 deletions detection/persistence/unexpected-listening-port-macos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ WHERE
signature.authority = 'Developer ID Application: Microsoft Corporation (UBF8T346G9)'
AND lp.port > 5000
)
AND NOT (
signature.authority = 'Developer ID Application: OpenAI, L.L.C. (2DC432GLL2)'
AND lp.port > 5000
AND lp.protocol = 6
)
AND NOT (
exception_key LIKE '%,6,500,IPNExtension,Apple Mac OS Application Signing'
AND lp.port > 5000
Expand Down
5 changes: 4 additions & 1 deletion detection/privesc/unexpected-privilege-escalation_linux.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ WHERE
)
AND NOT (
p0.name = 'fusermount3'
AND p1.path = '/usr/lib/xdg-document-portal'
AND p1.path IN (
'/usr/lib/xdg-document-portal',
'/usr/libexec/xdg-document-portal'
)
)
AND NOT (
p0.path = '/usr/bin/pkexec'
Expand Down
Loading