Chinaunix首页 | 论坛 | 博客
  • 博客访问: 809229
  • 博文数量: 222
  • 博客积分: 4341
  • 博客等级: 上校
  • 技术积分: 2155
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-16 13:50
个人简介

...

文章分类

全部博文(222)

文章存档

2019年(1)

2016年(9)

2015年(7)

2014年(14)

2013年(11)

2012年(10)

2011年(6)

2010年(25)

2009年(37)

2008年(21)

2007年(81)

我的朋友

分类: LINUX

2007-10-28 21:45:43

Part III: System Administration Tools
Chapter 9: Bypassing Automatic Configurations to Gain Control
Debian
 系统启动 /etc/inittab 调用 /etc/init.d/rcS
 SysV启动脚本 /etc/rc?.d
 运行级别和启动X /etc/X11/default-display-manager
 cron: /etc/crontab  调用 /etc/cron.interval
 超级服务 inetd, xinetd
 邮件服务器
 模块update-modules 根据/etc/modutils目录自动创建 /etc/modules.conf
 网络配置: 启动脚本/etc/init.d/networking 配置文件/etc/network
 启动文件: /etc/rc.boot 以及 /etc/rcS.d
 SysV 启动脚本模板
  #!/bin/bash
  case "$1" in
      start)
          /usr/local/bin/bigserv
          ;;
      stop)
          /usr/bin/killall bigserv
          ;;
      restart)
          $0 stop
          $0 start
          ;;
  esac
 ~/.xinitrc  ==>  startx
 ~/.xsession  ==>  XDM,KDM,GDM
 ~/.vnc/xstartup  ==> VNC server
Chapter 10: Using Multiple OSs
 GRUB
  # grub
  grub> find /boot/grub/stage1
   (hd0,5)
  grub> root (hd0,5)
  grub> setup (hd0)
  grub> quit
Chapter 11: Managing Packages
Chapter 13: Managing Printers
Chapter 14: Programs and Processes
 ps
 top
 pstree
 w
 jobs
 lsof
 netstat
 nice/renice
 kill/killall
Chapter 15: Creating a Custom Kernel
Chapter 16: Optimizing X Configuration
Chapter 17: Protecting Your System with Backups
 cp
 cpio
 dump
 smbtar
 tar
Chapter 18: System Security
 攻击方法
 好的密码
 本地服务
  # netstat -ap
  $ nmap -sT
Part IV: Networking Tools
Chapter 19: Basic Network Configuration
 网卡
  驱动 /etc/modules.conf
  DHCP 
   客户端 dhclient/pump 调用程序 /sbin/ifup 配置文件 /etc/network/interfaces, /etc/dhclient.conf RedHat /etc/sysconfig/network,/etc/sysconfig/network-scripts/ifcfg-eth0
   配置生效: # /etc/rc.d/init.d/network stop|start
   查看进程: $ ps ax | grep dhcpcd
  静态地址
  测试
   Xtraceroute
  优化网络
