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

unite.py 3.0KB

123456789101112131415161718192021
  1. import random
  2. false = 0
  3. hash = {"sips": {'192.168.231.3': [21, 0], '136.145.178.65': [8171, 0], '136.145.178.44': [4087, 0], '136.145.178.60': [10424, 0], '136.145.178.57': [17319, 0], '136.145.178.58': [14799, 0], '136.145.231.38': [53482, 0], '136.145.231.11': [2705, 0], '136.145.231.10': [39608, 0], '136.145.231.15': [104993, 0], '136.145.178.78': [752, 0], '136.145.231.31': [1199, 0], '136.145.231.19': [2094, 0], '136.145.231.32': [6142, 0], '136.145.231.34': [8992, 0], '136.145.231.37': [1330, 0], '136.145.178.70': [549, 0], '136.145.178.55': [6002, 0], '10.255.87.39': [1, 0], '136.145.178.247': [593, 0], '136.145.231.71': [2602, 0], '136.145.231.70': [3569, 0], '136.145.231.73': [2018, 0], '136.145.231.72': [11622, 0], '172.17.0.2': [5, 0], '10.255.86.22': [1, 0], '136.145.178.249': [597, 0], '136.145.178.248': [602, 0], '136.145.231.52': [3697, 0], '136.145.178.90': [24543, 0], '136.145.178.93': [809, 0], '136.145.178.95': [1078, 0], '136.145.178.94': [2966, 0], '10.255.87.28': [1, 0], '136.145.178.99': [1920, 0], '10.255.87.27': [1, 0], '10.255.87.24': [1, 0], '10.255.87.22': [1, 0], '136.145.178.107': [11012, 0], '10.255.87.20': [1, 0], '136.145.178.105': [8970, 0], '136.145.178.245': [620, 0], '10.255.86.19': [1, 0], '136.145.178.47': [6620, 0], '10.255.86.15': [1, 0], '136.145.231.9': [11356, 0], '10.255.86.17': [1, 0], '136.145.178.62': [16838, 0], '169.254.254.254': [3, 0], '10.255.87.26': [1, 0], '136.145.178.251': [671, 0], '136.145.178.20': [541, 0], '136.145.178.79': [2226, 0], '136.145.178.51': [3970, 0], '136.145.231.20': [1992, 0], '0.0.0.0': [21, 0], '136.145.231.25': [2209, 0], '136.145.178.252': [606, 0], '136.145.178.253': [558, 0], '136.145.231.42': [4679, 0], '136.145.231.43': [11221, 0], '136.145.178.42': [3441, 0], '136.145.178.43': [8283, 0], '136.145.231.46': [1557, 0], '136.145.231.12': [83180, 0], '136.145.231.48': [36993, 0], '136.145.178.67': [28, 0], '10.255.87.23': [1, 0], '136.145.178.82': [22282, 0], '136.145.178.68': [356, 0], '10.255.87.38': [1, 0], '136.145.178.85': [24081, 0], '136.145.178.45': [12308, 0], '136.145.87.253': [5, 0], '136.145.178.88': [7457, 0], '10.255.87.21': [1, 0], '10.255.87.34': [1, 0]}}
  4. otherHash= {"nodes":[]}
  5. sourceHash= []
  6. counter = -1
  7. for i in hash:
  8. for j in hash[i]:
  9. counter+=1
  10. hash_part = {"id":counter,"reflexive":"false","color":"#ba55d3","name":j,"index":counter,"weight":1,"x":random.randint(600, 900),"y":random.randint(300, 500),"px":random.randint(600, 900),"py":random.randint(300, 500)}
  11. otherHash["nodes"].append(hash_part)
  12. counter +=1
  13. hash_part = {"id":counter,"reflexive":"false","color":"#ba55d3","name":str(hash[i][j]),"index":counter,"weight":1,"x":random.randint(600, 900),"y":random.randint(300, 500),"px":random.randint(600, 900),"py":random.randint(300, 500)}
  14. print hash_part
  15. otherHash["nodes"].append(hash_part)
  16. source_part = {"source":counter-1,"target":counter,"left":"false","right":"true"}
  17. sourceHash.append(source_part)
  18. otherHash["nodes"].append(sourceHash)
  19. print otherHash