Python hacker attack and defense, build SSH botnet!

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

Python hacker attack and defense, build SSH botnet!  Hackers are not hard to spread

 

I still want to recommend the Python learning group I built by myself : 721195303. All students in the group are learning Python. If you want to learn or are learning Python, you are welcome to join. Everyone is a software development party and shares dry goods from time to time (only Python software development related), including a copy of the latest Python advanced materials and zero-based teaching compiled by myself in 2021. Welcome friends who are in advanced and interested in Python to join!
 

Guess you like

Origin blog.csdn.net/aaahtml/article/details/114359140