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

Skip to content

Commit 7d7170f

Browse files
committed
Minor code adjustments
1 parent 654aece commit 7d7170f

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

lib/parse/headers.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,30 @@
2626

2727
import re
2828

29-
from xml.sax import parse
30-
from xml.sax.handler import ContentHandler
31-
3229
from lib.core.common import checkFile
33-
from lib.core.common import sanitizeStr
3430
from lib.core.data import kb
3531
from lib.core.data import paths
3632
from lib.parse.banner import BannerHandler
3733

34+
3835
def headersParser(headers):
3936
"""
4037
This function calls a class that parses the input HTTP headers to
4138
fingerprint the back-end database management system operating system
42-
and web application technology
39+
and the web application technology
4340
"""
4441

45-
topHeaders = {
42+
topHeaders = (
4643
"cookie",
4744
"microsoftsharepointteamservices",
4845
"server",
4946
"servlet-engine",
5047
"www-authenticate",
5148
"x-aspnet-version",
5249
"x-powered-by",
53-
}
50+
)
5451

5552
for header in headers:
5653
if header in topHeaders:
54+
# TODO: fill me
5755
pass

lib/parse/html.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ def startElement(self, name, attrs):
6363
self.__match = None
6464

6565

66-
def htmlParser(page, xmlfile=None):
66+
def htmlParser(page):
6767
"""
6868
This function calls a class that parses the input HTML page to
6969
fingerprint the back-end database management system
7070
"""
7171

72-
if not xmlfile:
73-
xmlfile = paths.ERRORS_XML
74-
72+
xmlfile = paths.ERRORS_XML
7573
checkFile(xmlfile)
7674
page = sanitizeStr(page)
7775
handler = htmlHandler(page)

lib/techniques/inband/union/use.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from lib.core.data import conf
3232
from lib.core.data import kb
3333
from lib.core.data import logger
34-
from lib.core.data import paths
3534
from lib.core.data import temp
3635
from lib.core.exception import sqlmapUnsupportedDBMSException
3736
from lib.core.session import setUnion
@@ -74,7 +73,7 @@ def __unionPosition(count, expression):
7473
# HTML code of the result page because, for instance, it is there
7574
# when the query is wrong and the back-end DBMS is Microsoft SQL
7675
# server
77-
htmlParsed = htmlParser(resultPage, paths.ERRORS_XML)
76+
htmlParsed = htmlParser(resultPage)
7877

7978
if randQuery in resultPage and not htmlParsed:
8079
setUnion(position=exprPosition)

0 commit comments

Comments
 (0)