public override void Command(MenuItem menuItem, string UserInput) { CredentialsMenuItem credentialsMenuItem = (CredentialsMenuItem)menuItem; List <string> commands = Utilities.ParseParameters(UserInput); if (commands.Count() != 2) { EliteConsole.PrintFormattedErrorLine("Invalid Ticket command. Usage is: Ticket <ticket_id>"); EliteConsole.PrintFormattedErrorLine("Valid Ticket IDs are: " + String.Join(", ", credentialsMenuItem.TicketCredentials.Select(T => T.Id.ToString()))); } else if (!credentialsMenuItem.TicketCredentials.Select(T => T.Id.ToString()).Contains(commands[1])) { EliteConsole.PrintFormattedErrorLine("Invalid Ticket command. Usage is: Ticket <ticket_id>"); EliteConsole.PrintFormattedErrorLine("Valid Ticket IDs are: " + String.Join(", ", credentialsMenuItem.TicketCredentials.Select(T => T.Id.ToString()))); } else { EliteConsole.PrintFormattedInfoLine($"Ticket ID: {commands[1]} Base64EncodedTicket:"); EliteConsole.PrintInfoLine(credentialsMenuItem.TicketCredentials.FirstOrDefault(T => T.Id.ToString().Equals(commands[1], StringComparison.OrdinalIgnoreCase)).Ticket); } }
public override void Command(MenuItem menuItem, string UserInput) { menuItem.Refresh(); CredentialsMenuItem credentialsMenu = ((CredentialsMenuItem)menuItem); EliteConsoleMenu passwordCredentialsMenu = new EliteConsoleMenu(EliteConsoleMenu.EliteConsoleMenuType.List, "Password Credentials"); passwordCredentialsMenu.Columns.Add("Domain"); passwordCredentialsMenu.Columns.Add("Username"); passwordCredentialsMenu.Columns.Add("Password"); credentialsMenu.PasswordCredentials.ToList().ForEach(PC => { passwordCredentialsMenu.Rows.Add(new List <string> { PC.Domain, PC.Username, PC.Password }); }); if (passwordCredentialsMenu.Rows.Count > 0) { passwordCredentialsMenu.PrintEndBuffer = false; passwordCredentialsMenu.Print(); } EliteConsoleMenu hashCredentialsMenu = new EliteConsoleMenu(EliteConsoleMenu.EliteConsoleMenuType.List, "Hashed Credentials"); hashCredentialsMenu.Columns.Add("Domain"); hashCredentialsMenu.Columns.Add("Username"); hashCredentialsMenu.Columns.Add("Hash"); hashCredentialsMenu.Columns.Add("HashType"); credentialsMenu.HashCredentials.ToList().ForEach(HC => { hashCredentialsMenu.Rows.Add(new List <string> { HC.Domain, HC.Username, HC.Hash, HC.HashCredentialType.ToString() }); }); if (hashCredentialsMenu.Rows.Count > 0) { hashCredentialsMenu.PrintEndBuffer = false; hashCredentialsMenu.Print(); } EliteConsoleMenu ticketCredentialsMenu = new EliteConsoleMenu(EliteConsoleMenu.EliteConsoleMenuType.List, "Ticket Credentials"); ticketCredentialsMenu.Columns.Add("ID"); ticketCredentialsMenu.Columns.Add("Domain"); ticketCredentialsMenu.Columns.Add("Username"); ticketCredentialsMenu.Columns.Add("ServiceName"); ticketCredentialsMenu.Columns.Add("Ticket"); ticketCredentialsMenu.Columns.Add("TicketType"); credentialsMenu.TicketCredentials.ToList().ForEach(TC => { ticketCredentialsMenu.Rows.Add(new List <string> { TC.Id.ToString(), TC.Domain, TC.Username, TC.ServiceName, TC.Ticket, TC.TicketCredentialType.ToString() }); }); if (ticketCredentialsMenu.Rows.Count > 0) { ticketCredentialsMenu.Print(); } }