| skipped 30 lines |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | def parse_script(ip_addr, port, app_name, script): |
34 | | - | vulnerable_services.append(app_name) |
35 | | - | script_table = script['table']['table'] |
36 | | - | if isinstance(script_table, list): |
37 | | - | for vuln in script_table: |
38 | | - | parse_vuln(ip_addr, port, app_name, vuln['elem']) |
| 34 | + | if 'table' in script.keys(): |
| 35 | + | vulnerable_services.append(app_name) |
| 36 | + | script_table = script['table']['table'] |
| 37 | + | if isinstance(script_table, list): |
| 38 | + | for vuln in script_table: |
| 39 | + | parse_vuln(ip_addr, port, app_name, vuln['elem']) |
| 40 | + | else: |
| 41 | + | parse_vuln(ip_addr, port, app_name, script_table['elem']) |
39 | 42 | | else: |
40 | | - | parse_vuln(ip_addr, port, app_name, script_table['elem']) |
| 43 | + | print('ERROR in script: ' + ip_addr + port + app_name) |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | def get_app_name(service): |
| skipped 193 lines |