Class: Rex::Proto::IPMI::Channel_Auth_Reply

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/rex/proto/ipmi/channel_auth_reply.rb

Instance Method Summary collapse

Instance Method Details

#to_bannerObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/rex/proto/ipmi/channel_auth_reply.rb', line 56

def to_banner
  info   = self
  banner = "#{(info.ipmi_compat_20 == 1) ? "IPMI-2.0" : "IPMI-1.5"} "

  pass_info = []
  pass_info << "oem_auth" if info.ipmi_compat_oem_auth == 1
  pass_info << "password" if info.ipmi_compat_password == 1
  pass_info << "md5" if info.ipmi_compat_md5 == 1
  pass_info << "md2" if info.ipmi_compat_md2 == 1
  pass_info << "null" if info.ipmi_compat_none == 1

   = []
   << "kg_default" if (info.ipmi_compat_20 == 1 and info.ipmi_user_kg == 1)
   << "auth_msg" unless info.ipmi_user_disable_message_auth == 1
   << "auth_user" unless info.ipmi_user_disable_user_auth == 1
   << "non_null_user" if info.ipmi_user_non_null == 1
   << "null_user" if info.ipmi_user_null == 1
   << "anonymous_user" if info.ipmi_user_anonymous == 1

  conn_info = []
  conn_info << "1.5" if info.ipmi_conn_15 == 1
  conn_info << "2.0" if info.ipmi_conn_20 == 1

  if info.ipmi_oem_id != 0
    banner << "OEMID:#{info.ipmi_oem_id} "
  end

  banner << "UserAuth(#{.join(", ")}) PassAuth(#{pass_info.join(", ")}) Level(#{conn_info.join(", ")}) "
  banner
end