added unescaped regex test

This commit is contained in:
Somdev Sangwan
2019-11-25 10:21:17 +05:30
committed by GitHub
parent 205b214dda
commit b68631c587

View File

@@ -43,7 +43,14 @@ def active_tests(url, root, scheme, delay):
if acao_header: if acao_header:
if '`.example.com' in acao_header: if '`.example.com' in acao_header:
return 'Broken parser' return 'Broken parser'
time.sleep(delay) if root.count('.') > 1:
time.sleep(delay)
spoofed_root = root.replace('.', 'x', 1)
acao_header = requester(url, scheme, spoofed_root)
if acao_header:
if host(acao_header) == spoofed_root:
return 'Unescaped regex'
time.sleep(delay)
acao_header = requester(url, 'http', root) acao_header = requester(url, 'http', root)
if acao_header: if acao_header:
if acao_header.startswith('http://'): if acao_header.startswith('http://'):