@@ -40,6 +40,19 @@ def unSafeFormatString(value):
4040 retVal = retVal .replace ("__LEFT_SQUARE_BRACKET__" , "[" ).replace ("__RIGHT_SQUARE_BRACKET__" , "]" )
4141 return retVal
4242
43+ def setTextOnly ():
44+ """
45+ Save text only option to session file.
46+ """
47+
48+ condition = (
49+ not kb .resumedQueries or ( kb .resumedQueries .has_key (conf .url ) and
50+ not kb .resumedQueries [conf .url ].has_key ("Text only" ) )
51+ )
52+
53+ if condition :
54+ dataToSessionFile ("[%s][None][None][Text only][True]\n " % conf .url )
55+
4356def setString ():
4457 """
4558 Save string to match in session file.
@@ -263,7 +276,23 @@ def setRemoteTempPath():
263276 dataToSessionFile ("[%s][%s][%s][Remote temp path][%s]\n " % (conf .url , kb .injection .place , safeFormatString (conf .parameters [kb .injection .place ]), safeFormatString (conf .tmpPath )))
264277
265278def resumeConfKb (expression , url , value ):
266- if expression == "String" and url == conf .url :
279+ if expression == "Text only" and url == conf .url :
280+ value = unSafeFormatString (value [:- 1 ])
281+
282+ logMsg = "resuming text only option '%s' from session file" % value
283+ logger .info (logMsg )
284+
285+ if value and not conf .textOnly :
286+ message = "you did not turned on --text-only switch this time "
287+ message += "which could potentially lead to different "
288+ message += "and/or unstable results. "
289+ message += "Do you want to turn it on? [Y/n] "
290+ test = readInput (message , default = "Y" )
291+
292+ if not test or test [0 ] in ("y" , "Y" ):
293+ conf .textOnly = value
294+
295+ elif expression == "String" and url == conf .url :
267296 string = unSafeFormatString (value [:- 1 ])
268297
269298 logMsg = "resuming string match '%s' from session file" % string
0 commit comments