Unusually small programs (state-based)


Query · osquery

-- Unusually small programs (state-based)
--
-- references:
--   * https://cybersecurity.att.com/blogs/labs-research/shikitega-new-stealthy-malware-targeting-linux
--
-- tags: transient process state
SELECT
  p.pid,
  p.path,
  p.cmdline,
  file.size,
  p.start_time,
  file.mode,
  file.type,
  p.cwd,
  p.euid,
  p.parent,
  pp.path AS parent_path,
  pp.name AS parent_name,
  pp.cmdline AS parent_cmdline,
  pp.euid AS parent_euid,
  hash.sha256 AS parent_sha256
FROM
  processes p
  LEFT JOIN file ON p.path = file.path
  LEFT JOIN processes pp ON p.parent = pp.pid
  LEFT JOIN hash ON pp.path = hash.path
WHERE
  file.size > 0
  AND file.size < 10000
  AND NOT file.path LIKE '/home/%/.local/share/Steam/steamapps/%'
  AND NOT file.path LIKE '/home/%/.local/share/Steam/ubuntu%'
  AND NOT file.path LIKE '/home/%/.zsh/completion'
  AND NOT file.path LIKE '/Users/%/.zsh/completion'
  AND NOT file.path IN (
    '/',
    '/usr/bin/ruby',
    '/Applications/OpenOffice.app/Contents/MacOS/soffice'
  )
  AND NOT (
    file.path = '/sbin/ldconfig'
    AND pp.euid = 1000
  )
  AND NOT (
    file.path LIKE '/home/%/.ape-%'
    AND pp.euid = 1000
  )
Raw source Unusually small programs (state-based) · osquery SQL
Esc
Published by chainguard-dev/osquery-defense-kit ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
-- Unusually small programs (state-based)
--
-- references:
--   * https://cybersecurity.att.com/blogs/labs-research/shikitega-new-stealthy-malware-targeting-linux
--
-- tags: transient process state
SELECT
  p.pid,
  p.path,
  p.cmdline,
  file.size,
  p.start_time,
  file.mode,
  file.type,
  p.cwd,
  p.euid,
  p.parent,
  pp.path AS parent_path,
  pp.name AS parent_name,
  pp.cmdline AS parent_cmdline,
  pp.euid AS parent_euid,
  hash.sha256 AS parent_sha256
FROM
  processes p
  LEFT JOIN file ON p.path = file.path
  LEFT JOIN processes pp ON p.parent = pp.pid
  LEFT JOIN hash ON pp.path = hash.path
WHERE
  file.size > 0
  AND file.size < 10000
  AND NOT file.path LIKE '/home/%/.local/share/Steam/steamapps/%'
  AND NOT file.path LIKE '/home/%/.local/share/Steam/ubuntu%'
  AND NOT file.path LIKE '/home/%/.zsh/completion'
  AND NOT file.path LIKE '/Users/%/.zsh/completion'
  AND NOT file.path IN (
    '/',
    '/usr/bin/ruby',
    '/Applications/OpenOffice.app/Contents/MacOS/soffice'
  )
  AND NOT (
    file.path = '/sbin/ldconfig'
    AND pp.euid = 1000
  )
  AND NOT (
    file.path LIKE '/home/%/.ape-%'
    AND pp.euid = 1000
  )

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.