MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / sqlShell

Method sqlShell

plugins/generic/custom.py:96–139  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 return output
95
96 def sqlShell(self):
97 infoMsg = "calling %s shell. To quit type " % Backend.getIdentifiedDbms()
98 infoMsg += "'x' or 'q' and press ENTER"
99 logger.info(infoMsg)
100
101 autoCompletion(AUTOCOMPLETE_TYPE.SQL)
102
103 while True:
104 query = None
105
106 try:
107 query = _input("sql-shell> ")
108 query = getUnicode(query, encoding=sys.stdin.encoding)
109 query = query.strip("; ")
110 except UnicodeDecodeError:
111 print()
112 errMsg = "invalid user input"
113 logger.error(errMsg)
114 except KeyboardInterrupt:
115 print()
116 errMsg = "user aborted"
117 logger.error(errMsg)
118 except EOFError:
119 print()
120 errMsg = "exit"
121 logger.error(errMsg)
122 break
123
124 if not query:
125 continue
126
127 if query.lower() in ("x", "q", "exit", "quit"):
128 break
129
130 output = self.sqlQuery(query)
131
132 if output and output != "Quit":
133 conf.dumper.sqlQuery(query, output)
134
135 elif not output:
136 pass
137
138 elif output != "Quit":
139 dataToStdout("No output\n")
140
141 def sqlFile(self):
142 infoMsg = "executing SQL statements from given file(s)"

Callers 1

actionFunction · 0.80

Calls 7

sqlQueryMethod · 0.95
autoCompletionFunction · 0.90
getUnicodeFunction · 0.90
dataToStdoutFunction · 0.90
getIdentifiedDbmsMethod · 0.80
infoMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected