1

I have installed impacket and its requirements on windows, but when I want to execute a python file (in my case send_and_execute.py 192.168.x.x sample.exe), the message:

File ..., line 2, in <module>
 From impacket import smb, smbconnection importerror: no module named impacket

will appeared. I have tested it on two windows systems, but the problem has not been solved. What is the problem? It is necessary to mention that Initially I installed PyCrypto, then I executed these commands and the installation process was apparently successful:

py -m pip install pyasn1
py -m pip install pyasn1-modules
py -m pip install impacket
sh.sagheb
  • 27
  • 1
  • 1
  • 7
  • 1
    Exactly how are you executing the command? It's not uncommon today for a system to have multiple Python installations. – Tim Roberts Nov 09 '21 at 07:42
  • I have python 2.7 and 3.4, but the commands that i have mentioned are exactly what I have run in cmd. – sh.sagheb Nov 09 '21 at 07:49
  • Python ***3.5*** is EOL (not maintained at all any more), so **3.4** is even more so. I'd recommend upgrading. –  Nov 09 '21 at 15:39
  • If you type `py -V`, which does it tell you? I can't help but think that your `pip` call is installing in one, and your `send_and_execute.py` is invoking the other. – Tim Roberts Nov 09 '21 at 18:30
  • @Tim Roberts Python 3.8.5 – sh.sagheb Nov 10 '21 at 09:56
  • Then clearly your assertion that "I have python 2.7 and 3.4" is wrong. Where do you think the 3.8.5 version is coming from? – Tim Roberts Nov 10 '21 at 19:18
  • @Tim Roberts With this situation do I have to delete all versions except 3.8.5? – sh.sagheb Nov 14 '21 at 09:29
  • 1
    Not at all, you just need to make sure the "pip" you are running is for the version of Python you're hoping to use. This is why people often run pip like `python -m pip install ...`. – Tim Roberts Nov 15 '21 at 02:44

1 Answers1

0

Maybe you need to install it from there? https://github.com/SecureAuthCorp/impacket

mrvol
  • 2,575
  • 18
  • 21