Skip to content

Commit a7d0927

Browse files
committed
Add error handling to the module
1 parent 15f04ca commit a7d0927

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/auxiliary/gather/kerberoast.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ def run
6666
else
6767
run_user
6868
end
69+
rescue Errno::ECONNRESET
70+
fail_with(Failure::Disconnected, 'The connection was reset.')
71+
rescue Rex::ConnectionError => e
72+
fail_with(Failure::Unreachable, e.message)
73+
rescue Rex::Proto::Kerberos::Model::Error::KerberosError => e
74+
fail_with(Failure::NoAccess, e.message)
75+
rescue Net::LDAP::Error => e
76+
fail_with(Failure::Unknown, "#{e.class}: #{e.message}")
6977
end
7078

7179
def run_user

0 commit comments

Comments
 (0)