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

Skip to content

Commit 052d945

Browse files
committed
warning user in cases of "User xyz already has more than 'max_user_connections' active connections"
1 parent 831f79b commit 052d945

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/controller/controller.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,14 @@ def start():
608608
finally:
609609
showHttpErrorCodes()
610610

611+
if kb.maxConnectionsFlag:
612+
warnMsg = "it appears that the target "
613+
warnMsg += "has a maximum connections "
614+
warnMsg += "constraint"
615+
logger.warn(warnMsg)
616+
611617
if kb.dataOutputFlag and not conf.multipleTargets:
612-
logger.info("Fetched data logged to text files under '%s'" % conf.outputPath)
618+
logger.info("fetched data logged to text files under '%s'" % conf.outputPath)
613619

614620
if conf.multipleTargets and conf.resultsFilename:
615621
infoMsg = "you can find results of scanning in multiple targets "

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
14651465
kb.locks[_] = threading.Lock()
14661466

14671467
kb.matchRatio = None
1468+
kb.maxConnectionsFlag = False
14681469
kb.mergeCookies = None
14691470
kb.multiThreadMode = False
14701471
kb.negativeLogic = False

lib/request/connect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ def _randomizeParameter(paramString, randomParameter):
727727
if not response and removeReflection:
728728
page = removeReflectiveValues(page, payload)
729729

730+
kb.maxConnectionsFlag = re.search(r"max.+connections", page or "", re.I) is not None
730731
kb.permissionFlag = re.search(r"(command|permission|access)\s*(was|is)?\s*denied", page or "", re.I) is not None
731732

732733
if content or response:

0 commit comments

Comments
 (0)