Source Code for network and port scanner, TRW algorithm, and reduction method implementations.

erase.py 594B

123456789101112131415161718
  1. flowHash = {'hola':{'wassup':900, 'eh':9000}}
  2. sip = 'hola'
  3. dip = 'wassup'
  4. dport = 90
  5. otherHash = {}
  6. for sips in flowHash: #se itera por todos los dip y sus counters o puertos
  7. for dips, dports in flowHash[sips].items():
  8. if dports >= 100: #si la cantidad de puertos es mayor o igual a 100, nos interesan
  9. #y por lo tanto se guardan en un hash
  10. print dports
  11. if sips in otherHash:
  12. otherHash[sips][dips] = dports
  13. else:
  14. otherHash[sips] = {dips: dports}
  15. print otherHash