Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #
- #
- # Python IRC bot via Tor
- #
- # ~ by amus3d
- #
- #
- ######################################
- import TorCtl
- import socks
- import socket
- # Start the proxy shizz.
- socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050)
- __originalSocket = socket.socket
- # Functions
- def torify(password):
- socket.socket = __originalSocket
- conn = TorCtl.connect(controlAddr="127.0.0.1", controlPort=9051, passphrase=password)
- TorCtl.Connection.send_signal(conn, "NEWNYM")
- conn.close()
- socket.socket = socks.socksocket
- # The juicy stuff
- print " ____ _ "
- print " |___ \ | |"
- print " __ _ _ __ ___ _ _ ___ __) | __| |"
- print " / _` | '_ ` _ \| | | / __||__ < / _` |"
- print " | (_| | | | | | | |_| \__ \___) | (_| |"
- print " \__,_|_| |_| |_|\__,_|___|____/ \__,_|"
- print "\n"
- print "Big hecks, no whammies."
- password = raw_input('TOR\'s password ~> ')
- torify(password)
- nick = raw_input('Nick name ~> ')
- serber = raw_input('Server/host ~> ')
- port = raw_input('Port (6667 by default) ~> ')
- channel = raw_input('Channel ~> ')
- irc_cmd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- # The juicy stuff:
- irc_cmd.connect((serber,port))
- irc_cmd.recv (4096)
- irc_cmd.send('NICK ' + nick + '\r\n')
- irc_cmd.send('USER sabu sabu sabu sabu :sabu IRC\r\n')
- irc_cmd.send('JOIN ' + channel + '\r\n')
- # Commands shizzle
- while irc_cmd:
- data = irc_cmd.recv(1024)
- print data
- message = raw_input('Enter message to send ~> ')
- # you could obvs add something like:
- # help_cmd = "HELP OPTIONS: etc"
- # if '!help' in data:
- # irc_cmd.send("PRIVMSG " + channel + ": " + help_cmd + "\r\n")
- # but that is if you are l33t hecker.
- irc_cmd.send("PRIVMSG " + channel + " :" + message + "\r\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement