Question
Identify the IP addresses of the other people in the coffee shop. (Easier version of the exercise: Your source IP is 10.3.0.18). You know that
Identify the IP addresses of the other people in the coffee shop. (Easier version of the exercise: Your source IP is 10.3.0.18). You know that all the other machines on the coffee shop's local area network have the same subnet as you; in other words, they share the first three bytes in their IP address as you. Create a new function called findOtherIPs() that finds the other IPs of the people in the coffee shop. Need a hint? Remember that the other IPs have the same subnet as you. In other words their IPs start with 10.3.0. Your function should return the collection of all the IPs of the people in the coffee shop.
from scapy.all import * import sys
def parsePCAP(pkts): for pkt in pkts: print "Source IP: " + pkt[IP].src print "Destination IP: " + pkt[IP].dst print "Source port: " + str(pkt[TCP].sport) print "Destinations port: " + str(pkt[TCP].dport) print "Packet Payload: " + str(pkt[TCP].payload)
if __name__ == "__main__": if len(sys.argv) < 2: print "usage: python lab3.py [pcap]" sys.exit() pcap= rdpcap(sys.argv[1]) pcap = [pkt for pkt in pcap if TCP in pkt] parsePCAP(pcap)
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