byt3bl33d3r / CrackMapExec

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

Get-ComputerDetails module isn't working - no such file Get-ComputerDetails.ps1 #281

Closed Gvald closed 2 years ago

Gvald commented 5 years ago

Steps to reproduce

  1. Try running the Get-ComputerDetails module in smb
  2. Observe the output (gracefully failing...)

Command string used

cme smb -M Get-ComputerDetails

CME verbose output (using the --verbose flag)

{'clear_obfscripts': False,
 'content': False,
 'continue_on_success': False,
 'cred_id': [],
 'darrell': False,
 'depth': None,
 'disks': False,
 'domain': None,
 'exclude_dirs': '',
 'exec_method': None,
 'execute': None,
 'fail_limit': None,
 'force_ps32': False,
 'gen_relay_list': None,
 'gfail_limit': None,
 'groups': None,
 'hash': [],
 'jitter': None,
 'list_modules': False,
 'local_auth': False,
 'local_groups': None,
 'loggedon_users': False,
 'lsa': False,
 'module': 'Get-ComputerDetails',
 'module_options': [],
 'no_output': False,
 'ntds': None,
 'obfs': False,
 'only_files': False,
 'pass_pol': False,
 'password': [],
 'pattern': None,
 'port': 445,
 'protocol': 'smb',
 'ps_execute': None,
 'regex': None,
 'rid_brute': None,
 'sam': False,
 'server': 'https',
 'server_host': '0.0.0.0',
 'server_port': None,
 'sessions': False,
 'share': 'C$',
 'shares': False,
 'show_module_options': False,
 'spider': None,
 'spider_folder': '.',
 'target': [],
 'threads': 100,
 'timeout': None,
 'ufail_limit': None,
 'username': [],
 'users': None,
 'verbose': True,
 'wmi': None,
 'wmi_namespace': 'root\\cimv2'}
Traceback (most recent call last):
  File "/usr/local/bin/cme", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/cme/crackmapexec.py", line 162, in main
    module = loader.init_module(props['path'])
  File "/usr/local/lib/python2.7/dist-packages/cme/loaders/module_loader.py", line 96, in init_module
    module.options(context, module_options)
  File "/usr/local/lib/python2.7/dist-packages/cme/modules/Get-ComputerDetails.py", line 26, in options
    self.ps_script1 = obfs_ps_script('cme_powershell_scripts/Get-ComputerDetails.ps1')
  File "/usr/local/lib/python2.7/dist-packages/cme/helpers/powershell.py", line 57, in obfs_ps_script
    with open(get_ps_script(path_to_script), 'r') as script:
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/cme/data/cme_powershell_scripts/Get-ComputerDetails.ps1'

CME Version (cme --version)

4.0.1dev - Bug Pr0n

OS

Kali GNU/Linux Rolling, Ver. 2018.4

Target OS

Any

Detailed issue explanation

The Get-ComputerDetails module tries to execute the powershell script Get-ComputerDetails.ps1, which should resides in CME-PowerShell-Scripts repository. However, the script simply isn't there...

User temporary quick-fix

Copy the Get-ComputerDetails.ps1 file from dist-packages/cme/data/powersploit/Recon/ into your dist-packages/cme/data/cme_powershell_scripts/ folder.

awsmhacks commented 5 years ago

Possibly an issue with the installation steps?

Did you use the --recursive flag? See https://github.com/byt3bl33d3r/CrackMapExec/issues/267 for a similar issue.

Let us know if that wasnt it.

I seem to remember something else like this being an issue and it had to do with a python lib in setup.py changing how it worked.

mpgn commented 2 years ago

module removed