Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# You may NOT alter the import list!!!! import pyshark import hashlib class MITMException ( Exception ) : A class to throw

# You may NOT alter the import list!!!!
import pyshark
import hashlib
class MITMException(Exception):
"""A class to throw if you come across incorrect syntax or other issues"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class MITMProject(object):
def __init__(self):
self.cap = pyshark.FileCapture('TCP.reflection_fall2023.pcap')
self.class_id ="CS60353257"
# TODO: Change this to YOUR Georgia Tech ID!!!
# This is your 9-digit Georgia Tech ID
self.student_id ='903861572'
def get_student_hash(self, value):
return hashlib.sha256(self.student_id.encode('UTF-8')+ self.class_id + value).hexdigest()
# TODO:
# Task 1: Return n being:
# n = Number of packets with only SYN+ACK flags
def syn_ack(self):
n =0
return n
# TODO:
# Task 2: Return n being:
# n = Number of packets with only RST flag
def rst(self):
n =0
return n
# TODO:
# Task 3: Return d,p, being:
# d = IP Address of the victim
# p = Port being attacked
def victim_ip_port(self):
d,p =0,0
return d,p
if __name__=='__main__':
pcap_analysis = MITMProject()
ip,port = pcap_analysis.victim_ip_port()
synack = pcap_analysis.syn_ack()
rst = pcap_analysis.rst()
print("IP and Port: ",ip,port)
print("Number of SYN+ACK Packets : ", synack)
print("Number of RST Packets : ", rst)....... Task 6.1
Modify def syn_ack(self): function to return n, being n (int) the number of packets on TCP.reflection.pcap file that contains ONLY the SYN+ACK flags
Points: 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions