File tree Expand file tree Collapse file tree 1 file changed +10
-28
lines changed Expand file tree Collapse file tree 1 file changed +10
-28
lines changed Original file line number Diff line number Diff line change 9898from impacket .dcerpc .v5 import transport , samr
9999from ldap3 import Server , Connection , DSA
100100import yaml
101+ from enum import Enum
102+
101103try :
102104 from yaml import CDumper as Dumper
103105except ImportError :
320322GLOBAL_COLORS = True
321323GLOBAL_SAMBA_LEGACY = False
322324
323- class Colors :
324- ansi_reset = '\033 [0m'
325- ansi_red = '\033 [91m'
326- ansi_green = '\033 [92m'
327- ansi_yellow = '\033 [93m'
328- ansi_blue = '\033 [94m'
329-
330- @classmethod
331- def red (cls , msg ):
332- if GLOBAL_COLORS :
333- return f"{ cls .ansi_red } { msg } { cls .ansi_reset } "
334- return msg
335-
336- @classmethod
337- def green (cls , msg ):
338- if GLOBAL_COLORS :
339- return f"{ cls .ansi_green } { msg } { cls .ansi_reset } "
340- return msg
341-
342- @classmethod
343- def yellow (cls , msg ):
344- if GLOBAL_COLORS :
345- return f"{ cls .ansi_yellow } { msg } { cls .ansi_reset } "
346- return msg
325+ class Colors (Enum ):
326+ red = '\033 [91m'
327+ green = '\033 [92m'
328+ yellow = '\033 [93m'
329+ blue = '\033 [94m'
347330
348- @classmethod
349- def blue (cls , msg ):
331+ def __call__ (self , message ):
350332 if GLOBAL_COLORS :
351- return f"{ cls . ansi_blue } { msg } { cls . ansi_reset } "
333+ return f"{ self . value } { message } \033 [0m "
352334 return msg
353335
354336class Result :
@@ -3163,7 +3145,7 @@ def valid_file(file, mode=os.R_OK):
31633145### Print Functions and Error Processing
31643146
31653147def print_banner ():
3166- print (f" { Colors .green (f'ENUM4LINUX - next generation (v{ GLOBAL_VERSION } )' )} \n " )
3148+ print (Colors .green (f'ENUM4LINUX - next generation (v{ GLOBAL_VERSION } )' ), end = " \n \n " )
31673149
31683150def print_heading (text , leading_newline = True ):
31693151 output = f"| { text } |"
You can’t perform that action at this time.
0 commit comments