LoginSignup
1
0

More than 1 year has passed since last update.

Falco Ruleを紹介するシリーズ - Polkit Local Privilege Escalation Vulnerability (CVE-2021-4034)

Posted at

本シリーズでは、ランタイム脅威検知のデファクトスタンダードであるFalcoの検知Ruleを、1つの記事で1つ簡単に紹介していきます。
ランタイムセキュリティやFalco自体の概要を知りたい方はこちらのブログ記事をご参照ください。
今回ご紹介する検知Ruleは「Polkit Local Privilege Escalation Vulnerability (CVE-2021-4034)」です。

Rule記述

- rule: Polkit Local Privilege Escalation Vulnerability (CVE-2021-4034)
  desc: "This rule detects an attempt to exploit a privilege escalation vulnerability in Polkit's pkexec. By running specially crafted code, a local user can leverage this flaw to gain root privileges on a compromised system"
  condition:
    spawned_process and user.uid != 0 and proc.name=pkexec and proc.args = ''
  output:
    "Detect Polkit pkexec Local Privilege Escalation Exploit (CVE-2021-4034) (user=%user.loginname uid=%user.loginuid command=%proc.cmdline args=%proc.args)"
  priority: CRITICAL
  tags: [process, mitre_privilege_escalation]

Rule概要

プロセス権限を管理するPolkitの一部である、SUIDセットプログラム”pkexec”のローカル特権昇格のバグ(CVE-2021-4034)を利用した攻撃の試みを検知します。
CVE-2021-4034 の詳細についてはこちらのブログ記事をご参照ください。
攻撃者は、引数を渡さずに環境変数を操作することで”pkexec”を騙し、スーパーユーザー権限で任意のコードを読み込んで実行することができますが、このRuleを使うことで検知可能です。

Condition(条件)

spawned_process
新規プロセスが生成され、

user.uid != 0
ユーザーUIDが0(root)ではなく、

and proc.name=pkexec
プロセス名がpkexecで、

proc.args = ''
プロセスの引数が空の場合

Output(出力)

Polkit pkexecのローカル特権昇格の攻撃を検知しました(CVE-2021-4034)

%user.loginname
ユーザーログイン名

%user.loginuid
ユーザーのログインUID

%proc.cmdline
コマンドライン

%proc.args
プロセス引数

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0