quentinhardy / odat

ODAT: Oracle Database Attacking Tool
1.6k stars 345 forks source link

Upload file failed #35

Closed Fireplop closed 4 years ago

Fireplop commented 4 years ago

Hi, I am having issues uploading a file using the latest release version of the tool: OS: archlinux error:

./odat-libc2.12-x86_64 utlfile -s X.X.X.X -p 1521 -U scott -P tiger -d XE --sysdba --putFile c:/ test.exe test.exe                                

[1] (X.X.X.X:1521): Put the test.exe local file in the c:/ folder like test.exe on the X.X.X.X server                                                                                                   
Traceback (most recent call last):                                                                                                                                                                                                            
  File "odat.py", line 562, in <module>                                                                                                                                                                                                       
  File "odat.py", line 557, in main                                                                                                                                                                                                           
  File "UtlFile.py", line 305, in runUtlFileModule                                                                                                                                                                                            
  File "UtlFile.py", line 60, in putFile                                                                                                                                                                                                      
  File "UtlFile.py", line 38, in __createFile__                                                                                                                                                                                               
AttributeError: 'bytes' object has no attribute 'encode'                                                                                                                                                                                      
[14993] Failed to execute script odat

Am I doing something wrong ?

Thank you

quentinhardy commented 4 years ago

Thank you for this information. It was a bug during the porting of python 2.7 to python 3. Bug fixed now in https://github.com/quentinhardy/odat/commit/041a3cf24aedb41870d152a37b318deaddfe2cf5

This bug is not fixed in standalone release yet.

If I remember correctly, some copy errors will occur if you try to upload a binary file (e.g. exe/PE file) on the target with UTLFILE. I think it will be more safe to upload a script file (.ps1_) on the target for avoiding some special chars.

quentinhardy commented 4 years ago

Fixed in last standalone release.