

It's responsible for identifying other nodes and location addressing. To do this, we must know our master's IP address. Also, now that your slave is running, let's find master. This is one place the user's username is stored so let's use that. Using the C function getenv() with argument "USER" returns whatever the computer has stored in the USER environment variable. However, to make things more readable for regular humans, let's use the computer's username. Using an IP address is probably the best because it's a unique identifier for each client. There are many naming conventions that can be used. When starting a new node in our server, we should probably name it so master knows which clients to deploy commands to. All implemented function signatures can be found in either lib/connect.h or lib/utils.h.
#Agobot botnet command and control architecture free
Note that many constants have been defined in lib/macros.h so feel free to use those. The goal here is to make our slave node as simple as possible and adhere to the requirements detailed above. Let's move on to the more interesting bit: recieving and executing remote commands (We'll worry about disguising our malware later). No more work needed here! Our master is ready for use. I've slightly adjusted the netcat server and compiled it to a binary called "master". It's just a convienient, established tool that we can re-purpose to send text packets to an from clients (which is all a master really is). For the master server, we can use an open-source TCP server callet Netcat. This hackpack will primarily deal with implementing the client malware. We'll implement a simple slave node for a C&C botnet. However, for the purposes of this hackpack, let's keep things simple. Taking down such botnets is an interesting read by itself. These botnets pose a large headache to security experts because there's no central point of control and can grow to millions of nodes. More recent and sophisticated botnets follow peer-to-peer architecture, where admin rights are distributed across either all nodes or a subset of nodes in the network. However, this style of botnets is anitquated and can easily be taken down by cutting access to the master domain. These botnets have one master server and many slave servers. This structure is characteristic of what's known as Command & Control botnets. Transmit commands from the master node to the slave node, execute, and return an output back to master.Deploy disguised malware/slave nodes on host computers.Include a master node that controls all other nodes on the network.But in order to build our botnet successfully, we need to ensure the following features in our working network. There is a lot of variance between how botnets implement certain tasks. Most prominent are perhaps the Mirai and Gameover Zeus which controlled 3.8 thousand and 3.6 million IoT devices respectively. You may have heard of many botnets in the past. They've been used for everything from Distributed Denial of Service attacks to widely deploying spyware. Optionally, they can choose to relay information back to other nodes in the network. A botnet is a network of computers that are capable of recieving commands remotely and deploying them locally. What is a botnet?īefore you build a botnet, its important to understand what a botnet is. Privacy is important so please respect it. Most importantly, this hackpack is meant to be tested and deployed locally (so please don't share anything you build related to this hackpack with other hackers).

The concepts learned in this hackpack have far reaching use cases (basically anything having to do with networking). This hackpack is solely a case study of botnets for educational purposes. Note: Don't use anything you learn here for malevolent purposes. If you liked this tutorial, be sure to star this repo! It might help if you've worked with C before. This hackpack will walk you through implementing a basic framework that fundamentally characterizes a botnet.
