mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Some more Python 3.9 patching
This commit is contained in:
parent
44b7cc7d17
commit
2a1e812288
|
@ -44,7 +44,7 @@ def parseXmlNode(node):
|
||||||
for element in node.findall("boundary"):
|
for element in node.findall("boundary"):
|
||||||
boundary = AttribDict()
|
boundary = AttribDict()
|
||||||
|
|
||||||
for child in element.getchildren():
|
for child in element:
|
||||||
if child.text:
|
if child.text:
|
||||||
values = cleanupVals(child.text, child.tag)
|
values = cleanupVals(child.text, child.tag)
|
||||||
boundary[child.tag] = values
|
boundary[child.tag] = values
|
||||||
|
@ -56,18 +56,18 @@ def parseXmlNode(node):
|
||||||
for element in node.findall("test"):
|
for element in node.findall("test"):
|
||||||
test = AttribDict()
|
test = AttribDict()
|
||||||
|
|
||||||
for child in element.getchildren():
|
for child in element:
|
||||||
if child.text and child.text.strip():
|
if child.text and child.text.strip():
|
||||||
values = cleanupVals(child.text, child.tag)
|
values = cleanupVals(child.text, child.tag)
|
||||||
test[child.tag] = values
|
test[child.tag] = values
|
||||||
else:
|
else:
|
||||||
if len(child.getchildren()) == 0:
|
if len(child.findall("*")) == 0:
|
||||||
test[child.tag] = None
|
test[child.tag] = None
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
test[child.tag] = AttribDict()
|
test[child.tag] = AttribDict()
|
||||||
|
|
||||||
for gchild in child.getchildren():
|
for gchild in child:
|
||||||
if gchild.tag in test[child.tag]:
|
if gchild.tag in test[child.tag]:
|
||||||
prevtext = test[child.tag][gchild.tag]
|
prevtext = test[child.tag][gchild.tag]
|
||||||
test[child.tag][gchild.tag] = [prevtext, gchild.text]
|
test[child.tag][gchild.tag] = [prevtext, gchild.text]
|
||||||
|
@ -77,6 +77,15 @@ def parseXmlNode(node):
|
||||||
conf.tests.append(test)
|
conf.tests.append(test)
|
||||||
|
|
||||||
def loadBoundaries():
|
def loadBoundaries():
|
||||||
|
"""
|
||||||
|
Loads boundaries from XML
|
||||||
|
|
||||||
|
>>> conf.boundaries = []
|
||||||
|
>>> loadBoundaries()
|
||||||
|
>>> len(conf.boundaries) > 0
|
||||||
|
True
|
||||||
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
doc = et.parse(paths.BOUNDARIES_XML)
|
doc = et.parse(paths.BOUNDARIES_XML)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
@ -89,6 +98,15 @@ def loadBoundaries():
|
||||||
parseXmlNode(root)
|
parseXmlNode(root)
|
||||||
|
|
||||||
def loadPayloads():
|
def loadPayloads():
|
||||||
|
"""
|
||||||
|
Loads payloads/tests from XML
|
||||||
|
|
||||||
|
>>> conf.tests = []
|
||||||
|
>>> loadPayloads()
|
||||||
|
>>> len(conf.tests) > 0
|
||||||
|
True
|
||||||
|
"""
|
||||||
|
|
||||||
for payloadFile in PAYLOAD_XML_FILES:
|
for payloadFile in PAYLOAD_XML_FILES:
|
||||||
payloadFilePath = os.path.join(paths.SQLMAP_XML_PAYLOADS_PATH, payloadFile)
|
payloadFilePath = os.path.join(paths.SQLMAP_XML_PAYLOADS_PATH, payloadFile)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user