资源描述
网络安全实验指导
网络安全和管理实验指导书
电子与信息工程系网络工程教研室
2011-10-25
实验一 为WWW服务配置SSL
一、实验目的
1.加深并消化授课内容,掌握SSL的基本概念;
2.了解并熟悉万维网服务器的配置;
3.掌握在万维网服务器上部署SSL协议;
二、实验要求
1.掌握Security Socket Layer在应用层的作用;
2.独立完成在万维网服务器上部署SSL;
3.实验结束后,用统一的实验报告用纸编写实验报告。
三、实验环境
Windows 2003 企业版服务器+IIS服务,Linux企业版服务器+Apache服务
四、实验内容
1.Windows系统上部署万维网服务,并配置SSL
2.Linux系统上部署万维网服务,并配置SSL
五、实验步骤
Windows系统上部署万维网服务,并配置SSL
(1)颁发证书
1.从“管理工具”程序组中启动“证书颁发机构”工具。
2.展开证书颁发机构,然后选择“挂起的申请”文件夹。
3.选择刚才提交的证书申请。
4.在“操作”菜单中,指向“所有任务”,然后单击“颁发”。
5.确认该证书显示在“颁发的证书”文件夹中,然后双击查看它。
6.在“详细信息”选项卡中,单击“复制到文件”,将证书保存为 Base-64 编码的 X.509 证书。
7.关闭证书的属性窗口。
8.关闭“证书颁发机构”工具。
(2)在 Web 服务器上安装证书
1. 如果 Internet 信息服务尚未运行,则启动它。
2. 展开服务器名称,选择要安装证书的 Web 站点。
3. 右键单击该 Web 站点,然后单击“属性”。
4. 单击“目录安全性”选项卡。
5. 单击“服务器证书”启动 Web 服务器证书向导。
6. 单击“处理挂起的申请并安装证书”,然后单击“下一步”。
7. 输入包含 CA 响应的文件的路径和文件名,然后单击“下一步”。
8. 检查证书概述,单击“下一步”,然后单击“完成”。
现在,已在 Web 服务器上安装了证书。
(3)将资源配置为要求 SSL 访问
此过程使用 Internet 服务管理器,将虚拟目录配置为要求 SSL 访问。为特定的文件、目录或虚拟目录要求使用 SSL。客户端必须使用 HTTPS 协议访问所有这类资源。
1.如果 Internet 信息服务尚未运行,则启动它。
2.展开服务器名称和 Web 站点。(这必须是已安装证书的 Web 站点)
3.右键单击某个虚拟目录,然后单击“属性”。
4.单击“目录安全性”选项卡。
5. 单击“安全通信”下的“编辑”。
6.单击“要求安全通道 (SSL)”。
7. 单击“确定”,然后再次单击“确定”关闭“属性”对话框。
8.关闭 Internet 信息服务。
Linux系统上部署万维网服务,并配置SSL
安装并设置具备SSL的Apache网站服务器
1.创建rasref目录,在该目录提取文件。
# mkdir rsaref-2.0
# cd rsaref-2.0
# gzip -d -c ../rsaref20.tar.Z | tar xvf -
2.配置并构造OpenSSL库。
# cd rsaref-2.0
# cp -rp install/unix local
# cd local
# make
# mv rsaref.a librsaref.a
# cd ../..
3.安装OpenSSL。
# cd openssl-0.9.x
# ./config -prefix=/usr/local/ssl
-L`pwd`/../rsaref-2.0/local/ rsaref -fPIC
4.配置MOD_SSL模块,然后用Apache配置指定它为一个可装载的模块。
# cd mod_ssl-2.5.x-1.3.x
# ./configure
--with-apache=../apache_1.3.x
# cd ..
可以把更多的Apache模块加到Apache源代码树中。可选的--enable-shared=ssl选项使得mod_ssl构造成为一个DSO“libssl.so”。关于在Apache支持DSO的更多信息,阅读Apache源代码树中的INSTALL和 htdocs/manual/dso.html文档。
# cd apache_1.3.x
# SSL_BASE=../openssl-0.9.x
RSA_BASE=../rsaref-2.0/local
./configure --enable-module=ssl
--activate-module=src/modules/php4/libphp4.a
--enable-module=php4 --prefix=/usr/local/apache
--enable-shared=ssl
5.生成Apache,然后生成证书,并安装
# make
正确地完成,得到类似于以下的信息:
+-----------------------------------------------------------------------+
| Before you install the package you now should prepare the SSL |
| certificate system by running the "make certificate" command. |
| For different situations the following variants are provided: |
| |
| % make certificate TYPE=dummy (dummy self-signed Snake Oil cert) |
| % make certificate TYPE=test (test cert signed by Snake Oil CA) |
| % make certificate TYPE=custom (custom cert signed by own CA) |
| % make certificate TYPE=existing (existing cert) |
| CRT=/path/to/your.crt [KEY=/path/to/your.key] |
| |
| Use TYPE=dummy when you're a vendor package maintainer, |
| the TYPE=test when you're an admin but want to do tests only, |
| the TYPE=custom when you're an admin willing to run a real server |
| and TYPE=existing when you're an admin who upgrades a server. |
| (The default is TYPE=test) |
| |
| Additionally add ALGO=RSA (default) or ALGO=DSA to select |
| the signature algorithm used for the generated certificate. |
| |
| Use "make certificate VIEW=1" to display the generated data. |
| |
| Thanks for using Apache & mod_ssl. Ralf S. Engelschall |
| rse@ |
| |
+-----------------------------------------------------------------------+
实验二 NAT地址转换
一、实验目的
1.加深并消化授课内容,理解NAT的作用;
2.掌握NAT网络地址转换的方法;
3.掌握NAT服务在网络设备上的配置方法。
二、实验要求
1.掌握NAT的网络地址转换的原理;
2.熟悉在路由器上使用NAT服务;
3.熟悉Windows服务器上使用NAT服务
三、实验环境
Cisco路由器;Windows 2003企业版服务器
四、实验内容
1.静态地址转换
2.动态地址转换
3.复用动态地址转换。
4.Windows 2000 Server的网络地址翻译
五、实验步骤
1.静态地址转换
(1)、在内部本地地址与内部合法地址之间建立静态地址转换。在全局设置状态下输入:
Ip nat inside source static 内部本地地址 内部合法地址
(2)、指定连接网络的内部端口 在端口设置状态下输入:
ip nat inside
(3)、指定连接外部网络的外部端口 在端口设置状态下输入:
ip nat outside
2.动态地址转换
(1)、在全局设置模式下,定义内部合法地址池
ip nat pool 地址池名称 起始IP地址 终止IP地址 子网掩码
其中地址池名称可以任意设定。
(2)、在全局设置模式下,定义一个标准的access-list规则以允许哪些内部地址可以进行动态地址转换。
Access-list 标号 permit 源地址 通配符
其中标号为1-99之间的整数。
(3)、在全局设置模式下,将由access-list指定的内部本地地址与指定的内部合法地址池进行地址转换。
ip nat inside source list 访问列表标号 pool内部合法地址池名字
(4)、指定与内部网络相连的内部端口在端口设置状态下:
ip nat inside
(5)、指定与外部网络相连的外部端口
Ip nat outside
3.复用动态地址转换。
(1)、在全局设置模式下,定义内部合地址池
ip nat pool 地址池名字 起始IP地址 终止IP地址 子网掩码
其中地址池名字可以任意设定。
(2)、在全局设置模式下,定义一个标准的access-list规则以允许哪些内部本地地址可以进行动态地址转换。
access-list 标号 permit 源地址 通配符
其中标号为1-99之间的整数。
(3)、在全局设置模式下,设置在内部的本地地址与内部合法IP地址间建立复用动态地址转换。
ip nat inside source list 访问列表标号 pool 内部合法地址池名字 overload
(4)、在端口设置状态下,指定与内部网络相连的内部端口
ip nat inside
(5)、在端口设置状态下,指定与外部网络相连的外部端口
ip nat outside
4.Windows 2000 Server的网络地址翻译
(1)、连接Internet网卡的IP由ISP提供。
(2)、连接内部网网卡的IP地址需要以下配置:
IP地址:192.168.0.1
子网掩码:255.255.255.0
默认网关:无
(3)、客户机的IP地址的配置为:
IP地址:192.168.0.x(可设为同一网段内的任一独立的IP)
子网掩码:255.255.255.0
默认网关:192.168.0.1
(4)、在“路由和远程访问”控制台中,用鼠标右键单击域服务器,从弹出的快捷菜单中选择“配置并启用路由和远程访问”选项,打开“路由和远程访问服务器安装向导”对话框。
(5)、在路由和远程访问服务器安装向导中,选择用于“Internet连接服务器”的选项,以及用来安装带有网络地址转换(NAT)路由协议的路由器的选项。
(6)、接下来要定义好哪块网卡连接Internet。
(7)、至此所有配置工作已经全部完成,下面需要测试能不能连接内网和外网。
实验三 IPSec的配置
一、实验目的
1.加深并消化授课内容,理解VPN的作用;
2.掌握在VPN中部署IPSec的方法;
3.掌握IPSec在网络设备上的配置方法。
二、实验要求
1.掌握虚拟专用网的原理;
2.熟悉在路由器上使用VPN服务;
3.熟悉使用IPSec的虚拟专用网的接入方式
三、实验环境
路由器2台
四、实验内容
假设你是公司的网络管理员,公司因业务的扩大,建立了一个分公司,因为公司的业务数据重要,公司的总部与分公司传输数据时需要加密,采用IPSec VPN技术对数据进行加密。
五、实验步骤
1.路由器基本配置。
R1 (config)#
R1 (config)#interface fastEthernet 0/0
R1 (config-if)#ip address 101.1.1.1 255.255.255.252
R1 (config-if)#no shutdown
R1 (config-if)#exit
R1 (config)#interface Loopback 0
R1 (config-if)#ip address 10.1.1.1 255.255.255.0
R1 (config-if)#no shutdown
R1 (config-if)#exit
R2 (config)#interface fastEthernet 0/0
R2 (config-if)#ip address101.1.1.2 255.255.255.252
R2 (config-if)#no shutdown
R2 (config-if)#exit
R2 (config)#interface Loopback 0
R2 (config-if)#ip address 10.1.2.1 255.255.255.0
R2 (config-if)#no sh
R2 (config-if)#end
2.配置默认路由。
R1 (config)#ip route 0.0.0.0 0.0.0.0 101.1.1.2
R2 (config)# ip route 0.0.0.0 0.0.0.0 101.1.1.1
3.配置IPSec VPN。
R1 (config)# crypto isakmp policy 10
R1 (isakmp-policy)#authentication pre-share
R1 (isakmp-policy)#hash md5
R1 (isakmp-policy)#group 2
R1 (isakmp-policy)#exit
R1 (config)#crypto isakmp key 0 ruijie address 101.1.1.2
R1 (config)#crypto ipsec transform-set vpn ah-md5-hmac esp-des esp-md5-hmac
R1 (cfg-crypto-trans)#mode tunel
R1 (config)#crypto map vpnmap 10 ipsec-isakmp
R1 (config-crypto-map)#set peer 101.1.1.2
R1 (config-crypto-map)#set transform-set vpn
R1 (config-crypto-map)#match address 110
R1 (config)#crypto map vpnmap1 10 ipsec-isakmp
R2 (config)#crypto isakmp policy 10
R2 (isakmp-policy)#authentication pre-share
R2 (isakmp-policy)#hash md5
R2 (isakmp-policy)#group 2
R2 (config)#crypto isakmp key 0 ruijie address 101.1.1.2
R2 (config)#crypto ipsec transform-set vpn ah-md5-hmac esp-des esp-md5-hmac
R2 (cfg-crypto-trans)#mode tunel
R2 (config)#crypto map vpnmap 10 ipsec-isakmp
R2 (config-crypto-map)# set peer 101.1.1.1
R2 (config-crypto-map)# set transform-set vpn
R2 (config-crypto-map)# match address 110
4.定义感兴趣数据流及应用VPN。
R1 (config)#access-list extended 110 permit ip 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255
R1 (config)#interface FastEthernet 0/0
R1 (config-if)#crypto map vpnmap
R2 (config)#access-list extended 110 permit ip 10.1.2.0 0.0.0.255 10.1.1.0 0.0.0.255
R2 (config)#interface FastEthernet 0/0
R2 (config-if)#crypto map vpnmap
5.验证测试。
R1#ping
Protocol [ip]:
Target IP address: 10.1.2.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address:10.1.1.1
Time to Live [1, 64]:
Type of service [0, 31]:
Data Pattern [0xABCD]:0xabcd
Sending 5, 100-byte ICMP Echoes to 10.1.2.1, timeout is 2 seconds:
< press Ctrl+C to break >
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
R1#show crypto ipsec sa
Interface: FastEthernet 0/0
Crypto map tag:vpnmap, local addr 101.1.1.1
media mtu 1500
==================================
item type:static, seqno:10, id=32
local ident (addr/mask/prot/port): (10.1.1.0/0.0.0.255/0/0))
remote ident (addr/mask/prot/port): (10.1.2.0/0.0.0.255/0/0))
PERMIT
#pkts encaps: 4, #pkts encrypt: 4, #pkts digest 8
#pkts decaps: 4, #pkts decrypt: 4, #pkts verify 8
#send errors 0, #recv errors 0
Inbound esp sas:
spi:0x36328b56 (909282134)
transform: esp-des esp-md5-hmac
in use settings={Tunnel,}
crypto map vpnmap 10
sa timing: remaining key lifetime (k/sec): (4606998/3594)
IV size: 8 bytes
Replay detection support:Y
Inbound ah sas:
spi:0x75aa844e (1974109262)
transform: ah-null ah-md5-hmac
in use settings={Tunnel,}
crypto map vpnmap 10
sa timing: remaining key lifetime (k/sec): (4606998/3594)
IV size: 0 bytes
Replay detection support:Y
Outbound esp sas:
spi:0x4c96e9f2 (1284958706)
transform: esp-des esp-md5-hmac
in use settings={Tunnel,}
crypto map vpnmap 10
sa timing: remaining key lifetime (k/sec): (4606998/3594)
IV size: 8 bytes
Replay detection support:Y
Outbound ah sas:
spi:0x2c25e472 (740680818)
transform: ah-null ah-md5-hmac
in use settings={Tunnel,}
crypto map vpnmap 10
sa timing: remaining key lifetime (k/sec): (4606998/3594)
IV size: 0 bytes
Replay detection support:Y
R1#show crypto isakmp sa
destination source state conn-id lifetime(second)
101.1.1.2 101.1.1.1 QM_IDLE 33 86317
6c1ac77522d07d2b e0062c53799fc5ec
实验四 访问控制列表
一、实验目的
1.掌握路由配置方法
2.掌握访问控制列表的配置;
二、实验要求
1.ACL能正常工作的前提是所有主机都能ping通。(采用RIP路由协议)
2.路由器的基本配置: 1)设置路由器接口IP地址。2) 配置RIP路由
3.不允许R1访问R4及其内部网络
4.不允许R2 ping R4
5.不允许10.2.2.0网段访问R4及其内部网络
6.使用OSPF动态路由协议
三、实验环境
1、Windows XP , Cisco Packet Tracer
四、实验内容
拓扑图
五、实验步骤
1.基本配置及密码设置
R1、R2、R3、R4启动后,首先进行如下配置
Router(config)#no ip domain look
Router (config)#line con
Router (config)#line console 0
Router (config-line)#exec-
Router (config-line)#exec-timeout 0 0
Router (config-line)#exit
Router (config)#enable password cisco
Router (config)#line vty 0 4
Router (config-line)#password ciscovty
Router (config-line)#login
Router (config-line)#exit
Router (config)#hostname RX //4台路由器分别命名为R1、R2、R3、R4
2.配置R1、R2、R3、R4接口地址(将配置代码附下)
(1)配置路由器R1
R1(config)#int s1/0
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial1/0, changed state to down
R1(config-if)#int lo0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
(2)配置路由器R2
R2(config)#int lo0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2(config-if)#
R2(config-if)#ip add 10.2.2.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int s1/1
R2(config-if)#ip add 192.168.23.1 255.255.255.0
R2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial1/1, changed state to down
(3)配置路由器R3
R3(config)#int lo0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3(config-if)#
R3(config-if)#ip add 10.3.3.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int s1/0
R3(config-if)#ip add 192.168.13.2 255.255.255.0
R3(config-if)#clock rate 64000
R3(config-if)#no shut
%LINK-5-CHANGED: Interface Serial1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R3(config-if)#int s1/1
R3(config-if)#ip add 192.168.23.2 255.255.255.0
R3(config-if)#clock rate 64000
R3(config-if)#no shut
%LINK-5-CHANGED: Interface Serial1/1, changed state to up
R3(config-if)#
R3(config-if)#int s1/2
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R3(config-if)#ip add 192.168.34.1 255.255.255.0
R3(config-if)#clock rate 64000
R3(config-if)#no shut
%LINK-5-CHANGED: Interface Serial1/2, changed state to down
(4)配置路由器R4
R4(config)#int lo0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R4(config-if)#
R4(config-if)#ip add 10.4.4.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int s1/2
R4(config-if)#ip add 192.168.34.2 255.255.255.0
R4(config-if)#no shut
%LINK-5-CHANGED: Interface Serial1/2, changed state to up
R4(config-if)#
R4(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to up
3.设置OSPF路由协议
(1)配置路由器R1
R1(config)#route ospf 1
R1(config-router)#net 192.168.13.0 0.0.0.255 area 0
R1(config-router)#net 10.1.1.0 0.0.0.255 area 0
R1(config-router)#end
(2)配置路由器R2
R2(config)#route ospf 1
R2(config-router)#net 192.168.23.0 0.0.0.255 area 0
R2(config-router)#net 10.2.2.0 0.0.0.255 area 0
R2(config-router)#end
(3)配置路由器R3
R3(config)#route ospf 1
R3(config-router)#net 192.168.13.0 0.0.0.255 area 0
R3(config-router)#
00:32:17: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.1 on Serial1/0 from LOADING to FULL, Loading Done
R3(config-router)#net 192.168.23.0 0.0.0.255 area 0
R3(config-router)#net 192.168.34.0 0.0.0.255 area 0
00:32:49: %OSPF-5-ADJCHG: Process 1, Nbr 10.2.2.2 on Serial1/1 from LOADING to FULL, Loading Done
R3(config-router)#net 192.168.34.0 0.0.0.255 area 0
R3(config-router)#net 10.3.3.0 0.0.0.255 area 0
R3(config-router)#end
(4)配置路由器R4
R4(config)#route ospf 1
R4(config-router)#net 192.168.34.0 0.0.0.255 area 0
00:33:57: %OSPF-5-ADJCHG: Process 1, Nbr 10.3.3.3 on Serial1/2 from LOADING to FULL, Loading Done
R4(config-router)#net 10.4.4.0 0.0.0.255 area 0
R4(config-router)#end
4.查看各路由器学到的路由(以R3为例)
R3# show ip route // 将显示信息附下
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O 10.1.1.1/32 [110/782] via 192.168.13.1, 00:04:45, Serial1/0
O 10.2.2.2/32 [110/782] via 192.168.23.1, 00:04:09, Serial1/1
C 10.3.3.0/24 is directly connected, Loopback0
O 10.4.4.4/32 [110/782] via 192.168.34.2, 00:02:46, Serial1/2
C 192.168.13.0/24 is directly connected, Serial1/0
C 192.168.23.0/24 is directly connected, Serial1/1
C 192.168.34.0/24 is directly connected, Serial1/2
5.设置
展开阅读全文