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

Function _useWizardInterface

lib/core/option.py:2228–2296  ·  view source on GitHub ↗

Presents simple wizard interface for beginner users

()

Source from the content-addressed store, hash-verified

2226 kb.wordlists = None
2227
2228def _useWizardInterface():
2229 """
2230 Presents simple wizard interface for beginner users
2231 """
2232
2233 if not conf.wizard:
2234 return
2235
2236 logger.info("starting wizard interface")
2237
2238 while not conf.url:
2239 message = "Please enter full target URL (-u): "
2240 conf.url = readInput(message, default=None, checkBatch=False)
2241
2242 message = "%s data (--data) [Enter for None]: " % ((conf.method if conf.method != HTTPMETHOD.GET else None) or HTTPMETHOD.POST)
2243 conf.data = readInput(message, default=None)
2244
2245 if not (any('=' in _ for _ in (conf.url, conf.data)) or '*' in conf.url):
2246 warnMsg = "no GET and/or %s parameter(s) found for testing " % ((conf.method if conf.method != HTTPMETHOD.GET else None) or HTTPMETHOD.POST)
2247 warnMsg += "(e.g. GET parameter 'id' in 'http://www.site.com/vuln.php?id=1'). "
2248 if not conf.crawlDepth and not conf.forms:
2249 warnMsg += "Will search for forms"
2250 conf.forms = True
2251 logger.warning(warnMsg)
2252
2253 choice = None
2254
2255 while choice is None or choice not in ("", "1", "2", "3"):
2256 message = "Injection difficulty (--level/--risk). Please choose:\n"
2257 message += "[1] Normal (default)\n[2] Medium\n[3] Hard"
2258 choice = readInput(message, default='1')
2259
2260 if choice == '2':
2261 conf.risk = 2
2262 conf.level = 3
2263 elif choice == '3':
2264 conf.risk = 3
2265 conf.level = 5
2266 else:
2267 conf.risk = 1
2268 conf.level = 1
2269
2270 if not conf.getAll:
2271 choice = None
2272
2273 while choice is None or choice not in ("", "1", "2", "3"):
2274 message = "Enumeration (--banner/--current-user/etc). Please choose:\n"
2275 message += "[1] Basic (default)\n[2] Intermediate\n[3] All"
2276 choice = readInput(message, default='1')
2277
2278 if choice == '2':
2279 options = WIZARD.INTERMEDIATE
2280 elif choice == '3':
2281 options = WIZARD.ALL
2282 else:
2283 options = WIZARD.BASIC
2284
2285 for _ in options:

Callers 1

initFunction · 0.85

Calls 5

readInputFunction · 0.90
dataToStdoutFunction · 0.90
infoMethod · 0.80
debugMethod · 0.80
__setitem__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…