HTTP实验(ENSP模拟器实现)

目录

HTTP概述

HTTP实验

HTTPS 实验


HTTP概述

HTTP(HyperText Transfer Protocol,超文本传输协议),设计HTTP最初的目的是为了提供一种发布和接收HTML页面的方法。

img

  • HTTP定义了多种请求方法,常用的包括:

  • GET:请求资源。

  • POST:提交数据。

  • PUT:更新资源。

  • DELETE:删除资源。

HTTP实验

我们使用一个路由器来模拟客户端

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Client
[Client]interface G0/0/0
[Client-GigabitEthernet0/0/0]ip address 192.168.1.1 24

Server配置

选择文件根目录,然后启动HTTP服务 

img

使用路由器去发送GET请求

[Client]http get url 192.168.1.2
  Http getting 192.168.1.2[192.168.1.2]: 
   1:packets interaction time 20 ms,the link reachable
   2:packets interaction time 90 ms,the link reachable
   3:packets interaction time 110 ms,the link reachable
   4:packets interaction time 90 ms,the link reachable
   5:packets interaction time 90 ms,the link reachable
  --- http get result statistics ---
    Http Get 5 time(s),succeed 5 time(s),failed 0 time(s).
    round-trip min/avg/max = 90/80/110 ms.

测试访问是没问题的。

但是http是明文传输,所以接口抓包,我们就能看到

我们能直接看到HTTP的,传输的页面内容。

我还可以访问我的一个文件试一试(路径填写你的HTTP服务器,目录下有的文件)

[Client]http get url 192.168.1.2/desktop.ini
  Http getting 192.168.1.2/desktop.ini[192.168.1.2]: 
   1:packets interaction time 60 ms,the link reachable
   2:packets interaction time 90 ms,the link reachable
   3:packets interaction time 90 ms,the link reachable
   4:packets interaction time 100 ms,the link reachable
   5:packets interaction time 90 ms,the link reachable
  --- http get result statistics ---
    Http Get 5 time(s),succeed 5 time(s),failed 0 time(s).
    round-trip min/avg/max = 90/86/100 ms.

再来看看看抓包

传输的文件内容,都是明文的,验证了HTTP是明文传输。

HTTPS 实验

明文传输,那么肯定是不安全的,所以我们通常使用HTTPS(Hypertext Transfer Protocol Secure,超文本传输安全协议)的协议进行安全传输。

在HTTP的基础上加上TLS(Transport Layer Security)协议。

对于HTTPS的传输验证,我们可以使用ENSP中的USG6000V防火墙,防火墙的WEB管理页面就是HTTPS协议进行访问。

G0/0/0 默认配置IP地址是192.168.0.1

Username:admin                    # 用户名 admin
Password:                         # 密码Admin@123
The password needs to be changed. Change now? [Y/N]: Y    # Y 确认修改密码
Please enter old password:        # 旧密码Admin@123
Please enter new password:        # 新密码
Please confirm new password:      # 确认新密码

 Info: Your password has been changed. Save the change to survive a reboot. 
*************************************************************************
*         Copyright (C) 2014-2018 Huawei Technologies Co., Ltd.         *
*                           All rights reserved.                        *
*               Without the owner's prior written consent,              *
*        no decompiling or reverse-engineering shall be allowed.        *
*************************************************************************

 防火墙的接口,默认有接口访问控制,访问防火墙自身的https协议,需要接口下开启

<USG6000V1>system-view 
Enter system view, return user view with Ctrl+Z.
[USG6000V1]interface G0/0/0
[USG6000V1-GigabitEthernet0/0/0]service-manage https permit

Cloud设置(我是自己添加了一个环回网卡,地址配置成192.168.0.2/24,和防火墙接口地址在同一个网段)

我们使用浏览器登录防火墙(https://192.168.0.1:8443)(用户名是admin,密码是刚才修改的)

抓包查看报文交互

现在报文内容已经被加密了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YancyYue

您是我的“大可爱”!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值