From 534c2ee0e6d6e116c05505f47746f0f4fa6f2e10 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 1 Feb 2014 22:12:00 +0100 Subject: [PATCH] Minor update --- lib/core/common.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index fc0dc4e2d..bfd0e2713 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -711,7 +711,7 @@ def getManualDirectories(): return directories def getAutoDirectories(): - directories = set("/") + retVal = set("/") if kb.absFilePaths: infoMsg = "retrieved web server absolute paths: " @@ -722,17 +722,17 @@ def getAutoDirectories(): if absFilePath: directory = directoryPath(absFilePath) directory = ntToPosixSlashes(directory) - directories.add(directory) + retVal.add(directory) else: warnMsg = "unable to retrieve automatically any web server path" logger.warn(warnMsg) - webDir = extractRegexResult(r"//[^/]+?(?P/.*)/", conf.url) + _ = extractRegexResult(r"//[^/]+?(?P/.*)/", conf.url) # web directory - if webDir: - directories.add(webDir) + if _: + retVal.add(_) - return list(directories) + return list(retVal) def filePathToSafeString(filePath): """ @@ -1351,6 +1351,10 @@ def parseFilePaths(page): kb.absFilePaths.add(absFilePath) def getLocalIP(): + """ + Get local IP address (exposed to the remote/target) + """ + retVal = None try: @@ -1366,6 +1370,10 @@ def getLocalIP(): return retVal def getRemoteIP(): + """ + Get remote/target IP address + """ + retVal = None try: @@ -1529,6 +1537,10 @@ def getPageWordSet(page): return retVal def showStaticWords(firstPage, secondPage): + """ + Prints words appearing in two different response pages + """ + infoMsg = "finding static words in longest matching part of dynamic page content" logger.info(infoMsg) @@ -3694,6 +3706,10 @@ def splitFields(fields, delimiter=','): return [fields[x + 1:y] for (x, y) in zip(commas, commas[1:])] def pollProcess(process, suppress_errors=False): + """ + Checks for process status (prints . if still running) + """ + while True: dataToStdout(".") time.sleep(1)