Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Background Reading Before starting, you are encouraged to review the following paper to understand the RBS method, which is effective in detecting network worms and
Background Reading
Before starting, you are encouraged to review the following paper to understand the RBS method, which is effective in detecting network worms and port scanners by measuring the rate of connections to new destinations:
Jung, Jaeyeon, Rodolfo A Milito, and Vern Paxson. On the adaptive realtime detection of fastpropagating network worms." International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment. Springer, Berlin, Heidelberg, Read the paper hereLinks to an external site.. Part : PortScanner Detector
Task: Create a tool that records and analyzes firstcontact connection requests to within a LAN, including selfinitiated scans.
Data Management: Use a Python dictionary to log these firstcontact requests with their timestamps. Entries older than minutes should be continuously cleared.
Analysis: Calculate the "fanout rate" for each source IP which is defined as the rate of establishing firstcontact connections. Calculate this rate over three intervals: per second, per minute, and per minutes.
Detection Criteria: A source IP is flagged as a port scanner if its fanout rate exceeds any of the following thresholds: per second, per minute, or per minutes.
Output: For each detected port scanner, display the source IP average fanout rates, and the specific reason for detection.
Example Output:
A scanner detected on source IP x
avg. fanout per sec: y avg fanout per min: z fanout per min: d
reason for detection: fanout rate per sec must be less than
Part : PortScanner Update
Task: Modify the port scanner developed in Lab to accept a waiting time in milliseconds between each scan to different destinations. Also, enhance it to scan a range of network addresses CIDR notation
Functionality: The updated scanner should adhere to the specified waiting time between consecutive scans. Below is my lab code : import socket
def tcpscannertarget port:
try:
tcpsock socket.socketsocketAFINET, socket.SOCKSTREAM
tcpsock.connecttarget port
tcpsock.close
return True
except:
return False
def udpscannertarget port:
try:
udpsock socket.socketsocketAFINET, socket.SOCKDGRAM
udpsock.settimeout
# udpsock.sendtobytes "utftarget port # Send a UDP packet to the IP and port of the target
data bxxxxxxxxxxxxxexamplexcomxxxxx
udpsock.sendtodatatarget port
response, addr udpsock.recvfrom
if response:
return True
except socket.timeout as e:
return False
def main:
target input Enter Target IP:
for portNumber in range:
if udpscannertarget portNumber:
printPort portNumber, udpis DEFINITELY open'
for portNumber in range:
if tcpscannertarget portNumber:
print Port', portNumber, tcpis open'
if namemain:
mainlab code ends
Part : Testing Environment Setup
Configuration: Utilize two Kali VMs one original, one copy in the same LAN Designate one VM for defense and the other for attacks.
Execution: Run the PortScanner Detector on the defense VM and execute the updated port scanner on the attack VM under five different waiting times msssss Collect your results under each of these five scenarios.
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