:ms-properties 备用数据流的内容是什么?
What are the contents of the :ms-properties alternate data stream?
当您在 OneDrive 中存储文件时,会添加一个 :ms-properties
备用数据流。我使用 FlexHex 打开了一个示例流(如图所示),但我无法判断这些字节可能代表什么类型的结构。有人知道吗?
实际上,根据 1SPS
的顺序,我认为它可能是一个道具商店或一个 shell 包什么的。 . And this。但我不确定这是否正确。
1SPS 是序列化 属性 存储的签名,它本质上是一个键值对类型系统。它是一种标准结构,因此很容易解析,尽管数据类型可能会给它带来一些挑战。
看起来在这 4 个左右中有一些 GUID。很容易解析出这些结构,因为在 shellbags 中使用了类似的东西。它看起来就像一系列 1sps 块,这使得它变得简单。
你已经知道我的电子邮件了,所以如果你能提取其中的一些 ADS 示例,将它们压缩并发送,我可以仔细查看。如果有必要,我什至会编写一个新的取证工具来解析它们
它们只是序列化 Windows properties. You can write and read these files (as streams) using builtin Windows implementation of IPropertyStore,例如使用 PSCreateMemoryPropertyStore 函数
这是一个小型示例控制台应用程序,它创建一个 test.props
文件,其中包含一个 属性 字符串类型:
#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>
#include <propsys.h>
#include <propkey.h>
#include <propvarutil.h>
// some COM error handling useful macros
#define WIDEN2(x) L ## x
#define WIDEN(x) WIDEN2(x)
#define __WFILE__ WIDEN(__FILE__)
#define SBTRACE wprintf
#define CHECKHR(expr) {hr=(expr);if(FAILED(hr)){ SBTRACE(L"HR FAILED line:%u file:%s\n", __LINE__, __WFILE__); goto cleanup; } }
#define HR HRESULT hr=S_OK;
int main()
{
HR;
PROPVARIANT pv;
PropVariantInit(&pv);
CoInitialize(NULL);
{
CComPtr<IPropertyStore> ps;
CComPtr<IPersistStream> pstream;
CComPtr<IStream> stream;
// create the in-memory store
CHECKHR(PSCreateMemoryPropertyStore(IID_PPV_ARGS(&ps)));
// define some PROPVARIANT value (here it's a string)
CHECKHR(InitPropVariantFromString(L"hello world", &pv));
// any property key would work
CHECKHR(ps->SetValue(PKEY_ItemNameDisplay, pv));
// get IPersistStream to be able to load or write
CHECKHR(ps->QueryInterface(&pstream));
// create a file stream
CHECKHR(SHCreateStreamOnFileEx(L"test.props", STGM_WRITE | STGM_CREATE, 0, TRUE, nullptr, &stream));
// this sample only saves, but you can load from an existing stream
CHECKHR(pstream->Save(stream, TRUE));
}
cleanup:
PropVariantClear(&pv);
CoUninitialize();
return 0;
}
结果如下:
当您在 OneDrive 中存储文件时,会添加一个 :ms-properties
备用数据流。我使用 FlexHex 打开了一个示例流(如图所示),但我无法判断这些字节可能代表什么类型的结构。有人知道吗?
实际上,根据 1SPS
的顺序,我认为它可能是一个道具商店或一个 shell 包什么的。
1SPS 是序列化 属性 存储的签名,它本质上是一个键值对类型系统。它是一种标准结构,因此很容易解析,尽管数据类型可能会给它带来一些挑战。
看起来在这 4 个左右中有一些 GUID。很容易解析出这些结构,因为在 shellbags 中使用了类似的东西。它看起来就像一系列 1sps 块,这使得它变得简单。
你已经知道我的电子邮件了,所以如果你能提取其中的一些 ADS 示例,将它们压缩并发送,我可以仔细查看。如果有必要,我什至会编写一个新的取证工具来解析它们
它们只是序列化 Windows properties. You can write and read these files (as streams) using builtin Windows implementation of IPropertyStore,例如使用 PSCreateMemoryPropertyStore 函数
这是一个小型示例控制台应用程序,它创建一个 test.props
文件,其中包含一个 属性 字符串类型:
#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>
#include <propsys.h>
#include <propkey.h>
#include <propvarutil.h>
// some COM error handling useful macros
#define WIDEN2(x) L ## x
#define WIDEN(x) WIDEN2(x)
#define __WFILE__ WIDEN(__FILE__)
#define SBTRACE wprintf
#define CHECKHR(expr) {hr=(expr);if(FAILED(hr)){ SBTRACE(L"HR FAILED line:%u file:%s\n", __LINE__, __WFILE__); goto cleanup; } }
#define HR HRESULT hr=S_OK;
int main()
{
HR;
PROPVARIANT pv;
PropVariantInit(&pv);
CoInitialize(NULL);
{
CComPtr<IPropertyStore> ps;
CComPtr<IPersistStream> pstream;
CComPtr<IStream> stream;
// create the in-memory store
CHECKHR(PSCreateMemoryPropertyStore(IID_PPV_ARGS(&ps)));
// define some PROPVARIANT value (here it's a string)
CHECKHR(InitPropVariantFromString(L"hello world", &pv));
// any property key would work
CHECKHR(ps->SetValue(PKEY_ItemNameDisplay, pv));
// get IPersistStream to be able to load or write
CHECKHR(ps->QueryInterface(&pstream));
// create a file stream
CHECKHR(SHCreateStreamOnFileEx(L"test.props", STGM_WRITE | STGM_CREATE, 0, TRUE, nullptr, &stream));
// this sample only saves, but you can load from an existing stream
CHECKHR(pstream->Save(stream, TRUE));
}
cleanup:
PropVariantClear(&pv);
CoUninitialize();
return 0;
}
结果如下: