diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 38b2e67f5..21dd03602 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -394,8 +394,12 @@ def start(): # Test Cookie header only if --level >= 2 skip |= (place == PLACE.COOKIE and conf.level < 2) - skip &= not (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.testParameter)) - skip &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter)) + skip |= (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.skip, True) not in ([], None)) + skip |= (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.skip, True) not in ([], None)) + skip |= (place == PLACE.COOKIE and intersect('cookie', conf.skip, True) not in ([], None)) + + skip &= not (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.testParameter, True)) + skip &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter, True)) if skip: continue diff --git a/lib/core/common.py b/lib/core/common.py index 320c35af0..36779e0ea 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2679,7 +2679,7 @@ def getExceptionFrameLocals(): return retVal -def intersect(valueA, valueB): +def intersect(valueA, valueB, lowerCase=False): """ Returns intersection of the array-ized values """ @@ -2687,7 +2687,14 @@ def intersect(valueA, valueB): retVal = None if valueA and valueB: - retVal = [val for val in arrayizeValue(valueA) if val in arrayizeValue(valueB)] + valueA = arrayizeValue(valueA) + valueB = arrayizeValue(valueB) + + if lowerCase: + valueA = [val.lower() if isinstance(val, basestring) else val for val in valueA] + valueB = [val.lower() if isinstance(val, basestring) else val for val in valueB] + + retVal = [val for val in valueA if val in valueB] return retVal