mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 22:21:30 +00:00
added standard deviation check in time based tests
This commit is contained in:
@@ -27,6 +27,7 @@ from ConfigParser import RawConfigParser
|
||||
from StringIO import StringIO
|
||||
from difflib import SequenceMatcher
|
||||
from inspect import getmembers
|
||||
from math import sqrt
|
||||
from subprocess import PIPE
|
||||
from subprocess import Popen as execute
|
||||
from tempfile import NamedTemporaryFile
|
||||
@@ -1276,6 +1277,18 @@ def readXmlFile(xmlFile):
|
||||
xfile.close()
|
||||
return retVal
|
||||
|
||||
def stdev(values):
|
||||
"""
|
||||
Computes standard deviation of a list of numbers.
|
||||
"""
|
||||
sum = 0.0
|
||||
avg = average(values)
|
||||
|
||||
for value in values:
|
||||
sum += pow(value - avg, 2)
|
||||
|
||||
return sqrt(sum/len(values))
|
||||
|
||||
def average(values):
|
||||
"""
|
||||
Computes the arithmetic mean of a list of numbers.
|
||||
|
||||
@@ -1182,6 +1182,7 @@ def __setKnowledgeBaseAttributes():
|
||||
kb.technique = None
|
||||
kb.testMode = False
|
||||
kb.testQueryCount = 0
|
||||
kb.timeTests = True
|
||||
kb.unionComment = ""
|
||||
kb.unionCount = None
|
||||
kb.unionPosition = None
|
||||
|
||||
@@ -51,6 +51,7 @@ PAYLOAD_DELIMITER = "\x00"
|
||||
# time testing settings
|
||||
TIME_TOLERANCE = 0.5
|
||||
MIN_DURATION_RATIO = 1.5
|
||||
MAX_TIME_STDEV = 1
|
||||
|
||||
# System variables
|
||||
IS_WIN = subprocess.mswindows
|
||||
|
||||
Reference in New Issue
Block a user