CAPEC-6: Argument Injection

Standard Draft 严重程度: High 攻击可能性: High

CAPEC版本: 3.9

更新日期: 2023-01-24

攻击模式描述

An attacker changes the behavior or state of a targeted application through injecting data or command syntax through the targets use of non-validated and non-filtered arguments of exposed services or methods.

执行流程

步骤 1 Explore

[Discovery of potential injection vectors] Using an automated tool or manual discovery, the attacker identifies services or methods with arguments that could potentially be used as injection vectors (OS, API, SQL procedures, etc.).

技术:
  • Manually cover the application and record the possible places where arguments could be passed into external systems.
  • Use a spider, for web applications, to create a list of URLs and associated inputs.
步骤 2 Experiment

[1. Attempt variations on argument content] Possibly using an automated tool, the attacker will perform injection variations of the arguments.

技术:
  • Use a very large list of probe strings in order to detect if there is a positive result, and, what type of system has been targeted (if obscure).
  • Use a proxy tool to record results, error messages and/or log if accessible.
步骤 3 Exploit

[Abuse of the application] The attacker injects specific syntax into a particular argument in order to generate a specific malicious effect in the targeted application.

技术:
  • Manually inject specific payload into targeted argument.

前提条件

  • Target software fails to strip all user-supplied input of any content that could cause the shell to perform unexpected actions.
  • Software must allow for unvalidated or unfiltered input to be executed on operating system shell, and, optionally, the system configuration must allow for output to be sent back to client.

所需技能

Medium The attacker has to identify injection vector, identify the operating system-specific commands, and optionally collect the output.

所需资源

  • Ability to communicate synchronously or asynchronously with server. Optionally, ability to capture output directly through synchronous communication or other method such as FTP.

后果影响

影响范围: Confidentiality Access Control Authorization

技术影响: Gain Privileges

影响范围: Integrity

技术影响: Modify Data

影响范围: Confidentiality

技术影响: Read Data

缓解措施

Design: Do not program input values directly on command shell, instead treat user input as guilty until proven innocent. Build a function that takes user input and converts it to applications specific types and values, stripping or filtering out all unauthorized commands and characters in the process.

Design: Limit program privileges, so if metacharacters or other methods circumvent program input validation routines and shell access is attained then it is not running under a privileged account. chroot jails create a sandbox for the application to execute in, making it more difficult for an attacker to elevate privilege even in the case that a compromise has occurred.

Implementation: Implement an audit log that is written to a separate host, in the event of a compromise the audit log may be able to provide evidence and details of the compromise.

示例实例

A recent example instance of argument injection occurred against Java Web Start technology, which eases the client side deployment for Java programs. The JNLP files that are used to describe the properties for the program. The client side Java runtime used the arguments in the property setting to define execution parameters, but if the attacker appends commands to an otherwise legitimate property file, then these commands are sent to the client command shell. [REF-482]

关键信息

CAPEC ID: CAPEC-6

抽象级别: Standard

状态: Draft

典型严重程度: High

攻击可能性: High

相关攻击模式