privesc-nice: Nice - Privilege Escalation

日期: 2025-08-01 | 影响软件: Nice | POC: 已公开

漏洞描述

In Unix-like operating systems, the nice command is used to execute a program with a modified scheduling priority. It allows users to start a process with a specified priority level, which can influence the allocation of CPU resources. This can be useful for managing system resources and controlling the impact of a process on system performance.

PoC代码[已公开]

id: privesc-nice

info:
  name: Nice - Privilege Escalation
  author: daffainfo
  severity: high
  description: |
    In Unix-like operating systems, the nice command is used to execute a program with a modified scheduling priority. It allows users to start a process with a specified priority level, which can influence the allocation of CPU resources. This can be useful for managing system resources and controlling the impact of a process on system performance.
  reference:
    - https://gtfobins.github.io/gtfobins/nice/
  metadata:
    verified: true
    max-request: 3
  tags: code,linux,nice,privesc,local

self-contained: true
code:
  - engine:
      - sh
      - bash
    source: |
      whoami

  - engine:
      - sh
      - bash
    source: |
      nice whoami

  - engine:
      - sh
      - bash
    source: |
      sudo nice whoami

    matchers-condition: and
    matchers:
      - type: word
        part: code_1_response
        words:
          - "root"
        negative: true

      - type: dsl
        dsl:
          - 'contains(code_2_response, "root")'
          - 'contains(code_3_response, "root")'
        condition: or
# digest: 4b0a00483046022100d0b325de2c76d16b5c3097eca32a28f5b5056267a3e48c8e0689d07dcd4c5ee9022100ac3fd1a6f22bc6dc1eefcca2cb9791eec87c4222451f9f434c4ba5e144db4a77:922c64590222798bb761d5b6d8e72950

相关漏洞推荐