using gtalk to create a “Non Malicious” Trojan Horse
*) Using gtalk to control the hardwares in your home which are interfaced to your computer
*) Replacement for the famous telnet/ssh program (can’t use programs like vi , top .. though
*) Lets you know the status of the programs running in your home computer like download status …. etc
and leaving others for your imagination
This program uses the command module in python to execute the commands that you type into the chat window. Be careful that if you start the program as root, then you can possibly do “anything” in your machine. Be careful.
gtalk_trojan.py
import xmpp
import time
import commands
def execute_command(command):
return commands.getoutput(command)
def messageCB(sess,mess):
nick=mess.getFrom().getResource()
text=mess.getBody()
reply = execute_command(text)
sess.send(xmpp.Message(mess.getFrom(),reply))
roster=[]
def presenceCB(sess,pres):
nick=pres.getFrom().getResource()
text=”
if pres.getType()==’unavailable’:
if nick in roster:
text=nick
roster.remove(nick)
else:
if nick not in roster:
text=nick
roster.append(nick)
def StepOn(conn):
try:
conn.Process(1)
except KeyboardInterrupt: return 0
return 1
def Cont(conn):
while StepOn(conn): pass
def main_process():
jid = xmpp.protocol.JID(’maxin.john@gmail.com’)
cl = xmpp.Client(’gmail.com’)
cl.connect((’talk.google.com’,5223))
cl.RegisterHandler(’message’,messageCB)
cl.RegisterHandler(’presence’,presenceCB)
cl.auth(jid.getNode(), ‘my_secret_password’)
cl.sendInitPresence()
Cont(cl)
if __name__ == ‘__main__’:
main_process()