Skip to content

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