From ca562a95d83d081bca829a33bafa05875d95c911 Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Fri, 23 Feb 2024 09:46:44 -0500 Subject: [PATCH] Truncate private data at 88 chars Truncating at 87 was the exact length to trim the last byte of an AES256 kerberos key. Furthermore, adding the (TRUNCATED) string to the end caused the resuting value to be larger than the original trucated value. --- lib/msf/ui/console/command_dispatcher/creds.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msf/ui/console/command_dispatcher/creds.rb b/lib/msf/ui/console/command_dispatcher/creds.rb index c354bfa89b..220365a4c7 100644 --- a/lib/msf/ui/console/command_dispatcher/creds.rb +++ b/lib/msf/ui/console/command_dispatcher/creds.rb @@ -477,8 +477,8 @@ class Creds else private_val = '' end - if truncate && private_val.to_s.length > 87 - private_val = "#{private_val[0,87]} (TRUNCATED)" + if truncate && private_val.to_s.length > 88 + private_val = "#{private_val[0,76]} (TRUNCATED)" end realm_val = core.realm ? core.realm.value : '' human_val = core.private ? core.private.class.model_name.human : ''