当前位置: 首页 > article >正文

HTTP实验(ENSP模拟器实现)

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是明文传输。


http://www.kler.cn/a/559367.html

相关文章:

  • C语言基础之【函数】
  • docker下安装 es 设置账号密码
  • 使用 Grafana 监控 Spring Boot 应用
  • 离子阱量子计算机的原理与应用:开辟量子计算的新天地
  • 分布式服务注册与发现
  • Maxscript血管网络分形的算法实现
  • Golang学习笔记_36——装饰器模式
  • DeepSeek本地搭建 和 Android
  • 后门慈善家
  • Leetcode 3464. Maximize the Distance Between Points on a Square
  • C#素数判定算法
  • Java-01-源码篇-04集合-05-ConcurrentHashMap(1)
  • 模型评测:基于Python和PyTorch的深度学习模型性能评估
  • Redis的弊端
  • vue3 Props的使用
  • SwinTransformer 改进:添加SimAM轻量级注意力机制
  • 第十八天 WebView深度优化指南
  • PH热榜 | 2025-02-23
  • 记录一个ES分词器不生效的解决过程
  • PHP课程预约小程序源码