FreeBSD sendfile Kernel Information Disclosure (Exploit)
10 Nov. 2005
Summary
The FreeBSD sendfile system call allows a server application (such as an HTTP or FTP server) to transmit the contents of a file over a network connection without first copying it to application memory.
The FreeBSD kernel does not clean memory parts before being used with sendfile, allowing users to retrieve random information about the system, the following exploit code can be used to determine whether your system is vulnerable or not.
Credit:
The information has been provided by kcope.
Exploit:
/*
** FreeBSD master.passwd disclosure exploit
** by kcope in 2005, kingcope[at]gmx.net
** thanks to revoguard
** just compile and execute .. look into the kmem file
** it contains the master.passwd
** tested on unpatched FreeBSD 4.11-RELEASE
** advisory: ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:02.sendfile.asc
** +++KEEP PRIV8+++
*/