Path: blob/master/lib/rex/proto/gss/spnego_neg_token_init.rb
55805 views
require 'rasn1'12module Rex::Proto::Gss3# Initial negotiation token4# https://datatracker.ietf.org/doc/html/rfc4178#section-4.25class MechType < RASN1::Types::ObjectId6end78class MechTypeList < RASN1::Model9sequence_of(:mech_type, Rex::Proto::Gss::MechType)10end1112class ContextFlags < RASN1::Types::BitString13def initialize(options = {})14options[:bit_length] = 3215super16end17end1819class NegTokenInit < RASN1::Model20sequence :neg_token_init, explicit: 0, class: :context, constructed: true,21content: [wrapper(model(:mech_type_list, Rex::Proto::Gss::MechTypeList), explicit: 0, constructed: true),22wrapper(model(:context_flags, Rex::Proto::Gss::ContextFlags), explicit: 1, constructed: true, optional: true),23octet_string(:mech_token, explicit: 2, constructed: true, optional: true),24octet_string(:mech_list_mic, explicit: 3, optional: true)25]26end2728class SpnegoNegTokenInit < RASN1::Model29sequence :gssapi, implicit: 0, class: :application, constructed: true,30content: [objectid(:oid),31model(:neg_token_init, Rex::Proto::Gss::NegTokenInit)]3233def mech_token34self[:gssapi][:neg_token_init][:mech_token].value35end3637def mech_type_list38self[:gssapi][:neg_token_init][:mech_type_list][:mech_type]39end40end41end4243