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

oleautomation write file still uses python2 syntax #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RichHacks
Copy link

You will get an error as below when running the command:

./msdat.py oleautomation -s x.x.x.x -p 1433 -U sa -P sa --put-file '/home/kali/Desktop/test.txt' 'C:/temp/' 


[1] (x.x.x.x:1433): Try to copy the local file /home/kali/test.txt to C:/temp/
Traceback (most recent call last):
  File "/home/kali/pentest/tools/msdat/./msdat.py", line 394, in <module>
    main()
  File "/home/kali/pentest/tools/msdat/./msdat.py", line 389, in main
    arguments.func(args)
  File "/home/kali/pentest/tools/msdat/OleAutomation.py", line 285, in runOleAutomationModule
    data = oleAutomation.putFile(args['put-file'][0],args['put-file'][1])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/pentest/tools/msdat/OleAutomation.py", line 184, in putFile
    dataEncoded = "0x"+data.encode('hex')
                       ^^^^^^^^^^^
AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'?

The change here should resolve it.

fix a bug in the transition from python2 to python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant