efficiency_testing.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import ID2TLib.TestLibrary as Lib
  2. import Test.ID2TAttackTest as Test
  3. sha_SMBLoris_10_000 = '1433f4f69e9311ca7f64920f94992a8e8fbd045433fc0143dc47dfd25a6a02c1'
  4. sha_SMBLoris_100_000 = '4891720093ba32f9794431ee16815931b1866bccac58b8ef750b669742875fb0'
  5. sha_SMBScan_10_000 = '311cbfc28859597ce7ff58b1bdc8f0ddd733f33ab2bd83a4a7579edadce736aa'
  6. sha_SMBScan_100_000 = '9e55f4c2f035ec52701eabed32757f427627ce5ccf53e30bfc084680a4bf49a2'
  7. sha_SMBScan_hosting_10_000 = '14f92d19535332bf523e94bcb2038309844abedaa848ca7195a343256adba5f3'
  8. sha_SMBScan_hosting_100_000 = '029d064de82122202b6ae53d4efff2ea3318ded73a2987cb16e1e74606532766'
  9. class EfficiencyTests(Test.ID2TAttackTest):
  10. def test_SMBLoris_10_000(self):
  11. self.checksum_test([['SMBLorisAttack', 'attackers.count=30', 'packets.per-second=7.7']], sha_SMBLoris_10_000,
  12. time=True)
  13. self.assertLessEqual(self.controller.durations[0], 15)
  14. def test_SMBLoris_100_000(self):
  15. self.checksum_test([['SMBLorisAttack', 'attackers.count=30', 'packets.per-second=95']], sha_SMBLoris_100_000,
  16. time=True)
  17. self.assertLessEqual(self.controller.durations[0], 150)
  18. def test_SMBScan_10_000(self):
  19. self.checksum_test([['SMBScanAttack', 'ip.src=192.168.178.1', 'ip.dst=192.168.178.10-192.168.197.145']],
  20. sha_SMBScan_10_000, time=True)
  21. self.assertLessEqual(self.controller.durations[0], 15)
  22. def test_SMBScan_100_000(self):
  23. self.checksum_test([['SMBScanAttack', 'ip.src=192.168.178.1', 'ip.dst=192.168.0.1-192.168.195.81']],
  24. sha_SMBScan_100_000, time=True)
  25. self.assertLessEqual(self.controller.durations[0], 150)
  26. def test_SMBScan_hosting_10_000(self):
  27. self.checksum_test([['SMBScanAttack', 'ip.src=192.168.178.1', 'ip.dst=192.168.178.10-192.168.181.241',
  28. 'hosting.ip=192.168.178.10-192.168.181.241']], sha_SMBScan_hosting_10_000, time=True)
  29. self.assertLessEqual(self.controller.durations[0], 15)
  30. def test_SMBScan_hosting_100_000(self):
  31. self.checksum_test([['SMBScanAttack', 'ip.src=192.168.178.1', 'ip.dst=192.168.178.10-192.168.217.25',
  32. 'hosting.ip=192.168.178.10-192.168.217.25']], sha_SMBScan_hosting_100_000, time=True)
  33. self.assertLessEqual(self.controller.durations[0], 150)