CovenantRandomizer.sh 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #!/bin/bash
  2. cat << "EOF"
  3. __ _ ___ ___ _ _ _ __ ___ ___ | |__ _ __ ___ __ _ ___| |__
  4. / _` / __/ __| | | | '_ ` _ \ / _ \_____| '_ \| '__/ _ \/ _` |/ __| '_ \
  5. | (_| \__ \__ \ |_| | | | | | | __/_____| |_) | | | __/ (_| | (__| | | |
  6. \__,_|___/___/\__,_|_| |_| |_|\___| |_.__/|_| \___|\__,_|\___|_| |_|
  7. **Covenant Randomizer**
  8. Based On The GIST By S3cur3Th1sSh1t
  9. https://gist.github.com/S3cur3Th1sSh1t/bf5935b5bff48f9f63bdbb4bcc9e8e3d
  10. Use At Your Own Risk
  11. EOF
  12. echo "Enter A Random Word!"
  13. read Random1
  14. echo ""
  15. echo "Enter A Different Random Word!"
  16. read Random2
  17. echo ""
  18. echo "Enter A Different Random Word!"
  19. read Random3
  20. apt install -y docker.io
  21. custom1=$(echo $custom1 | md5sum | head -c 20)
  22. sudo git clone --recurse-submodules https://github.com/assume-breach/Covenant.git /opt/Covenant
  23. cd /opt/Covenant/Covenant/
  24. mv ./Data/AssemblyReferences/ ../AssemblyReferences/
  25. mv ./Data/ReferenceSourceLibraries/ ../ReferenceSourceLibraries/
  26. mv ./Data/EmbeddedResources/ ../EmbeddedResources/
  27. mv ./Models/Covenant/ ./Models/${Random1^}/
  28. mv ./Components/CovenantUsers/ ./Components/${Random1^}Users/
  29. mv ./Components/Grunts/ ./Components/${Random2^}s/
  30. mv ./Models/Grunts/ ./Models/${Random2^}s/
  31. mv ./Data/Grunt/GruntBridge/ ./Data/Grunt/${Random2^}Bridge/
  32. mv ./Data/Grunt/GruntHTTP/ ./Data/Grunt/${Random2^}HTTP/
  33. mv ./Data/Grunt/GruntSMB/ ./Data/Grunt/${Random2^}SMB/
  34. mv ./Components/GruntTaskings/ ./Components/${Random2^}Taskings/
  35. mv ./Components/GruntTasks/ ./Components/${Random2^}Tasks/
  36. mv ./Data/Grunt/ ./Data/${Random2^}/
  37. find ./ -type f -print0 | xargs -0 sed -i "s/Grunt/${Random2^}/g"
  38. find ./ -type f -print0 | xargs -0 sed -i "s/GRUNT/${Random2^^}/g"
  39. find ./ -type f -print0 | xargs -0 sed -i "s/grunt/${Random2,,}/g"
  40. #find ./ -type f -print0 | xargs -0 sed -i "s/covenant/${Random1,,}/g"
  41. find ./ -type f -print0 | xargs -0 sed -i "s/Covenant/${Random1^}/g"
  42. find ./ -type f -print0 | xargs -0 sed -i "s/COVENANT/${Random1^^}/g"
  43. find ./ -type f -print0 | xargs -0 sed -i "s/ExecuteStager/ExecLevel/g"
  44. #find ./ -type f -print0 | xargs -0 sed -i "s/REPLACE_PROFILE/REP_PROF/g"
  45. #find ./ -type f -print0 | xargs -0 sed -i "s/REPLACE_PIPE/REP_PIP/g"
  46. #find ./ -type f -print0 | xargs -0 sed -i "s/GUID/ANGID/g"
  47. find ./ -type f -print0 | xargs -0 sed -i "s/SetupAES/Install"${custom1}"AES/g"
  48. find ./ -type f -print0 | xargs -0 sed -i "s/SessionKey/Sess"${custom1}"KEy/g"
  49. find ./ -type f -print0 | xargs -0 sed -i "s/EncryptedChallenge/Enc"${custom1}"ChallEnge/g"
  50. find ./ -type f -print0 | xargs -0 sed -i "s/DecryptedChallenges/Decrypt"${custom1}"ChallEnges/g"
  51. find ./ -type f -print0 | xargs -0 sed -i "s/Stage0Body/First"${custom1}"Body/g"
  52. find ./ -type f -print0 | xargs -0 sed -i "s/Stage0Response/First"${custom1}"Response/g"
  53. find ./ -type f -print0 | xargs -0 sed -i "s/Stage0Bytes/First"${custom1}"Bytes/g"
  54. find ./ -type f -print0 | xargs -0 sed -i "s/Stage1Body/Seccond"${custom1}"Body/g"
  55. find ./ -type f -print0 | xargs -0 sed -i "s/Stage1Response/Seccond"${custom1}"Response/g"
  56. find ./ -type f -print0 | xargs -0 sed -i "s/Stage1Bytes/Seccond"${custom1}"Bytes/g"
  57. find ./ -type f -print0 | xargs -0 sed -i "s/Stage2Body/Third"${custom1}"Body/g"
  58. find ./ -type f -print0 | xargs -0 sed -i "s/Stage2Response/Third"${custom1}"Response/g"
  59. find ./ -type f -print0 | xargs -0 sed -i "s/Stage2Bytes/Third"${custom1}"Bytes/g"
  60. find ./ -type f -print0 | xargs -0 sed -i "s/message64str/messAgE"${custom1}"64str/g"
  61. find ./ -type f -print0 | xargs -0 sed -i "s/messageBytes/messAgE"${custom1}"bytes/g"
  62. find ./ -type f -print0 | xargs -0 sed -i "s/totalReadBytes/ToTal"${custom1}"ReaDBytes/g"
  63. #find ./ -type f -print0 | xargs -0 sed -i "s/inputStream/instream/g"
  64. #find ./ -type f -print0 | xargs -0 sed -i "s/outputStream/outstream/g"
  65. find ./ -type f -print0 | xargs -0 sed -i "s/deflateStream/deFlatE"${custom1}"stream/g"
  66. find ./ -type f -print0 | xargs -0 sed -i "s/memoryStream/memOrYstream/g" #don't change
  67. find ./ -type f -print0 | xargs -0 sed -i "s/compressedBytes/packed"${custom1}"bytes/g"
  68. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/REPLACE_/REP"${custom1}"_/g"
  69. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/_PROFILE_/_PROF"${custom1}"_/g"
  70. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/_VALIDATE_/_VA"${custom1}"L_/g"
  71. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/GUID/${Random3^^}/g"
  72. find ./ -type f -name "*.razor" -print0 | xargs -0 sed -i "s/GUID/${Random3^^}/g"
  73. find ./ -type f -name "*.json" -print0 | xargs -0 sed -i "s/GUID/${Random3^^}/g"
  74. find ./ -type f -name "*.yaml" -print0 | xargs -0 sed -i "s/GUID/${Random3^^}/g"
  75. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/guid/${Random3,,}/g"
  76. find ./ -type f -name "*.razor" -print0 | xargs -0 sed -i "s/guid/${Random3,,}/g"
  77. find ./ -type f -name "*.json" -print0 | xargs -0 sed -i "s/guid/${Random3,,}/g"
  78. find ./ -type f -name "*.yaml" -print0 | xargs -0 sed -i "s/guid/${Random3,,}/g"
  79. find ./ -type f -print0 | xargs -0 sed -i "s/ProfileHttp/Prof"${custom1}"HTTP/g"
  80. find ./ -type f -print0 | xargs -0 sed -i "s/baseMessenger/bAse"${custom1}"mEsSenger/g"
  81. find ./ -type f -print0 | xargs -0 sed -i "s/PartiallyDecrypted/Part"${custom1}"decrypted/g"
  82. find ./ -type f -print0 | xargs -0 sed -i "s/FullyDecrypted/Fulld"${custom1}"ecrypted/g"
  83. find ./ -type f -print0 | xargs -0 sed -i "s/compressedBytes/packed"${custom1}"bytes/g"
  84. find ./ -type f -print0 | xargs -0 sed -i "s/CookieWebClient/d"${custom1}"WebClient/g"
  85. #find ./ -type f -print0 | xargs -0 sed -i "s/CookieContainer/KekseContains/g"
  86. #find ./ -type f -print0 | xargs -0 sed -i "s/GetWebRequest/DoAnWebReq/g"
  87. find ./ -type f -print0 | xargs -0 sed -i "s/Jitter/JIt"${custom1}"ter/g"
  88. find ./ -type f -print0 | xargs -0 sed -i "s/ConnectAttempts/ConneCT"${custom1}"AttEmpts/g"
  89. find ./ -type f -print0 | xargs -0 sed -i "s/RegisterBody/Reg"${custom1}"Body/g"
  90. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/messenger/meSsenGer"${custom1}"/g"
  91. find ./ -type f -print0 | xargs -0 sed -i "s/Hello World/"${custom1}"/g"
  92. find ./ -type f -print0 | xargs -0 sed -i "s/ValidateCert/Val"${custom1}"CerT/g"
  93. find ./ -type f -print0 | xargs -0 sed -i "s/UseCertPinning/UsCert"${custom1}"Pin/g"
  94. find ./ -type f -print0 | xargs -0 sed -i "s/EncryptedMessage/Enc"${custom1}"Msg/g"
  95. find ./ -type f -print0 | xargs -0 sed -i "s/cookieWebClient/"${custom1}"WebClient/g" #ottos
  96. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/aes/crypt"${custom1}"var/g"
  97. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/aes2/crypt"${custom1}"var2/g"
  98. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array5/ar"${custom1}"r5/g"
  99. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array6/ar"${custom1}"r6/g"
  100. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array4/ar"${custom1}"r4/g"
  101. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array7/ar"${custom1}"r7/g"
  102. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array1/ar"${custom1}"r1/g"
  103. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array2/ar"${custom1}"r2/g"
  104. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/array3/ar"${custom1}"r3/g"
  105. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/list1/l"${custom1}"i1/g"
  106. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/list2/l"${custom1}"i2/g"
  107. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/list3/l"${custom1}"i3/g"
  108. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/list4/l"${custom1}"i4/g"
  109. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/list5/l"${custom1}"i5/g"
  110. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group0/gr"${custom1}"p0/g"
  111. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group1/gr"${custom1}"p1/g"
  112. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group2/gr"${custom1}"p2/g"
  113. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group3/gr"${custom1}"p3/g"
  114. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group4/gr"${custom1}"p4/g"
  115. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group5/gr"${custom1}"p5/g"
  116. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group6/gr"${custom1}"p6/g"
  117. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group7/gr"${custom1}"p7/g"
  118. find ./ -type f -name "*.cs" -print0 | xargs -0 sed -i "s/group8/gr"${custom1}"p8/g"
  119. find ./ -type f -name "*Grunt*" | while read FILE ; do
  120. newfile="$(echo ${FILE} |sed -e "s/Grunt/${Random2^}/g")";
  121. mv "${FILE}" "${newfile}";
  122. done
  123. find ./ -type f -name "*GRUNT*" | while read FILE ; do
  124. newfile="$(echo ${FILE} |sed -e "s/GRUNT/${Random2^^}/g")";
  125. mv "${FILE}" "${newfile}";
  126. done
  127. find ./ -type f -name "*grunt*" | while read FILE ; do
  128. newfile="$(echo ${FILE} |sed -e "s/grunt/${Random2,,}/g")";
  129. mv "${FILE}" "${newfile}";
  130. done
  131. find ./ -type f -name "*Covenant*" | while read FILE ; do
  132. newfile="$(echo ${FILE} |sed -e "s/Covenant/${Random1^}/g")";
  133. mv "${FILE}" "${newfile}";
  134. done
  135. find ./ -type f -name "*COVENANT*" | while read FILE ; do
  136. newfile="$(echo ${FILE} |sed -e "s/COVENANT/${Random2^^}/g")";
  137. mv "${FILE}" "${newfile}";
  138. done
  139. #find ./ -type f -name "*covenant*" | while read FILE ; do
  140. # newfile="$(echo ${FILE} |sed -e "s/covenant/ottocommand/g")";
  141. # mv "${FILE}" "${newfile}";
  142. #done
  143. mv ../AssemblyReferences/ ./Data/
  144. mv ../ReferenceSourceLibraries/ ./Data/
  145. mv ../EmbeddedResources/ ./Data/
  146. docker build -t covenant .