{"id":17994896,"url":"https://github.com/p0dalirius/pylaps","last_synced_at":"2025-10-25T17:08:34.904Z","repository":{"id":41381739,"uuid":"413937493","full_name":"p0dalirius/pyLAPS","owner":"p0dalirius","description":"Python setter/getter for property ms-Mcs-AdmPwd used by LAPS. ","archived":false,"fork":false,"pushed_at":"2024-10-28T08:36:38.000Z","size":71,"stargazers_count":101,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T12:06:44.124Z","etag":null,"topics":["ad","administrator","laps","local","ms-mcs-admpwd","python3"],"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-05T18:35:21.000Z","updated_at":"2025-03-30T08:52:41.000Z","dependencies_parsed_at":"2024-08-01T10:56:57.182Z","dependency_job_id":"54dc847b-1a0e-4fa3-aba1-f6081f774abc","html_url":"https://github.com/p0dalirius/pyLAPS","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FpyLAPS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FpyLAPS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FpyLAPS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2FpyLAPS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p0dalirius","download_url":"https://codeload.github.com/p0dalirius/pyLAPS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"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":["ad","administrator","laps","local","ms-mcs-admpwd","python3"],"created_at":"2024-10-29T20:17:06.779Z","updated_at":"2025-10-25T17:08:29.858Z","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  A simple way to read and write LAPS passwords from linux.\n  \u003cbr\u003e\n  \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/p0dalirius/pyLAPS\"\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\nThis script is a python setter/getter for property ms-Mcs-AdmPwd used by LAPS inspired by [@swisskyrepo](https://github.com/swisskyrepo/)'s [SharpLAPS](https://github.com/swisskyrepo/SharpLAPS) in C#.\n\nRequire (either):\n  * Account with `ExtendedRight` or `GenericRead` to get LAPS passwords\n  * Account with `ExtendedRight` or `GenericWrite` to set LAPS passwords\n  * Domain Admin privileges\n\n## General usage\n\nThis tool supports many authentication methods:\n\n```\n                 __    ___    ____  _____\n    ____  __  __/ /   /   |  / __ \\/ ___/\n   / __ \\/ / / / /   / /| | / /_/ /\\__ \\   \n  / /_/ / /_/ / /___/ ___ |/ ____/___/ /   \n / .___/\\__, /_____/_/  |_/_/    /____/    v1.2\n/_/    /____/           @podalirius_           \n\nusage: pyLAPS.py [-h] [--use-ldaps] [-q] [-debug] [-a [{get,set}]] [-c TARGET_COMPUTER] [-v TARGET_VALUE] [--dc-ip ip address] [-d DOMAIN] [-u USER]\n [--no-pass | -p PASSWORD | -H [LMHASH:]NTHASH | --aes-key hex key] [-k]\n\nPython setter/getter for property ms-Mcs-AdmPwd used by LAPS.\n\noptional arguments:\n-h, --help            show this help message and exit\n--use-ldaps           Use LDAPS instead of LDAP\n-debug                Debug mode\n-a [{get,set}], --action [{get,set}]\n        Get or Set the LAPS password\n-c TARGET_COMPUTER, --computer TARGET_COMPUTER\n        Target computer to modify\n-v TARGET_VALUE, --value TARGET_VALUE\n        New password to set\n\nauthentication \u0026 connection:\n--dc-ip ip address    IP Address of the domain controller or KDC (Key Distribution Center) for Kerberos. If omitted it will use the domain part (FQDN)\n        specified in the identity parameter\n-d DOMAIN, --domain DOMAIN\n        (FQDN) domain to authenticate to\n-u USER, --user USER  User to authenticate as\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 valid credentials cannot be found, it will use the ones specified in the command line\n\n```\n\n## Read the password of all computers\n\n```\n# ./pyLAPS.py --action get -u 'Administrator' -d 'LAB.local' -p 'Admin123!' --dc-ip 192.168.2.1\n                 __    ___    ____  _____\n    ____  __  __/ /   /   |  / __ \\/ ___/\n   / __ \\/ / / / /   / /| | / /_/ /\\__ \\   \n  / /_/ / /_/ / /___/ ___ |/ ____/___/ /   \n / .___/\\__, /_____/_/  |_/_/    /____/    v1.2\n/_/    /____/           @podalirius_           \n\n[+] Extracting LAPS passwords of all computers ...\n  | PC01$           : H0zqUkoCAcbVXf0Q3ZbQ\n  | PC02$           : PoSaRYUhqbLQjWjY9D0g\n  | PC17$           : spf41mUjm9pxrgl11Osd\n  | PC25$           : oqy814nS1p2lRVlatcKG\n```\n\n\n## Read the password of a specific computer\n\n```\n# ./pyLAPS.py --action get --computer 'PC01$' -u 'Administrator' -d 'LAB.local' -p 'Admin123!' --dc-ip 192.168.2.1\n                 __    ___    ____  _____\n    ____  __  __/ /   /   |  / __ \\/ ___/\n   / __ \\/ / / / /   / /| | / /_/ /\\__ \\   \n  / /_/ / /_/ / /___/ ___ |/ ____/___/ /   \n / .___/\\__, /_____/_/  |_/_/    /____/    v1.2\n/_/    /____/           @podalirius_           \n\n[+] Extracting LAPS password of computer: PC01$ ...\n[+] Searching for the target computer: PC01$\n[+] Target computer found: CN=PC01,OU=LAPS Managed Computers,DC=LAB,DC=local\n  | PC01$           : Wookie123\n```\n\n## Write a random password to a specific computer\n\nWhen no password is supplied with `--value`, a random password is generated.\n\n```\n# ./pyLAPS.py --action set --computer 'PC01$' -u 'Administrator' -d 'LAB.local' -p 'Admin123!' --dc-ip 192.168.2.1\n                 __    ___    ____  _____\n    ____  __  __/ /   /   |  / __ \\/ ___/\n   / __ \\/ / / / /   / /| | / /_/ /\\__ \\   \n  / /_/ / /_/ / /___/ ___ |/ ____/___/ /   \n / .___/\\__, /_____/_/  |_/_/    /____/    v1.2\n/_/    /____/           @podalirius_           \n\n[+] Setting LAPS password in LDAP ...\n[+] Searching for the target computer\n[+] Target computer found: CN=PC01,OU=LAPS Managed Computers,DC=LAB,DC=local\n[+] Using random password: qnaEmUsWOqQ6d2PR6wVr\n[+] Successfully updated the ms-Mcs-AdmPwd attribute of the target PC01$ to qnaEmUsWOqQ6d2PR6wVr\n```\n\n## Write a specific password to a specific computer\n\nYou can set the value of `ms-Mcs-AdmPwd` on a specific computer with `--value` option like this:\n\n```\n# ./pyLAPS.py --action set --computer 'PC01$' --value \"Wookie123\" -u 'Administrator' -d 'LAB.local' -p 'Admin123!' --dc-ip 192.168.2.1\n                 __    ___    ____  _____\n    ____  __  __/ /   /   |  / __ \\/ ___/\n   / __ \\/ / / / /   / /| | / /_/ /\\__ \\   \n  / /_/ / /_/ / /___/ ___ |/ ____/___/ /   \n / .___/\\__, /_____/_/  |_/_/    /____/    v1.2\n/_/    /____/           @podalirius_               \n\n[+] Setting LAPS password in LDAP ...\n[+] Searching for the target computer\n[+] Target computer found: CN=PC01,OU=LAPS Managed Computers,DC=LAB,DC=local\n[+] Successfully updated the ms-Mcs-AdmPwd attribute of the target PC01$ to Wookie123\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%2Fpylaps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp0dalirius%2Fpylaps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Fpylaps/lists"}