# SharpShares | Multithreaded C# .NET Assembly To Enumerate Accessible Network Shares In A Domain

**URL:** <https://onehack.st/t/sharpshares-multithreaded-c-net-assembly-to-enumerate-accessible-network-shares-in-a-domain/275241>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, networking\
**Created:** [February 13, 2024, 11:20pm UTC](https://onehack.st/t/sharpshares-multithreaded-c-net-assembly-to-enumerate-accessible-network-shares-in-a-domain/275241 "2024-02-13T23:20:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [February 13, 2024, 11:20pm UTC](https://onehack.st/t/sharpshares-multithreaded-c-net-assembly-to-enumerate-accessible-network-shares-in-a-domain/275241/1 "2024-02-13T23:20:16Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/9/7/97c97ff776c7fab1b30fdf35c898f02e9d38c803.jpeg)

# SharpShares

Multithreaded C# .NET Assembly to enumerate accessible network shares in a domain

Built upon [djhohnstein’s SharpShares](https://github.com/djhohnstein/SharpShares) project

```auto
> .\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 - specify maximum number of parallel threads (default=25)
    /dc - specify domain controller to query (if not ran on a domain-joined host)
    /domain - specify domain name (if not ran on a domain-joined host)
    /ldap - query hosts from the following LDAP filters (default=all)
         :all - All enabled computers with 'primary' group 'Domain Computers'
         :dc - All enabled Domain Controllers (not read-only DCs)
         :exclude-dc - All enabled computers that are not Domain Controllers or read-only DCs
         :servers - All enabled servers
         :servers-exclude-dc - All enabled servers excluding Domain Controllers or read-only DCs
    /ou - specify LDAP OU to query enabled computer objects from
                ex: "OU=Special Servers,DC=example,DC=local"
    /stealth - list share names without performing read/write access checks
    /filter - list of comma-separated shares to exclude from enumeration
                default: SYSVOL,NETLOGON,IPC$,PRINT$
    /outfile - specify file for shares to be appended to instead of printing to std out
    /verbose - return unauthorized shares

```

## Execute Assembly

```auto
execute-assembly /path/to/SharpShares.exe /ldap:all /filter:sysvol,netlogon,ipc$,print$

```

## Example Output

```auto
[+] 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

```

### Specifying Targets

The `/ldap` and `/ou` flags can be used together or seprately to generate a list of hosts to enumerate.

All hosts returned from these flags are combined and deduplicated before enumeration starts.

## GitHub:

> **[GitHub - mitchmoser/SharpShares: Multithreaded C# .NET Assembly to enumerate...](https://github.com/mitchmoser/SharpShares)**
>
> Multithreaded C# .NET Assembly to enumerate accessible network shares in a domain
