Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Fundamentals of Financial Accounting

Authors: Fred Phillips, Robert Libby, Patricia Libby

5th edition

78025915, 978-1259115400, 1259115402, 978-0078025914

Students also viewed these Algorithms questions