BC-SECURITY / Empire

Empire is a post-exploitation and adversary emulation framework that is used to aid Red Teams and Penetration Testers.
https://bc-security.gitbook.io/empire-wiki/
BSD 3-Clause "New" or "Revised" License
4.21k stars 575 forks source link

ModuleNotFoundError: No module named 'Crypto' HELP me please #658

Closed vlados31999 closed 1 year ago

vlados31999 commented 1 year ago

Traceback (most recent call last): File "/home/user/opt/Empire/empire.py", line 11, in import empire.server.server as server File "/home/user/opt/Empire/empire/server/server.py", line 17, in from empire.server.common import empire File "/home/user/opt/Empire/empire/server/common/empire.py", line 38, in from . import agents, credentials, listeners, stagers File "/home/user/opt/Empire/empire/server/common/agents.py", line 62, in from . import encryption, helpers, packets File "/home/user/opt/Empire/empire/server/common/encryption.py", line 32, in from Crypto.Cipher import PKCS1_v1_5 ModuleNotFoundError: No module named 'Crypto'

ytza commented 1 year ago

I had a similar issue when the program was loading. It seems there is crypto and cryptodome, pycryptodome, pycryptodomex. My issue was that it said no module named 'Cryptodome'. I edited the code and changed it to "From Crypto.Cipher" instead of "From Cryptodome.Cipher". Perhaps if you change the entry to Cryptodome, or one of the other options, it will work.

vlados31999 commented 1 year ago

Friend, can you write in which file you need to change? Thanks

ytza commented 1 year ago

It depends on your error output. Looking at yours it's the encryption.py and it will have a line with "from Crypto.Cipher".

vlados31999 commented 1 year ago

Friend, thank you I see this entry from

Crypto.Cipher import PKCS1_v1_5

What should I rename it to??Thanks

vlados31999 commented 1 year ago

Now here is the error

ModuleNotFoundError: No module named 'Cryptodome'

lavafroth commented 1 year ago

Try running the following:

pip3 uninstall crypto 
pip3 uninstall pycrypto 
pip3 install pycryptodome
vlados31999 commented 1 year ago

Friends Thank you all for your help Empire launched, there were a lot of errors Now the client freezes after the uselisteners command and any others

empire

vlados31999 commented 1 year ago

It works via the web

Cx01N commented 1 year ago

Glad it's working, I'm going to close this topic out and you can open a new issue if the client is having some issues.