<s> from src . platform . tomcat . authenticate import checkAuth <EOL> from src . platform . tomcat . interfaces import TINTERFACES <EOL> from auxiliary import Auxiliary <EOL> from log import LOG <EOL> import utility <EOL> class Auxiliary : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . name = '<STR_LIT>' <EOL> self . versions = [ '<STR_LIT>' ] <EOL> self . flag = '<STR_LIT>' <EOL> def check ( self , fingerprint ) : <EOL> """<STR_LIT:U+0020>""" <EOL> if fingerprint . title == TINTERFACES . MAN : <EOL> return True <EOL> return False <EOL> def run ( self , fingerengine , fingerprint ) : <EOL> utility . Msg ( "<STR_LIT>" ) <EOL> base = "<STR_LIT>" . format ( fingerengine . options . ip , <EOL> fingerprint . port ) <EOL> relative = '<STR_LIT>' <EOL> if fingerprint . version in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> relative = '<STR_LIT>' <EOL> url = base + relative <EOL> response = utility . requests_get ( url ) <EOL> if response . status_code == <NUM_LIT> : <EOL> utility . Msg ( "<STR_LIT>" % <EOL> ( fingerengine . options . ip , fingerprint . port ) , LOG . DEBUG ) <EOL> cookies = checkAuth ( fingerengine . options . ip , fingerprint . port , <EOL> fingerprint . title , fingerprint . 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>" % <EOL> ( fingerengine . options . ip , fingerprint . port ) , LOG . ERROR ) <EOL> return <EOL> if response . status_code == <NUM_LIT:200> : <EOL> info = response . content . split ( '<STR_LIT:\n>' ) [ <NUM_LIT:1> : - <NUM_LIT:1> ] <EOL> for entry in info : <EOL> utility . Msg ( entry ) </s>
