コンテンツにスキップ

T1070.003 Clear Command History

T1070.003

必要なテーブル

  • file_events
  • process_events

戻りフィールド

フィールド 説明
timestamp 文字列で表した日付タイムスタンプ
file_events.path ファイルイベントのパス
process_events.path プロセスイベントのパス
provess_events.username プロセスイベントを作成したユーザーのユーザー名

クエリ

SELECT
    FROM_UNIXTIME(unix_nano_timestamp/1e9),
    file_events.path,
    process_events.path,
    process_events.username
FROM file_events
LEFT JOIN (
    SELECT
        path,
        username,
        process_uuid
    FROM process_events
    GROUP BY path, username, process_uuid
) AS process_events
    ON process_events.process_uuid = file_events.process_uuid
WHERE process_events.path != '/usr/bin/dockerd'
    AND (event_type=4 OR event_type=3)
    AND (regexp_like(file_events.path, '/home/.+/\..+_history')
        OR regexp_like(file_events.path, '/root/\..+\.history')
    )
ORDER BY  file_events.unix_nano_timestamp DESC