Dark Mode

Settings

Capec-88 Detail

OS Command Injection

Standard Software Likelihood: High Typical Severity: High

Parents: 248

Threats: T290

Description

In this type of an attack, an adversary injects operating system commands into existing application functions. An application that uses untrusted input to build command strings is vulnerable. An adversary can leverage OS command injection in an application to elevate privileges, execute arbitrary commands and compromise the underlying operating system.

Not present

External ID Source Link Description
CAPEC-88 capec https://capec.mitre.org/data/definitions/88.html
CWE-78 cwe http://cwe.mitre.org/data/definitions/78.html
CWE-88 cwe http://cwe.mitre.org/data/definitions/88.html
CWE-20 cwe http://cwe.mitre.org/data/definitions/20.html
CWE-697 cwe http://cwe.mitre.org/data/definitions/697.html
31 WASC http://projects.webappsec.org/OS-Commanding OS Commanding
REF-543 reference_from_CAPEC http://secunia.com/advisories/16869/ Secunia Advisory SA16869: Firefox Command Line URL Shell Command Injection, Secunia Advisories, 2005--09---20, Secunia
Explore
  1. Identify inputs for OS commands: The attacker determines user controllable input that gets passed as part of a command to the underlying operating system.

  2. Techniques
    Port mapping. Identify ports that the system is listening on, and attempt to identify inputs and protocol types on those ports.
    TCP/IP Fingerprinting. The attacker uses various software to make connections or partial connections and observe idiosyncratic responses from the operating system. Using those responses, they attempt to guess the actual operating system.
    Induce errors to find informative error messages
  3. Survey the Application: The attacker surveys the target application, possibly as a valid and authenticated user

  4. Techniques
    Spidering web sites for all available links
    Inventory all application inputs
Experiment
  1. Vary inputs, looking for malicious results.: Depending on whether the application being exploited is a remote or local one the attacker crafts the appropriate malicious input, containing OS commands, to be passed to the application

  2. Techniques
    Inject command delimiters using network packet injection tools (netcat, nemesis, etc.)
    Inject command delimiters using web test frameworks (proxies, TamperData, custom programs, etc.)
Exploit
  1. Execute malicious commands: The attacker may steal information, install a back door access mechanism, elevate privileges or compromise the system in some other way.

  2. Techniques
    The attacker executes a command that stores sensitive information into a location where they can retrieve it later (perhaps using a different command injection).
  1. User controllable input used as part of commands to the underlying operating system.

Not present

High
The attacker needs to have knowledge of not only the application to exploit but also the exact nature of commands that pertain to the target operating system. This may involve, though not always, knowledge of specific assembly commands for the platform.
Integrity Availability Authorization Access Control Confidentiality
Execute Unauthorized Commands (Run Arbitrary Code) Execute Unauthorized Commands (Run Arbitrary Code) Gain Privileges Gain Privileges Execute Unauthorized Commands (Run Arbitrary Code)
Bypass Protection Mechanism Bypass Protection Mechanism Gain Privileges
Bypass Protection Mechanism
Read Data
  1. A transaction processing system relies on code written in a number of languages. To access this functionality, the system passes transaction information on the system command line. An attacker can gain access to the system command line and execute malicious commands by injecting these commands in the transaction data. If successful, the attacker can steal information, install backdoors and perform other nefarious activities that can compromise the system and its data.See also: A vulnerability in Mozilla Firefox 1.x browser allows an attacker to execute arbitrary commands on the UNIX/Linux operating system. The vulnerability is caused due to the shell script used to launch Firefox parsing shell commands that are enclosed within back-ticks in the URL provided via the command line. This can be exploited to execute arbitrary shell commands by tricking a user into following a malicious link in an external application which uses Firefox as the default browser (e.g. the mail client Evolution on Red Hat Enterprise Linux 4).