Projects STRLCPY RTSPbrute Commits 83ff77d0
🤬
  • Change debug logging to ignore timeout errors

  • Loading...
  • Woolf committed 4 years ago
    83ff77d0
    1 parent c4d399ef
  • ■ ■ ■ ■ ■ ■
    rtspbrute/modules/attack.py
    skipped 31 lines
    32 32   connected = target.connect(port)
    33 33   if not connected:
    34 34   if logger_is_enabled:
    35  - if target.status is Status.UNIDENTIFIED:
    36  - logger.debug(f"Failed to connect {target}:", exc_info=target.last_error)
    37  - else:
    38  - logger.debug(f"Failed to connect {target}: {target.status.name}")
     35 + exc_info = (
     36 + target.last_error if target.status is Status.UNIDENTIFIED else None
     37 + )
     38 + logger.debug(f"Failed to connect {target}:", exc_info=exc_info)
    39 39   return False
    40 40   
    41 41   # Try to authorize: create describe packet and send it.
    skipped 8 lines
    50 50   if not authorized:
    51 51   if logger_is_enabled:
    52 52   attack_url = RTSPClient.get_rtsp_url(target.ip, port, credentials, route)
    53  - logger.debug(
    54  - f"Failed to authorize {attack_url}", exc_info=target.last_error
     53 + exc_info = (
     54 + target.last_error if target.status is Status.UNIDENTIFIED else None
    55 55   )
     56 + logger.debug(f"Failed to authorize {attack_url}", exc_info=exc_info)
    56 57   return False
    57 58   
    58 59   return True
    skipped 129 lines
Please wait...
Page is in error, reload to recover