#NEWLINE# def run( self , fingerengine , fingerprint ) : #NEWLINE# #INDENT# '\n        ' #NEWLINE# utility . Msg ( 'Obtaining deployed applications...' ) #NEWLINE# base = 'https://{0}:{1}' . format ( fingerengine . options . ip , fingerprint . port ) #NEWLINE# uri = '/management/domain/applications/list-applications' #NEWLINE# headers = { #NEWLINE# #INDENT# 'Accept' : 'application/json' , #NEWLINE# #UNINDENT# } #NEWLINE# cookie = checkAuth ( fingerengine . options . ip , fingerprint . port , fingerprint . title ) #NEWLINE# if ( not cookie ) : #NEWLINE# #INDENT# utility . Msg ( ( 'Could not get auth on %s:%s' % ( fingerengine . options . ip , fingerprint . port ) ) , LOG . ERROR ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( fingerprint . version in [ '3.0' ] ) : #NEWLINE# #INDENT# base = base . replace ( 'https' , 'http' ) #NEWLINE# uri = '/management/domain/applications/application' #NEWLINE# return self . _parse_old ( ( base + uri ) , cookie ) #NEWLINE# #UNINDENT# response = utility . requests_get ( ( data + uri ) , auth = cookie , headers = headers ) #NEWLINE# if ( response . status_code is 200 ) : #NEWLINE# #INDENT# data = json . loads ( response . content ) #NEWLINE# if ( not ( 'properties' in data . keys ( ) ) ) : #NEWLINE# #INDENT# utility . Msg ( 'No applications found.' ) #NEWLINE# return #NEWLINE# #UNINDENT# utility . Msg ( ( 'Discovered %d deployed apps' % len ( data [ 'properties' ] ) ) ) #NEWLINE# for entry in data [ 'properties' ] . keys ( ) : #NEWLINE# #INDENT# utility . Msg ( ( '  /%s' % entry ) )