For this task, you need to use the provided pcapanalysis.py and TCP.reflection.pcap files to create three functions.
Fantastic news! We've Found the answer you've been seeking!
Question:
For this task, you need to use the provided pcapanalysis.py and TCP.reflection.pcap files to create three functions. The snippet below shows where you need to code the functions and the expected output on each variable n.
Deliverables:
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
Task 6.2
- Modify def rst(self): function to return n, being n (int) the number of packets on TCP.reflection.pcap file that contains ONLY the RST flag
- Points: 2
Task 6.3
- Modify def victim_ip_port(self): function to return d, p, being d the IP address of the host involved with the attack (string) in the TCP.reflection.pcap file and p (int), being the TCP port of the service being attacked.
- Points: 10
# 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 = '900000000' 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 # TODO: Implement me return n # TODO: # Task 2: Return n being: # n = Number of packets with only RST flag def rst(self): n = 0 # TODO: Implement me 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 # TODO: Implement me 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)
Related Book For
Fundamentals of Financial Accounting
ISBN: 978-0078025914
5th edition
Authors: Fred Phillips, Robert Libby, Patricia Libby
Posted Date: