Change background image
  1. What's up? I see you're viewing as a Guest. How about registering, it only takes like 2 minutes. This will enable you to do more on our forum and stay updated.

Xat Bots without Bot Power

Discussion in 'PC General' started by 3nvisi0n, Nov 12, 2011.

Thread Status:
This thread is more than 180 days old.
  1. 3nvisi0n

    3nvisi0n The R3v0lu710n Super-Mod

    Hey,

    SO I said I wouldn't reveal the innerworkings of my C bot that got around the Xat bot power.
    However today I came across something I had forgotten about, and this little thing lets you do that in an easier form with code I'd be willing to expose a bit. You can now make Xat bots in the simple language of Javascript. Now its not as fully features as the normal bots, and I'm probably not going to release a full code just this proof of concept that shows its possible.

    How it works is through Greasemonkey, using greasemonkey I wrote a Javascript that would run on the m.xat.com site(mobile chat) and watch for a command and perform the appropriate action.(command: !yell same thing as !say on most bots)

    As for the technical details in basic idea is that it overloads the AddMess() function from the page which is used to display messages(and user joins) to the user it overloads it and reads the message to be displayed looking for the yell command. It then posts the appropriate response if it finds the command.

    Also this is NOT my come back to bots, I had the idea and decided to try and see if it works nothing more.

    Userscripts: Javascript Xat Bot PoC for Greasemonkey

    PHP:
    // ==UserScript==
    // @name           JSXatBot
    // @namespace      JSBot
    // @include        http://m.xat.com:10049/*
    // ==/UserScript==
    String.prototype.between = function(prefixsuffix) {
      
    this;
      var 
    s.indexOf(prefix);
      if (
    >= 0) {
        
    s.substring(prefix.length);
      }
      else {
        return 
    '';
      }
      if (
    suffix) {
        
    s.indexOf(suffix);
        if (
    >= 0) {
          
    s.substring(0i);
        }
        else {
          return 
    '';
        }
      }
      return 
    s;
    }
    AddMessB unsafeWindow.AddMess;
    unsafeWindow.AddMess = function AddMess(tabs)
    {
        if(
    s.indexOf("<B>")>=0) {
            var 
    msg s.between("<B>","</B>")+" ";
            if(
    msg.charAt(0) == "!") {
                var 
    cmd msg.substring(1,msg.indexOf(" "));
                if(
    cmd=="yell")
                    
    sendMessage(msg.substring(msg.indexOf(" ")+1));
            } 
        }

        
    AddMessB(tab,s);
    }

    function 
    sendMessage(message) {
        
    xmlHttp2 unsafeWindow.getHTTPObject();
        
    xmlHttp2.open('GET','/Post?m='+message,true);
        
    xmlHttp2.setRequestHeader("Content-Type""text/plain");
        
    xmlHttp2.setRequestHeader("Connection""close");
        
    xmlHttp2.send(null);  
    }
  2. aazcod

    aazcod Dns is gey Member

    can you make an exactable application?
  3. 3nvisi0n

    3nvisi0n The R3v0lu710n Super-Mod

    ...its a javascript so...thats a no...use greasemonkey ... google
  4. Crazy52

    Crazy52 Gate Keeper Admin

    Yea grease monkey ftw

    Sent from my ADR6300
Thread Status:
This thread is more than 180 days old.

Share This Page