Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 2.61 KB

8-NTFS-Streams.md

File metadata and controls

49 lines (31 loc) · 2.61 KB

Hiding Files using NTFS streams

A stream consists of data associated with a main file directory (known as the main unnamed stream). Each file and directory in NTFS can have multiple data streams that are generally hidden from the user.

https://docs.microsoft.com/en-us/sysinternals/downloads/streams

NTFS supersedes the FAT file system as the preferred file system for Microsoft Windows operating systems. NTFS has several improvements over FAT and HPFS (High Performance File System), such as improved support for metadata and the use of advanced data structures.

Objectives

  • How to hide files usign NTFS streams.

Requirements

  • Windows 7, 8, 10 or Windows Server 2012, 2016.

Hiding Data using NTFS streams

Make sure the C:\drive file system is NTFS format. To check this, go to Computer and right click C:\ and click Properties.

NFTS-Info-1

  1. Open Windows Explorer and create a new folder called trick inside the C: drive.

  2. Go to C:\windows\system32 and copy the calc.exe to the trick folder. Calc-copy

  3. Launch the command prompt as Administrator, and navigate to C:\trick.
    cd C:\trick

  4. Create a readme.txt file, type Hello World inside of it and save the file.
    notepad readme.txt

  5. Back to command prompt and type dir to list the files on the current folder. Note the file size of readme.txt. Readme-Size

  6. Now hide calc.exe inside the readme.txt by typing:
    type c:\trick\calc.exe > c:\trick\readme.txt:calc.exe ntfs-4

  7. Type dir again and note the file size of readme.txt did not change.

  8. Back to the c:\trick and delete the calc.exe.

Execute the Hidden Application

  1. Create a symlink: mklink backdoor.exe readme.txt:calc.exe

  2. Execute the backdoor.exe by typing: backdoor.exe
    ntfs-5

Attackers may hide malicious files from being visible to the legitimate users by using NTFS streams and execute them whenever required.