Update anti_ddos_challenge.lua

Big Fix : 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI
URIError: The URI to be encoded contains invalid character (Edge)
URIError: malformed URI sequence (Firefox)
URIError: URI malformed (Chrome)

To prevent this happening on my Hex encryption of javascript "\x char" and "%" char values a soloution is to use `unescape()` or `escape()` i decided to escape values.
This commit is contained in:
C0nw0nk
2020-02-24 19:05:18 +00:00
committed by GitHub
parent afa5fa796f
commit 88326858a2

View File

@ -535,13 +535,13 @@ local function encrypt_javascript(string1, type, defer_async, num_encrypt, encry
if defer_async == "0" or defer_async == nil then --Browser default loading / execution order
--https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent
output = "<script type=\"text/javascript\" charset=\"" .. default_charset .. "\" data-cfasync=\"false\">eval(decodeURIComponent('" .. hexadecimal_x .. "'))</script>"
output = "<script type=\"text/javascript\" charset=\"" .. default_charset .. "\" data-cfasync=\"false\">eval(decodeURIComponent(escape('" .. hexadecimal_x .. "')));</script>"
end
if defer_async == "1" then --Defer
output = "<script type=\"text/javascript\" defer=\"defer\" charset=\"" .. default_charset .. "\" data-cfasync=\"false\">eval(decodeURIComponent('" .. hexadecimal_x .. "'))</script>"
output = "<script type=\"text/javascript\" defer=\"defer\" charset=\"" .. default_charset .. "\" data-cfasync=\"false\">eval(decodeURIComponent(escape('" .. hexadecimal_x .. "')));</script>"
end
if defer_async == "2" then --Defer
output = "<script type=\"text/javascript\" async=\"async\" charset=\"" .. default_charset .. "\" data-cfasync=\"false\">eval(decodeURIComponent('" .. hexadecimal_x .. "'))</script>"
output = "<script type=\"text/javascript\" async=\"async\" charset=\"" .. default_charset .. "\" data-cfasync=\"false\">eval(decodeURIComponent(escape('" .. hexadecimal_x .. "')));</script>"
end
end