CAPEC-132: Symlink Attack

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

CAPEC版本: 3.9

更新日期: 2023-01-24

攻击模式描述

An adversary positions a symbolic link in such a manner that the targeted user or application accesses the link's endpoint, assuming that it is accessing a file with the link's name.

执行流程

步骤 1 Explore

[Identify Target] Adversary identifies the target application by determining whether there is sufficient check before writing data to a file and creating symlinks to files in different directories.

技术:
  • The adversary writes to files in different directories to check whether the application has sufficient checking before file operations.
  • The adversary creates symlinks to files in different directories.
步骤 2 Experiment

[Try to create symlinks to different files] The adversary then uses a variety of techniques, such as monitoring or guessing to create symlinks to the files accessed by the target application in the directories which are identified in the explore phase.

技术:
  • The adversary monitors the file operations performed by the target application using a tool like dtrace or FileMon. And the adversary can delay the operations by using "sleep(2)" and "usleep()" to prepare the appropriate conditions for the attack, or make the application perform expansive tasks (large files parsing, etc.) depending on the purpose of the application.
  • The adversary may need a little guesswork on the filenames on which the target application would operate.
  • The adversary tries to create symlinks to the various filenames.
步骤 3 Exploit

[Target application operates on created symlinks to sensitive files] The adversary is able to create symlinks to sensitive files while the target application is operating on the file.

技术:
  • Create the symlink to the sensitive file such as configuration files, etc.

前提条件

  • The targeted application must perform the desired activities on a file without checking whether the file is a symbolic link or not. The adversary must be able to predict the name of the file the target application is modifying and be able to create a new symbolic link where that file would appear.

所需技能

Low To create symlinks
High To identify the files and create the symlinks during the file operation time window

所需资源

  • None: No specialized resources are required to execute this type of attack. The only requirement is the ability to create the necessary symbolic link.

后果影响

影响范围: Confidentiality

技术影响: Other

说明: Information Leakage

影响范围: Integrity

技术影响: Modify Data

影响范围: Confidentiality

技术影响: Read Data

影响范围: Integrity

技术影响: Modify Data

影响范围: Authorization

技术影响: Execute Unauthorized Commands

说明: Run Arbitrary Code

影响范围: Accountability Authentication Authorization Non-Repudiation

技术影响: Gain Privileges

影响范围: Access Control Authorization

技术影响: Bypass Protection Mechanism

影响范围: Availability

技术影响: Unreliable Execution

缓解措施

Design: Check for the existence of files to be created, if in existence verify they are neither symlinks nor hard links before opening them.

Implementation: Use randomly generated file names for temporary files. Give the files restrictive permissions.

分类映射

分类名称 条目ID 条目名称
ATTACK 1547.009 Boot or Logon Autostart Execution:Shortcut Modification
关键信息

CAPEC ID: CAPEC-132

抽象级别: Detailed

状态: Draft

典型严重程度: High

攻击可能性: Low

相关攻击模式
相关CWE弱点