Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__copy_file_to_windows function second argument is "desintation" instead of "destination" #60

Open
akivashor opened this issue Jan 16, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@akivashor
Copy link

akivashor commented Jan 16, 2023

Describe the bug
At this path:
atomic_operator/execution/copier.py
The function "__copy_file_to_windows" function second argument is "desintation" instead of "destination".
The problem is it isn't only a typo.
When you call this function from the code at line 51 of the same file the call fails since the call variables are specified with their names:
self.__copy_file_to_windows(source=source, destination=destination).

Please replace all "destination" mentions in the code(3):
def __copy_file_to_windows(self, source, destination):
try:
command = f"New-Item -Path {os.path.dirname(destination)} -ItemType Directory"
if self.elevation_required:
command = f'Start-Process PowerShell -Verb RunAs; {command}'
output, streams, had_errors = self.windows_client.execute_ps(command)
response = self.windows_client.copy(source, destination)
except:
self.__logger.warning(f'Unable to execute copy of supporting file {source}')
self.__logger.warning(f'Output: {output}/nStreams: {streams}/nHad Errors: {had_errors}')

To Reproduce
Steps to reproduce the behavior:

  1. For example: Run the atomic operator on T1218.002 with remoteRunner and it will try to copy a file to windows.
  2. You will get an error

Expected behaviour
The expected behaviour should be for it to run without any errors

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Window10
@MSAdministrator MSAdministrator self-assigned this Feb 27, 2023
@MSAdministrator MSAdministrator added the bug Something isn't working label Feb 27, 2023
@MSAdministrator
Copy link
Collaborator

@akivashor This is a bug but should be fixed in this version #62 since we are using a new executor framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants