mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-11-04 01:47:37 +03:00 
			
		
		
		
	Minor code adjustments
This commit is contained in:
		
							parent
							
								
									654aecedfe
								
							
						
					
					
						commit
						7d7170fc97
					
				| 
						 | 
				
			
			@ -26,23 +26,20 @@ Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		|||
 | 
			
		||||
import re
 | 
			
		||||
 | 
			
		||||
from xml.sax import parse
 | 
			
		||||
from xml.sax.handler import ContentHandler
 | 
			
		||||
 | 
			
		||||
from lib.core.common import checkFile
 | 
			
		||||
from lib.core.common import sanitizeStr
 | 
			
		||||
from lib.core.data import kb
 | 
			
		||||
from lib.core.data import paths
 | 
			
		||||
from lib.parse.banner import BannerHandler
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def headersParser(headers):
 | 
			
		||||
    """
 | 
			
		||||
    This function calls a class that parses the input HTTP headers to
 | 
			
		||||
    fingerprint the back-end database management system operating system
 | 
			
		||||
    and web application technology
 | 
			
		||||
    and the web application technology
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
    topHeaders = {
 | 
			
		||||
    topHeaders = (
 | 
			
		||||
                   "cookie",
 | 
			
		||||
                   "microsoftsharepointteamservices",
 | 
			
		||||
                   "server",
 | 
			
		||||
| 
						 | 
				
			
			@ -50,8 +47,9 @@ def headersParser(headers):
 | 
			
		|||
                   "www-authenticate",
 | 
			
		||||
                   "x-aspnet-version",
 | 
			
		||||
                   "x-powered-by",
 | 
			
		||||
                 }
 | 
			
		||||
                 )
 | 
			
		||||
 | 
			
		||||
    for header in headers:
 | 
			
		||||
        if header in topHeaders:
 | 
			
		||||
            # TODO: fill me
 | 
			
		||||
            pass
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -63,15 +63,13 @@ class htmlHandler(ContentHandler):
 | 
			
		|||
                self.__match = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def htmlParser(page, xmlfile=None):
 | 
			
		||||
def htmlParser(page):
 | 
			
		||||
    """
 | 
			
		||||
    This function calls a class that parses the input HTML page to
 | 
			
		||||
    fingerprint the back-end database management system
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
    if not xmlfile:
 | 
			
		||||
    xmlfile = paths.ERRORS_XML
 | 
			
		||||
 | 
			
		||||
    checkFile(xmlfile)
 | 
			
		||||
    page = sanitizeStr(page)
 | 
			
		||||
    handler = htmlHandler(page)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,6 @@ from lib.core.common import randomStr
 | 
			
		|||
from lib.core.data import conf
 | 
			
		||||
from lib.core.data import kb
 | 
			
		||||
from lib.core.data import logger
 | 
			
		||||
from lib.core.data import paths
 | 
			
		||||
from lib.core.data import temp
 | 
			
		||||
from lib.core.exception import sqlmapUnsupportedDBMSException
 | 
			
		||||
from lib.core.session import setUnion
 | 
			
		||||
| 
						 | 
				
			
			@ -74,7 +73,7 @@ def __unionPosition(count, expression):
 | 
			
		|||
        # HTML code of the result page because, for instance, it is there
 | 
			
		||||
        # when the query is wrong and the back-end DBMS is Microsoft SQL
 | 
			
		||||
        # server
 | 
			
		||||
        htmlParsed = htmlParser(resultPage, paths.ERRORS_XML)
 | 
			
		||||
        htmlParsed = htmlParser(resultPage)
 | 
			
		||||
 | 
			
		||||
        if randQuery in resultPage and not htmlParsed:
 | 
			
		||||
            setUnion(position=exprPosition)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user