byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.38k stars 1.64k forks source link

PYTHON3 - OS.SYSTEM("crackmapexec...") COMMAND = EOFERROR #442

Open BroadbentT opened 3 years ago

BroadbentT commented 3 years ago

1

Installed on 2019 Kali with dist-upgrade and running as root.

When running crackmapexec commands from python3 using os.system("") - the last command that I run always returns an EoF error. No matter what order I put them in, ie. winrm/smb or smb/winrm or how many (1 to 5 commands in a row test), the last command always errors out with an EOFErrorr at the next function call. The prompt() command shown above is not the issue as it works for all other function calls within my program (https://github.com/BroadbentT/ROGUE-AGENT), and I have put it before the crackmapexec commands and it works!

Its as if the crackmapexec command does not terminate properly when returning to the python coding ?

Kind regards Tez

BroadbentT commented 3 years ago

Some more data - I added try on error code - TypeError: can only concatenate str (not "EOFError") to str. Not sure if it helps ? Also considering if its possible related to the number of files I have open?

Original code:

           command("crackmapexec smb " + TIP.rstrip(" ") + " -u " + USR.rstrip(" ") + " -H :" + NTM.rstrip(" ") + " --local-auth --ntds drsuapi")                    

  try:
     null = input("\nPress ENTER to continue...")
  except EOFError as e:
     print("[!] Crackmap is generating this error: " + e + "...")

Error message:

Press ENTER to continue...Traceback (most recent call last): File "/root/Documents/ROGUE-AGENT/rogue-agent.py", line 2551, in null = input("\nPress ENTER to continue...") EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/Documents/ROGUE-AGENT/rogue-agent.py", line 2553, in print("[!] Crackmap is generating this error: " + e + "...") TypeError: can only concatenate str (not "EOFError") to str

Marshall-Hallenbeck commented 1 year ago

Is this still an issue? I'm not sure this is a problem with CME.