Run sqlmap with current configuration
(self)
| 520 | del input_win |
| 521 | |
| 522 | def _run_sqlmap(self): |
| 523 | """Run sqlmap with current configuration""" |
| 524 | config = {} |
| 525 | |
| 526 | # Collect all field values |
| 527 | for tab in self.tabs: |
| 528 | for option in tab['options']: |
| 529 | dest = option['dest'] |
| 530 | value = option['value'] if option['value'] is not None else option.get('default') |
| 531 | |
| 532 | if option['type'] == 'bool': |
| 533 | config[dest] = bool(value) |
| 534 | elif option['type'] == 'int': |
| 535 | config[dest] = int(value) if value else None |
| 536 | elif option['type'] == 'float': |
| 537 | config[dest] = float(value) if value else None |
| 538 | else: |
| 539 | config[dest] = value |
| 540 | |
| 541 | # Set defaults for unset options |
| 542 | for option in self.parser.option_list: |
| 543 | if option.dest not in config or config[option.dest] is None: |
| 544 | config[option.dest] = defaults.get(option.dest, None) |
| 545 | |
| 546 | # Create temp config file |
| 547 | handle, configFile = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.CONFIG, text=True) |
| 548 | os.close(handle) |
| 549 | |
| 550 | saveConfig(config, configFile) |
| 551 | |
| 552 | # Show console |
| 553 | self._show_console(configFile) |
| 554 | |
| 555 | def _show_console(self, configFile): |
| 556 | """Show console output from sqlmap""" |
no test coverage detected