mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-11-04 09:57:38 +03:00 
			
		
		
		
	Fixes #1899
This commit is contained in:
		
							parent
							
								
									1de6996c26
								
							
						
					
					
						commit
						43af2a4aee
					
				| 
						 | 
				
			
			@ -19,7 +19,7 @@ from lib.core.enums import OS
 | 
			
		|||
from lib.core.revision import getRevisionNumber
 | 
			
		||||
 | 
			
		||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
 | 
			
		||||
VERSION = "1.0.5.69"
 | 
			
		||||
VERSION = "1.0.5.70"
 | 
			
		||||
REVISION = getRevisionNumber()
 | 
			
		||||
STABLE = VERSION.count('.') <= 2
 | 
			
		||||
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -370,7 +370,7 @@ def _setRequestParams():
 | 
			
		|||
        raise SqlmapGenericException(errMsg)
 | 
			
		||||
 | 
			
		||||
    if conf.csrfToken:
 | 
			
		||||
        if not any(conf.csrfToken in _ for _ in (conf.paramDict.get(PLACE.GET, {}), conf.paramDict.get(PLACE.POST, {}))) and not conf.csrfToken in set(_[0].lower() for _ in conf.httpHeaders) and not conf.csrfToken in conf.paramDict.get(PLACE.COOKIE, {}):
 | 
			
		||||
        if not any(conf.csrfToken in _ for _ in (conf.paramDict.get(PLACE.GET, {}), conf.paramDict.get(PLACE.POST, {}))) and not re.search(r"\b%s\b" % re.escape(conf.csrfToken), conf.data or "") and not conf.csrfToken in set(_[0].lower() for _ in conf.httpHeaders) and not conf.csrfToken in conf.paramDict.get(PLACE.COOKIE, {}):
 | 
			
		||||
            errMsg = "anti-CSRF token parameter '%s' not " % conf.csrfToken
 | 
			
		||||
            errMsg += "found in provided GET, POST, Cookie or header values"
 | 
			
		||||
            raise SqlmapGenericException(errMsg)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -872,6 +872,10 @@ class Connect(object):
 | 
			
		|||
            match = re.search(r"<input[^>]+name=[\"']?%s[\"']?\s[^>]*value=(\"([^\"]+)|'([^']+)|([^ >]+))" % re.escape(conf.csrfToken), page or "")
 | 
			
		||||
            token = (match.group(2) or match.group(3) or match.group(4)) if match else None
 | 
			
		||||
 | 
			
		||||
            if not token:
 | 
			
		||||
                match = re.search(r"%s[\"']:[\"']([^\"']+)" % re.escape(conf.csrfToken), page or "")
 | 
			
		||||
                token = match.group(1) if match else None
 | 
			
		||||
 | 
			
		||||
            if not token:
 | 
			
		||||
                if conf.csrfUrl != conf.url and code == httplib.OK:
 | 
			
		||||
                    if headers and "text/plain" in headers.get(HTTP_HEADER.CONTENT_TYPE, ""):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user