Tips for TCP/IP Attack Lab
计算机安全与保密技术 实验1 Tips
This is a tip-page for TCP/IP Attack Lab of seed-lab project.
1 - About gcc
gcc is not installed on seed’s docker container. So when you need to compile the C program on heterogeneous platforms (like MacOSX, Arch etc.), you may encounter the glibc version-mismatch problem.
To cope with such situation, you can install the gcc yourself:
- Add local sources on
apt
.
nano /etc/apt/sources.list
Recommended sources:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multivers
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
- Update the apt source and install gcc.
apt update
apt install gcc
- You are able to compile the C program on containers.
2 - About SYN Flood Attack (C Version)
In this part, my computer crashed when lauching such attack to the victim with countermesuare (SYN Cookie) using C script. The reason is that the packet sending failure causes the dead loop to be too fast.
You can add a sleep statement to solve it:
/*********************************************************
Step 3: Finally, send the spoofed packet
********************************************************/
send_raw_ip_packet(ip);
usleep(200);
Note that usleep
is for Linux/Unix Kernels’ POSIX.