Discussions » Development

How to fix unknown block

§
Posted: 2017-02-22
Edited: 2017-02-22

How to fix unknown block

I don't known what is this block

I send request to x.x.x.x:5000 for get result everything is correct , But somthing is incorrect in string Example : one two three???? . So ???? is not result get from request

What wrong in this ?

§
Posted: 2017-02-22
Edited: 2017-02-22

In line 40 result should be one two three but recieve some unknown string

// ==UserScript==

// ==/UserScript==

var dllink = null;
var domain = (window.location != window.parent.location) ? document.referrer.toString() : document.location.toString();
var domain = domain.replace("http://","").replace("https://","").replace("http://www.","").replace("https://www.","").replace("www.","").split("/")[0];
// var domain = domain.substr(0, domain.lastIndexOf("."))
var urlloc = null;
var result = null;
var result = null;

if(domain.match('uploadbank.com|filecyber.com|userscdn.com|fileflares.com|datasbit.com|google.com')) { //You can exclude domains here (advanced)
    if(location.href.indexOf('frame')>-1){
        console.log('[RC] FRAME');
        var audio = setInterval(function(){
            if(document.querySelector('.rc-audiochallenge-download-link') != null){
                console.log('[RC] AUDIO FOUND');
                clearInterval(audio);
                setInterval(function(){
                    var getlink = document.querySelector('.rc-audiochallenge-download-link').href;
                    if(getlink != null && getlink != dllink){
                        dllink = getlink;
                        urlloc = ('http://192.168.126.1:5000/captcha?' + 'web=' + (domain) + '%20-%20' + (Math.random()) + '&' + 'url=' + (dllink));
                        console.log('[RC] SENDING AUDIO');
                        console.log('[RC] LINK : ' + (urlloc));
                        console.log('[RC] HOST : ' + (domain));
                        var source = GM_xmlhttpRequest({
                            method: "GET",
                            url: urlloc,
                            onload: function(reponse) {
                                var result = reponse.responseText.toLowerCase().trim().replace('to', 'two').replace('tree', 'three').replace('for', 'four').replace('for', 'four');
                                if(result != null){
                                    var json = null;
                                    try {
                                        json = result;
                                    } catch (e) {
                                    }
                                    if(json.match('one|two|three|four|five|six|seven|eight|nine|zero') && json.match('sorry|error') == null){
                                        document.getElementById('audio-response').value = json;
                                        console.log('[RC] JSON : ' + (json));
                                        var exact = json.replace(/\s*(one|two|three|four|five|six|seven|eight|nine|zero)\s*/gi, '');
                                        if (!exact) {
                                            console.log('[RC] EXAC : OK');
                                            var buttonclick = setInterval(function(){
                                                document.getElementById('recaptcha-verify-button').click();
                                                clearInterval(buttonclick);
                                            }, 10000);
                                        }else{
                                            console.log('[RC] EXAC : NO');
                                            var buttonclick = setInterval(function(){
                                                document.getElementById('recaptcha-reload-button').click();
                                                clearInterval(buttonclick);
                                            }, 10000);
                                        }
                                    }else{
                                        document.getElementById('audio-response').value = json;
                                        console.log('[RC] JSON : ' + (json));
                                        var buttonclick = setInterval(function(){
                                            document.getElementById('recaptcha-reload-button').click();
                                            clearInterval(buttonclick);
                                        }, 10000);
                                    }                       
                                }
                            //  sentback(result);
                            }
                        });
                        //  function sentback(x){
                        //      alert(x);
                        //  }                       
                        //  var request = new XMLHttpRequest();
                        //  request.open('POST', urlloc, true);
                        //  request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
                        //  request.onreadystatechange = function() {
                        //      if(request.readyState == 4 && request.status == 200) {
                        //          console.log('[RC] audio result received');
                        //          var result = request.responseText;
                        //          if(result.length>0){
                        //              var json = null;
                        //              try {
                        //                  json = JSON.parse(result);
                        //              } catch (e) {
                        //              }
                        //              if(json !== null && json.confidence > 0.7){
                        //                  document.getElementById('audio-response').value = json.result;
                        //                  //document.getElementById('recaptcha-verify-button').click();
                        //              }else{
                        //                  document.getElementById('audio-response').value = '???';
                        //              }
                        //          }
                        //      }
                        //  };
                        //  request.send('audiocaptcha='+encodeURIComponent(dllink).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'));
                    }
                }, 6000);
            }
        }, 3000);
    }
}
    /*
    function click(x, y)
    {
        var myLayer = document.createElement('div');
        myLayer.style.position = 'absolute';
        myLayer.style.left = x+'px';
        myLayer.style.top = y+'px';
        myLayer.style.width = '2px';
        myLayer.style.height = '2px';
        myLayer.style.background = 'red';
        myLayer.style.zIndex = '9999999';
        myLayer.style.border = '3px double #FFF';
        myLayer.style.borderRadius = '10px';
        myLayer.style.pointerEvents = 'none';
        document.body.appendChild(myLayer);

        var ev = new MouseEvent('click', {
            'view': window,
            'bubbles': true,
            'cancelable': true,
            'screenX': x,
            'screenY': y
        });
        var el = document.elementFromPoint(x, y);
        el.dispatchEvent(ev);

        myLayer.click();

        myLayer.dispatchEvent(ev);

        console.log('click x:'+x+' y:'+y);
    }*/
§
Posted: 2017-02-22

Fixed with : str.replace(/[^a-zA-Z ]/g, "")

Post reply

Sign in to post a reply.