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

Function start

lib/controller/controller.py:268–794  ·  view source on GitHub ↗

This function calls a function that performs checks on both URL stability and all GET, POST, Cookie and User-Agent parameters to check if they are dynamic and SQL injection affected

()

Source from the content-addressed store, hash-verified

266
267@stackedmethod
268def start():
269 """
270 This function calls a function that performs checks on both URL
271 stability and all GET, POST, Cookie and User-Agent parameters to
272 check if they are dynamic and SQL injection affected
273 """
274
275 if conf.hashFile:
276 crackHashFile(conf.hashFile)
277
278 if conf.direct:
279 initTargetEnv()
280 setupTargetEnv()
281 action()
282 return True
283
284 if conf.url and not any((conf.forms, conf.crawlDepth)):
285 kb.targets.add((conf.url, conf.method, conf.data, conf.cookie, None))
286
287 if conf.configFile and not kb.targets:
288 errMsg = "you did not edit the configuration file properly, set "
289 errMsg += "the target URL, list of targets or google dork"
290 logger.error(errMsg)
291 return False
292
293 if kb.targets and isListLike(kb.targets) and len(kb.targets) > 1:
294 infoMsg = "found a total of %d targets" % len(kb.targets)
295 logger.info(infoMsg)
296
297 targetCount = 0
298 initialHeaders = list(conf.httpHeaders)
299
300 for targetUrl, targetMethod, targetData, targetCookie, targetHeaders in kb.targets:
301 targetCount += 1
302
303 try:
304 if conf.checkInternet:
305 infoMsg = "checking for Internet connection"
306 logger.info(infoMsg)
307
308 if not checkInternet():
309 warnMsg = "[%s] [WARNING] no connection detected" % time.strftime("%X")
310 dataToStdout(warnMsg)
311
312 valid = False
313 for _ in xrange(conf.retries):
314 if checkInternet():
315 valid = True
316 break
317 else:
318 dataToStdout('.')
319 time.sleep(5)
320
321 if not valid:
322 errMsg = "please check your Internet connection and rerun"
323 raise SqlmapConnectionException(errMsg)
324 else:
325 dataToStdout("\n")

Callers 1

mainFunction · 0.90

Calls 15

crackHashFileFunction · 0.90
initTargetEnvFunction · 0.90
setupTargetEnvFunction · 0.90
actionFunction · 0.90
isListLikeFunction · 0.90
checkInternetFunction · 0.90
dataToStdoutFunction · 0.90
urlencodeFunction · 0.90
parseTargetUrlFunction · 0.90
readInputFunction · 0.90
extractRegexResultFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…