I recently gave a lecture on DDoS in my Network OS class. I demonstrated a simple bot on the computers in the class. I also demonstrated how portable devices are capable of running bots as well.
I used Android Scripting Environment (ASE) for the demo. The commands I gave it where text, call, speak aloud, and vibrate. The only draw back ASE has is no real GUI support. I can’t wait for the day when OpenGL ES is ported to python. Anyway, ASE allows access to almost all of the phones featurtes. Here is a link to the API ref: http://code.google.com/p/android-scripting/wiki/ApiReference
#------------------------------------------------------------------------------- # Name: AndroidIRC # Purpose: Android based IRC bot # # Author: K.B. Carte (techb) # # Created: 10/26/2010 # # Copyright: (c) K.B. Carte (techb) 2010 #------------------------------------------------------------------------------- #!/usr/bin/env python import socket, string, time, os, sys, android droid = android.Android() os.chdir("sdcard") droid.makeToast("AndroidBot Started") droid.vibrate(300) chan = 'AndroidBot' ircsite = 'irc.freenode.net' port = 6667 irc = socket.socket() irc.connect((ircsite, port)) n = 'AndroidBotV1' irc.send('NICK %s\r\n' % n) irc.send("USER %s %s bla :%s\r\n" % ("Ohlook", 'itsnotmy', 'Realname')) time.sleep(4) irc.send("JOIN #%s\r\n" % chan) readbuffer = '' while True: readbuffer= irc.recv(1024) temp=string.split(readbuffer, "\n") Check = readbuffer.split(':') print readbuffer if 'PING' in readbuffer: """PIN/PONG connection echo response""" irc.send("PONG :%s" % Check[1]) if 'JOIN' in readbuffer: """Greet people that join the channel""" na = Check[1].split('!') irc.send("PRIVMSG #%s :Hello %s\r\n" % (chan, str(na[0]))) if '^call' in readbuffer: number = readbuffer.split(':') droid.phoneCallNumber(number[3].strip()) if '^text' in readbuffer: "texts the number 5 times with given message" data = readbuffer.split(":") number = data[3].strip() message = data[4].strip() print number, message cnt = 0 while cnt < 5: droid.smsSend(number, message) cnt += 1 if '^vibe' in readbuffer: droid.vibrate(300) if '^say' in readbuffer: say = readbuffer.split(":") droid.ttsSpeak(say[3].strip()
I hope I’m not too late to say, “Good Job!”
Oh how I love Android… Oh how I love IRC… ^_^
Android+IRC=amazing. I gave a demo of an android botnet in my network security class that everyone went crazy over. And thank you for liking my stuff =). I am thinking about doing a tutorial series for android and ASE.
Wait a second…. did I actually get infected on my older phone? Wow, I should be more careful next time ^_^’
nice work, thx 🙂
Your welcome. I was thinking about having it log into a private channel and update my GPS location when requested. Could get more information about the phone too, like battery life, or send a complete link to google maps of my location or something.
Which IRC client were you using on your phone?
The script posted would be considered the IRC client. I wrote it to access and use IRC via Python programming language.
Well… now that I want to get back into SL4A/ASE/whatever it is called now, I could make my own IRC client with it *wonders if that one irc libary coded in Python that’s found online will work for our Android phones (there’s only one way to find out xD)*
Good luck with life, and I assume you already thought of making a bot that uses the Text-to-Speech engine to say random stuff instead of the normal notification tone when you recieve a text message. That idea is just for humor of course 😉