<s> from src . platform . jboss . authenticate import checkAuth <EOL> from src . platform . jboss . interfaces import JINTERFACES <EOL> from cprint import FingerPrint <EOL> from log import LOG <EOL> from requests import exceptions <EOL> import utility <EOL> class FPrint ( FingerPrint ) : <EOL> def __init__ ( self ) : <EOL> self . platform = "<STR_LIT>" <EOL> self . version = "<STR_LIT>" <EOL> self . title = JINTERFACES . STS <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> if response . status_code == <NUM_LIT> : <EOL> utility . Msg ( "<STR_LIT>" % <EOL> ( ip , rport , self . uri ) , LOG . DEBUG ) <EOL> cookies = checkAuth ( ip , rport , self . title , self . version ) <EOL> if cookies : <EOL> response = utility . requests_get ( url , cookies = cookies [ <NUM_LIT:0> ] , <EOL> auth = cookies [ <NUM_LIT:1> ] ) <EOL> else : <EOL> utility . Msg ( "<STR_LIT>" % ( ip , rport ) , LOG . ERROR ) <EOL> return False <EOL> if response . status_code == <NUM_LIT:200> : <EOL> return True <EOL> except exceptions . Timeout : <EOL> utility . Msg ( "<STR_LIT>" . format ( self . platform , ip , <EOL> rport ) , LOG . DEBUG ) <EOL> except exceptions . ConnectionError : <EOL> utility . Msg ( "<STR_LIT>" . format ( self . platform , <EOL> ip , rport ) , LOG . DEBUG ) <EOL> return False </s>
