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

erase.py 614B

12345678910111213141516171819
  1. flowHash = {'hola':{'wassup':{'bleh':9000, 'hi':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 len(dports) >= 1: #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 len(dports)
  11. if sips in otherHash:
  12. otherHash[sips][dips] = dports
  13. else:
  14. otherHash[sips] = {dips: dports}
  15. print otherHash