Dell PowerEdge LCD MOTD


Dell PowerEdge LCD MOTD

What's LCD

Previous Works

IPMI Registers

0x6             This is the network function (NetFn) number for Applications.
                See the IPMI spec for more information.
0x58            The operation number for setting system information. IPMI spec (page 572)
193 or 194      The selector for setting the Dell LCD text. 193 means
                set the string to this, 194 controls what string to show
                in the LCD.
0               Which chunk of 16 bytes of text you're editing (62 bytes are allowed).
0               Text encoding. This should always be 0 for ASCII.

6               This is the length of the string you're encoding.
                'foobar' is 6 characters. You can send 14 characters with each chunk.
                This is because you can only send 16 bytes total (1 byte for text
                encoding, 1 byte for length, 14 bytes for text).
0x66 0x6F 0x6F 0x62 0x61 0x72
                The ASCII codes for 'foobar'.

There are 2 registers:

0 Which chunk of 16 bytes of text you're editing (62 bytes are allowed).

0 Text encoding. This should always be 0 for ASCII.

They are a control bit of buffer inside IPMI. The LCD string is a buffer which has a width of 16 (each chunk), and has a height.

You can use the chunk register to control which row you are editing. And the text coding and length register only exist in the first row.

Python PoC

# -*- coding: UTF-8 -*-
# !/usr/bin/python

host = '*.*.*.*'
user = 'root'
passwd = '******'
lcd = 'Dell PowerEdge R710 - VMware vSphere - Misaka Network, Inc.'

strHex = ''
cmd_prefix = 'ipmitool -I lanplus -H ' + host + ' -U ' + user + ' -P ' + passwd
LCD_len = len(lcd)
cmd = cmd_prefix + ' raw 0x6 0x58 193'

for x in lcd:
    strHex += hex(ord(x))
    strHex += " "

if LCD_len <= 14:
    print(cmd_prefix + ' raw 0x6 0x58 193 0 0 ' + str(LCD_len) + ' ' + strHex)
else:
    first = lcd[:14]
    strFirst = ''
    for x in first:
        strFirst += hex(ord(x))
        strFirst += " "
    print(cmd_prefix + ' raw 0x6 0x58 193 0 0 ' + str(LCD_len) + ' ' + strFirst)
    lcd = lcd[14:]
    num = LCD_len - 14
    for i in range(num // 16 + 1):
        strHex = ''
        for x in lcd[i * 16:min(num + 1, (i + 1) * 16)]:
            strHex += hex(ord(x))
            strHex += ' '
        print(cmd_prefix + ' raw 0x6 0x58 193 ' + str(i + 1) + ' ' + strHex)

文章作者: sfc9982
版权声明: 本博客所有文章除特別声明外,均采用 CC BY-NC-ND 4.0 许可协议。转载请注明来源 sfc9982 !
  目录