Class: Ronin::Listener::CLI::Commands::Http Private
- Inherits:
-
Ronin::Listener::CLI::Command
- Object
- Core::CLI::Command
- Ronin::Listener::CLI::Command
- Ronin::Listener::CLI::Commands::Http
- Includes:
- Core::CLI::Logging
- Defined in:
- lib/ronin/listener/cli/commands/http.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Starts a HTTP server for receiving exfiltrated data.
Usage
ronin-listener http [options]
Options
-o, --output FILE The output file to write HTTP requests to
-F, --output-format txt|csv|json|ndjson
The output format
-H, --host IP The interface to listen on (Default: 0.0.0.0)
-p, --port PORT The port to listen on (Default: 8080)
--vhost HOST The Host: header to filter requests by
-R, --root DIR The root directory to filter requests by (Default: /)
-h, --help Print help information
Examples
ronin-listener http -H 127.0.0.1 -p 8080
ronin-listener http -H 127.0.0.1 -p 8080 --vhost example.com
Instance Method Summary collapse
-
#run ⇒ Object
private
Runs the
ronin-listener http
command. -
#server_kwargs ⇒ Hash{Symbol => Object}
private
Maps options to keyword arguments for
Ronin::Listener::HTTP.listen
.
Instance Method Details
#run ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Runs the ronin-listener http
command.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/ronin/listener/cli/commands/http.rb', line 118 def run output_file = if [:output] [:output_format].open([:output]) end log_info "Listening on #{[:host]}:#{[:port]} ..." Ronin::Listener::HTTP.listen(**server_kwargs) do |request| log_info "Received HTTP request from #{request.remote_ip}:#{request.remote_port} ..." puts(request) output_file << request if output_file end end |
#server_kwargs ⇒ Hash{Symbol => Object}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Maps options to keyword arguments for
Ronin::Listener::HTTP.listen
.
140 141 142 143 144 145 146 147 |
# File 'lib/ronin/listener/cli/commands/http.rb', line 140 def server_kwargs { host: [:host], port: [:port], vhost: [:vhost], root: [:root] } end |