<s> from src . platform . tomcat . authenticate import checkAuth <EOL> from src . platform . tomcat . interfaces import TINTERFACES <EOL> from requests import exceptions <EOL> from cprint import FingerPrint <EOL> from re import findall <EOL> from log import LOG <EOL> import utility <EOL> class FPrint ( FingerPrint ) : <EOL> def __init__ ( self ) : <EOL> self . platform = "<STR_LIT>" <EOL> self . version = "<STR_LIT>" <EOL> self . title = TINTERFACES . APP <EOL> self . uri = "<STR_LIT>" <EOL> self . port = <NUM_LIT> <EOL> self . hash = None <EOL> def check ( self , ip , port = None ) : <EOL> """<STR_LIT:U+0020>""" <EOL> try : <EOL> rport = self . port if port is None else port <EOL> url = "<STR_LIT>" . format ( ip , rport , self . uri ) <EOL> response = utility . requests_get ( url ) <EOL> found = findall ( "<STR_LIT>" , response . content ) <EOL> if len ( found ) > <NUM_LIT:0> and self . version in found [ <NUM_LIT:0> ] : <EOL> return True <EOL> except exceptions . Timeout : <EOL> utility . Msg ( "<STR_LIT>" . format ( self . platform , <EOL> ip , rport ) , <EOL> LOG . DEBUG ) <EOL> except exceptions . ConnectionError : <EOL> utility . Msg ( "<STR_LIT>" . format ( self . platform , <EOL> ip , rport ) , <EOL> LOG . DEBUG ) <EOL> return False </s>
