#NEWLINE# def enum_lusers( self ) : #NEWLINE# #INDENT# ( dce , rpctransport ) = self . connect ( 'wkssvc' ) #NEWLINE# try : #NEWLINE# #INDENT# resp = wkst . hNetrWkstaUserEnum ( dce , 1 ) #NEWLINE# lusers = resp [ 'UserInfo' ] [ 'WkstaUserInfo' ] [ 'Level1' ] [ 'Buffer' ] #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . logger . success ( 'Enumerating logged on users' ) #NEWLINE# for user in lusers : #NEWLINE# #INDENT# self . logger . highlight ( 'Username: {}\\{} {}' . format ( user [ 'wkui1_logon_domain' ] , user [ 'wkui1_username' ] , ( 'LogonServer: {}' . format ( user [ 'wkui1_logon_server' ] ) if ( user [ 'wkui1_logon_server' ] != '\x00' ) else '' ) ) )