Starting Point - psexec.py error

Hi all,

I was seeking some advice to know why my psexec.py error and i cant work out why.

any help would be appreciated:

Traceback (most recent call last):
file "psexec.py", line 33, in
from impacket.krb5.keytab import Keytab
ImportError: No module named keytab

Comments

  • Hey, so I ran into this same problem.

    If you are running Kali you want to make sure you have used the pip3 install impacket in the main folder for impacket.

    once you have done that you then need to run

    sudo python3 setup.py install

    This finishes the install of impacket and should allow your command to run

  • I too had this problem, albeit with smbexec.py. I realised that calling the script from the impacket/examples dir where it resides normally worked fine.. but calling it from a dir in my root directory raised the exception. If you look in the impacket directory, there's a folder called impacket/krb5 containing a file called keytab.py.. calling the script from somewhere outside this directory sometimes means the smbexec.py/psexec.py can't find that krb5 dir for some reason.. but that's mystery partially solved I guess...

  • Clone the files from the github repo, then run pip3 install . in the cloned directory.

    IMPORTANT: The install process will create a new build folder. Navigate to the build folder then locate the scripts within the build directory. Mine are in a subfolder titled scripts-3.8. You'll want to run your scripts from the build directory. I think most issues here are from people running the python scripts from outside of the build directory--i.e., in the examples folder.

    d3v1ant

  • Type your comment> @d3v1ant said:

    Clone the files from the github repo, then run pip3 install . in the cloned directory.

    IMPORTANT: The install process will create a new build folder. Navigate to the build folder then locate the scripts within the build directory. Mine are in a subfolder titled scripts-3.8. You'll want to run your scripts from the build directory. I think most issues here are from people running the python scripts from outside of the build directory--i.e., in the examples folder.

    This was my issue, thank you for this! Appreciate you taking the time to comment.

  • Specifying python3 psexec.py is what fixed it for me.

  • edited January 14

    hay, I also have a problem with psexec.py. So, now I am working with the first machine and when i enter the next command:
    psexec.py [email protected]
    i enter the pass and get this:
    Password:
    [] Requesting shares on 10.10.10.27.....
    [
    ] Found writable share ADMIN$
    [*] Uploading file tdDuQHqv.exe
    And then nothing happens, I have waited for about 15 minutes, but nothing
    may be someone can help me with such problem

  • TazWake

    Note: https://www.nohello.com/

    Happy to help people but PLEASE explain your problem in as much detail as possible! If you say vague things like "It's not working", I cant help. This isn't Twitter so my DMs are always open.

Sign In to comment.