MUST BE DONE IN PYTHON

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

MUST BE DONE IN PYTHON

Post by answerhappygod »

MUST BE DONE IN PYTHON
Must Be Done In Python 1
Must Be Done In Python 1 (101.5 KiB) Viewed 38 times
Must Be Done In Python 2
Must Be Done In Python 2 (90.17 KiB) Viewed 38 times
Write a Python script that implements the SYN flood attack and SYN scanning to detect open ports. Your script should also spoof the host IP address. You will need to use tcpdump, or some equivalent tool, to monitor the network. Create a class called TcpAttack that takes in the following parameters in the constructor: spoofIP, which is the IP Address to Spoof, and targetIP, which is the IP Address of the target computer to attack. Both of the IPs should be in string type. Your program should implement the following methods: scan Target (rangeStart, rangeEnd) This method will scan the target computer for open ports, using the range of ports passed, and return ALL the open ports found into an output file called openports.txt. The range values are passed as integers. attackTarget(port) This method first verifies the specified port is open and then performs a DoS attack on the target using the port. If the port is open, it should perform the DoS attack and return 1 (otherwise return 0 if the port passed is not open). For the purposes of this assignment, it is only necessary to send some fixed number of SYN packets, rather than looping in_nitely. Note that SYN flood attacks have become more difficult to mount over the years. Most ISPs now use BCP 38 ingress filtering to prevent spoofing over a router. Therefore you would have to do the spoofing attack between two computers on the same LAN where the packets wouldn't go through a router. It is acceptable if you do not actually manage to cause a DoS outside your LAN or do not have the means to do it with another computer on the same LAN. You are just required to implement the theory correctly.
Your class will be tested with a script similar to the one below. from <your file name> import * port=<int> #Your TepAttack class should be named as TcpAttack spoofIP='string'; targetIP='string' rangStart <int>; rangeEnd=<int>; Tcp = Tep Attack(spoofIP,targetIP) Tcp.scan Target(rangeStart, if (Tcp.attackTarget(port)): print 'port was open to attack' rangeEnd) Remember, in the event that the user wants to scan the computer for open ports, your script should subsequently report the open ports in an output file called openports.txt. In the event that the user wants to attack the computer, your script should first check if the port (passed as an argument to attackTarget) is open. Your submission should include your code, and the working of your program. You must also include the output from tcpdump, which should be started before you execute your script. Remember to filter out irrelevant information. In the event that you are on a busy network, you can use tcpdump to selectively sniff packets. To further avoid clutter, make sure you turn off all other applications connecting to the internet. For Python, use the socket and scapy modules to handle raw socket packets. You must turn in one file electronically. Please denote the Python version in your code with either a shebang line (e.g. #!/usr/bin/env python3) or a comment denoting the version. Please include comments in your code.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply