Sha256: 9081c2179a08f40f4952b595553c9d8d2085ffd1cb0d2986defd8543bd5be8c2

Contents?: true

Size: 963 Bytes

Versions: 10

Compression:

Stored size: 963 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'ronin/support/network/ssl/proxy'

Ronin::Support::Network::SSL::Proxy.start(port: 1337, server: ['example.com', 443]) do |proxy|
  address = ->(socket) {
    addrinfo = socket.peeraddr

    "#{addrinfo[3]}:#{addrinfo[1]}"
  }

  proxy.on_client_data do |client,server,data|
    puts "#{address[client]} -> #{proxy}"
    puts data
  end

  proxy.on_client_connect do |client|
    puts "#{address[client]} -> #{proxy} [connected]"
  end

  proxy.on_client_disconnect do |client,server|
    puts "#{address[client]} <- #{proxy} [disconnected]"
  end

  proxy.on_server_data do |client,server,data|
    puts "#{address[client]} <- #{proxy}"
    puts data
  end

  proxy.on_server_connect do |client,server|
    puts "#{address[client]} <- #{proxy} [connected]"
  end

  proxy.on_server_disconnect do |client,server|
    puts "#{address[client]} <- #{proxy} [disconnected]"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ronin-support-1.1.0 examples/ssl_proxy.rb
ronin-support-1.1.0.rc2 examples/ssl_proxy.rb
ronin-support-1.0.7 examples/ssl_proxy.rb
ronin-support-1.1.0.rc1 examples/ssl_proxy.rb
ronin-support-1.0.6 examples/ssl_proxy.rb
ronin-support-1.0.5 examples/ssl_proxy.rb
ronin-support-1.0.4 examples/ssl_proxy.rb
ronin-support-1.0.3 examples/ssl_proxy.rb
ronin-support-1.0.2 examples/ssl_proxy.rb
ronin-support-1.0.1 examples/ssl_proxy.rb