Lucene search
K

Ruby Base64 Encoder

🗓️ 21 Apr 2018 08:54:26Reported by Robin Stenvi <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 24 Views

Ruby Base64 Encoder module for Metasploit framewor

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

class MetasploitModule < Msf::Encoder
  Rank = GreatRanking

  def initialize
    super(
      'Name'             => 'Ruby Base64 Encoder',
      'Description'      => %q{
        This encoder returns a base64 string encapsulated in
        eval(%(base64 encoded string).unpack(%(m0)).first).
      },
      'Author'           => 'Robin Stenvi <robin.stenvi[at]gmail.com>',
      'License'          => BSD_LICENSE,
      'Arch'             => ARCH_RUBY)
  end

  def encode_block(state, buf)
    %w{( ) . % e v a l u n p c k m 0 f i r s t}.each do |c|
      raise BadcharError if state.badchars.include?(c)
    end

    b64 = Rex::Text.encode_base64(buf)

    state.badchars.each_byte do |byte|
      raise BadcharError if b64.include?(byte.chr)
    end

    return "eval(%(" + b64 + ").unpack(%(m0)).first)"
  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