12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
-
-
- import ipaddress
- import json
-
-
-
-
-
-
- x = 20
- y = 60000
- deletevar = []
- newHash={}
-
- PATH = '/Users/Sara/Documents/Univ Classes/Investigacion/Programas/netflows.txt'
-
- myFile = open(PATH, 'r')
- ip = myFile.read()
- flow = json.loads(ip)
-
- for i in flow["flows"]:
-
-
-
- if i['sip'] == 2291263257:
- if i['dip'] in newHash:
- newHash[i['dip']].append(i['dport'])
- else:
- newHash[i['dip']] = [i['dport']]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- counter = 0
- for k, v in newHash.items():
- counter = counter+1
- k = str(ipaddress.IPv4Address(k))
- print ("{}:{}".format(k,v))
- print (counter)
- print( "Done checking:")
|