Attackers usually use hacked computer groups to achieve malicious purposes. We call it a botnet" because a hacked computer will execute instructions like a zombie.
To build a botnet, we must introduce a new concept and category. The concept of classes is the basis of object-oriented programming and programming models. In this programming model, we will instantiate various objects and their associated methods together. In our botnet, each individual zombie or client (client) needs to be able to connect to a certain meat machine and send commands to the meat machine.
Let's take a look at the code that generates the Client() class object. In order to construct the client object, the host name, user name, and password or key are required. At the same time, this class also contains the methods needed to maintain the connection with the meat machine-connect(), send_command() and alive(). Please note that when we refer to a variable belonging to a class, it is represented by self followed by the variable name. In order to build a botnet, we have to create a global array called botnet, which records a single client object. Next, we have to write a method named addClient() whose input is the host name, user and password, and instantiate a client object based on this, and add it to the botnet array. The next botnetCommand() function takes only one parameter-the command to be issued. This function traverses the entire array and sends the command to each chient in the botnet array.
test
kalilinux native and msf target