{"id":17994917,"url":"https://github.com/p0dalirius/finduncommonshares","last_synced_at":"2025-03-26T02:31:14.177Z","repository":{"id":41381983,"uuid":"414203628","full_name":"p0dalirius/FindUncommonShares","owner":"p0dalirius","description":"FindUncommonShares is a Python script allowing to quickly find uncommon shares in vast Windows Domains, and filter by READ or WRITE accesses.","archived":false,"fork":false,"pushed_at":"2024-10-28T08:34:54.000Z","size":2181,"stargazers_count":387,"open_issues_count":0,"forks_count":45,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-28T10:32:00.084Z","etag":null,"topics":["active-directory","pentesting","python","shares","smb","uncommon","windows"],"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":null,"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":null,"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":"2021-10-06T12:30:16.000Z","updated_at":"2024-10-28T08:34:58.000Z","dependencies_parsed_at":"2023-11-28T14:29:46.871Z","dependency_job_id":"d10d0ea7-c75a-419c-b1ba-f79e2cf32bed","html_url":"https://github.com/p0dalirius/FindUncommonShares","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FFindUncommonShares","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FFindUncommonShares/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FFindUncommonShares/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FFindUncommonShares/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p0dalirius","download_url":"https://codeload.github.com/p0dalirius/FindUncommonShares/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222105679,"owners_count":16932043,"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":["active-directory","pentesting","python","shares","smb","uncommon","windows"],"created_at":"2024-10-29T20:17:11.602Z","updated_at":"2024-10-29T20:17:12.080Z","avatar_url":"https://github.com/p0dalirius.png","language":"Python","funding_links":["https://github.com/sponsors/p0dalirius","https://patreon.com/Podalirius"],"categories":[],"sub_categories":[],"readme":"![](./.github/banner.png)\n\n\u003cp align=\"center\"\u003e\n    The script \u003ca href=\"https://github.com/p0dalirius/FindUncommonShares/blob/main/FindUncommonShares.py\"\u003eFindUncommonShares.py\u003c/a\u003e is a Python equivalent of \u003ca href=\"https://github.com/darkoperator/Veil-PowerView/\"\u003ePowerView\u003c/a\u003e's \u003ca href=\"https://github.com/darkoperator/Veil-PowerView/blob/master/PowerView/functions/Invoke-ShareFinder.ps1\"\u003eInvoke-ShareFinder.ps1\u003c/a\u003e allowing to quickly find uncommon shares in vast Windows Active Directory Domains.\n    \u003cbr\u003e\n    \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/p0dalirius/FindUncommonShares\"\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\n## Features\n\n - [x] Only requires a **low privileges domain user account**.\n - [x] Automatically gets the list of all computers from the domain controller's LDAP.\n - [x] Ignore the hidden shares (ending with `$`) with `--ignore-hidden-shares`.\n - [x] Multithreaded connections to discover SMB shares.\n - [x] Export results in JSON with IP, name, comment, flags and UNC path with `--export-json \u003cfile.json\u003e`.\n - [x] Export results in XLSX with IP, name, comment, flags and UNC path with `--export-xlsx \u003cfile.xlsx\u003e`.\n - [x] Export results in SQLITE3 with IP, name, comment, flags and UNC path with `--export-sqlite \u003cfile.db\u003e`.\n - [x] Iterate on LDAP result pages to get every computer of the domain, no matter the size.\n\n## Demonstration\n\n![](./.github/example.png)\n\n## Quick win commands\n\n + List all shares where your current user has WRITE access:\n    ```\n    ./FindUncommonShares.py -au user -ap 'Podalirius123!' -ad DOMAIN --auth-dc-ip 192.168.1.71 --writable\n    ```\n \n + Export list of shares in the domain to an Excel file for the client:\n   ```\n   ./FindUncommonShares.py -au user -ap 'Podalirius123!' -ad DOMAIN --auth-dc-ip 192.168.1.71 --export-xlsx ./examples/results.xlsx\n   ```\n\n + List all shares with access rights for your current user:\n    ```\n    ./FindUncommonShares.py -au user -ap 'Podalirius123!' -ad DOMAIN --auth-dc-ip 192.168.1.71 --check-user-access\n    ```\n   \n## Usage\n\n```              \n$ ./FindUncommonShares.py -h\nFindUncommonShares v3.2 - by @podalirius_\n\nusage: FindUncommonShares.py [-h] [-v] [-q] [--debug] [-no-colors] [-t THREADS] [-ns NAMESERVER] [-tf TARGETS_FILE] [-tt TARGET] [-tu TARGET_URL]\n                             [-tU TARGETS_URLS_FILE] [-tp TARGET_PORTS] [-ad AUTH_DOMAIN] [-ai AUTH_DC_IP] [-au AUTH_USER] [--ldaps] [--no-ldap] [--subnets]\n                             [-tl TARGET_LDAP_QUERY] [--no-pass | -ap AUTH_PASSWORD | -ah AUTH_HASHES | --aes-key hex key] [-k] [--kdcHost AUTH_KDCHOST]\n                             [--check-user-access] [--readable] [--writable] [-iH] [-iP] [-i IGNORED_SHARES] [-s ACCEPTED_SHARES] [--export-xlsx EXPORT_XLSX]\n                             [--export-json EXPORT_JSON] [--export-sqlite EXPORT_SQLITE]\n\nFind uncommon SMB shares on remote machines.\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --verbose         Verbose mode. (default: False).\n  -q, --quiet           Show no information at all.\n  --debug               Debug mode. (default: False).\n  -no-colors            Disables colored output mode.\n  -t THREADS, --threads THREADS\n                        Number of threads (default: 20).\n  -ns NAMESERVER, --nameserver NAMESERVER\n                        IP of the DNS server to use, instead of the --dc-ip.\n\nTargets:\n  -tf TARGETS_FILE, --targets-file TARGETS_FILE\n                        Path to file containing a line by line list of targets.\n  -tt TARGET, --target TARGET\n                        Target IP, FQDN or CIDR.\n  -tu TARGET_URL, --target-url TARGET_URL\n                        Target URL to the tomcat manager.\n  -tU TARGETS_URLS_FILE, --targets-urls-file TARGETS_URLS_FILE\n                        Path to file containing a line by line list of target URLs.\n  -tp TARGET_PORTS, --target-ports TARGET_PORTS\n                        Target ports to scan top search for Apache Tomcat servers.\n  -ad AUTH_DOMAIN, --auth-domain AUTH_DOMAIN\n                        Windows domain to authenticate to.\n  -ai AUTH_DC_IP, --auth-dc-ip AUTH_DC_IP\n                        IP of the domain controller.\n  -au AUTH_USER, --auth-user AUTH_USER\n                        Username of the domain account.\n  --ldaps               Use LDAPS (default: False)\n  --no-ldap             Do not perform LDAP queries.\n  --subnets             Get all subnets from the domain and use them as targets (default: False)\n  -tl TARGET_LDAP_QUERY, --target-ldap-query TARGET_LDAP_QUERY\n                        LDAP query to use to extract computers from the domain.\n\nCredentials:\n  --no-pass             Don't ask for password (useful for -k)\n  -ap AUTH_PASSWORD, --auth-password AUTH_PASSWORD\n                        Password of the domain account.\n  -ah AUTH_HASHES, --auth-hashes AUTH_HASHES\n                        LM:NT hashes to pass the hash for this user.\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 valid credentials cannot\n                        be found, it will use the ones specified in the command line\n  --kdcHost AUTH_KDCHOST\n                        IP of the domain controller.\n\nShares:\n  --check-user-access   Check if current user can access the share.\n  --readable            Only list shares that current user has READ access to.\n  --writable            Only list shares that current user has WRITE access to.\n  -iH, --ignore-hidden-shares\n                        Ignores hidden shares (shares ending with $)\n  -iP, --ignore-print-queues\n                        Ignores print queues (shares of STYPE_PRINTQ)\n  -i IGNORED_SHARES, --ignore-share IGNORED_SHARES\n                        Specify shares to ignore explicitly. (e.g., --ignore-share \"C$\" --ignore-share \"Backup\")\n  -s ACCEPTED_SHARES, --show-share ACCEPTED_SHARES\n                        Specify shares to show explicitly. (e.g., --show-share \"C$\" --show-share \"Backup\")\n\nOutput files:\n  --export-xlsx EXPORT_XLSX\n                        Output XLSX file to store the results in.\n  --export-json EXPORT_JSON\n                        Output JSON file to store the results in.\n  --export-sqlite EXPORT_SQLITE\n                        Output SQLITE3 file to store the results in.\n```\n\n## Exported results\n\nEach JSON entry looks like this:\n\n```json\n{\n    \"computer\": {\n        \"fqdn\": \"TDC01.DOMAIN.local\",\n        \"ip\": \"192.168.1.71\"\n    },\n    \"share\": {\n        \"name\": \"IPC$\",\n        \"comment\": \"Remote IPC\",\n        \"hidden\": true,\n        \"uncpath\": \"\\\\\\\\192.168.1.71\\\\IPC$\\\\\",\n        \"type\": {\n            \"stype_value\": 2147483651,\n            \"stype_flags\": [\n                \"STYPE_IPC\",\n                \"STYPE_TEMPORARY\"\n            ]\n        },\n        \"access_rights\": {\n            \"readable\": true,\n            \"writable\": false\n        }\n    }\n}\n```\n\n## Credits\n\n - Feature suggested in [impacket issue #1176](https://github.com/SecureAuthCorp/impacket/issues/1176) by [@CaledoniaProject](https://github.com/CaledoniaProject)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Ffinduncommonshares","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp0dalirius%2Ffinduncommonshares","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Ffinduncommonshares/lists"}