Noisecode: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
noisecode: eval self.say_public('hi')
noisecode: eval self.say_public('hi')
noisecode: eval reduce(lambda (say,s),i,w=110: [say, [[w>>(s[i-1]*4+s[i]*2+s[(i+1)%len(s)])&1 for i in range(len(s))], say("".join(c and "*" or " " for c in s)), __import__('time').sleep(1)][0]], range(25), [self.say_public, [0] * 70 + [ 1, 0]] ) and "ok 25 is enough"
noisecode: eval reduce(lambda (say,s),i,w=110: [say, [[w>>(s[i-1]*4+s[i]*2+s[(i+1)%len(s)])&1 for i in range(len(s))], say("".join(c and "*" or " " for c in s)), __import__('time').sleep(1)][0]], range(25), [self.say_public, [0] * 70 + [ 1, 0]] ) and "ok 25 is enough"
noisecode: eval (lambda c,self=self: map(lambda m,self=self: self.say_public(m) or __import__("time").sleep(1) or c, __import__("re").compile("\w{2,}(?:\w+ ){1,5}(?:is)(?:\w+){1,5}\w{3,}",__import__("re").I).findall(__import__("urllib2").urlopen(__import__("urllib2").Request("http://www.google.com/search?q=%s" % c,headers={"User-agent":"Mozilla/5.0"})).read())[:5]))(__import__("random").choice(self.channels['#noisebridge'].users()))[0]
</pre>
</pre>


Line 43: Line 44:
* Multiline output, like "Hello, world\nquit\n".  The bots only reply with the first line of the output.
* Multiline output, like "Hello, world\nquit\n".  The bots only reply with the first line of the output.
* Infinite loops.  The bots use setrlimit and watchdog threads to cap the maximum amount of execution time per eval request.
* Infinite loops.  The bots use setrlimit and watchdog threads to cap the maximum amount of execution time per eval request.
* Modifying noisecode's internal objects using setattr/getattr.
* Calling eval() in noisecode via InteractiveConsole and InteractiveInterpreter.

Revision as of 17:24, 14 January 2010

Noisecode is a bot in #noisebridge which knows all about python. Fun things to ask it to do:

noisecode: eval __import__('urllib2').urlopen('http://www.slashdot.org/').info()['Server']
noisecode: eval self.ircobj.connections[0].get_nickname()
noisecode: eval file('/etc/passwd').readlines()
noisecode: eval __import__('smtplib').SMTP('172.30.0.3').sendmail('noisecodebot@gmail.com', 'noisebridge-discuss@lists.noisebridge.net', 'Noisecode online.')
noisecode: eval self.say_public('hi')
noisecode: eval reduce(lambda (say,s),i,w=110: [say, [[w>>(s[i-1]*4+s[i]*2+s[(i+1)%len(s)])&1 for i in range(len(s))], say("".join(c and "*" or " " for c in s)), __import__('time').sleep(1)][0]], range(25), [self.say_public, [0] * 70 + [ 1, 0]] ) and "ok 25 is enough"
noisecode: eval (lambda c,self=self: map(lambda m,self=self: self.say_public(m) or __import__("time").sleep(1) or c, __import__("re").compile("\w{2,}(?:\w+ ){1,5}(?:is)(?:\w+){1,5}\w{3,}",__import__("re").I).findall(__import__("urllib2").urlopen(__import__("urllib2").Request("http://www.google.com/search?q=%s" % c,headers={"User-agent":"Mozilla/5.0"})).read())[:5]))(__import__("random").choice(self.channels['#noisebridge'].users()))[0]

Noisec is another bot in #noisebridge which knows all about C. Fun things to ask it to do:

noisec: eval char * p; int i; p=&main; for(i=0;i<20;i++) { printf("%.02hhX ", p[i]);
noisec: eval char*f="eval char*f=%c%s%c;printf(f,34,f,34,10);%c";printf(f,34,f,34,10);
noisec: eval int i; __asm("movl $0xdeadbeef, %0": "m"(i)); printf("i=0x%x", i);

Noisesql is yet another bot in #noisebridge which knows all about MySQL. Fun things to ask it to do:

noisesql: eval SELECT REPLACE(@prog := 'SELECT REPLACE(@prog := \'lolz\', CONCAT(\'lo\', \'lz\'), REPLACE(REPLACE(@prog, \'\\\\\', \'\\\\\\\\\'), \'\\\'\', \'\\\\\\\'\'));', CONCAT('lo', 'lz'), REPLACE(REPLACE(@prog, '\\', '\\\\'), '\'', '\\\''));
noisesql: eval select cos(0)
noisesql: eval select aes_encrypt('hocus', 'pocus')

Noiseelisp is, you guessed it, yet again another bot in #noisebridge which knows all about emacs lisp. Fun things to ask it to do:

noiseelisp: (message "1+1=%d" (+ 1 1))

Noisejs is yet another bot in #noisebridge which knows all about javascript. Fun things to ask it to do:

noisejs: eval function f(x) { if(x>2) { return x*f(x-1); } else { return x; } };  print(f(5));

Things people have tried to break the bots so far:

  • Flooding. The bots are ratelimited and rejoin if they are kicked by the server.
  • Multiline output, like "Hello, world\nquit\n". The bots only reply with the first line of the output.
  • Infinite loops. The bots use setrlimit and watchdog threads to cap the maximum amount of execution time per eval request.
  • Modifying noisecode's internal objects using setattr/getattr.
  • Calling eval() in noisecode via InteractiveConsole and InteractiveInterpreter.