Description
This module exploits a race and use-after-free vulnerability in the FreeBSD kernel IPv6 socket handling. A missing synchronization lock in the `IPV6_2292PKTOPTIONS` option handling in `setsockopt` permits racing `ip6_setpktopt` access to a freed `ip6_pktopts` struct.
This exploit overwrites the `ip6po_pktinfo` pointer of a `ip6_pktopts` struct in freed memory to achieve arbitrary kernel read/write.
This module has been tested successfully on:
FreeBSD 9.0-RELEASE #0 (amd64); FreeBSD 9.1-RELEASE #0 r243825 (amd64); FreeBSD 9.2-RELEASE #0 r255898 (amd64); FreeBSD 9.3-RELEASE #0 r268512 (amd64); FreeBSD 12.0-RELEASE r341666 (amd64); and FreeBSD 12.1-RELEASE r354233 (amd64).
Module options
To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':
msf > use exploit/freebsd/local/ip6/setpktopt_uaf_priv_escmsf undefined(setpktopt_uaf_priv_esc) > show actions ...actions...msf undefined(setpktopt_uaf_priv_esc) > set ACTION < action-name >msf undefined(setpktopt_uaf_priv_esc) > show options ...show and set options...msf undefined(setpktopt_uaf_priv_esc) > runPrioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub