Closed ccben87 closed 1 week ago
My mistake, none of the info in this report is correct. Same result happens if executed directly in Velociraptor. Apparently Velociraptor doesn't like that particular command.
PS Thanks for sorting out Velociraptor orgs!
Sorry is there an issue here or was just the command you were using incorrect and we can close this issue out?
I thought I had closed this with my last comment. My bug report is all wrong. Please disregard.
Describe the bug
When attempting to run "Command" on Agent using Velociraptor with "Windows.System.CmdShell", it fails to work with a non-root org. Looking at the logs, it's failing to query the specific org for the agent. Note: Other functions such as "Collect" function works fine.
PS Thanks a lot for your fast work on https://github.com/socfortress/CoPilot/commit/b49a45a1be282b72e34dae187ab666561392009b !
To Reproduce Steps to reproduce the behavior:
Expected behavior Expected that the results of the command "dir C:\" is returned in Copilot
**Container Logs
2024-06-28 03:49:47.081 | INFO | app.connectors.velociraptor.routes.artifacts:run_command:387 - Received request to run command hostname='<snip>' velociraptor_id=None velociraptor_org=None command='dir C:\\' artifact_name=<CommandArtifactsEnum.windows_cmd: 'Windows.System.CmdShell'>
Here it is not picking up the velociraptor_org which is "None".
2024-06-28 03:49:47.151 | INFO | app.connectors.velociraptor.routes.artifacts:get_velociraptor_org:159 - velociraptor_org for hostname DESKTOP-<snip> is OMP9G
Here it incorrectly retrieves the Velociraptor org name as a subset of the velociraptor_id, namely it retrieves the very end of the velociraptor_id which ends in "-OMP9G" which is not the Velociraptor org. This is odd.
2024-06-28 03:49:47.169 | ERROR | app.connectors.velociraptor.services.artifacts:run_remote_command:216 - Failed to run artifact collection on hostname='DESKTOP-<snip>' velociraptor_id='C.<snip>-OMP9G' velociraptor_org='OMP9G' command='dir C:\\' artifact_name='Windows.System.CmdShell': list index out of range
Must get an empty return because it wasn't executed correctly. This is probably something which can be disregarded because if the query executed against the right org then this error shouldn't happen.