File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ def action():
118118 if conf .sqlShell :
119119 conf .dbmsHandler .sqlShell ()
120120
121+ if conf .sqlFile :
122+ conf .dbmsHandler .sqlFile ()
123+
121124 # User-defined function options
122125 if conf .udfInject :
123126 conf .dbmsHandler .udfInjectCustom ()
Original file line number Diff line number Diff line change 119119 "firstChar" : "integer" ,
120120 "lastChar" : "integer" ,
121121 "query" : "string" ,
122- "sqlShell" : "boolean"
122+ "sqlShell" : "boolean" ,
123+ "sqlFile" : "string"
123124 },
124125
125126 "Brute" : {
Original file line number Diff line number Diff line change @@ -383,6 +383,9 @@ def cmdLineParser():
383383 action = "store_true" ,
384384 help = "Prompt for an interactive SQL shell" )
385385
386+ enumeration .add_option ("--sql-file" , dest = "sqlFile" ,
387+ help = "Execute SQL statements from given file(s)" )
388+
386389 # User-defined function options
387390 brute = OptionGroup (parser , "Brute force" , "These "
388391 "options can be used to run brute force "
Original file line number Diff line number Diff line change 1616from lib .core .common import dataToStdout
1717from lib .core .common import filterPairValues
1818from lib .core .common import getLimitRange
19+ from lib .core .common import getSQLSnippet
1920from lib .core .common import getUnicode
2021from lib .core .common import isInferenceAvailable
2122from lib .core .common import isListLike
@@ -2463,3 +2464,16 @@ def sqlShell(self):
24632464
24642465 elif output != "Quit" :
24652466 dataToStdout ("No output\n " )
2467+
2468+ def sqlFile (self ):
2469+ infoMsg = "executing SQL statements from given file(s)"
2470+ logger .info (infoMsg )
2471+
2472+ for sfile in re .split (PARAMETER_SPLITTING_REGEX , conf .sqlFile ):
2473+ found = False
2474+ sfile = sfile .strip ()
2475+
2476+ if not sfile :
2477+ continue
2478+
2479+ self .sqlQuery (getSQLSnippet (Backend .getDbms (), sfile ))
Original file line number Diff line number Diff line change @@ -432,6 +432,9 @@ query =
432432# Valid: True or False
433433sqlShell = False
434434
435+ # Execute SQL statements from given file(s).
436+ sqlFile =
437+
435438
436439# These options can be used to run brute force checks.
437440[Brute force]
You can’t perform that action at this time.
0 commit comments