Old versions of the 'host' command suffer from an exploitable buffer overflow. The host command is used to perform the AXFR request to obtain the zone transfer information, and can be caused to execute arbitrary code when connecting to a fake DNS server (e.g. A netcat process listening on port 53).
Credit:
The information has been provided by antirez.
Vulnerable systems:
The version affected is the following:
static char rcsid[] = "$Id: host.c,v 8.21 1998/03/19 19:31:25 halley Exp $";
Details:
The host command can be used to perform the AXFR request to obtain the zone transfer of some domain. UDP DNS messages are limited to 512 bytes, TCP DNS messages to 65535 bytes. Vulnerable versions of the host command perform the AXFR query using TCP but write the received data to a stack allocated buffer of 512 bytes. If the server send a message bigger than 512 bytes the return address of the function can be modified.
This can be reproduced using the host command with the syntax and the proof of concepts exploit attached blow: