Skip to content

Enumerate Windows files and folders in shares on all AD domain-joined computers, outputs in CSV format, 1 file for each share.

Notifications You must be signed in to change notification settings

malacupa/invoke-slowshareenum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Invoke-SlowShareEnum

Wrapper around net view to use in internal penetration test or for any other review of available files on SMB shares in Windows domain. Enumerates files and folders in shares on all AD domain-joined computers and outputs 1 CSV file for each found share. The generated CSV files can then be reviewed to find sensitive files. It enumerates in parallel but isn't very fast.

Install

. .\Invoke-SlowShareEnum.ps1

Usage

Get-Help Invoke-SlowShareEnum -Detailed

NAME
    Invoke-SlowShareEnum

SYNOPSIS
    Enumerate files and folders in shares on all AD domain-joined computers, outputs in CSV format, 1 file for each share.


SYNTAX
    Invoke-SlowShareEnum [[-ComputerFile] <FileInfo>] [[-SharesFile] <FileInfo>] [[-StartFrom] <String>] [[-JobCount] <Int32>] [<CommonParameters>]


DESCRIPTION
    Creates folder `sseout` on current users desktop which will contain:

     - Log inside `sseout\0_share_enum_log.txt` on user's desktop (appends to file)
     - Found AD computers into `sseout\0_domain_computers.txt` (overwrites the file)
     - Found AD shares into `sseout\0_domain_shares.txt` (overwrites the file)
     - All files and folders accessible by current user in separate files for each share UNC path, e.g. \\server1\share3 will create `sseout\server1_share3.txt` (overwrites the files)


PARAMETERS
    -ComputerFile <FileInfo>
        Optional path to file containing one host per line to scan for available shares

    -SharesFile <FileInfo>
        Optional path to file containing one UNC share path per line to scan for available files

    -StartFrom <String>
        Optional UNC share path that allows to start enumeration from specific share in the shares list

    -JobCount <Int32>
        Optional number of jobs to run share enun/file listing with, default is 2

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

    -------------------------- EXAMPLE 1 --------------------------

    PS C:\>Invoke-SlowShareEnum

Example output for one of generated CSV files:

Get-Content C:\Users\testuser\Desktop\sseout\DC01_Users.txt

"FullName","Length","LastWriteTime","Attributes"
"\\DC01\Users\Administrator",,"6/10/2019 12:24:49 PM","Directory"
"\\DC01\Users\Administrator\Documents",,"7/8/2020 4:51:01 AM","ReadOnly, Directory"
"\\DC01\Users\Administrator\Documents\adminfolder",,"7/8/2020 4:51:05 AM","Directory"
"\\DC01\Users\Administrator\Documents\adminfolder\New Text Document.txt","0","7/8/2020 4:51:05 AM","Archive"

Similar Tools

This script is nothing new, there are others like it, e.g:

Paid:

License

MIT

About

Enumerate Windows files and folders in shares on all AD domain-joined computers, outputs in CSV format, 1 file for each share.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published