パスワード保護されたファイルを探す:風邪なのか喉が痛い - B-) の独り言(情報元のブックマーク数)

パスワード保護されたファイルを見つけ出すってのが、ツールでもあるんだ。へぇ

確かに、やましいファイルはパスワードか暗号化しますしねwwww

ZIPファイルやOffice文書ファイルにはパスワードを設定することが可能ですが、フォレンジック調査などでパスワード付きのファイルを探したい時があります。EnCaseでは標準のスクリプト機能としてCase Processor =>Infomation Finders =>Find Protected Filesを使うことでZIPやOffice文書でパスワード設定されたファイルを検出することが可能です。*2

FTKなど他のツールも当然検出してくれるみたいですが、他にもパスワード保護付きのファイルを探すツールがないかを探してみところ以下のものがあるようです。

2009-02-04

OpenOffice形式の(ODF)では、暗号化、ZIPパスワードの設定について記載されていますね。

17.3Encryption

The encryption process takes place in the following multiple stages:
1.A 20-byte SHA1 digest of the user entered password is created and passed to the package component.
2.The package component initializes a random number generator with the current time.
3.The random number generator is used to generate a random 8-byte initialization vector and 16-byte salt for each file.
4.This salt is used together with the 20-byte SHA1 digest of the password to derive a unique 128-bit key for each file. The algorithm used to derive the key is PBKDF2 using HMAC-SHA-1 (see [RFC2898]) with an iteration count of 1024.
5.The derived key is used together with the initialization vector to encrypt the file using the Blowfish algorithm in cipher-feedback (CFB) mode.
Each file that is encrypted is compressed before being encrypted. To allow the contents of the package file to be verified, it is necessary that encrypted files are flagged as 'STORED' rather than 'DEFLATED'. As entries which are 'STORED' must have their size equal to the compressed size, it is necessary to store the uncompressed size in the manifest. The compressed size is stored in both the local file header and central directory record of the Zip file.

OASIS Open Document Format for Office Applications (OpenDocument) TC | OASIS

ぁ、ここと一緒みたいですね。ってことはODF的にも同じなので、標準的な暗号化方式みたいですね>id:hideakiiさん

OpenOffice形式(ODF)もPK以外から始まる特定拡張子ファイルでいけそうだ。

まず、パスワード設定がない xlsx ファイルの先頭ヘッダ部分を16進数で見るとこんな↓感じですね。\x50 \x4B の部分が文字列“PK”となり、ZIPファイルのヘッダと同じになります。

2009-02-04

17.4MIME Type Stream

If a MIME type for a document that makes use of packages is existing, then the package should contain a stream called "mimetype". This stream should be first stream of the package's zip file, it shall not be compressed, and it shall not use an 'extra field' in its header (see [ZIP]).
The purpose is to allow packaged files to be identified through 'magic number' mechanisms, such as Unix's file/magic utility. If a ZIP file contains a stream at the beginning of the file that is uncompressed, and has no extra data in the header, then the stream name and the stream content can be found at fixed positions. More specifically, one will find:
" a string 'PK' at position 0 of all zip files
" a string 'mimetype' at position 30 of all such package files

MS Office系は、以下に仕様があるみたいだけどEncrypt,Decryptってのが見つからなかった・・・

This Standard defines Office Open XML's vocabularies and document representation and packaging. It also specifies requirements for consumers and producers of Office Open XML. An Office Open XML overview is available on the Ecma website.

Standard ECMA-376

screenshot