CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/proto/ipmi/rakp2.rb
Views: 11704
1
# -*- coding: binary -*-
2
3
require 'bindata'
4
5
module Rex
6
module Proto
7
module IPMI
8
class RAKP2 < BinData::Record
9
endian :little
10
uint8 :rmcp_version ,label: "RMCP Version"
11
uint8 :rmcp_padding ,label: "RMCP Padding"
12
uint8 :rmcp_sequence ,label: "RMCP Sequence"
13
bit1 :rmcp_mtype ,label: "RMCP Message Type"
14
bit7 :rmcp_class ,label: "RMCP Message Class"
15
16
uint8 :session_auth_type ,label: "Authentication Type"
17
18
bit1 :session_payload_encrypted ,label: "Session Payload Encrypted"
19
bit1 :session_payload_authenticated ,label: "Session Payload Authenticated"
20
bit6 :session_payload_type ,label: "Session Payload Type"
21
22
uint32 :session_id ,label: "Session ID"
23
uint32 :session_sequence ,label: "Session Sequence Number"
24
uint16 :message_length ,label: "Message Length"
25
uint8 :ignored1 ,label: "Ignored"
26
uint8 :error_code ,label: "RMCP Error Code"
27
uint16 :ignored2 ,label: "Ignored"
28
rest :data ,label: "RAKP2 Data"
29
end
30
31
class RAKP2_Data < BinData::Record
32
endian :little
33
string :console_session_id, length: 4 ,label: "Console Session ID"
34
string :bmc_random_id, length: 16 ,label: "BMC Random ID"
35
string :bmc_guid, length: 16 ,label: "RAKP2 Hash 2 (nulls)"
36
string :hmac_sha1, length: 20 ,label: "HMAC_SHA1 Output"
37
end
38
end
39
end
40
end
41
42