test_EternalBlueExploit.py 1.1 KB

12345678910111213141516171819202122232425
  1. import ID2TLib.TestLibrary as Lib
  2. import Test.ID2TAttackTest as Test
  3. sha_default = '5a997aa3e1be1a34b46ea3308fece71336fae5f47e45d7ef4b26a8e4982f21e3'
  4. sha_ips_not_in_pcap = '32919a785133574c536ea383dce70874b76d60a5c41679b94822177acd6263b1'
  5. sha_multiple_params = '07eb84bd0cb695012d2d4aa5b3ba7943e4eadbc86dd538bbc64f6768a3516d8d'
  6. # TODO: improve coverage
  7. class UnitTestEternalBlue(Test.ID2TAttackTest):
  8. def test_eternalblue_default(self):
  9. self.checksum_test([['EternalBlueExploit']], sha_default)
  10. def test_eternalblue_ips_not_in_pcap(self):
  11. self.checksum_test([['EternalBlueExploit', 'ip.src=1.1.1.1', 'ip.dst=2.2.2.2']], sha_ips_not_in_pcap)
  12. def test_eternalblue_multiple_params(self):
  13. ip_src = 'ip.src=' + Lib.test_pcap_ips[0]
  14. ip_dst = 'ip.dst=' + Lib.test_pcap_ips[1]
  15. self.checksum_test([['EternalBlueExploit', ip_src, ip_dst, 'mac.src=00:0C:21:1C:60:61',
  16. 'mac.dst=04:0C:32:2C:63:62', 'port.src=1337', 'port.dst=42']], sha_multiple_params)
  17. def test_eternalblue_order(self):
  18. self.order_test([['EternalBlueExploit']])