mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 22:25:28 +00:00
test: extended the DSL helper integration test cases
This commit is contained in:
parent
5281d342c0
commit
cadba90a5a
@ -14,67 +14,72 @@ requests:
|
|||||||
02: {{base64(1234)}}
|
02: {{base64(1234)}}
|
||||||
03: {{base64_decode("SGVsbG8=")}}
|
03: {{base64_decode("SGVsbG8=")}}
|
||||||
04: {{base64_py("Hello")}}
|
04: {{base64_py("Hello")}}
|
||||||
05: {{concat("Hello", "world")}}
|
05: {{compare_versions('v1.0.0', '>v0.0.1', '<v1.0.1')}}
|
||||||
06: {{contains("Hello", "lo")}}
|
06: {{concat("Hello", "world")}}
|
||||||
07: {{date_time("%Y-%M-%D")}}
|
07: {{contains("Hello", "lo")}}
|
||||||
08: {{date_time("%Y-%M-%D", unix_time())}}
|
08: {{date_time("%Y-%M-%D")}}
|
||||||
09: {{date_time("%H-%m")}}
|
09: {{date_time("%Y-%M-%D", unix_time())}}
|
||||||
10: {{date_time("02-01-2006 15:04")}}
|
10: {{date_time("%H-%m")}}
|
||||||
11: {{date_time("02-01-2006 15:04", unix_time())}}
|
11: {{date_time("02-01-2006 15:04")}}
|
||||||
12: {{generate_java_gadget("commons-collections3.1", "wget http://{{interactsh-url}}", "base64")}}
|
12: {{date_time("02-01-2006 15:04", unix_time())}}
|
||||||
13: {{gzip("Hello")}}
|
13: {{dec_to_hex(11111)}}
|
||||||
14: {{hex_decode("6161")}}
|
14: {{generate_java_gadget("commons-collections3.1", "wget http://{{interactsh-url}}", "base64")}}
|
||||||
15: {{hex_encode("aa")}}
|
15: {{gzip("Hello")}}
|
||||||
16: {{hmac("sha1", "test", "scrt")}}
|
16: {{gzip_decode(hex_decode("1f8b08000000000000fff248cdc9c907040000ffff8289d1f705000000"))}}
|
||||||
17: {{hmac("sha256", "test", "scrt")}}
|
17: {{hex_decode("6161")}}
|
||||||
18: {{html_escape("<body>test</body>")}}
|
18: {{hex_encode("aa")}}
|
||||||
19: {{html_unescape("<body>test</body>")}}
|
19: {{hmac("sha1", "test", "scrt")}}
|
||||||
20: {{join("_", "hello", "world")}}
|
20: {{hmac("sha256", "test", "scrt")}}
|
||||||
21: {{len("Hello")}}
|
21: {{html_escape("<body>test</body>")}}
|
||||||
22: {{len(5555)}}
|
22: {{html_unescape("<body>test</body>")}}
|
||||||
23: {{md5("Hello")}}
|
23: {{join("_", "hello", "world")}}
|
||||||
24: {{md5(1234)}}
|
24: {{len("Hello")}}
|
||||||
25: {{mmh3("Hello")}}
|
25: {{len(5555)}}
|
||||||
26: {{print_debug(1+2, "Hello")}}
|
26: {{md5("Hello")}}
|
||||||
27: {{rand_base(5, "abc")}}
|
27: {{md5(1234)}}
|
||||||
28: {{rand_base(5, "")}}
|
28: {{mmh3("Hello")}}
|
||||||
29: {{rand_base(5)}}
|
29: {{print_debug(1+2, "Hello")}}
|
||||||
30: {{rand_char("abc")}}
|
30: {{rand_base(5, "abc")}}
|
||||||
31: {{rand_char("")}}
|
31: {{rand_base(5, "")}}
|
||||||
32: {{rand_char()}}
|
32: {{rand_base(5)}}
|
||||||
33: {{rand_int(1, 10)}}
|
33: {{rand_char("abc")}}
|
||||||
34: {{rand_int(10)}}
|
34: {{rand_char("")}}
|
||||||
35: {{rand_int()}}
|
35: {{rand_char()}}
|
||||||
36: {{rand_ip("192.168.0.0/24")}}
|
36: {{rand_int(1, 10)}}
|
||||||
37: {{rand_ip("2002:c0a8::/24")}}
|
37: {{rand_int(10)}}
|
||||||
38: {{rand_ip("192.168.0.0/24","10.0.100.0/24")}}
|
38: {{rand_int()}}
|
||||||
39: {{rand_text_alpha(10, "abc")}}
|
39: {{rand_ip("192.168.0.0/24")}}
|
||||||
40: {{rand_text_alpha(10, "")}}
|
40: {{rand_ip("2002:c0a8::/24")}}
|
||||||
41: {{rand_text_alpha(10)}}
|
41: {{rand_ip("192.168.0.0/24","10.0.100.0/24")}}
|
||||||
42: {{rand_text_alphanumeric(10, "ab12")}}
|
42: {{rand_text_alpha(10, "abc")}}
|
||||||
43: {{rand_text_alphanumeric(10)}}
|
43: {{rand_text_alpha(10, "")}}
|
||||||
44: {{rand_text_numeric(10, 123)}}
|
44: {{rand_text_alpha(10)}}
|
||||||
45: {{rand_text_numeric(10)}}
|
45: {{rand_text_alphanumeric(10, "ab12")}}
|
||||||
46: {{regex("H([a-z]+)o", "Hello")}}
|
46: {{rand_text_alphanumeric(10)}}
|
||||||
47: {{remove_bad_chars("abcd", "bc")}}
|
47: {{rand_text_numeric(10, 123)}}
|
||||||
48: {{repeat("a", 5)}}
|
48: {{rand_text_numeric(10)}}
|
||||||
49: {{replace("Hello", "He", "Ha")}}
|
49: {{regex("H([a-z]+)o", "Hello")}}
|
||||||
50: {{replace_regex("He123llo", "(\\d+)", "")}}
|
50: {{remove_bad_chars("abcd", "bc")}}
|
||||||
51: {{reverse("abc")}}
|
51: {{repeat("a", 5)}}
|
||||||
52: {{sha1("Hello")}}
|
52: {{replace("Hello", "He", "Ha")}}
|
||||||
53: {{sha256("Hello")}}
|
53: {{replace_regex("He123llo", "(\\d+)", "")}}
|
||||||
54: {{to_lower("HELLO")}}
|
54: {{reverse("abc")}}
|
||||||
55: {{to_upper("hello")}}
|
55: {{sha1("Hello")}}
|
||||||
56: {{trim("aaaHelloddd", "ad")}}
|
56: {{sha256("Hello")}}
|
||||||
57: {{trim_left("aaaHelloddd", "ad")}}
|
57: {{to_lower("HELLO")}}
|
||||||
58: {{trim_prefix("aaHelloaa", "aa")}}
|
58: {{to_upper("hello")}}
|
||||||
59: {{trim_right("aaaHelloddd", "ad")}}
|
59: {{trim("aaaHelloddd", "ad")}}
|
||||||
60: {{trim_space(" Hello ")}}
|
60: {{trim_left("aaaHelloddd", "ad")}}
|
||||||
61: {{trim_suffix("aaHelloaa", "aa")}}
|
61: {{trim_prefix("aaHelloaa", "aa")}}
|
||||||
62: {{unix_time(10)}}
|
62: {{trim_right("aaaHelloddd", "ad")}}
|
||||||
63: {{url_decode("https:%2F%2Fprojectdiscovery.io%3Ftest=1")}}
|
63: {{trim_space(" Hello ")}}
|
||||||
64: {{url_encode("https://projectdiscovery.io/test?a=1")}}
|
64: {{trim_suffix("aaHelloaa", "aa")}}
|
||||||
65: {{wait_for(1)}}
|
65: {{unix_time(10)}}
|
||||||
|
66: {{url_decode("https:%2F%2Fprojectdiscovery.io%3Ftest=1")}}
|
||||||
|
67: {{url_encode("https://projectdiscovery.io/test?a=1")}}
|
||||||
|
68: {{wait_for(1)}}
|
||||||
|
69: {{zlib("Hello")}}
|
||||||
|
70: {{zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"))}}
|
||||||
|
|
||||||
extractors:
|
extractors:
|
||||||
- type: regex
|
- type: regex
|
||||||
|
|||||||
@ -256,7 +256,7 @@ func (h *httpDSLFunctions) Execute(filePath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
totalExtracted := strings.Split(submatch[1], ",")
|
totalExtracted := strings.Split(submatch[1], ",")
|
||||||
numberOfDslFunctions := 65
|
numberOfDslFunctions := 70
|
||||||
if len(totalExtracted) != numberOfDslFunctions {
|
if len(totalExtracted) != numberOfDslFunctions {
|
||||||
return errors.New("incorrect number of results")
|
return errors.New("incorrect number of results")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user