byt3bl33d3r / CrackMapExec

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

Python error when adding target IP to end of CME command #487

Closed reybango closed 3 years ago

reybango commented 3 years ago

Describe the bug Specifying the IP of a target at the end of the CME command generates an error.

To Reproduce Steps to reproduce the behavior:

  1. In a terminal type a command similar to: cme smb -u users.txt -p pwd.txt 10.10.10.149
  2. Run it and the error will display.
  3. See error below: Traceback (most recent call last): File "/home/haribo/.local/bin/cme", line 8, in <module> sys.exit(main()) File "/home/haribo/.local/pipx/venvs/crackmapexec/lib/python3.9/site-packages/cme/crackmapexec.py", line 77, in main if os.path.exists(passw): File "/usr/lib/python3.9/genericpath.py", line 19, in exists os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not TextIOWrapper

Expected behavior Normal scan results would appear

Screenshots image

Crackmapexec info

Additional context Note that specifying the target IP before the command line options works: cme smb 10.10.10.149 -u users.txt -p pwd.txt

mpgn commented 3 years ago

Hello

Try: cme smb 10.10.10.149 -u users.txt -p pwd.txt :)

reybango commented 3 years ago

@mpgn hehe yes I know that works. I mentioned that same syntax in my issue in the Additional context section. What I wanted to report was how an error was thrown if you specified the syntax in the way I had mentioned: cme smb -u users.txt -p pwd.txt 10.10.10.149

Definitely not a pri 0 bug but something to perhaps queue up for later. :)

mpgn commented 3 years ago

Ah, yeah I understand your point, but this exact stacktrace help me to understand better the initial problem ^^