Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f26de89

Browse files
committed
Minor bug fix to correctly deal with unicode queries with -d
1 parent 655bd79 commit f26de89

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

lib/core/convert.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,9 @@ def urlencode(string, safe=":/?%&=", convall=False):
100100
result = urllib.quote(string, safe)
101101

102102
return result
103+
104+
def utf8encode(string):
105+
return string.encode("utf-8")
106+
107+
def utf8decode(string):
108+
return string.decode("utf-8")

lib/request/direct.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from lib.core.common import dataToSessionFile
2727
from lib.core.convert import base64pickle
2828
from lib.core.convert import base64unpickle
29+
from lib.core.convert import utf8decode
2930
from lib.core.data import conf
3031
from lib.core.data import kb
3132
from lib.core.data import logger
@@ -35,6 +36,7 @@
3536
def direct(query, content=True):
3637
output = None
3738
select = False
39+
query = utf8decode(query)
3840
query = agent.payloadDirect(query)
3941

4042
if kb.dbms == "Oracle" and query.startswith("SELECT ") and " FROM " not in query:

0 commit comments

Comments
 (0)