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

Function _basicOptionValidation

lib/core/option.py:2571–2894  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2569 logger.info(infoMsg)
2570
2571def _basicOptionValidation():
2572 if conf.limitStart is not None and not (isinstance(conf.limitStart, int) and conf.limitStart > 0):
2573 errMsg = "value for option '--start' (limitStart) must be an integer value greater than zero (>0)"
2574 raise SqlmapSyntaxException(errMsg)
2575
2576 if conf.limitStop is not None and not (isinstance(conf.limitStop, int) and conf.limitStop > 0):
2577 errMsg = "value for option '--stop' (limitStop) must be an integer value greater than zero (>0)"
2578 raise SqlmapSyntaxException(errMsg)
2579
2580 if conf.level is not None and not (isinstance(conf.level, int) and conf.level >= 1 and conf.level <= 5):
2581 errMsg = "value for option '--level' must be an integer value from range [1, 5]"
2582 raise SqlmapSyntaxException(errMsg)
2583
2584 if conf.risk is not None and not (isinstance(conf.risk, int) and conf.risk >= 1 and conf.risk <= 3):
2585 errMsg = "value for option '--risk' must be an integer value from range [1, 3]"
2586 raise SqlmapSyntaxException(errMsg)
2587
2588 if isinstance(conf.limitStart, int) and conf.limitStart > 0 and \
2589 isinstance(conf.limitStop, int) and conf.limitStop < conf.limitStart:
2590 warnMsg = "usage of option '--start' (limitStart) which is bigger than value for --stop (limitStop) option is considered unstable"
2591 logger.warning(warnMsg)
2592
2593 if isinstance(conf.firstChar, int) and conf.firstChar > 0 and \
2594 isinstance(conf.lastChar, int) and conf.lastChar < conf.firstChar:
2595 errMsg = "value for option '--first' (firstChar) must be smaller than or equal to value for --last (lastChar) option"
2596 raise SqlmapSyntaxException(errMsg)
2597
2598 if conf.proxyFile and not any((conf.randomAgent, conf.mobile, conf.agent, conf.requestFile)):
2599 warnMsg = "usage of switch '--random-agent' is strongly recommended when "
2600 warnMsg += "using option '--proxy-file'"
2601 logger.warning(warnMsg)
2602
2603 if conf.textOnly and conf.nullConnection:
2604 errMsg = "switch '--text-only' is incompatible with switch '--null-connection'"
2605 raise SqlmapSyntaxException(errMsg)
2606
2607 if conf.uValues and conf.uChar:
2608 errMsg = "option '--union-values' is incompatible with option '--union-char'"
2609 raise SqlmapSyntaxException(errMsg)
2610
2611 if conf.base64Parameter and conf.tamper:
2612 errMsg = "option '--base64' is incompatible with option '--tamper'"
2613 raise SqlmapSyntaxException(errMsg)
2614
2615 if conf.eta and conf.verbose > defaults.verbose:
2616 errMsg = "switch '--eta' is incompatible with option '-v'"
2617 raise SqlmapSyntaxException(errMsg)
2618
2619 if conf.secondUrl and conf.secondReq:
2620 errMsg = "option '--second-url' is incompatible with option '--second-req')"
2621 raise SqlmapSyntaxException(errMsg)
2622
2623 if conf.direct and conf.url:
2624 errMsg = "option '-d' is incompatible with option '-u' ('--url')"
2625 raise SqlmapSyntaxException(errMsg)
2626
2627 if conf.direct and conf.dbms:
2628 errMsg = "option '-d' is incompatible with option '--dbms'"

Callers 1

initFunction · 0.85

Calls 10

getSafeExStringFunction · 0.90
getPublicTypeMembersFunction · 0.90
intersectFunction · 0.90
checkCharEncodingFunction · 0.90
xrangeClass · 0.85
searchMethod · 0.45
escapeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…