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

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. You can make as many functions and variables you need, however the provided functions need to return the expected output.


Need to understand how to do each of these, the concepts of doing each via python, and a example to go alongside each. never used python so any resource on how to learn it (at least enough to understand and accomplish whats being asked) would be much appreciated.

Function Skeleton

# 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)


 

Task 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 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 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


Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!