From f31443a49eb732d6d9268f2cf6109fc68ff8a91c Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Fri, 14 Jul 2023 14:40:28 +0200 Subject: [PATCH] updating helpers (#159) * updating helpers * misc update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com> --- docs/template-examples/helper-functions.md | 145 +++++++++++---------- 1 file changed, 78 insertions(+), 67 deletions(-) diff --git a/docs/template-examples/helper-functions.md b/docs/template-examples/helper-functions.md index 6b25e2ed..5e795f67 100644 --- a/docs/template-examples/helper-functions.md +++ b/docs/template-examples/helper-functions.md @@ -15,82 +15,93 @@ http: - | GET / HTTP/1.1 Host: {{Hostname}} - 1: {{base64("Hello")}} - 2: {{base64(1234)}} - 3: {{base64_decode("SGVsbG8=")}} - 4: {{base64_py("Hello")}} - 5: {{compare_versions('v1.0.0', '>v0.0.1', 'v0.0.1', 'test")}} - 24: {{html_unescape("<body>test</body>")}} - 25: {{join("_", "hello", "world")}} - 26: {{len("Hello")}} - 27: {{len(5555)}} - 28: {{md5("Hello")}} - 29: {{md5(1234)}} - 30: {{mmh3("Hello")}} - 31: {{print_debug(1+2, "Hello")}} - 32: {{rand_base(5, "abc")}} - 33: {{rand_base(5, "")}} - 34: {{rand_base(5)}} - 35: {{rand_char("abc")}} - 36: {{rand_char("")}} - 37: {{rand_char()}} - 38: {{rand_int(1, 10)}} - 39: {{rand_int(10)}} - 40: {{rand_int()}} - 41: {{rand_ip("192.168.0.0/24")}} - 42: {{rand_ip("2002:c0a8::/24")}} - 43: {{rand_ip("192.168.0.0/24","10.0.100.0/24")}} - 44: {{rand_text_alpha(10, "abc")}} - 45: {{rand_text_alpha(10, "")}} - 46: {{rand_text_alpha(10)}} - 47: {{rand_text_alphanumeric(10, "ab12")}} - 48: {{rand_text_alphanumeric(10)}} - 49: {{rand_text_numeric(10, 123)}} - 50: {{rand_text_numeric(10)}} - 51: {{regex("H([a-z]+)o", "Hello")}} - 52: {{remove_bad_chars("abcd", "bc")}} - 53: {{repeat("a", 5)}} - 54: {{replace("Hello", "He", "Ha")}} - 55: {{replace_regex("He123llo", "(\\d+)", "")}} - 56: {{reverse("abc")}} - 57: {{sha1("Hello")}} - 58: {{sha256("Hello")}} - 59: {{to_lower("HELLO")}} - 60: {{to_upper("hello")}} - 61: {{trim("aaaHelloddd", "ad")}} - 62: {{trim_left("aaaHelloddd", "ad")}} - 63: {{trim_prefix("aaHelloaa", "aa")}} - 64: {{trim_right("aaaHelloddd", "ad")}} - 65: {{trim_space(" Hello ")}} - 66: {{trim_suffix("aaHelloaa", "aa")}} - 67: {{unix_time(10)}} - 68: {{url_decode("https:%2F%2Fprojectdiscovery.io%3Ftest=1")}} - 69: {{url_encode("https://projectdiscovery.io/test?a=1")}} - 70: {{wait_for(1)}} - 71: {{zlib("Hello")}} - 72: {{zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"))}} - 73: {{hex_encode(aes_gcm("AES256Key-32Characters1234567890", "exampleplaintext"))}} - 74: {{starts_with("Hello", "He")}} - 75: {{ends_with("Hello", "lo")}} - 76: {{line_starts_with("Hi\nHello", "He")}} - 77: {{line_ends_with("Hello\nHi", "lo")}} - 78: {{ip_format("169.254.169.254", 4)}} + 23: {{hmac("sha512", "test", "scrt")}} + 24: {{html_escape("test")}} + 25: {{html_unescape("<body>test</body>")}} + 26: {{join("_", "hello", "world")}} + 27: {{len("Hello")}} + 28: {{len(5555)}} + 29: {{md5("Hello")}} + 30: {{md5(1234)}} + 31: {{mmh3("Hello")}} + 32: {{print_debug(1+2, "Hello")}} + 33: {{rand_base(5, "abc")}} + 34: {{rand_base(5, "")}} + 35: {{rand_base(5)}} + 36: {{rand_char("abc")}} + 37: {{rand_char("")}} + 38: {{rand_char()}} + 39: {{rand_int(1, 10)}} + 40: {{rand_int(10)}} + 41: {{rand_int()}} + 42: {{rand_ip("192.168.0.0/24")}} + 43: {{rand_ip("2002:c0a8::/24")}} + 44: {{rand_ip("192.168.0.0/24","10.0.100.0/24")}} + 45: {{rand_text_alpha(10, "abc")}} + 46: {{rand_text_alpha(10, "")}} + 47: {{rand_text_alpha(10)}} + 48: {{rand_text_alphanumeric(10, "ab12")}} + 49: {{rand_text_alphanumeric(10)}} + 50: {{rand_text_numeric(10, 123)}} + 51: {{rand_text_numeric(10)}} + 52: {{regex("H([a-z]+)o", "Hello")}} + 53: {{remove_bad_chars("abcd", "bc")}} + 54: {{repeat("a", 5)}} + 55: {{replace("Hello", "He", "Ha")}} + 56: {{replace_regex("He123llo", "(\\d+)", "")}} + 57: {{reverse("abc")}} + 58: {{sha1("Hello")}} + 59: {{sha256("Hello")}} + 60: {{sha512("Hello")}} + 61: {{to_lower("HELLO")}} + 62: {{to_upper("hello")}} + 63: {{trim("aaaHelloddd", "ad")}} + 64: {{trim_left("aaaHelloddd", "ad")}} + 65: {{trim_prefix("aaHelloaa", "aa")}} + 66: {{trim_right("aaaHelloddd", "ad")}} + 67: {{trim_space(" Hello ")}} + 68: {{trim_suffix("aaHelloaa", "aa")}} + 69: {{unix_time(10)}} + 70: {{url_decode("https:%2F%2Fprojectdiscovery.io%3Ftest=1")}} + 71: {{url_encode("https://projectdiscovery.io/test?a=1")}} + 72: {{wait_for(1)}} + 73: {{zlib("Hello")}} + 74: {{zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"))}} + 75: {{hex_encode(aes_gcm("AES256Key-32Characters1234567890", "exampleplaintext"))}} + 76: {{starts_with("Hello", "He")}} + 77: {{ends_with("Hello", "lo")}} + 78: {{line_starts_with("Hi\nHello", "He")}} + 79: {{line_ends_with("Hello\nHi", "lo")}} + 80: {{sort("a1b2c3d4e5")}} + 81: {{uniq("abcabdaabbccd")}} + 82: {{join(" ", sort("b", "a", "2", "c", "3", "1", "d", "4"))}} + 83: {{join(" ", uniq("ab", "cd", "12", "34", "12", "cd"))}} + 84: {{split("ab,cd,efg", ",")}} + 85: {{split("ab,cd,efg", ",", 2)}} + 86: {{ip_format('127.0.0.1', 3)}} + 87: {{ip_format('127.0.1.0', 11)}} ``` + +For a more complete and up to date list check the [dsl repository](https://github.com/projectdiscovery/dsl) \ No newline at end of file