博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hunting for Sensitive Data with the Veil-Framework
阅读量:5898 次
发布时间:2019-06-19

本文共 3627 字,大约阅读时间需要 12 分钟。

hot3.png

Data mining available file shares for sensitive data is a staple of red teaming. We’ve found everything from password lists, to full employee directories, salary information, network diagrams and more, all due to network shares with incorrectly configured permissions.  has a few functions (Invoke-Netview and Invoke-Sharefinder) that have helped us quickly find and explore shares our current user has access to. I’ve talked in the past about  during engagements, and realized that robust, recursive file listing would make a great addition into PowerView. Those two functions (Invoke-SearchFiles and Invoke-FileFinder) were recently added, and I wanted to demonstrate how this new functionality can help you find sensitive files on the network as quickly as possible.

Invoke-ShareFinder has had its output recently reworked so it spits out any “\\HOST\share    - COMMENT” found, instead of the status output similar to Invoke-Netview. The reason for this is to easily chain together Invoke-ShareFinder and Invoke-FileFinder, while preserving as much information we might want as possible. Here’s how I usually run sharefinder:

  • PS C:\> Invoke-ShareFinder -Ping -CheckShareAccess -Verbose | Out-File -Encoding ascii found_shares.txt

This will query AD for all machine objects, ping each one to ensure the host is up before enumeration, check each found share for read access, and output everything to found_shares.txt. The -Verbose flag gives some status output as it chews through all the retrieved servers, and the output will look something like this:

\\WIN2K8.company.com\MSBuild 	- test\\WIN2K8.company.com\NETLOGON 	- Logon server share \\WIN2K8.company.com\SYSVOL 	- Logon server share \\WIN2K8.company.com\test 	- \\WIN2K8.company.com\Users 	- User share\\WINDOWS7.company.com\secret	- don't look here...snip...

I’ll save off an original copy of the file off for reference, and then will glance over the output, manually trimming out certain shares that seem like they likely won’t be interesting. I can then feed that output file straight into Invoke-FileFinder. This will recursively search given shares for sensitive files:

  • PS C:> Invoke-FileFinder -ShareList .\found_shares.txt -OutFile found_files.csv

This will take the share input list from sharefinder and recursively list each share, filtering for files with ‘*pass*’, ‘*sensitive*’, ‘*admin*’, ‘*secret*’, ‘*login*’, ‘*unattend*.xml’, ‘*.vmdk’, ‘*creds*’, or ‘*credential*’ in the file name. Anything found is then output to a CSV with the full path, owner, last access time, last write time, and length. If I want/need to search for other terms, I’ll use something like this:

  • PS C:> Invoke-FileFinder -ShareList .\found_shares.txt -OutFile found_files.csv -Terms payroll,CEO,…

This will replace the default terms with the wildcarded terms specified. If you want to run Invoke-FileFinder without enumerating shares ahead of time, the following function will query AD for active machines like the rest of PowerView’s Invoke-* cmdlets. It will then enumerate all shares it finds, excluding C$ and ADMIN$ by default (these can be included with the -IncludeC and -IncludeAdmin flags). I still advise running Invoke-ShareFinder first and pruning your results a bit for speed reasons, but kicking off the following command will find everything sensitive it can in the network:

  • PS C:> Invoke-FileFinder -OutFile all_files.csv -Verbose

There are several more flags available, including filters for office documents, last creation/write/access times, etc. Check out  if you’re interested in more of the options:

Happy hunting :)

转载于:https://my.oschina.net/u/1188877/blog/294329

你可能感兴趣的文章
Redis List数据类型
查看>>
大数据项目实践(四)——之Hive配置
查看>>
初学vue2.0-组件-文档理解笔记v1.0
查看>>
NG-ZORRO-MOBILE 0.11.9 发布,基于 Angular 7 的 UI 组件
查看>>
我就是一个救火员(DBA救援)
查看>>
Centos7安装Gitlab10.0
查看>>
Windows Server 笔记(六):Active Directory域服务:域控制器安装
查看>>
discuz X3登录流程分析
查看>>
javascript事件响应
查看>>
上传图片预览
查看>>
vim编辑器
查看>>
程序设计的一些原理
查看>>
iTerm的安装以及配置
查看>>
lagp,lacp详解
查看>>
LVS之DR模式原理与实践
查看>>
struts2+extjs
查看>>
Apache2.4.33安装无systemctl/service status/state显示
查看>>
Docker的系统资源限制及验证
查看>>
在大公司呆5年,你就废了
查看>>
mac mamp mysql no start servel
查看>>