#!/usr/bin/env python # quick script to list ports that were not hit # description: # http://enablesecurity.com/2008/06/23/restricted-ports-on-the-browsers # EnableSecurity import sys if len(sys.argv) <= 1: print "give me a pcap file please" sys.exit(1) from scapy import * grid = list() for i in xrange(65536): grid.append(0) packets = rdpcap(sys.argv[1]) packets2 = packets.filter(lambda x: x.getlayer(TCP).flags == 2) for pkt in packets2: dport = pkt.getlayer(TCP).dport grid[dport] = 1 for index in xrange(len(grid)): if grid[index] == 0: print index