简体   繁体   中英

Can I filter the content of SSL website using WEBrick proxy server

I'm making content filtering proxy server using WEBrick.

Can I change/filter the content of ssl-encrypted page?

Thanks.

here is my code;

#!/usr/bin/env ruby

require "webrick"
require "webrick/httpproxy"
require "ruby-debug"

include WEBrick

handler = Proc.new do |req, res|
  # res.body is empty when connecting https
  # I wanna chagne the body...
end

server = HTTPProxyServer.new(
  :Port => 4545,
  :ProxyVia => false,
  :ProxyContentHandler => handler,
)

Signal.trap('INT') do
  server.shutdown
end

server.start

You have to Man-In-The-Middle attack.

WEBrick::HTTPProxyServer does not support MITM natively but you can find some third party MITM proxy implementations based on WEBrick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM