NTFS 的ADS(Alternate Directory Stream)

剛在分類一下 Sysinternal 的一些工具

並且想熟悉一下這些工具

看到一個Streams.exe , 很好奇跟串流有什麼關係...

後來查來查去...

 

原來是NTFS的檔案系統

一個檔案會有兩種stream ,也可以講是資料

一種是(real data) 就是實際的資料,也就是 explorer 列出的檔案大小和檔案

另一種是資全性的資訊,explorer 或者dir 都不會把它列出,

(

In NTFS, a file consists of different data streams. One stream holds the security information (access rights and such things), another one holds the "real data" you expect to be in a file. There may be another stream with link information instead of the real data stream, if the file actually is a link. And there may be alternate data streams, holding data the same way the standard data stream does.

http://www.heysoft.de/nt/ntfs-ads.htm

)

 

另外上面那個網址講的很清楚易懂

接著可以有另一種解釋是,可以讓檔案有 ":" 的檔名 , explorer 不能有 : 的檔名

例如 hello.txt:stream 這樣是一個檔案

那要如何產生這樣的檔案,其實 streams.exe 有講到,簡單的方式是在console模式下(in ntfs system)

 

echo helloTxt > hello.txt:textData

 

這樣就會在你的磁碟產生一個 0kb 的檔案, 你用文字編輯器去看也是沒有資料

但是透過下列指令可以把資料列出

 

more < hello.txt:textData

 

helloTxt

 

很奇妙就是,他實際還是有資料的,但是檔案管理員不會把它的資料量列在裡面

 

另外就是你不僅可以塞文字, 還可以塞圖片或者 exe !!

image

重點就來了,透過一些方式你就可以把 hello.txt 當作一個執行檔

hello.txt:exeMyfile.exe

接著你就可以做一些事情,但是一般的使用者只會知道它是個文字檔

不過實際我還沒跑過這段

改天再來實驗看看

下面是一些找到的資料

http://www.ntfs.com/

http://www.heysoft.de/nt/ntfs-ads.htm

http://support.microsoft.com/kb/105763

http://www.auditmypc.com/freescan/readingroom/ntfsstreams.asp

下面這個網址有詳細的exe 使用方式

http://www.infosecwriters.com/texts.php?op=display&id=53

0 ) 個留言 (歡迎按此留下你的留言喔 ):

張貼留言