smbclientng


Namesmbclientng JSON
Version 2.1.7 PyPI version JSON
download
home_pagehttps://github.com/p0dalirius/smbclient-ng
Summarysmbclient-ng, a fast and user friendly way to interact with SMB shares.
upload_time2024-11-27 21:07:07
maintainerNone
docs_urlNone
authorPodalirius
requires_python>=3.6
licenseGPL3
keywords
VCS
bugtrack_url
requirements impacket rich charset-normalizer pefile
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    smbclient-ng, a fast and user friendly way to interact with SMB shares.
    <br>
    <img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/p0dalirius/smbclient-ng">
    <img alt="PyPI" src="https://img.shields.io/pypi/v/smbclientng">
    <a href="https://twitter.com/intent/follow?screen_name=podalirius_" title="Follow"><img src="https://img.shields.io/twitter/follow/podalirius_?label=Podalirius&style=social"></a>
    <a href="https://www.youtube.com/c/Podalirius_?sub_confirmation=1" title="Subscribe"><img alt="YouTube Channel Subscribers" src="https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social"></a>
    <br>
</p>

## Features

- [x] `acls`: List ACLs of files and folders in cwd. Syntax: `acls`
- [x] `bat`: Pretty prints the contents of a file. Syntax: `bat <file>`
- [x] `cat`: Get the contents of a file. Syntax: `cat <file>`
- [x] `cd`: Change the current working directory. Syntax: `cd <directory>`
- [x] `close`: Closes the SMB connection to the remote machine. Syntax: `close`
- [x] `connect`: Connect to the remote machine (useful if connection timed out). Syntax: `connect`
- [x] `dir`: List the contents of the current working directory. Syntax: `dir`
- [x] `exit`: Exits the smbclient-ng script. Syntax: `exit`
- [x] `get`: Get a remote file. Syntax: `get [-r] <directory or file>`
- [x] `help`: Displays this help message. Syntax: `help`
- [x] `info`: Get information about the server and or the share. Syntax: `info [server|share]`
- [x] `lbat`: Pretty prints the contents of a local file. Syntax: `lbat <file>`
- [x] `lcat`: Print the contents of a local file. Syntax: `lcat <file>`
- [x] `lcd`: Changes the current local directory. Syntax: `lcd <directory>`
- [x] `lcp`: Create a copy of a local file. Syntax: `lcp <srcfile> <dstfile>`
- [x] `lls`: Lists the contents of the current local directory. Syntax: `lls`
- [x] `lmkdir`: Creates a new local directory. Syntax: `lmkdir <directory>`
- [x] `lpwd`: Shows the current local directory. Syntax: `lpwd`
- [x] `lrename`: Renames a local file. Syntax: `lrename <oldfilename> <newfilename>`
- [x] `lrm`: Removes a local file. Syntax: `lrm <file>`
- [x] `lrmdir`: Removes a local directory. Syntax: `lrmdir <directory>`
- [x] `ls`: List the contents of the current remote working directory. Syntax: `ls`
- [x] `ltree`: Displays a tree view of the local directories. Syntax: `ltree [directory]`
- [x] `mkdir`: Creates a new remote directory. Syntax: `mkdir <directory>`
- [x] `module`: Loads a specific module for additional functionalities. Syntax: `module <name>`
- [x] `mount`: Creates a mount point of the remote share on the local machine. Syntax: `mount <remote_path> <local_mountpoint>`
- [x] `put`: Put a local file or directory in a remote directory. Syntax: `put [-r] <directory or file>`
- [x] `reconnect`: Reconnect to the remote machine (useful if connection timed out). Syntax: `reconnect`
- [x] `reset`: Reset the TTY output, useful if it was broken after printing a binary file on stdout. Syntax: `reset`
- [x] `rm`: Removes a remote file. Syntax: `rm <file>`
- [x] `rmdir`: Removes a remote directory. Syntax: `rmdir <directory>`
- [x] `sessions`: Manage the SMB sessions. Syntax: `sessions [interact|create|delete|execute|list]`
- [x] `shares`: Lists the SMB shares served by the remote machine. Syntax: `shares`
- [x] `sizeof`: Recursively compute the size of a folder. Syntax: `sizeof [directory|file]`
- [x] `tree`: Displays a tree view of the remote directories. Syntax: `tree [directory]`
- [x] `umount`: Removes a mount point of the remote share on the local machine. Syntax: `umount <local_mount_point>`
- [x] `use`: Use a SMB share. Syntax: `use <sharename>`


