Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 conversion #14

Merged
merged 5 commits into from
Sep 19, 2021
Merged

Python 3 conversion #14

merged 5 commits into from
Sep 19, 2021

Conversation

NuHarborMartin
Copy link
Contributor

Upgrading to Python3 (#10 ) and handling all the byte/string changes to ensure the encryption (XOR and AES) continues to work.

I've successfully tested with Python 3.9.2 (Kali) against IIS 10.0.19041.1 (Windows 10 Pro 21H1 19043.1110). I ran tests with the original ShaPyShell (Python 2.7) to compare results with my changes as well as with Windows Defender both enabled and disabled. The usage seems to be identical now between this version and the older 2.7 version.

All modules were tested and function as expected except for lateral_wmi due to testing limitations.

Fixing the string/bytes conversion needed to work with python3
All modules tested (except lateral)  and responding as they did with 2.7 on an IIS10 box
Now using bytes for both XOR and AES encrypt methods.

Decrypt now returns str. This allows both encryption methods to use the _encrypt_request successfully without encoding issues.
This reverts commit de18c20.
@antonioCoco
Copy link
Owner

This PR looks very good, thanks for your contribution!

I will test the changes in my labs ASAP and will fix/merge accordingly.

I will keep updated this thread.

@antonioCoco
Copy link
Owner

I made some tests and there are still some broken functionalities (AES, SharPyShellPrompt and download module). Anyway it partially works, so i'm merging it into the py3 branch and i will fix what is remaining. Keep an eye on the commits of the branch https://github.com/antonioCoco/SharPyShell/tree/py3
Thanks for the contrib!

@antonioCoco antonioCoco merged commit 51f97b7 into antonioCoco:py3 Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants