Answered step by step
Verified Expert Solution
Question
1 Approved Answer
TCP Vulnerabilities The goal of this assignment is to give you a deeper grasp of TCP vulnerabilities and the denial - of - service (
TCP Vulnerabilities
The goal of this assignment is to give you a deeper grasp of TCP vulnerabilities and
the denialofservice DoS attacks.
Problem Statement
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:
scanTargetrangeStart 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.
attackTargetport
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 otherwise return 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 innitely.
Note that SYN flood attacks have become more difficult to mount over the years.
Most ISPs now use BCP 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 import
#Your TcpAttack class should be named as TcpAttack
spoofIP'string' ; targetIP'string'
rangStart ; rangeEnd ; port
Tcp TcpAttackspoofIPtargetIP
TcpscanTargetrangeStart rangeEnd
if TcpattackTargetport:
print 'port was open to attack'
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 eg #usrbinenv python or a comment denoting
the version. Please include comments in your code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started