| Attack Pattern ID | Pattern Abstraction: Detailed 40 |
| Typical Severity | Very High |
| Description | Summary This attack exploits terminal devices that allow themselves to be written to by other users. The attacker sends command strings to the target terminal device hoping that the target user will hit enter and thereby execute the malicious command with their privileges. The attacker can send the results (such as copying /etc/passwd) to a known directory and collect once the attack has succeeded.
|
| Attack Prerequisites | User terminals must have a permissive access control such as world writeable that allows normal users to control data on other user's terminals.
|
| Typical Likelihood of Exploit |
High
|
| Methods of Attack | |
| Examples-Instances | Description Any system that allows other peers to write directly to its terminal process is vulnerable to this type of attack. If the terminals are available through being overprivileged (i.e. world-writable) or the attacker is an administrator, then a series of commands in this format can be used to echo commands out to victim terminals. "$echo -e "\033[30m\033\132" >> /dev/ttyXX where XX is the tty number of the user under attack. This will paste the characters to another terminal (tty). Note this technique works only if the victim's tty is world writable (which it may not be). That is one reason why programs like write(1) and talk(1) in UNIX systems need to run setuid." [Hoglund and McGraw 04] If the victim continues to hit "enter" and execute the commands, there are an endless supply of vectors available to the attacker, copying files, open up network connections, ftp out to servers, and so on.
|
| Attacker Skill or Knowledge Required |
Low
|
| Resources Required |
Access to a terminal on the target network
|
| Solutions and Mitigations |
Design: Ensure that terminals are only writeable by named owner user and/or administrator
Design: Enforce principle of least privilege
|
| Attack Motivation-Consequences | - Privilege Escalation
- Information Leakage
- Run Arbitrary Code
|
| Injection Vector |
Payload delivered through standard user terminal.
|
| Payload |
Command(s) executed directly on host, in other victim's terminal
|
| Activation Zone |
Multi-user host
|
| Payload Activation Impact |
Enables attacker to execute server side code with any commands that the program owner has privileges to.
|
| Related Weaknesses | | CWE-ID | Weakness Name | Weakness Relationship Type |
|---|
| 306 | No Authentication for Critical Function | Targeted | | 74 | Failure to Sanitize Data into a Different Plane (aka 'Injection') | Targeted |
|
| Purpose | Exploitation |
| CIA Impact | | Confidentiality Impact | Integrity Impact | Availability Impact |
|---|
| High | High | Low |
|
| Technical Context | | Architectural Paradigm | Framework | Platform | Language |
|---|
| Mainframe | Other | UNIX-LINUX | All |
|
| References |
G. Hoglund and G. McGraw. Exploiting Software: How to Break Code. Addison-Wesley, February 2004.
|
| Source | | Submission(s) |
|---|
| Submitter | Organization | Date | Comment |
|---|
| G. Hoglund and G. McGraw. Exploiting Software: How to Break Code. Addison-Wesley, February 2004. | Cigital, Inc | 2007-01-01 | |
| Modification(s) |
|---|
| Modifier | Organization | Date | Comment |
|---|
| Gunnar Peterson | Cigital, Inc | 2007-02-28 | Fleshed out content to CAPEC schema from the original descriptions in "Exploiting Software" | | Sean Barnum | Cigital, Inc | 2007-03-09 | Review and revise | | Richard Struse | VOXEM, Inc | 2007-03-26 | Review and feedback leading to changes in Name, Description and Examples | | Sean Barnum | Cigital, Inc | 2007-04-13 | Modified pattern content according to review and feedback |
|