diff --git a/README.md b/README.md index f1cf2ce..a799f6c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,131 @@ -# 2022年秋季网络安全公共作业仓库 -### 中国传媒大学 -## 实验报告要求 -* Markdown 书写,且在 Github 上渲染出的排版效果正常,可读性强; -* 在 Github 上每次提交作业单独从 master 分支 新 开一个分支; - * 每次作业均保存到 独立不冲突 的子目录; -* 图文并茂证明: - * 实验关键步骤是自己做的; - * 哪些 实验结果符合实验要求预期; -* 如有涉及到代码、配置文件,请记得 commit 源代码 文件; -* 规范的 Git 工作流程: - * 提交作业等待批改:提交 PR 请求将作业分支合并到 master 分支; - * 未 PR 时的 commit 不会被批改; - * 课程没有在教务处系统上查到分数之前,禁止合并或关闭 已有批改记录的 PR,可以在该 PR 对应的分支上继续提交新变更;; - * 每次实验报告只保留一个 Open 状态的 PR ,禁止同一次作业发起多个 PR; - * PR 的标题应体现本次实验报告的主题; \ No newline at end of file +# chap0x01 + +------ +auther:milkcandy + +------ + +## 实验目的 +* 掌握 VirtualBox 虚拟机的安装与使用; +* 掌握 VirtualBox 的虚拟网络类型和按需配置; +* 掌握 VirtualBox 的虚拟硬盘多重加载; + +----- + +## 实验环境 + +* VirtualBox 虚拟机 +* 攻击者主机(Attacker):kali-linux-2022.3-virtualbox-amd64 +* 网关(Gateway, GW):Debian Buster +* 靶机(Victim):From Sqli to shell / xp-sp3 / Kali + +----- + +## 实验要求 + +* 虚拟硬盘配置成多重加载,配置完效果如下图所示; +![](img/multi_load.png) +![](img/multi.png) +
+ +* 搭建满足如下拓扑图所示的虚拟机网络拓扑; +![](img/network_topology.png) +
+ +* 配置网络前准备工作 +`管理>主机网络管理器>创建新的hostonly地址>手动分配地址` + * 作用:用于ssh登录虚拟机时更好地区分不同主机的网络地址。 +![](img/pre_hostonly.png) +
+ +* 搭建内部网络配置 +`以Enterprise Network-2为例:` + * 此局域网包括三台主机:Debian 10(gateway) | xp-victim-2 | debian-victim-2 + * 先配置`Debian 10(gateway)`的网络 + ![](img/enterprise_network-debian-gw.png) + * 配置`xp-victim-2`的网络 + ![](img/enterprise_network-xp_2.png) + ![](img/enterprise_network-xp.png) + * 配置`debian-victim-2`的网络 + ![](img/enterprise_network-debian_2.png) + ![](img/enterprise_network-debian.png) + + * 配置好网络后,可以发现虚拟机自动分配好了内网地址,如下图所示: +`Debian 10(gateway):` +![](img/debian-gw-ip.png) +`xp-victim-2:` +![](img/xp-victim-2-ip.png) +`debian-victim-2:` +![](img/debian-victim-2-ip.png) +* 测试内网连通性: + 先关闭`xp-victim-2`的防火墙: + ![](img/xp-shutdownfirewall.png) + * `Debian 10(gateway)`和`xp-victim-2`之间的连通性: + ![](img/debian-gw-ping-xp-2.png) + ![](img/xp-2-ping-debian-gw.png) + * `Debian 10(gateway)`和`debian-victim-2`之间的连通性: + ![](img/debian-gw-ping-debian-2.png) + ![](img/debian-2-ping-debian-gw.png) + * `debian-victim-2`和`xp-victim-2`之间的连通性: + ![](img/xp-2-ping-debian-2.png) + ![](img/debian-2-ping-xp-2.png) + + +* 全局网络配置 + * 设置全局Nat network + ![](img/natnetwork.png) + * 给debian(gateway)添加Nat + ![](img/bebian-gw-nat.png) + * 给Kali-Attacker添加Nat + ![](img/kali-attacker-nat.png) + +* 网络连接测试 +![](img/network_all.png) + * 靶机可以直接访问攻击者主机 + ![](img/debian-2-ping-kali-attacker.png) + + * 攻击者主机无法直接访问靶机 + ![](img/kali-attacker-ping-debian-2.png) + + * 网关可以直接访问攻击者主机和靶机 + ![](img/debian-gw-ping-others.png) + + * 靶机的所有对外上下行流量必须经过网关 + 在Debian10(GateWay)上安装tshark + ```bash + apt install tshark + ``` + * 查看Debian10(GateWay)可检测接口: + ![](img/enpos.png) + ```bash + tshark -i enp0s9 + #监控intnet1的所有流量 + tshark -i enp0s10 + #监控intnet2的所有流量 + ``` + ![](img/intnet1.png) + ![](img/intnet2.png) + * 所有节点均可以访问互联网 + 经测试,所以节点均可ping通www.baidu.com,即所有节点均可访问互联网。 +## 出现的问题 +* PS:ssh连接虚拟机设置 +![](img/ssh_permission_denied.png) +问题分析:可能是没开通ssh服务 +```bash +apt update +apt install ssh +systemctl restart ssh +ssh root@192.168.56.113 +#经过上述操作,发现可以成功连接ssh +``` +![](img/successfully_ssh.png) +## 参考资料 +[VirtualBox 多重加载](https://expoli.tech/articles/2021/06/07/1623066136894.html) + +
+ +[VirtualBox 配置网络](https://www-nakivo-com.translate.goog/blog/virtualbox-network-setting-guide/?_x_tr_sl=en&_x_tr_tl=zh-CN&_x_tr_hl=zh-CN&_x_tr_pto=sc) + +
+ +[tshark 使用语法](https://www.wireshark.org/docs/man-pages/tshark.html) \ No newline at end of file diff --git a/img/bebian-gw-nat.png b/img/bebian-gw-nat.png new file mode 100644 index 0000000..1aaef4d Binary files /dev/null and b/img/bebian-gw-nat.png differ diff --git a/img/debian-2-ping-debian-gw.png b/img/debian-2-ping-debian-gw.png new file mode 100644 index 0000000..7feea64 Binary files /dev/null and b/img/debian-2-ping-debian-gw.png differ diff --git a/img/debian-2-ping-kali-attacker.png b/img/debian-2-ping-kali-attacker.png new file mode 100644 index 0000000..559ae3f Binary files /dev/null and b/img/debian-2-ping-kali-attacker.png differ diff --git a/img/debian-2-ping-xp-2.png b/img/debian-2-ping-xp-2.png new file mode 100644 index 0000000..0e42560 Binary files /dev/null and b/img/debian-2-ping-xp-2.png differ diff --git a/img/debian-gw-ip.png b/img/debian-gw-ip.png new file mode 100644 index 0000000..fa20539 Binary files /dev/null and b/img/debian-gw-ip.png differ diff --git a/img/debian-gw-ping-debian-2.png b/img/debian-gw-ping-debian-2.png new file mode 100644 index 0000000..b24e419 Binary files /dev/null and b/img/debian-gw-ping-debian-2.png differ diff --git a/img/debian-gw-ping-others.png b/img/debian-gw-ping-others.png new file mode 100644 index 0000000..b6919b0 Binary files /dev/null and b/img/debian-gw-ping-others.png differ diff --git a/img/debian-gw-ping-xp-2.png b/img/debian-gw-ping-xp-2.png new file mode 100644 index 0000000..19026e1 Binary files /dev/null and b/img/debian-gw-ping-xp-2.png differ diff --git a/img/debian-victim-2-ip.png b/img/debian-victim-2-ip.png new file mode 100644 index 0000000..0888ccf Binary files /dev/null and b/img/debian-victim-2-ip.png differ diff --git a/img/enpos.png b/img/enpos.png new file mode 100644 index 0000000..8b119a2 Binary files /dev/null and b/img/enpos.png differ diff --git a/img/enterprise_network-debian-gw.png b/img/enterprise_network-debian-gw.png new file mode 100644 index 0000000..f49c410 Binary files /dev/null and b/img/enterprise_network-debian-gw.png differ diff --git a/img/enterprise_network-debian.png b/img/enterprise_network-debian.png new file mode 100644 index 0000000..a5df07b Binary files /dev/null and b/img/enterprise_network-debian.png differ diff --git a/img/enterprise_network-debian_2.png b/img/enterprise_network-debian_2.png new file mode 100644 index 0000000..bc5430b Binary files /dev/null and b/img/enterprise_network-debian_2.png differ diff --git a/img/enterprise_network-xp.png b/img/enterprise_network-xp.png new file mode 100644 index 0000000..542b65e Binary files /dev/null and b/img/enterprise_network-xp.png differ diff --git a/img/enterprise_network-xp_2.png b/img/enterprise_network-xp_2.png new file mode 100644 index 0000000..3334769 Binary files /dev/null and b/img/enterprise_network-xp_2.png differ diff --git a/img/intnet1.png b/img/intnet1.png new file mode 100644 index 0000000..db5a10f Binary files /dev/null and b/img/intnet1.png differ diff --git a/img/intnet2.png b/img/intnet2.png new file mode 100644 index 0000000..057e852 Binary files /dev/null and b/img/intnet2.png differ diff --git a/img/kali-attacker-nat.png b/img/kali-attacker-nat.png new file mode 100644 index 0000000..f4089bb Binary files /dev/null and b/img/kali-attacker-nat.png differ diff --git a/img/kali-attacker-ping-debian-2.png b/img/kali-attacker-ping-debian-2.png new file mode 100644 index 0000000..09e39d6 Binary files /dev/null and b/img/kali-attacker-ping-debian-2.png differ diff --git a/img/multi.png b/img/multi.png new file mode 100644 index 0000000..556c943 Binary files /dev/null and b/img/multi.png differ diff --git a/img/multi_load.png b/img/multi_load.png new file mode 100644 index 0000000..86fd7de Binary files /dev/null and b/img/multi_load.png differ diff --git a/img/natnetwork.png b/img/natnetwork.png new file mode 100644 index 0000000..bbfa2ac Binary files /dev/null and b/img/natnetwork.png differ diff --git a/img/network_all.png b/img/network_all.png new file mode 100644 index 0000000..147b03c Binary files /dev/null and b/img/network_all.png differ diff --git a/img/network_topology.png b/img/network_topology.png new file mode 100644 index 0000000..aa0bb4c Binary files /dev/null and b/img/network_topology.png differ diff --git a/img/pre_hostonly.png b/img/pre_hostonly.png new file mode 100644 index 0000000..ddedb7b Binary files /dev/null and b/img/pre_hostonly.png differ diff --git a/img/ssh_permission_denied.png b/img/ssh_permission_denied.png new file mode 100644 index 0000000..e3034b9 Binary files /dev/null and b/img/ssh_permission_denied.png differ diff --git a/img/successfully_ssh.png b/img/successfully_ssh.png new file mode 100644 index 0000000..3eacc5a Binary files /dev/null and b/img/successfully_ssh.png differ diff --git a/img/xp-2-ping-debian-2.png b/img/xp-2-ping-debian-2.png new file mode 100644 index 0000000..5db378c Binary files /dev/null and b/img/xp-2-ping-debian-2.png differ diff --git a/img/xp-2-ping-debian-gw.png b/img/xp-2-ping-debian-gw.png new file mode 100644 index 0000000..be7c520 Binary files /dev/null and b/img/xp-2-ping-debian-gw.png differ diff --git a/img/xp-shutdownfirewall.png b/img/xp-shutdownfirewall.png new file mode 100644 index 0000000..016b5f6 Binary files /dev/null and b/img/xp-shutdownfirewall.png differ diff --git a/img/xp-victim-2-ip.png b/img/xp-victim-2-ip.png new file mode 100644 index 0000000..c94259a Binary files /dev/null and b/img/xp-victim-2-ip.png differ