Lucene search
K

SPARC DWORD XOR Encoder

🗓️ 15 Jan 2006 21:26:20Reported by optyx <optyx@no$email.com>, hdm <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 10 Views

SPARC DWORD XOR Encoder with tweak

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Encoder::XorAdditiveFeedback

  def initialize
    super(
      'Name'             => 'SPARC DWORD XOR Encoder',
      'Description'      => %q{
        This encoder is optyx's 48-byte SPARC encoder with some tweaks.
      },
      'Author'           => [ 'optyx', 'hdm' ],
      'Arch'             => ARCH_SPARC,
      'License'          => MSF_LICENSE,
      'Decoder'          =>
        {
          'KeySize'    => 4,
          'BlockSize'  => 4,
          'KeyPack'    => 'N',
        })
  end

  #
  # Returns the decoder stub
  #
  def decoder_stub(state)
    Rex::Arch::Sparc.set_dword(state.key, 'l1') +
    "\x20\xbf\xff\xff" +   # bn,a  _start - 4
    "\x20\xbf\xff\xff" +   # bn,a  _start
    "\x7f\xff\xff\xff" +   # call  _start + 4
    "\xea\x03\xe0\x20" +   # ld    [%o7 + 0x20],%l7
    "\xaa\x9d\x40\x11" +   # xorcc %l5,%l1,%l5
    "\xea\x23\xe0\x20" +   # st    %l5,[%o7 + 0x20]
    "\xa2\x04\x40\x15" +   # add   %l1,%l5,%l1
    "\x81\xdb\xe0\x20" +   # flush %o7 + 0x20
    "\x12\xbf\xff\xfb" +   # bnz   dec_loop
    "\x9e\x03\xe0\x04"     # add   %o7,4,%o7
  end

  #
  # Append the decoder key now that we're done
  #
  def encode_end(state)
    state.encoded += [ state.key.to_i ].pack('N')
  end

  #
  # Verify that the chosen key doesn't become an invalid byte due to
  # the set_dword() result (22/10 bit split)
  #
  def find_key_verify(buf, key_bytes, badchars)
    return ( has_badchars?(
      Rex::Arch::Sparc.set_dword(key_bytes_to_integer(key_bytes), 'l1'),
      badchars
    ) ? false : true)
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

24 Jul 2017 13:26Current
10