| 397 | return self.readRegKey(regKey, regVal, True) |
| 398 | |
| 399 | def regAdd(self): |
| 400 | self._regInit() |
| 401 | |
| 402 | errMsg = "missing mandatory option" |
| 403 | |
| 404 | if not conf.regKey: |
| 405 | msg = "which registry key do you want to write? " |
| 406 | regKey = readInput(msg) |
| 407 | |
| 408 | if not regKey: |
| 409 | raise SqlmapMissingMandatoryOptionException(errMsg) |
| 410 | else: |
| 411 | regKey = conf.regKey |
| 412 | |
| 413 | if not conf.regVal: |
| 414 | msg = "which registry key value do you want to write? " |
| 415 | regVal = readInput(msg) |
| 416 | |
| 417 | if not regVal: |
| 418 | raise SqlmapMissingMandatoryOptionException(errMsg) |
| 419 | else: |
| 420 | regVal = conf.regVal |
| 421 | |
| 422 | if not conf.regData: |
| 423 | msg = "which registry key value data do you want to write? " |
| 424 | regData = readInput(msg) |
| 425 | |
| 426 | if not regData: |
| 427 | raise SqlmapMissingMandatoryOptionException(errMsg) |
| 428 | else: |
| 429 | regData = conf.regData |
| 430 | |
| 431 | if not conf.regType: |
| 432 | default = "REG_SZ" |
| 433 | msg = "which registry key value data-type is it? " |
| 434 | msg += "[%s] " % default |
| 435 | regType = readInput(msg, default=default) |
| 436 | else: |
| 437 | regType = conf.regType |
| 438 | |
| 439 | infoMsg = "adding Windows registry path '%s\\%s' " % (regKey, regVal) |
| 440 | infoMsg += "with data '%s'. " % regData |
| 441 | infoMsg += "This will work only if the user running the database " |
| 442 | infoMsg += "process has privileges to modify the Windows registry." |
| 443 | logger.info(infoMsg) |
| 444 | |
| 445 | self.addRegKey(regKey, regVal, regType, regData) |
| 446 | |
| 447 | def regDel(self): |
| 448 | self._regInit() |