简体   繁体   English

我可以使用WEBrick代理服务器过滤SSL网站的内容吗

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

I'm making content filtering proxy server using WEBrick. 我正在使用WEBrick制作内容过滤代理服务器。

Can I change/filter the content of ssl-encrypted page? 我可以更改/过滤ssl加密页面的内容吗?

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. WEBrick :: HTTPProxyServer本机不支持MITM,但是您可以找到一些基于WEBrick的第三方MITM代理实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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