{"id":17994950,"url":"https://github.com/p0dalirius/smbclient-ng","last_synced_at":"2025-04-12T03:44:34.632Z","repository":{"id":242477508,"uuid":"664982278","full_name":"p0dalirius/smbclient-ng","owner":"p0dalirius","description":"smbclient-ng, a fast and user friendly way to interact with SMB shares. ","archived":false,"fork":false,"pushed_at":"2025-03-21T17:58:35.000Z","size":2029,"stargazers_count":897,"open_issues_count":8,"forks_count":77,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-05T01:01:37.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://podalirius.net/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p0dalirius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"p0dalirius","patreon":"Podalirius"}},"created_at":"2023-07-11T07:19:17.000Z","updated_at":"2025-03-31T19:56:19.000Z","dependencies_parsed_at":"2024-07-08T14:06:37.820Z","dependency_job_id":"1a11f519-2cad-4e34-bb2e-0be47af70486","html_url":"https://github.com/p0dalirius/smbclient-ng","commit_stats":null,"previous_names":["p0dalirius/smbclient-ng"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fsmbclient-ng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fsmbclient-ng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fsmbclient-ng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fsmbclient-ng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p0dalirius","download_url":"https://codeload.github.com/p0dalirius/smbclient-ng/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514214,"owners_count":21116899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T20:17:17.447Z","updated_at":"2025-04-12T03:44:34.594Z","avatar_url":"https://github.com/p0dalirius.png","language":"Python","funding_links":["https://github.com/sponsors/p0dalirius","https://patreon.com/Podalirius"],"categories":["Samba Enumerating"],"sub_categories":["Penetration Testing Report Templates"],"readme":"![](./.github/banner.png)\n\n\u003cp align=\"center\"\u003e\n    smbclient-ng, a fast and user friendly way to interact with SMB shares.\n    \u003cbr\u003e\n    \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/p0dalirius/smbclient-ng\"\u003e\n    \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/smbclientng\"\u003e\n    \u003ca href=\"https://twitter.com/intent/follow?screen_name=podalirius_\" title=\"Follow\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/podalirius_?label=Podalirius\u0026style=social\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.youtube.com/c/Podalirius_?sub_confirmation=1\" title=\"Subscribe\"\u003e\u003cimg alt=\"YouTube Channel Subscribers\" src=\"https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social\"\u003e\u003c/a\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\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 \u003cfile\u003e`\n- [x] `bhead`: Pretty prints the first n lines of a file. Syntax: `bhead \u003cfile\u003e`\n- [x] `btail`: Pretty prints the last n lines of a file. Syntax: `btail \u003cfile\u003e`\n- [x] `cat`: Get the contents of a file. Syntax: `cat \u003cfile\u003e`\n- [x] `cd`: Change the current working directory. Syntax: `cd \u003cdirectory\u003e`\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] \u003cdirectory or file\u003e`\n- [x] `help`: Displays this help message. Syntax: `help`\n- [x] `head`: Get the first n lines of a remote file. Syntax: `head \u003cfile\u003e`\n- [x] `history`: Displays the command history. Syntax: `history`\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 \u003cfile\u003e`\n- [x] `lcat`: Print the contents of a local file. Syntax: `lcat \u003cfile\u003e`\n- [x] `lcd`: Changes the current local directory. Syntax: `lcd \u003cdirectory\u003e`\n- [x] `lcp`: Create a copy of a local file. Syntax: `lcp \u003csrcfile\u003e \u003cdstfile\u003e`\n- [x] `lls`: Lists the contents of the current local directory. Syntax: `lls`\n- [x] `lmkdir`: Creates a new local directory. Syntax: `lmkdir \u003cdirectory\u003e`\n- [x] `lpwd`: Shows the current local directory. Syntax: `lpwd`\n- [x] `lrename`: Renames a local file. Syntax: `lrename \u003coldfilename\u003e \u003cnewfilename\u003e`\n- [x] `lrm`: Removes a local file. Syntax: `lrm \u003cfile\u003e`\n- [x] `lrmdir`: Removes a local directory. Syntax: `lrmdir \u003cdirectory\u003e`\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] `metadata`: Get metadata about a file or directory. Syntax: `metadata \u003cfile|directory\u003e`\n- [x] `mkdir`: Creates a new remote directory. Syntax: `mkdir \u003cdirectory\u003e`\n- [x] `module`: Loads a specific module for additional functionalities. Syntax: `module \u003cname\u003e`\n- [x] `mount`: Creates a mount point of the remote share on the local machine. Syntax: `mount \u003cremote_path\u003e \u003clocal_mountpoint\u003e`\n- [x] `put`: Put a local file or directory in a remote directory. Syntax: `put [-r] \u003cdirectory or file\u003e`\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 \u003cfile\u003e`\n- [x] `rmdir`: Removes a remote directory. Syntax: `rmdir \u003cdirectory\u003e`\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] `tail`: Get the last n lines of a remote file. Syntax: `tail \u003cfile\u003e`\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 \u003clocal_mount_point\u003e`\n- [x] `use`: Use a SMB share. Syntax: `use \u003csharename\u003e`\n\n\n## Install\n\nTo install `smbclient-ng`, you can use `pip`, `pip3` or `pipx`. You can run any of the following command in your terminal to install [smbclient-ng](https://github.com/p0dalirius/smbclient-ng) :\n\n+ With `pip`:\n    ```\n    python3 -m pip install smbclientng\n    ```\n\n+ With `pip3`:\n    ```\n    pip3 install smbclientng\n    ```\n    \n+ With `pipx`:\n    ```\n    pipx install smbclientng\n    ```\n\n## Demonstration\n\n![](./.github/example.png)\n\n## Usage\n\n```\n$ ./smbclient-ng.py \n               _          _ _            _\n ___ _ __ ___ | |__   ___| (_) ___ _ __ | |_      _ __   __ _\n/ __| '_ ` _ \\| '_ \\ / __| | |/ _ \\ '_ \\| __|____| '_ \\ / _` |\n\\__ \\ | | | | | |_) | (__| | |  __/ | | | ||_____| | | | (_| |\n|___/_| |_| |_|_.__/ \\___|_|_|\\___|_| |_|\\__|    |_| |_|\\__, |\n    by @podalirius_                             v2.1.8  |___/\n    \nusage: smbclientng [-h] [--debug] [--no-colors] [-l LOGFILE] [-T TIMEOUT] [-a ADVERTISED_NAME] [-C COMMAND] [-S STARTUP_SCRIPT] [-N] -H HOST [-P PORT] [-d DOMAIN] [-u USER]\n                   [-p [PASSWORD] | --no-pass | --hashes [LMHASH:]NTHASH | --aes-key HEXKEY | -k | --kdcHost KDCHOST]\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\nConfig:\n  --debug               Enable debug mode.\n  --no-colors           Disable colored output.\n  -l LOGFILE, --logfile LOGFILE\n                        Log file path.\n  -T TIMEOUT, --timeout TIMEOUT\n                        Timeout for SMB connections (default: 3s)\n  -a ADVERTISED_NAME, --advertised-name ADVERTISED_NAME\n                        Advertised machine name.\n\nCommands:\n  -C COMMAND, --command COMMAND\n                        smbclient-ng commands to execute.\n  -S STARTUP_SCRIPT, --startup-script STARTUP_SCRIPT\n                        Startup script with commands.\n  -N, --not-interactive\n                        Non-interactive mode.\n\nTarget:\n  -H HOST, --host HOST  Target SMB Server IP or hostname.\n  -P PORT, --port PORT  Target SMB Server port (default: 445).\n\nAuthentication \u0026 Connection:\n  -d DOMAIN, --domain DOMAIN\n                        Authentication domain.\n  -u USER, --user USER  Username for authentication.\n\nSecrets:\n  -p [PASSWORD], --password [PASSWORD]\n                        Password.\n  --no-pass             Do not prompt for a password.\n  --hashes [LMHASH:]NTHASH\n                        NT/LM hashes.\n  --aes-key HEXKEY      AES key for Kerberos authentication.\n  -k, --kerberos        Use Kerberos authentication.\n  --kdcHost KDCHOST     Fully qualified domain name (FQDN) of key distribution center (KDC) for Kerberos.\n```\n\n## Quick start commands\n\n + Connect to a remote SMB server:\n    ```\n    smbclient-ng -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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Fsmbclient-ng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp0dalirius%2Fsmbclient-ng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Fsmbclient-ng/lists"}