Answered step by step
Verified Expert Solution
Link Copied!

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 denial-of-service (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:
scanTarget(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 import *
#Your TcpAttack class should be named as TcpAttack
spoofIP='string' ; targetIP='string'
rangStart= ; rangeEnd= ; port=
Tcp = TcpAttack(spoofIP,targetIP)
Tcp.scanTarget(rangeStart, rangeEnd)
if (Tcp.attackTarget(port)):
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 (e.g. #!/usr/bin/env python3) 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions