feat(wire): https target support with certificate verification; document reverse-proxy limitation
ci / macos-latest / py3.9 (push) Canceled after 0s
ci / macos-latest / py3.12 (push) Canceled after 0s
ci / ubuntu-latest / py3.9 (push) Canceled after 0s
ci / ubuntu-latest / py3.12 (push) Canceled after 0s
ci / windows-latest / py3.9 (push) Canceled after 0s
ci / windows-latest / py3.12 (push) Canceled after 0s
ci / macos-latest / py3.9 (push) Canceled after 0s
ci / macos-latest / py3.12 (push) Canceled after 0s
ci / ubuntu-latest / py3.9 (push) Canceled after 0s
ci / ubuntu-latest / py3.12 (push) Canceled after 0s
ci / windows-latest / py3.9 (push) Canceled after 0s
ci / windows-latest / py3.12 (push) Canceled after 0s
This commit is contained in:
+21
-2
@@ -58,9 +58,28 @@ class UrlTargetTest(unittest.TestCase):
|
||||
ns = cli.resolve_target(parse(["leak", "--url", "http://lab.internal:9000"]))
|
||||
self.assertEqual(ns.path, "/index.php")
|
||||
|
||||
def test_https_rejected(self):
|
||||
def test_https_enables_tls(self):
|
||||
ns = cli.resolve_target(parse(["exploit", "--url", "https://lab.internal/"]))
|
||||
self.assertTrue(ns.tls)
|
||||
self.assertEqual(ns.port, 443)
|
||||
self.assertEqual(ns.path, "/")
|
||||
|
||||
def test_https_default_port_443(self):
|
||||
ns = cli.resolve_target(parse(["leak", "--url", "https://lab.internal/index.php"]))
|
||||
self.assertEqual((ns.tls, ns.port, ns.path), (True, 443, "/index.php"))
|
||||
|
||||
def test_http_leaves_tls_off(self):
|
||||
ns = cli.resolve_target(parse(["exploit", "--url", "http://lab.internal/"]))
|
||||
self.assertFalse(ns.tls)
|
||||
self.assertEqual(ns.port, 80)
|
||||
|
||||
def test_unsupported_scheme_rejected(self):
|
||||
with self.assertRaises(SystemExit):
|
||||
cli.resolve_target(parse(["exploit", "--url", "https://lab.internal/"]))
|
||||
cli.resolve_target(parse(["exploit", "--url", "ftp://lab.internal/"]))
|
||||
|
||||
def test_insecure_flag_parses(self):
|
||||
ns = parse(["exploit", "--url", "https://lab.internal", "--insecure"])
|
||||
self.assertTrue(ns.insecure)
|
||||
|
||||
def test_explicit_flags_win_over_url(self):
|
||||
ns = cli.resolve_target(parse(["exploit", "--url", "http://a:1/x.php", "--port", "7000"]))
|
||||
|
||||
Reference in New Issue
Block a user