Fix compatibility with Python 3.13 (crypt module removal & deprecated import logic)#296
Open
Chocapikk wants to merge 2 commits intocalebstewart:masterfrom
Open
Fix compatibility with Python 3.13 (crypt module removal & deprecated import logic)#296Chocapikk wants to merge 2 commits intocalebstewart:masterfrom
Chocapikk wants to merge 2 commits intocalebstewart:masterfrom
Conversation
…crypt) - Replaced deprecated `find_module` usage in `CommandParser` and `Manager` by `importlib.util.module_from_spec` and `exec_module` (fixes AttributeError: 'FileFinder' object has no attribute 'find_module') - Replaced `crypt.crypt(...)` with `passlib.hash.sha512_crypt` for password hashing (fixes ModuleNotFoundError: No module named 'crypt') - Added `passlib` as a dependency in `pyproject.toml` under [tool.poetry.dependencies] (fixes ModuleNotFoundError: No module named 'passlib')
63b2df4 to
9f81b10
Compare
…tibility Fixed CVE-2019-14287 detection logic. Also reverted a previous accidental change that broke pickle serialization, preventing persistent storage from working properly.
|
Are you also getting an error when trying to get a shell from a windows target? I get this: |
Author
|
Hey @Yakui420 , I haven't looked or tested it on Windows environments. But I just think that this payload is not compatible with the env. It says that a command cannot be found, I think it's "stty" here, you will have to add an alternative payload for the interactive shell. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes
pwncatcompatibility with Python 3.13 by addressing five key issues:Fixes included
Module replacement
cryptmodule (dropped in Python 3.13)passlib.hash.sha512_cryptfor hashing/etc/passwdentries→ Updated in:
modules/linux/enumerate/escalate/append_passwd.pymodules/linux/implant/passwd.pyImport system cleanup
pwncat/commands/__init__.pypwncat/manager.pyCVE-2019-14287 detection fix
try/exceptwithpackaging.version.parse()→ Prevents crashes on systems with distro-specific or malformed sudo versions.
Pickle serialization fix
→ Restores proper enumeration, persistence, and database commits.
Dependency update
passlibtopyproject.tomlto support the new password hashing backend.Errors resolved
ModuleNotFoundError: No module named 'crypt'AttributeError: 'FileFinder' object has no attribute 'find_module'PicklingError: Can't pickle <class ...>How to install this fix immediately
If this PR is not yet merged, you can install the fixed version directly from my fork: