@coderprowin

Как выдрать функцию со скрипта js и выполнить ее в консоли?

При отправке на сайт запроса, генерируется токен
ads_token_js=7c5fca6a494f867c57c6e755t336999uup9505454n5w0094583060ceg7a79223c25a87fcb5885bd6a2fe5d454b774b8c9ebfa0893880b6720f3cfe48b57c05g289a005c548c74989c9e6b6e83497a51df994a1c89aa7d6ce920f6f369464c352c8d6i59ae5239844f7b58de9640b2eed0adbc7b97186b1b87f9


Все после ads_token_js= , генерируется через функцию inputnode.name = 'ads_token_js';inputnode.value = cfdffdcfbdbdddcd ();

cfdffdcfbdbdddcd (); сама функция ниже в скрипте

Сам скрипт:
<script>var autosubmit = true;
	function cfdffdcfbdbdddcd(){var e=function(){return document.domain?function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(function(e){if(typeof location!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("44cd9d1d743232bec9c1f1d2643733be"),function(e){if(typeof location!="undefined"&&typeof location.host!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("d06a6a4a55bd50c554e38c184aede1ae")):""}();return e=function(){return document.documentElement?function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(e,function(e){if(typeof location!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("9fa1769224069d6f85df8f840b102105")):""}(),e=function(){return document.documentElement?e+function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("01b35fa43b635e90f0a65b6fc4da6d09"),function(e){if(typeof navigator!="undefined"&&typeof navigator.appName!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("b6c3e9fe349bc1d4b4a0717c5c6580d0")):""}(),e=function(){return document.styleSheets?e+function(e,t){var n=t&&t.charCodeAt(0)%26||e.charCodeAt(3)%26,r=-1,i=e.replace(/[a-zA-Z]/g,function(e){return r+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(r%t.length))%26+n+(e<="Z"?90:122)-26)?e:e-26)});return i}(function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("cc061df6226b138a339aa7dfbf43f0ba"),function(e){if(typeof navigator!="undefined"&&typeof navigator.appName!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("d9bb30e8e560c9180a41ddfc96cf12bd")):""}(),e=function(){return document.characterSet?function(e,t){var n=-1,r=e.replace(/[a-zA-Z]/g,function(e){return n+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(n%t.length))%26+13+(e<="Z"?90:122)-26)?e:e-26)});return r}(e,function(e){if(typeof location!="undefined"&&typeof location.host!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("9f939d8e0a555d764cb5c7e8ff53fdb3")):""}(),e=function(){return document.documentElement?function(e,t){var n=-1,r=e.replace(/[a-zA-Z]/g,function(e){return n+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(n%t.length))%26+13+(e<="Z"?90:122)-26)?e:e-26)});return r}(e,function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("e2fad677976e57127d82363cb9eef5bc")):""}(),e+=function(e,t){return typeof navigator!="undefined"&&typeof navigator.appName!="undefined"?t:e}("a63534b39fa4a786","c44baadbecf07e54"),e}if(document){var d=new Date;d.setTime(d.getTime()+3e5),document.cookie="xppcts = bb5710215ca4adfa; path=/; expires = "+d.toUTCString()}try {var inputnode = document.createElement("input");inputnode.type = 'hidden';inputnode.name = 'ads_token_js';inputnode.value = cfdffdcfbdbdddcd ();document.forms["challenge"].appendChild(inputnode);var debugnode = document.createElement("input");debugnode.type = 'hidden';debugnode.name = '6c96ca43662a9f88';debugnode.value = '38cd967f3e6dc189';document.forms["challenge"].appendChild(debugnode);} catch (err) {autosubmit = false;document.getElementById("ads-plugin").style.display = "block";}document.forms["challenge"].submit();</script>


Нужно выдрать саму функцию генерации, что бы когда вставишь в консоль в браузере, получался данный ответ.

Работаю с другим ЯП, и в js не понимаю почти ничего, но ради одного момента не осилю обучение его.
Всем заранее спасибо за помощь, писал на фрилансим так и не дождался ответа.
Буду рад помочь материально, кто поможет разобраться тут.
  • Вопрос задан
  • 306 просмотров
Решения вопроса 1
@ns5d
нечего сказать
Chrome: F12, Console
function cfdffdcfbdbdddcd() {
    var e = function() {
        return document.domain ? function(e, t) {
            t || (t = e);
            var n = e.split(t[2]),
                r = "";
            for (var i = n.length - 1; i >= 0; i--) r = r + n[i] + t[i % t.length];
            return r
        }(function(e) {
            if (typeof location != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("44cd9d1d743232bec9c1f1d2643733be"), function(e) {
            if (typeof location != "undefined" && typeof location.host != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("d06a6a4a55bd50c554e38c184aede1ae")) : ""
    }();

    return e = function() {
        return document.documentElement ? function(e, t) {
            t || (t = e);
            var n = e.split(t[2]),
                r = "";
            for (var i = n.length - 1; i >= 0; i--) r = r + n[i] + t[i % t.length];
            return r
        }(e, function(e) {
            if (typeof location != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("9fa1769224069d6f85df8f840b102105")) : ""
    }(), e = function() {
        return document.documentElement ? e + function(e, t) {
            t || (t = e);
            var n = e.split(t[2]),
                r = "";
            for (var i = n.length - 1; i >= 0; i--) r = r + n[i] + t[i % t.length];
            return r
        }(function(e) {
            if (typeof screen != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("01b35fa43b635e90f0a65b6fc4da6d09"), function(e) {
            if (typeof navigator != "undefined" && typeof navigator.appName != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("b6c3e9fe349bc1d4b4a0717c5c6580d0")) : ""
    }(), e = function() {
        return document.styleSheets ? e + function(e, t) {
            var n = t && t.charCodeAt(0) % 26 || e.charCodeAt(3) % 26,
                r = -1,
                i = e.replace(/[a-zA-Z]/g, function(e) {
                    return r += 1, String.fromCharCode((e <= "Z" ? 90 : 122) >= (e = (e.charCodeAt(0) + t.charCodeAt(r % t.length)) % 26 + n + (e <= "Z" ? 90 : 122) - 26) ? e : e - 26)
                });
            return i
        }(function(e) {
            if (typeof screen != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("cc061df6226b138a339aa7dfbf43f0ba"), function(e) {
            if (typeof navigator != "undefined" && typeof navigator.appName != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("d9bb30e8e560c9180a41ddfc96cf12bd")) : ""
    }(), e = function() {
        return document.characterSet ? function(e, t) {
            var n = -1,
                r = e.replace(/[a-zA-Z]/g, function(e) {
                    return n += 1, String.fromCharCode((e <= "Z" ? 90 : 122) >= (e = (e.charCodeAt(0) + t.charCodeAt(n % t.length)) % 26 + 13 + (e <= "Z" ? 90 : 122) - 26) ? e : e - 26)
                });
            return r
        }(e, function(e) {
            if (typeof location != "undefined" && typeof location.host != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("9f939d8e0a555d764cb5c7e8ff53fdb3")) : ""
    }(), e = function() {
        return document.documentElement ? function(e, t) {
            var n = -1,
                r = e.replace(/[a-zA-Z]/g, function(e) {
                    return n += 1, String.fromCharCode((e <= "Z" ? 90 : 122) >= (e = (e.charCodeAt(0) + t.charCodeAt(n % t.length)) % 26 + 13 + (e <= "Z" ? 90 : 122) - 26) ? e : e - 26)
                });
            return r
        }(e, function(e) {
            if (typeof screen != "undefined") {
                var t = e.charCodeAt(0) % e.length,
                    n = e.substring(t) + e.substring(0, t);
                return n
            }
            return b
        }("e2fad677976e57127d82363cb9eef5bc")) : ""
    }(), e += function(e, t) {
        return typeof navigator != "undefined" && typeof navigator.appName != "undefined" ? t : e
    }("a63534b39fa4a786", "c44baadbecf07e54"), e
}

if (document) {
    var d = new Date;
    d.setTime(d.getTime() + 3e5), document.cookie = "xppcts = bb5710215ca4adfa; path=/; expires = " + d.toUTCString()
}

cfdffdcfbdbdddcd()
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
@abberati
frontend-разработчик
это минифицированный код. специально для хитрых парней, которые хотят его упереть.
в строке не одна функция. достаточно посчитать количество { и }.

вот нужная вам функция, отделённая от остального:
function myAwesomeStealedFunction() {
  var e=function(){return document.domain?function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(function(e){if(typeof location!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("44cd9d1d743232bec9c1f1d2643733be"),function(e){if(typeof location!="undefined"&&typeof location.host!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("d06a6a4a55bd50c554e38c184aede1ae")):""}();return e=function(){return document.documentElement?function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(e,function(e){if(typeof location!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("9fa1769224069d6f85df8f840b102105")):""}(),e=function(){return document.documentElement?e+function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("01b35fa43b635e90f0a65b6fc4da6d09"),function(e){if(typeof navigator!="undefined"&&typeof navigator.appName!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("b6c3e9fe349bc1d4b4a0717c5c6580d0")):""}(),e=function(){return document.styleSheets?e+function(e,t){var n=t&&t.charCodeAt(0)%26||e.charCodeAt(3)%26,r=-1,i=e.replace(/[a-zA-Z]/g,function(e){return r+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(r%t.length))%26+n+(e<="Z"?90:122)-26)?e:e-26)});return i}(function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("cc061df6226b138a339aa7dfbf43f0ba"),function(e){if(typeof navigator!="undefined"&&typeof navigator.appName!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("d9bb30e8e560c9180a41ddfc96cf12bd")):""}(),e=function(){return document.characterSet?function(e,t){var n=-1,r=e.replace(/[a-zA-Z]/g,function(e){return n+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(n%t.length))%26+13+(e<="Z"?90:122)-26)?e:e-26)});return r}(e,function(e){if(typeof location!="undefined"&&typeof location.host!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("9f939d8e0a555d764cb5c7e8ff53fdb3")):""}(),e=function(){return document.documentElement?function(e,t){var n=-1,r=e.replace(/[a-zA-Z]/g,function(e){return n+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(n%t.length))%26+13+(e<="Z"?90:122)-26)?e:e-26)});return r}(e,function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("e2fad677976e57127d82363cb9eef5bc")):""}(),e+=function(e,t){return typeof navigator!="undefined"&&typeof navigator.appName!="undefined"?t:e}("a63534b39fa4a786","c44baadbecf07e54"),e
}

console.log(myAwesomeStealedFunction())
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы