# DumpSMBShare | A Script To Dump Files And Folders Remotely From A Windows SMB Share

**URL:** <https://onehack.st/t/dumpsmbshare-a-script-to-dump-files-and-folders-remotely-from-a-windows-smb-share/219463>\
**Category:** Tools & Scripts\
**Tags:** tools, hacking, business\
**Created:** [April 22, 2022, 9:56am UTC](https://onehack.st/t/dumpsmbshare-a-script-to-dump-files-and-folders-remotely-from-a-windows-smb-share/219463 "2022-04-22T09:56:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteHat](https://onehack.st/user_avatar/onehack.st/whitehat/32/162514_2.png) [@WhiteHat](https://onehack.st/u/WhiteHat)\
**Post date:** [April 22, 2022, 9:56am UTC](https://onehack.st/t/dumpsmbshare-a-script-to-dump-files-and-folders-remotely-from-a-windows-smb-share/219463/1 "2022-04-22T09:56:08Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/4/1/4100409dc034d8b132f9e189ab2676da633dc186.png)

A script to dump files and folders remotely from a Windows SMB share.  
[![GitHub release (latest by date)](https://camo.githubusercontent.com/450cd7f7841e62c6aa03eb10ee06e2da76e223e38bc0f2b575c5e7275df52477/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f703064616c69726975732f44756d70534d425368617265)](https://camo.githubusercontent.com/450cd7f7841e62c6aa03eb10ee06e2da76e223e38bc0f2b575c5e7275df52477/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f703064616c69726975732f44756d70534d425368617265) [![](https://camo.githubusercontent.com/b10eb64ea9c513e01a8f68ba2f60cab855d32eace20c7a0de41f4d0df41394da/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f706f64616c69726975735f3f6c6162656c3d506f64616c6972697573267374796c653d736f6369616c)](https://twitter.com/intent/follow?screen_name=podalirius_) [![YouTube Channel Subscribers](https://camo.githubusercontent.com/ba5ae186e8603121f9a0c6485c5d220b579b4653c0017a2b84320a6e87839d92/68747470733a2f2f696d672e736869656c64732e696f2f796f75747562652f6368616e6e656c2f73756273637269626572732f5543465f78354f3743536672383241664e56544b4f765f413f7374796c653d736f6369616c)](https://www.youtube.com/channel/UCF_x5O7CSfr82AfNVTKOv_A?sub_confirmation=1)

## Features

- Only list shares with `--list-shares`.
- Select only files with given extensions (with `--extensions`) or all files.
- Choose the local folder to dump to with `--dump-dir`.
- Select base folder to search from in the share with `--base-dir`.

## Usage

```auto
$ ./DumpSMBShare.py -h
DumpSMBShare v1.2 - by @podalirius_

usage: Dump.py [-h] (-s SHARE | -l) [-e EXTENSIONS] [-D DUMP_DIR] [-f FILE] [-B BASE_DIR] [--debug] [-q] [-H LMHASH:NTHASH] [--no-pass] [-k] [-A hex key]
               [--dc-ip ip address] [-I ip address] [-P [destination port]]
               target

positional arguments:
  target [[domain/]username[:password]@]<targetName or address>

optional arguments:
  -h, --help show this help message and exit
  -s SHARE, --share SHARE
                        SMB Share to dump
  -l, --list-shares Lists SMB shares.
  -e EXTENSIONS, --extensions EXTENSIONS
                        Extensions
  -D DUMP_DIR, --dump-dir DUMP_DIR
                        Dump directory
  -f FILE, --file FILE SMB file to dump
  -B BASE_DIR, --base-dir BASE_DIR
                        Directory to search in (Default: /)
  --debug Turn on debug output. (Default: False)
  -q, --quiet Turn DEBUG output ON

authentication:
  -H LMHASH:NTHASH, --hashes LMHASH:NTHASH
                        NTLM hashes, format is LMHASH:NTHASH
  --no-pass Don't ask for password (useful for -k)
  -k, --kerberos Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot
                        be found, it will use the ones specified in the command line
  -A hex key, --aesKey hex key
                        AES key to use for Kerberos Authentication (128 or 256 bits)

connection:
  --dc-ip ip address IP Address of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter
  -I ip address, --target-ip ip address
                        IP Address of the target machine. If omitted it will use whatever was specified as target. This is useful when target is the NetBIOS
                        name and you cannot resolve it
  -P [destination port], --port [destination port]
                        Destination port to connect to SMB Server

```

## Example

- Dump all files from the `SYSVOL` share:

```auto
./DumpSMBShare.py 'LAB.local/user2:Admin123@192.168.2.1' --debug

```

[![](https://github.com/p0dalirius/DumpSMBShare/raw/master/.github/example_verbose.png)](https://github.com/p0dalirius/DumpSMBShare/blob/master/.github/example_verbose.png)

[![](https://github.com/p0dalirius/DumpSMBShare/raw/master/.github/example.png)](https://github.com/p0dalirius/DumpSMBShare/blob/master/.github/example.png)

## Contributing

Pull requests are welcome. Feel free to open an issue if you want to add other features.

## GitHub:

> **[GitHub - p0dalirius/DumpSMBShare: A python script to dump files and folders remotely...](https://github.com/p0dalirius/DumpSMBShare)**
>
> A python script to dump files and folders remotely from a Windows SMB share.
