Dmidecode - CVE-2023-30630
Dmidecode is a tool for dumping a computers DMI (SMBIOS) table contents in a human-readable format. This table contains a description of the systems hardware components, as well as other useful pieces of information such as serial numbers and BIOS revisions.
With root permissions to dmidecode
a low privileged user can use the application maliciously to escalate its privileges to root through a file write vulnerability.
Newly created files through
dmidecode
will have the ownerroot
. If you instead write to an already existing file, the content will be overwritten but the privileges will be honored.You are not able to create directories with
dmidecode
. If you plan to privesc through.ssh/authorized_key
the directory needs to exist.To privesc through
/root/.ssh/authorized_keys
,PermitRootLogin
must be enabled in/etc/ssh/sshd_config
dmidecode
will add junk at the beginning of the file, this is not visible withcat
but you'll see it withvi/vim
. To circumvent this write your ssh-key on row 2 or below.dmidecode
version 3.3 has a bug that SEGFAULTs the program when trying to exploit, however this is again fixed for version 3.4. This exploit will work on all versions between 1.8 and 3.4, except 3.3.
Use the tool dmiwrite
to build malicious payload.
Last updated