Update anti_ddos_challenge.lua

Fix : malformed URI Javascript error with escaping back slashes through Lua
This commit is contained in:
C0nw0nk
2020-03-05 21:50:38 +00:00
committed by GitHub
parent eeee46a135
commit 4b900ef3de

View File

@ -1316,14 +1316,14 @@ local function encrypt_javascript(string1, type, defer_async, num_encrypt, encry
local encrypt_type_origin = encrypt_type --Store var passed to function in local var
if tonumber(encrypt_type) == nil or tonumber(encrypt_type) <= 0 then
encrypt_type = math.random(1, 2) --Random encryption
encrypt_type = math.random(2, 2) --Random encryption
end
--I was inspired by http://www.hightools.net/javascript-encrypter.php so i built it myself
if tonumber(encrypt_type) == 1 then
hexadecimal_x = "%" .. sep(hex_output, "%x%x", "%") --hex output insert a char every 2 chars %x%x
end
if tonumber(encrypt_type) == 2 then
hexadecimal_x = "\\x" .. sep(hex_output, "%x%x", "\\x") --hex output insert a char every 2 chars %x%x
hexadecimal_x = string.char(92) .. "x" .. sep(hex_output, "%x%x", string.char(92) .. "x") --hex output insert a char every 2 chars %x%x
end
--TODO: Fix this.