byt3bl33d3r / CrackMapExec

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

What is the proper way to specify a deep share? #154

Closed jackassplus closed 7 years ago

jackassplus commented 7 years ago

The share lives in a Win2k8 server. Windows clients have the drive mapped as: \file01\Data\Shared\Everyone

The users have no access to Data, or Data\Users\, or Data\Users\Shared, but has access to Data\Users\Shared\Everyone

crackmapexec 192.168.17.233 -d rg -u "user" -p "pass" --verbose --share "Data\\Users\\Shared\\Everyone\\" --spider --pattern pass ultimately yields Failed to connect to share Data\Users\Shared\Everyone\: SMB SessionError: STATUS_INVALID_PARAMETER(An invalid parameter was passed to a service or function.)

crackmapexec rg-file01 -d rg -u "user" -p "pass" --verbose --share "Data" --spider --pattern pass gives the expected:[-] Failed to connect to share Data: SMB SessionError: STATUS_ACCESS_DENIED({Access Denied} A process has requested access to an object but has not been granted those access rights.)

every combination of escapes, leading/trailing slashes (forward and back) gives either STATUS_INVALID_PARAMETER or STATUS_BAD_NETWORK_NAME ( ex. --share "Data/Users/Shared/Everyone" )

byt3bl33d3r commented 7 years ago

Sorry I took so long with this, wanted to get v4.0 out (which i just pushed to master). As of v4.0 the proper way to spider stuff is:

cme smb <TARGETS> -u user -p pass --spider <SHARE> --pattern <PATTERN>

Let me know if that works and clears things up. Comment below otherwise. Cheers