多线程C# .NET程序集,用于枚举域中可访问的网络共享
基于 djhohnstein 的 SharpShares 项目
> .\SharpShares.exe help
Usage:
SharpShares.exe /threads:50 /ldap:servers /ou:"OU=Special Servers,DC=example,DC=local" /filter:SYSVOL,NETLOGON,IPC$,PRINT$ /verbose /outfile:C:\path\to\file.txt
Optional Arguments:
/threads - 指定最大并行线程数 (默认=25)
/dc - 指定要查询的域控制器(如果未在加入域的主机上运行)
/domain - 指定域名(如果未在加入域的主机上运行)
/ldap - 从以下 LDAP 过滤器查询主机 (默认=all)
:all - 所有已启用且主要组为 'Domain Computers' 的计算机
:dc - 所有已启用的域控制器(非只读域控制器)
:exclude-dc - 所有已启用但不是域控制器或只读域控制器的计算机
:servers - 所有已启用的服务器
:servers-exclude-dc - 所有已启用服务器,排除域控制器或只读域控制器
/ou - 指定 LDAP OU 以从中查询已启用的计算机对象
ex: "OU=Special Servers,DC=example,DC=local"
/stealth - 列出共享名称,不执行读/写访问检查
/filter - 要从枚举中排除的以逗号分隔的共享列表
default: SYSVOL,NETLOGON,IPC$,PRINT$
/outfile - 指定文件用于追加共享,而不是打印到标准输出
/verbose - 返回未授权的共享
execute-assembly /path/to/SharpShares.exe /ldap:all /filter:sysvol,netlogon,ipc$,print$
[+] Parsed Aguments:
threads: 25
ldap: all
ou: none
filter: SYSVOL,NETLOGON,IPC$,PRINT$
stealth: False
verbose: False
outfile:
[*] Excluding SYSVOL,NETLOGON,IPC$,PRINT$ shares
[*] Starting share enumeration with thread limit of 25
[r] = Readable Share
[w] = Writeable Share
[-] = Unauthorized Share (requires /verbose flag)
[?] = Unchecked Share (requires /stealth flag)
[+] Performing LDAP query for all enabled computers with "primary" group "Domain Computers"...
[+] This may take some time depending on the size of the environment
[+] LDAP Search Results: 10
[+] Starting share enumeration against 10 hosts
[r] \\DC-01\CertEnroll
[r] \\DC-01\File History Backups
[r] \\DC-01\Folder Redirection
[r] \\DC-01\Shared Folders
[r] \\DC-01\Users
[w] \\WEB-01\wwwroot
[r] \\DESKTOP\ADMIN$
[r] \\DESKTOP\C$
[+] Finished Enumerating Shares
/ldap 和 /ou 标志可以一起使用或单独使用以生成要枚举的主机列表。
在枚举开始前,这些标志返回的所有主机被合并并去重。