Chapter 20: Controlling Network Access
 防火墙工具
  Shorewall 调用配置文件 /etc/sysconfig/iptables
  Red Hat Security Level Configuration: redhat-config-securitylevel 和 lokkit 调用 iptables
  Knetfilter 配置文件 /etc/iptables_rules.cfg
  防火墙模板
   #!/bin/bash
  
   iptables -F INPUT
   iptables -F FORWARD
   iptables -F OUTPUT
  
   iptables -P INPUT DROP
   iptables -P FORWARD DROP
   iptables -P OUTPUT DROP
  
   # Let traffic on the loopback interface pass
   iptables -A OUTPUT -d 127.0.0.1 -o lo -j ACCEPT
   iptables -A INPUT -s 127.0.0.1 -i lo -j ACCEPT
  
   # Let DNS traffic pass
   iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
   iptables -A INPUT -p udp --sport 53 -j ACCEPT
  
   # Let clients' TCP traffic pass
   iptables -A OUTPUT -p tcp --sport 1024:65535 -m state \
            --state NEW,ESTABLISHED,RELATED -j ACCEPT
   iptables -A INPUT -p tcp --dport 1024:65535 -m state \
            --state ESTABLISHED,RELATED -j ACCEPT
  
   # Let local connections to local SSH server pass
   iptables -A OUTPUT -p tcp --sport 22 -d 172.24.1.0/24 -m state \
            --state ESTABLISHED,RELATED -j ACCEPT
   iptables -A INPUT -p tcp --dport 22 -s 172.24.1.0/24 -m state \
            --state NEW,ESTABLISHED,RELATED -j ACCEPT
  
 TCP Wrappers
  通常由 inetd 调用
  配置文件 /etc/inetd.conf /etc/hosts.allow 和 /etc/hosts.deny
  服务名解析 /etc/services
  
  TCP Wrappers配置格式(/etc/hosts.allow 和 /etc/hosts.deny)
   service-names : client-list [: shell-command ]
   service-names : 例如 in.ftpd 或 in.telnetd
   client-list : ip地址或ip地址范围, 主机名, 域名, 用户名  例如 172.24.45.0/24 EXCEPT 172.24.45.72
  /etc/hosts.allow 格式
   in.telnetd : 172.24.45.2 trex.pangaea.edu
   vsftpd : 172.24.45. EXCEPT 172.24.45.1
   imapd : .pangaea.edu EXCEPT router.pangaea.edu
   ipop3d :
 xinetd
  格式
   service swat
   {
       port         = 901
       socket_type  = stream
       wait         = no
       only_from    = 127.0.0.1
       user         = root
       server       = /usr/sbin/swat
       disable      = no
   }
 使用Jail
  chroot
Chapter 21: Detecting Intruders
 Tripwire
 策略文件格式:
  TWBIN = /usr/sbin ;
  
  # Tripwire binaries
  (
    rulename = "Tripwire Binaries",
  )
  {
    $(TWBIN)/siggen         -> $(ReadOnly) ;
    $(TWBIN)/tripwire       -> $(ReadOnly) ;
    $(TWBIN)/twadmin        -> $(ReadOnly) ;
    $(TWBIN)/twprint        -> $(ReadOnly) ;
  }
  
  /usr/bin -> $(ReadOnly) ;
  /etc -> $(Dynamic) ;
 初始化数据库
  /etc/tripwire/twinstall.sh
  tripwire --init
 校验
  tripwire --check
 修改Tripwire配置
  twadmin --create-cfgfile -S /etc/tripwire/site.key /etc/tripwire/twcfg.txt  # 修改配置文件
  twadmin --create-polfile -S /etc/tripwire/site.key /etc/tripwire/twpol.txt  # 修改策略
  tripwire --update-policy -S /etc/tripwire/site.key /etc/tripwire/twpol.txt  # 创建新的策略文件
  tripwire --update --twrfile /var/lib/tripwire/report/knox.luna.edu-20031212-155357.twr  # 更新数据库
 chkrootkit

Part V: Server Tools
Chapter 22: Running Servers
 SysV启动脚本
  位置: Debian /etc/init.d /etc/rc?.d  Redhat /etc/rc.d/init.d/  /etc/rc.d/rc?.d
 
  chkconfig/ntsysv/redhat-config-services/ksysv
 
 本地启动脚本: /etc/rc.boot
Chapter 23: Getting More from a Web Server
 web服务器: apache/roxen/zeus/kHTTPd
 apache服务器配置
Chapter 24: Serving Files
 FTP
 NFS
 Samba
Chapter 25: Delivering E-Mail
 服务器: Sendmail/Postfix/Exim/qmail
Chapter 26: Providing Remote Login Access
 字符模式远程访问: OpenSSH
 GUI 远程访问: XDMCP Server/VNC
Chapter 27: Miscellaneous Servers
 DHCP
 DNS
 NTP
阅读(1442) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~