Path: blob/dev/integration_tests/protocols/http/dsl-functions.yaml
2070 views
id: helper-functions-examples12info:3name: RAW Template with Helper Functions4author: pdteam5severity: info67http:8- raw:9# Note for the integration test: dsl expression should not contain commas10- |11GET / HTTP/1.112Host: {{Hostname}}1301: {{base64("Hello")}}1402: {{base64(1234)}}1503: {{base64_decode("SGVsbG8=")}}1604: {{base64_py("Hello")}}1705: {{compare_versions('v1.0.0', '>v0.0.1', '<v1.0.1')}}1806: {{concat("Hello", "world")}}1907: {{contains("Hello", "lo")}}2008: {{contains_all("Hello everyone", "lo", "every")}}2109: {{contains_any("Hello everyone", "abc", "llo")}}2210: {{date_time("%Y-%M-%D")}}2311: {{date_time("%Y-%M-%D", unix_time())}}2412: {{date_time("%H-%m")}}2513: {{date_time("02-01-2006 15:04")}}2614: {{date_time("02-01-2006 15:04", unix_time())}}2715: {{dec_to_hex(11111)}}2816: {{generate_java_gadget("commons-collections3.1", "wget http://scanme.sh", "base64")}}2917: {{gzip("Hello")}}3018: {{gzip_decode(hex_decode("1f8b08000000000000fff248cdc9c907040000ffff8289d1f705000000"))}}3119: {{hex_decode("6161")}}3220: {{hex_encode("aa")}}3321: {{hmac("sha1", "test", "scrt")}}3422: {{hmac("sha256", "test", "scrt")}}3523: {{hmac("sha512", "test", "scrt")}}3624: {{html_escape("<body>test</body>")}}3725: {{html_unescape("<body>test</body>")}}3826: {{join("_", "hello", "world")}}3927: {{len("Hello")}}4028: {{len(5555)}}4129: {{md5("Hello")}}4230: {{md5(1234)}}4331: {{mmh3("Hello")}}4432: {{print_debug(1+2, "Hello")}}4533: {{rand_base(5, "abc")}}4634: {{rand_base(5, "")}}4735: {{rand_base(5)}}4836: {{rand_char("abc")}}4937: {{rand_char("")}}5038: {{rand_char()}}5139: {{rand_int(1, 10)}}5240: {{rand_int(10)}}5341: {{rand_int()}}5442: {{rand_ip("192.168.0.0/24")}}5543: {{rand_ip("2002:c0a8::/24")}}5644: {{rand_ip("192.168.0.0/24","10.0.100.0/24")}}5745: {{rand_text_alpha(10, "abc")}}5846: {{rand_text_alpha(10, "")}}5947: {{rand_text_alpha(10)}}6048: {{rand_text_alphanumeric(10, "ab12")}}6149: {{rand_text_alphanumeric(10)}}6250: {{rand_text_numeric(10, 123)}}6351: {{rand_text_numeric(10)}}6452: {{regex("H([a-z]+)o", "Hello")}}6553: {{remove_bad_chars("abcd", "bc")}}6654: {{repeat("a", 5)}}6755: {{replace("Hello", "He", "Ha")}}6856: {{replace_regex("He123llo", "(\\d+)", "")}}6957: {{reverse("abc")}}7058: {{sha1("Hello")}}7159: {{sha256("Hello")}}7260: {{sha512("Hello")}}7361: {{to_lower("HELLO")}}7462: {{to_upper("hello")}}7563: {{trim("aaaHelloddd", "ad")}}7664: {{trim_left("aaaHelloddd", "ad")}}7765: {{trim_prefix("aaHelloaa", "aa")}}7866: {{trim_right("aaaHelloddd", "ad")}}7967: {{trim_space(" Hello ")}}8068: {{trim_suffix("aaHelloaa", "aa")}}8169: {{unix_time(10)}}8270: {{url_decode("https:%2F%2Fprojectdiscovery.io%3Ftest=1")}}8371: {{url_encode("https://projectdiscovery.io/test?a=1")}}8472: {{wait_for(1)}}8573: {{zlib("Hello")}}8674: {{zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"))}}8775: {{hex_encode(aes_gcm("AES256Key-32Characters1234567890", "exampleplaintext"))}}8876: {{starts_with("Hello", "He")}}8977: {{ends_with("Hello", "lo")}}9078: {{line_starts_with("Hi\nHello", "He")}}9179: {{line_ends_with("Hello\nHi", "lo")}}9280: {{sort("a1b2c3d4e5")}}9381: {{uniq("abcabdaabbccd")}}9482: {{join(" ", sort("b", "a", "2", "c", "3", "1", "d", "4"))}}9583: {{join(" ", uniq("ab", "cd", "12", "34", "12", "cd"))}}9684: {{split("ab,cd,efg", ",")}}9785: {{split("ab,cd,efg", ",", 2)}}9886: {{ip_format('127.0.0.1', 3)}}9987: {{ip_format('127.0.1.0', 11)}}10088: {{jarm('scanme.sh:443')}}101extractors:102- type: regex103name: results104regex:105- '\d+: [^\s]+'106107108