modules/auxiliary/admin/kerberos/get_ticket.rb
Method initialize
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Kerberos TGT/TGS Ticket Requester',
Method validate_options
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def validate_options
if datastore['CERT_FILE'].present?
certificate = File.read(datastore['CERT_FILE'])
begin
@pfx = OpenSSL::PKCS12.new(certificate, datastore['CERT_PASSWORD'] || '')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File get_ticket.rb
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::Kerberos
include Msf::Exploit::Remote::Kerberos::Client
include Msf::Exploit::Remote::Kerberos::Ticket::Storage
Method validate_options
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def validate_options
if datastore['CERT_FILE'].present?
certificate = File.read(datastore['CERT_FILE'])
begin
@pfx = OpenSSL::PKCS12.new(certificate, datastore['CERT_PASSWORD'] || '')
Method action_get_tgs
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def action_get_tgs
authenticator = init_authenticator({ ticket_storage: kerberos_ticket_storage(read: true, write: true) })
tgt_request_options = {}
if datastore['Krb5Ccname'].present?
tgt_request_options[:cache_file] = datastore['Krb5Ccname']
Method init_authenticator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def init_authenticator(options = {})
options.merge!({
host: rhost,
realm: @realm,
username: @username,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"