代做Network Security Tasks代做Python语言

Network Security Tasks

Introduction

This assignment includes three parts:

1.   Network Packet Analysis (25 pts).

2.   TCP Reset Attack (35 pts).

3.   DNS Poisoning Attack (40 pts).

In these tasks, you are asked to conduct the corresponding attack  in simulated network environments. As the virtual environment is built via Docker, you will need to install Docker in a Linux system. Please refer to this link https://docs.docker.com/engine/install/ to check out how to install Docker in Linux system. If you are using Mac with an ARM CPU, we recommend installing OrbStack to run docker containers.

Scripting Cheat Sheet

As the attack script is asked to be written in Python to manipulate the network packets, here is a Python example for sniffing packets with Scapy.

Install Scapy Library:

Scapy will be used in the assignment for packet manipulation, you can install it via:

$ python3 -m pip install scapy

Packet Sniffing:

from scapy.all import * # Import anything from scapy library

target_src_ip = "1.2.3.4"

target_dst_ip = "5.6.7.8"

def send_rst(packet):

pass

sniff(iface="br-123456789", filter=f"tcp and host {target_src_ip} and

{target_dst_ip}", prn=send_rst)

Scapy’s `sniff` method can help us with sniffing the packet in given network interface with customized filter. For the above instance, three arguments are passed:

1.   iface: The interface where the packets are captured. The interfaces ’ name can be viewed via `ifconfig -a` in Linux.

2.   filter: It  indicates  what  kind of packets will be captured.  In this example, Scapy only captures the TCP packets with source ip address “ 1.2.3.4” and destination ip address “5.6.7.8”.

3.   prn: Callback function for each captured  packet. This function will be called for every captured packet.

The    complete     instruction     of    Scapy’s     `sniff`    function     can     be    viewed     here https://scapy.readthedocs.io/en/latest/usage.html.

Syn Flood Attack (25pts)

Description

In this task, you are required to perform and defense the syn flood attack using our provided environment..

Environment Setup

1.   Decompressing the attachment and enter the corresponding folder based on your environment (Linux or Mac Arm).

2.   Run `docker-compose up` in command line.

3.   Run `docker ps  -a` in command line to check the containers ’ status (all of the three containers should be up” at this step).

Then you can use `docker exec -it seed-attacker bash`, `docker exec -it victim-10.9.0.5 bash`, etc, to enter each container.

Questions

l (5 pts) In the attack’s container, we provide a script (/volume/synflood.c) that can send the attack packets to the victim machine. Learn and use one tool to capture, analyze the attack packets, and provide screenshots.

l (15 pts) In one user container, demonstrate that when the victim machine is under attack by running our original script, it can still receive normal connection sent out from the user machine using telnet, which means that the attack is unsuccessful. Explain why it is unsuccessful and find a way to launch a successful attack. Provide screenshots to include each necessary step and demonstrate a successful attack.

l (5 pts) Restart all the containers, learn and explain one defense technique of this attack, use it on the victim machine, and demonstrate that the original attack is successfully prevented with screenshots.

TCP Reset Attack (35 pts)

Description

Consider the following network graph:

User and server has built up a stable TCP connection via Telnet. As an attacker in this LAN, you are asked to maliciously shut down the connection using TCP reset attack.

Environment Setup

Please find the attachment TCP-Reset-Attack.zip . Before starting the attack, you should do the following first:

4.   Decompress the zip file.

5.   Change directory to where docker-compose.yml ” is located.

6.   Run `docker-compose up` in command line.

7.   Run `docker ps  -a` in command line to check the containers ’ status (all of the three containers should be up” at this step).

a)     Please ensure all the three containers are successfully deployed before moving on.

8.   Switch into “ user1-tcp-rst ” container via `docker exec  -it user1-tcp-rst bash` and start

TCP connection to server via `telnet 10.7.0.2`.

a)    You need to log in the telnet with username (user) and password (user).

9.   If you log in successfully, you can execute any command in the telnet panel.

Questions

Please answer the following questions in your report:

1.   (5 pts) How does TCP reset attack work?

2.   (10 pts) After building up a successful TCP connection via Telnet between user and server (step 5 in Environment Setup), execute `cat /home/user/flag` to get the file content. You need to provide a screenshot for this question.

3.   (15 pts) Write a Python script to conduct TCP reset attack and explain how the code’s

workflow is. Your code should be able to:

a)    Automatically sniff the packets in the LAN.

b)    Automatically generate the attack payload and send to ruin the TCP connection.

4.   (5 pts) Suggestion an effective approach to detect and prevent TCP reset attack.

Tips:

l You should conduct the attack in the container `attacker-tcp-rst`.

l Your attack script. should be written in Python code,

l After all the containers are up, you can transfer the files between your host and `attacker - tcp-rst` in the shared `volumes`, which is located in `/volumes` in `attacker-tcp-rst`.

DNS Poisoning Attack (40 pts)

Description

In this task, you are an attacker that has already invaded into a network environment that hosts a DNS server. You are required to conduct the DNS poisoning to attack the DNS server to trick victims who query this server for domain addresses.

We provided a script. template, which currently monitors the current network to sniff all DNS packets and outputs their information to you.

You are required to complete the script to poison the DNS server and verify that, when a user queries a certain domain `www.example.com`, the  DNS server would  response with the address poisoned by the attacker (i.e., your script) instead of the correct address.

Environment Setup

Please find the attachment DNS-Poisoning-Attack.zip .

Decompress the zip file, change directory to where docker-compose.yml ” is located and type `docker-compose up`. It starts several docker containers to simulate the DNS server’s machine, the victim user’s machine, and the attacker’s machine. Type Ctrl-C in the same terminal will stop the running containers.

Useful commands:

l `dig`: query a domain address, as taught in the class.

l Start a terminal to enter the user (victim)’s machine: `sudo docker exec -it victim-user bash`

l Start a terminal to enter the DNS server’s machine: `sudo docker exec -it local-dns - server bash`

n The only allowed operation on the DNS server’s machine is `rndc flush`, which clears the DNS server’s cache.

l Start a terminal to enter the attackers machine: `sudo docker exec -it attacker bash`

n Running the script. `python3 /volume/attack.py`

u Running the provided script directly would start to monitor the network for sniffing DNS packets.

n The script is placed in /volume in the attacker’s machine, which are also mapped to the volume/ folder outside the docker containers. You can modify the script in volume/ to complete the attack and run it in the container.

Questions

l (10 pts) Please start the original script in the attack’s machine, clear the cache in the DNS server’s machine, and enter the user’s machine to query the domain `www.example.com` by `dig`. When there is no attack, based on the script’s and `dig` output, observe and report the complete DNS query process step-by-step.

l (10 pts) Based on the query process above, please report the process of how to poison the DNS server by sending it forged network packets.

l (20 pts) Please complete the script to send forged packets to the DNS server, explain the code you written in the script (i.e., don’t have to modify the function `send_dns`, you should call it with proper arguments and explain them), and verify that the user has been tricked to visit a wrong address when querying for ` www.example.com `.


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图