(host: str, port: int, shared_aconf: AuditConf)
| 1382 | |
| 1383 | # Worker thread for scanning multiple targets concurrently. |
| 1384 | def target_worker_thread(host: str, port: int, shared_aconf: AuditConf) -> Tuple[int, str]: |
| 1385 | ret = -1 |
| 1386 | string_output = '' |
| 1387 | |
| 1388 | out = OutputBuffer() |
| 1389 | out.verbose = shared_aconf.verbose |
| 1390 | my_aconf = copy.deepcopy(shared_aconf) |
| 1391 | my_aconf.host = host |
| 1392 | my_aconf.port = port |
| 1393 | |
| 1394 | # If we're outputting JSON, turn off colors and ensure 'info' level messages go through. |
| 1395 | if my_aconf.json: |
| 1396 | out.json = True |
| 1397 | out.use_colors = False |
| 1398 | |
| 1399 | out.v("Running against: %s:%d..." % (my_aconf.host, my_aconf.port), write_now=True) |
| 1400 | try: |
| 1401 | ret = audit(out, my_aconf, print_target=True) |
| 1402 | string_output = out.get_buffer() |
| 1403 | except Exception: |
| 1404 | ret = -1 |
| 1405 | string_output = "An exception occurred while scanning %s:%d:\n%s" % (host, port, str(traceback.format_exc())) |
| 1406 | |
| 1407 | return ret, string_output |
| 1408 | |
| 1409 | |
| 1410 | def builtin_manual(out: OutputBuffer) -> int: |
nothing calls this directly
no test coverage detected