Skip to content

Fails when getting data from Oracle XMLTYPE column #260

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

Closed
yonnym opened this issue Nov 26, 2012 · 8 comments
Closed

Fails when getting data from Oracle XMLTYPE column #260

yonnym opened this issue Nov 26, 2012 · 8 comments
Assignees
Milestone

Comments

@yonnym
Copy link

yonnym commented Nov 26, 2012

[12:46:40] [CRITICAL] unhandled exception in sqlmap/1.0-dev-8fe8bea, retry your run with the latest development version from the GitHub repository. If the exception persists, please send by e-mail to '[email protected]' or open a new issue at 'https://github.com/sqlmapproject/sqlmap/issues/new' with the following text and any information required to reproduce the bug. The developers will try to reproduce the bug, fix it accordingly and get back to you.
sqlmap version: 1.0-dev-8fe8bea
Python version: 2.7.1+
Operating system: posix
Command line: ./sqlmap.py -d ************************************************* -D ******* -T ************* --dump
Technique: None
Back-end DBMS: Oracle (fingerprinted)
Traceback (most recent call last):
File "/pentest/database/sqlmap-dev/sqlmap.py", line 73, in main
start()
File "/pentest/database/sqlmap-dev/lib/controller/controller.py", line 241, in start
action()
File "/pentest/database/sqlmap-dev/lib/controller/action.py", line 127, in action
conf.dbmsHandler.dumpTable()
File "/pentest/database/sqlmap-dev/plugins/generic/entries.py", line 163, in dumpTable
entries = inject.getValue(query, blind=False, time=False, dump=True)
File "/pentest/database/sqlmap-dev/lib/request/inject.py", line 391, in getValue
value = direct(forgeCaseExpression if expected == EXPECTED.BOOL else expression)
File "/pentest/database/sqlmap-dev/lib/request/direct.py", line 56, in direct
hashDBWrite(query, output, True)
File "/pentest/database/sqlmap-dev/lib/core/common.py", line 3259, in hashDBWrite
conf.hashDB.write(
, value, serialize)
File "/pentest/database/sqlmap-dev/lib/utils/hashdb.py", line 85, in write
self.write_cache[hash] = getUnicode(value) if not serialize else serializeObject(value)
File "/pentest/database/sqlmap-dev/lib/core/common.py", line 3154, in serializeObject
return base64pickle(object_)
File "/pentest/database/sqlmap-dev/lib/core/convert.py", line 31, in base64pickle
return base64encode(pickle.dumps(value, pickle.HIGHEST_PROTOCOL))
File "/usr/lib/python2.7/pickle.py", line 1374, in dumps
Pickler(file, protocol).dump(obj)
File "/usr/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 600, in save_list
self._batch_appends(iter(obj))
File "/usr/lib/python2.7/pickle.py", line 633, in _batch_appends
save(x)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 548, in save_tuple
save(element)
File "/usr/lib/python2.7/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
File "/usr/lib/python2.7/pickle.py", line 396, in save_reduce
save(cls)
File "/usr/lib/python2.7/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python2.7/pickle.py", line 753, in save_global
(obj, module, name))
PicklingError: Can't pickle <type 'cx_Oracle.OBJECT'>: it's not the same object as cx_Oracle.OBJECT

[*] shutting down at 12:46:40

stamparm added a commit that referenced this issue Nov 26, 2012
@ghost ghost assigned stamparm Nov 26, 2012
@stamparm
Copy link
Member

This was/is a problem of an underlying third-party library (in this case cx_Oracle). Just committed an usual "patch" for this kind of "serialization" problems (str casting based)

@yonnym
Copy link
Author

yonnym commented Nov 26, 2012

Thanks Miroslav,
The error appears to be fixed.The only problem is that the output is
as follows:

113,<cx_Oracle.OBJECT object at 0xab1c220>
114,<cx_Oracle.OBJECT object at 0xab1c260>
115,<cx_Oracle.OBJECT object at 0xab1c2a0>
116,<cx_Oracle.OBJECT object at 0xab1c2e0>
117,<cx_Oracle.OBJECT object at 0xab1c320>
118,<cx_Oracle.OBJECT object at 0xab1c360>
119,<cx_Oracle.OBJECT object at 0xab1c3a0>

 How can I get the string representation of this object ?

Thanks.

Regards.

On Mon, Nov 26, 2012 at 1:20 PM, Miroslav Stampar
[email protected]:

This was/is a problem of an underlying third-party library (in this case
cx_Oracle). Just committed an usual "patch" for this kind of
"serialization" problems (str casting based)


Reply to this email directly or view it on GitHubhttps://github.com//issues/260#issuecomment-10710486.

@yonnym
Copy link
Author

yonnym commented Nov 26, 2012

The output data takes the form below:

113,<cx_Oracle.OBJECT object at 0xab1c220>
114,<cx_Oracle.OBJECT object at 0xab1c260>
115,<cx_Oracle.OBJECT object at 0xab1c2a0>
116,<cx_Oracle.OBJECT object at 0xab1c2e0>
117,<cx_Oracle.OBJECT object at 0xab1c320>
118,<cx_Oracle.OBJECT object at 0xab1c360>
119,<cx_Oracle.OBJECT object at 0xab1c3a0>

@stamparm
Copy link
Member

There are two problems here.

  1. As a generic solution, if object can't be pickled/serialized and/or "stringified", then that's the problem of an underlying library/module (it wasn't well prepared for possible serialization and/or string representation of it's content)
  2. I am not around Oracle machine this moment so I can't test this at all. I can try to do it today at late hours

@yonnym
Copy link
Author

yonnym commented Nov 26, 2012

Thanks anyway Stampar. I greatly appreciate your response.

On Mon, Nov 26, 2012 at 3:22 PM, Miroslav Stampar
[email protected]:

There are two problems here.

  1. As a generic solution, if object can't be pickled/serialized and/or
    "stringified", then that's the problem of an underlying library/module (it
    wasn't well prepared for possible serialization and/or string
    representation of it's content)
  2. I am not around Oracle machine this moment so I can't test this at all.
    I can try to do it today at late hours


Reply to this email directly or view it on GitHubhttps://github.com//issues/260#issuecomment-10713482.

@stamparm
Copy link
Member

Couldn't manage yesterday. Came back home (where I have a Oracle testing VM) late night. I am not sure that I'll manage today too. Will do eventually :(

@stamparm stamparm reopened this Nov 27, 2012
stamparm added a commit that referenced this issue Nov 28, 2012
@stamparm
Copy link
Member

@yonnym Now it should work properly

@yonnym
Copy link
Author

yonnym commented Nov 28, 2012

Many thanks Miroslav !!

On Wed, Nov 28, 2012 at 7:01 PM, Miroslav Stampar
[email protected]:

@yonnym https://github.com/yonnym Now it should work properly


Reply to this email directly or view it on GitHubhttps://github.com//issues/260#issuecomment-10807998.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants