在一次网络演习中,我不得不“接管”一些已经被感染的windows工作站和服务器。计划是设置,例如。使用最新补丁的干净windows 7工作站...然后将受感染的工作站7更新为最新的补丁程序...加载osquery数据(文件校验和、文件所有者/组、权限等)并对照这个已知良好的“基线”检查受感染的工作站。有没有好的方法可以用osquery来做到这一点,或者你有没有推荐其他的工具来达到这个目的?
发布于 2019-03-04 23:09:08
我不确定你所说的"load osquery data“到底是什么意思,但你可以使用osquery来查询这些信息。例如,下面将允许您获取用户下载目录中所有文件的文件信息(包括权限、所有者等):
select * from file where path like '/Users/user/Downloads/%';如果您想要哈希,可以查询hash表:
select * from hash where path like '/Users/user/Downloads/%';发布于 2019-03-05 06:42:51
这应该是可行的,但你的问题相当宽泛。了解一个已知良好的Windows7系统的基本情况在很大程度上取决于你关心的是什么。我推荐做的是获取一些您认为对您的特定调查可能重要的表的json转储,因此可能类似于:
PS C:\Users\thor\Desktop> osqueryi --json -A drivers
PS C:\Users\thor\Desktop> osqueryi --json -A programs
PS C:\Users\thor\Desktop> osqueryi --json -A users
PS C:\Users\thor\Desktop> osqueryi --json -A startup_items
PS C:\Users\thor\Desktop> osqueryi --json "select f.filename, f.path, h.md5, h.sha256 from file f, hash h where h.path = f.path and f.path like 'C:\Windows\%';"
PS C:\Users\thor\Desktop> osqueryi --json "select f.filename, f.path, h.md5, h.sha256 from file f, hash h where h.path = f.path and f.path like 'C:\Windows\system32\%%';"
PS C:\Users\thor\Desktop> osqueryi --json -A scheduled_tasks
PS C:\Users\thor\Desktop> osqueryi --json -A certificates注意这绝对不是一个详尽的列表,但只是一些可能是很好的检查。我还建议在上面提到的queries @fmanco中添加。
一旦您使用基准系统中的数据构建了一个庞大的JSON blob列表,您就可以对受损的系统运行相同的查询,并“比较”json输出以查找差异。这可能会变得非常棘手,特别是在考虑C:\Windows\system32\%%文件的哈希时,考虑到哈希值可能会有很大的变化,即使在相同的系统补丁版本上也是如此,仅供参考。
希望这能有所帮助!
发布于 2019-03-18 10:08:47
您可能会对https://github.com/Netflix-Skunkworks/diffy感兴趣
这是一个用来比较主机之间差异的工具。
https://stackoverflow.com/questions/54972318
复制相似问题