3
0

test_SQLi.py 1.1 KB

1234567891011121314151617181920212223242526
  1. import Test.ID2TAttackTest as Test
  2. import ID2TLib.TestLibrary as Lib
  3. sha_default = 'a130ecdaf5fd8c09ef8418d2dbe7bd68c54e922553eb9fa703df016115393a46'
  4. sha_ips_not_in_pcap = 'b3174ab4b7573c317c3e87b35e14eb38d99cf33613d76cfd77b0c30cbf1f1fa2'
  5. sha_multiple_params = 'aac4d2015e2af52dfefc0f76fcbfca664e3420d07af8b574803f56aae70222c5'
  6. # TODO: improve coverage
  7. class UnitTestSQLi(Test.ID2TAttackTest):
  8. def test_sqli_default(self):
  9. self.checksum_test([['SQLiAttack']], sha_default)
  10. def test_sqli_ips_not_in_pcap(self):
  11. self.checksum_test([['SQLiAttack', 'ip.src=1.1.1.1', 'ip.dst=2.2.2.2']], sha_ips_not_in_pcap)
  12. def test_sqli_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([['SQLiAttack', ip_src, ip_dst, 'mac.src=00:0C:21:1C:60:61',
  16. 'mac.dst=04:0C:32:2C:63:62', 'port.dst=42',
  17. 'target.host=www.ihopethisisnotarealwebsite.com']], sha_multiple_params)
  18. def test_sqli_order(self):
  19. self.order_test([['SQLiAttack']])