## Install

To install `smbclient-ng`, you can use pip. Run the following command in your terminal:

```
python3 -m pip install smbclientng
```

## Demonstration

![](./.github/example.png)


## Usage

```
$ ./smbclient-ng.py 
               _          _ _            _                    
 ___ _ __ ___ | |__   ___| (_) ___ _ __ | |_      _ __   __ _ 
/ __| '_ ` _ \| '_ \ / __| | |/ _ \ '_ \| __|____| '_ \ / _` |
\__ \ | | | | | |_) | (__| | |  __/ | | | ||_____| | | | (_| |
|___/_| |_| |_|_.__/ \___|_|_|\___|_| |_|\__|    |_| |_|\__, |
    by @podalirius_                             v2.1.6  |___/  
    
usage: smbclient-ng.py [-h] [--debug] [--no-colors] [-S startup_script] [-N] [-L LOGFILE] [--timeout TIMEOUT]
                       [--advertised-name ADVERTISED_NAME] --host HOST [--port PORT] [--kdcHost FQDN KDC] [-d DOMAIN] [-u USER]
                       [--no-pass | -p [PASSWORD] | -H [LMHASH:]NTHASH | --aes-key hex key] [-k]

smbclient-ng, a fast and user friendly way to interact with SMB shares.

options:
  -h, --help            show this help message and exit
  --debug               Debug mode.
  --no-colors           No colors mode.
  -S startup_script, --startup-script startup_script
                        File containing the list of commands to be typed at start of the console.
  -N, --not-interactive
                        Non interactive mode.
  -L LOGFILE, --logfile LOGFILE
                        File to write logs to.
  --timeout TIMEOUT     Timeout in seconds for SMB connections (default: 3)
  --advertised-name ADVERTISED_NAME
                        Advertised name of your machine to the SMB client.

Target:
  --host HOST           IP address or hostname of the SMB Server to connect to.
  --port PORT           Port of the SMB Server to connect to. (default: 445)

Authentication & connection:
  --kdcHost FQDN KDC    FQDN of KDC for Kerberos.
  -d DOMAIN, --domain DOMAIN
                        (FQDN) domain to authenticate to.
  -u USER, --user USER  User to authenticate with.

  --no-pass             Don't ask for password (useful for -k).
  -p [PASSWORD], --password [PASSWORD]
                        Password to authenticate with.
  -H [LMHASH:]NTHASH, --hashes [LMHASH:]NTHASH
                        NT/LM hashes, format is LMhash:NThash.
  --aes-key hex key     AES key to use for Kerberos Authentication (128 or 256 bits).
  -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.

```

## Quick win commands

 + Connect to a remote SMB server:
    ```
    ./smbclient-ng.py -d "LAB" -u "Administrator" -p 'Admin123!' --host "10.0.0.201"
    ```

## Contributing

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/p0dalirius/smbclient-ng",
    "name": "smbclientng",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Podalirius",
    "author_email": "podalirius@protonmail.com",
    "download_url": null,
    "platform": null,
    "description": "<p align=\"center\">\n    smbclient-ng, a fast and user friendly way to interact with SMB shares.\n    <br>\n    <img alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/p0dalirius/smbclient-ng\">\n    <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/smbclientng\">\n    <a href=\"https://twitter.com/intent/follow?screen_name=podalirius_\" title=\"Follow\"><img src=\"https://img.shields.io/twitter/follow/podalirius_?label=Podalirius&style=social\"></a>\n    <a href=\"https://www.youtube.com/c/Podalirius_?sub_confirmation=1\" title=\"Subscribe\"><img alt=\"YouTube Channel Subscribers\" src=\"https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social\"></a>\n    <br>\n</p>\n\n## Features\n\n- [x] `acls`: List ACLs of files and folders in cwd. Syntax: `acls`\n- [x] `bat`: Pretty prints the contents of a file. Syntax: `bat <file>`\n- [x] `cat`: Get the contents of a file. Syntax: `cat <file>`\n- [x] `cd`: Change the current working directory. Syntax: `cd <directory>`\n- [x] `close`: Closes the SMB connection to the remote machine. Syntax: `close`\n- [x] `connect`: Connect to the remote machine (useful if connection timed out). Syntax: `connect`\n- [x] `dir`: List the contents of the current working directory. Syntax: `dir`\n- [x] `exit`: Exits the smbclient-ng script. Syntax: `exit`\n- [x] `get`: Get a remote file. Syntax: `get [-r] <directory or file>`\n- [x] `help`: Displays this help message. Syntax: `help`\n- [x] `info`: Get information about the server and or the share. Syntax: `info [server|share]`\n- [x] `lbat`: Pretty prints the contents of a local file. Syntax: `lbat <file>`\n- [x] `lcat`: Print the contents of a local file. Syntax: `lcat <file>`\n- [x] `lcd`: Changes the current local directory. Syntax: `lcd <directory>`\n- [x] `lcp`: Create a copy of a local file. Syntax: `lcp <srcfile> <dstfile>`\n- [x] `lls`: Lists the contents of the current local directory. Syntax: `lls`\n- [x] `lmkdir`: Creates a new local directory. Syntax: `lmkdir <directory>`\n- [x] `lpwd`: Shows the current local directory. Syntax: `lpwd`\n- [x] `lrename`: Renames a local file. Syntax: `lrename <oldfilename> <newfilename>`\n- [x] `lrm`: Removes a local file. Syntax: `lrm <file>`\n- [x] `lrmdir`: Removes a local directory. Syntax: `lrmdir <directory>`\n- [x] `ls`: List the contents of the current remote working directory. Syntax: `ls`\n- [x] `ltree`: Displays a tree view of the local directories. Syntax: `ltree [directory]`\n- [x] `mkdir`: Creates a new remote directory. Syntax: `mkdir <directory>`\n- [x] `module`: Loads a specific module for additional functionalities. Syntax: `module <name>`\n- [x] `mount`: Creates a mount point of the remote share on the local machine. Syntax: `mount <remote_path> <local_mountpoint>`\n- [x] `put`: Put a local file or directory in a remote directory. Syntax: `put [-r] <directory or file>`\n- [x] `reconnect`: Reconnect to the remote machine (useful if connection timed out). Syntax: `reconnect`\n- [x] `reset`: Reset the TTY output, useful if it was broken after printing a binary file on stdout. Syntax: `reset`\n- [x] `rm`: Removes a remote file. Syntax: `rm <file>`\n- [x] `rmdir`: Removes a remote directory. Syntax: `rmdir <directory>`\n- [x] `sessions`: Manage the SMB sessions. Syntax: `sessions [interact|create|delete|execute|list]`\n- [x] `shares`: Lists the SMB shares served by the remote machine. Syntax: `shares`\n- [x] `sizeof`: Recursively compute the size of a folder. Syntax: `sizeof [directory|file]`\n- [x] `tree`: Displays a tree view of the remote directories. Syntax: `tree [directory]`\n- [x] `umount`: Removes a mount point of the remote share on the local machine. Syntax: `umount <local_mount_point>`\n- [x] `use`: Use a SMB share. Syntax: `use <sharename>`\n\n\n## Install\n\nTo install `smbclient-ng`, you can use pip. Run the following command in your terminal:\n\n```\npython3 -m pip install smbclientng\n```\n\n## Demonstration\n\n![](./.github/example.png)\n\n\n## Usage\n\n```\n$ ./smbclient-ng.py \n               _          _ _            _                    \n ___ _ __ ___ | |__   ___| (_) ___ _ __ | |_      _ __   __ _ \n/ __| '_ ` _ \\| '_ \\ / __| | |/ _ \\ '_ \\| __|____| '_ \\ / _` |\n\\__ \\ | | | | | |_) | (__| | |  __/ | | | ||_____| | | | (_| |\n|___/_| |_| |_|_.__/ \\___|_|_|\\___|_| |_|\\__|    |_| |_|\\__, |\n    by @podalirius_                             v2.1.6  |___/  \n    \nusage: smbclient-ng.py [-h] [--debug] [--no-colors] [-S startup_script] [-N] [-L LOGFILE] [--timeout TIMEOUT]\n                       [--advertised-name ADVERTISED_NAME] --host HOST [--port PORT] [--kdcHost FQDN KDC] [-d DOMAIN] [-u USER]\n                       [--no-pass | -p [PASSWORD] | -H [LMHASH:]NTHASH | --aes-key hex key] [-k]\n\nsmbclient-ng, a fast and user friendly way to interact with SMB shares.\n\noptions:\n  -h, --help            show this help message and exit\n  --debug               Debug mode.\n  --no-colors           No colors mode.\n  -S startup_script, --startup-script startup_script\n                        File containing the list of commands to be typed at start of the console.\n  -N, --not-interactive\n                        Non interactive mode.\n  -L LOGFILE, --logfile LOGFILE\n                        File to write logs to.\n  --timeout TIMEOUT     Timeout in seconds for SMB connections (default: 3)\n  --advertised-name ADVERTISED_NAME\n                        Advertised name of your machine to the SMB client.\n\nTarget:\n  --host HOST           IP address or hostname of the SMB Server to connect to.\n  --port PORT           Port of the SMB Server to connect to. (default: 445)\n\nAuthentication & connection:\n  --kdcHost FQDN KDC    FQDN of KDC for Kerberos.\n  -d DOMAIN, --domain DOMAIN\n                        (FQDN) domain to authenticate to.\n  -u USER, --user USER  User to authenticate with.\n\n  --no-pass             Don't ask for password (useful for -k).\n  -p [PASSWORD], --password [PASSWORD]\n                        Password to authenticate with.\n  -H [LMHASH:]NTHASH, --hashes [LMHASH:]NTHASH\n                        NT/LM hashes, format is LMhash:NThash.\n  --aes-key hex key     AES key to use for Kerberos Authentication (128 or 256 bits).\n  -k, --kerberos        Use Kerberos authentication. Grabs credentials from .ccache file (KRB5CCNAME) based on target parameters. If\n                        valid credentials cannot be found, it will use the ones specified in the command line.\n\n```\n\n## Quick win commands\n\n + Connect to a remote SMB server:\n    ```\n    ./smbclient-ng.py -d \"LAB\" -u \"Administrator\" -p 'Admin123!' --host \"10.0.0.201\"\n    ```\n\n## Contributing\n\nPull requests are welcome. Feel free to open an issue if you want to add other features.\n",
    "bugtrack_url": null,
    "license": "GPL3",
    "summary": "smbclient-ng, a fast and user friendly way to interact with SMB shares.",
    "version": "2.1.7",
    "project_urls": {
        "Homepage": "https://github.com/p0dalirius/smbclient-ng"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4558feebf58002c9f2bcdc054e5ae08c24851816dc3db7ee716117452621ce87",
                "md5": "d395adbaf2c37359f189ef25f450f267",
                "sha256": "8bb15a8f9502925a3264bccbf9298ab28ae2f7b824402598e34de8f1ab2f22c7"
            },
            "downloads": -1,
            "filename": "smbclientng-2.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d395adbaf2c37359f189ef25f450f267",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 76704,
            "upload_time": "2024-11-27T21:07:07",
            "upload_time_iso_8601": "2024-11-27T21:07:07.771728Z",
            "url": "https://files.pythonhosted.org/packages/45/58/feebf58002c9f2bcdc054e5ae08c24851816dc3db7ee716117452621ce87/smbclientng-2.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-27 21:07:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "p0dalirius",
    "github_project": "smbclient-ng",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "impacket",
            "specs": []
        },
        {
            "name": "rich",
            "specs": []
        },
        {
            "name": "charset-normalizer",
            "specs": []
        },
        {
            "name": "pefile",
            "specs": []
        }
    ],
    "lcname": "smbclientng"
}
        
Elapsed time: 0.34685s