[BUG] Python3 Implant Not Working
r00t0v3rr1d3 opened this issue · comments
Description
Using Python 3.9.2 that is installed by default on the latest up-to-date Kali results in errors and implants not functioning.
Execution Environment:
All of this must be filled in
Data | Value |
---|---|
Full Posh version (all the text between the === at the top of the Implant Handler) | PoshC2 v7.4.0 (f6664b1) |
OS & version | Kali 2021.2 Rolling |
Using Docker/containerisation? | no |
Implant Info
- What implant does the problem occur on? Python
- How was the implant created? python3 /var/poshc2/project/py_dropper.py
Defensive Technologies
- Is the target environment running any particular defensive products? No
To Reproduce
Steps to reproduce the behavior:
- Install PoshC2 with defaults.
- Create a project named project.
- Run python3 /var/poshc2/project/py_dropper.py
Expected behavior
Implant shows up as expected - "New Python implant connected..." - and it displays all the expected information, but it doesn't accept commands or return results. Every check-in it spits out:
error expected string or bytes-like object
'utf-8' codec can't decode byte byte 0xc1 in position 0: invalid start byte
error expected string or bytes-like-object
Also, when running the implant using python2, it appears to function properly, but every time it checks in with no tasking, it spits out an error: Incorrect padding.
Screenshots
Hi,
Will give this a test shortly. Thanks for raising a bug, was the comms local e.g. over the local network or domain fronted or via a proxy or anything?
Thanks
The comms were local, on the same machine actually.
Hi - do you mind trying this branch - https://github.com/nettitude/PoshC2/tree/update-mods
Tested against both python2 and python3. There are some errors on the dropper side that are not suppressed but are expected just FYI
Looks great! Python2 and Python3 implants working on latest Kali.
Amazing, will get this PR closed and into DEV this week