File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -978,6 +978,7 @@ def enumerate_sessions_info(self, sessions):
978978 except SessionError :
979979 self .logger .fail ("RDP is probably not enabled, cannot list remote IPv4 addresses." )
980980
981+
981982 @requires_admin
982983 def qwinsta (self ):
983984 import os
@@ -1040,7 +1041,7 @@ def qwinsta(self):
10401041 if self .args .qwinsta and self .args .qwinsta is not True :
10411042 arg = self .args .qwinsta
10421043 if os .path .isfile (arg ):
1043- with open (arg , "r" ) as f :
1044+ with open (arg ) as f :
10441045 usernames = [line .strip ().lower () for line in f if line .strip ()]
10451046 else :
10461047 usernames = [arg .lower ()]
@@ -1052,9 +1053,8 @@ def qwinsta(self):
10521053 domain = sessions [i ]["Domain" ]
10531054 user_full = f"{ domain } \\ { username } " if username else ""
10541055
1055- if usernames :
1056- if username .lower () not in usernames :
1057- continue
1056+ if usernames and username .lower () not in usernames :
1057+ continue
10581058
10591059 found_user = True
10601060
@@ -2079,4 +2079,4 @@ def add_ntds_hash(ntds_hash, host_id):
20792079 NTDS .finish ()
20802080
20812081 def mark_guest (self ):
2082- return highlight (f"{ highlight ('(Guest)' )} " if self .is_guest else "" )
2082+ return highlight (f"{ highlight ('(Guest)' )} " if self .is_guest else "" )
You can’t perform that action at this time.
0 commit comments