Sunday, 31 January 2016


Second Programming challenge from root-me. For me, also it requires basic programming skills.

To start this challenge, you must send a private message to bot Candy: !ep2

- The bot answer you by a private message.
- This is a series of encoded characters.
- You must send him the decoded message.
- You have 2 seconds.
- If the bot does not respond, then you have been banned. Just wait a few minutes.
- The answer must be sent as :
!ep2 -rep <answer>

import socket
import base64

 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 s.send('NICK rootek\r\n')
 print s.recv(1024000)
 s.send('USER rootek 0 * :Real Name\r\n')
 print s.recv(1024000)
 s.send("JOIN #root-me_challenge\r\n")
 print s.recv(20140000)
 message = s.send("PRIVMSG Candy !ep2\r\n")
 answer = s.recv(128).split(' :')[1].replace(' ','')
 print answer
 s.send("PRIVMSG Candy !ep2 -rep " + str(base64.b64decode(answer) + "\r\n"))
 print s.recv(10240)
 print "Connection closed"

except Exception,e:
 print e