Ruby MITM代理 [英] Ruby MITM proxy

查看:226
本文介绍了Ruby MITM代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些关于如何在支持HTTPS的Ruby中编写代理的示例。我有一个使用Webricks HTTPProxyServer实现的简单代理,但我注意到,HTTPS流量只是隧道(因为它应该;))。但我想用录像机录制内容(关于我的问题,请点击此处 VCRProxy:记录PhantomJS ajax在Capybara内部使用VCR调用)只要内容只是通过,VCR就无法记录它。

I'm searching for some examples on how to write a proxy in Ruby that supports HTTPS. I have a simple proxy implemented with Webricks HTTPProxyServer, but I noticed, that HTTPS traffic is just tunneling (as it should ;) ). But I want to record the content with VCR (regarding my question here VCRProxy: Record PhantomJS ajax calls with VCR inside Capybara) and as long the content is only tunnled through, VCR can't record it.

所以我在考虑将代理编写为中间人,动态生成SSL证书(我不关心证书错误,仅用于测试),然后我就能记录内容/稍后再播放。

So I was thinking of writing the proxy as a man-in-the-middle, generate SSL certificates on the fly (I don't care about certificate errors, its just for testing), and then I would be able to record the content / playback it later.

因此,如果有人从如何开始,或教程或要点有一个很好的资源,请告诉我。

So if somebody has a good ressource from how to start, or a tutorial or a gist, please let me know.

PS:我已经看过这个问题了,但是他们没有提供任何进一步的东西(而且它需要在红宝石中):

PS: I have already seen this questions, but they don't provide any further stuff (and it need to be in ruby):

  • Man in the Middle (MITM) proxy with HTTPS support
  • How do I write a simple HTTPS proxy server in Ruby?
  • Help with HTTP Intercepting Proxy in Ruby?

推荐答案

一个老问题,但为了完整起见,这里有另一个答案。

An old question, but for the sake of completeness here goes another answer.

我在Ruby中实现了一个HTTP / HTTPS拦截代理,项目是托管在github

I've implemented a HTTP/HTTPS interception proxy in Ruby, the project is hosted in github.

项目是新的,所以它还不像Python的 mitmproxy 那样成熟,但它支持HTTPS并生成证书飞行。

The project is new, so it's not (yet) as mature as Python's mitmproxy, but it supports HTTPS with certificates generation on-the-fly.

这篇关于Ruby MITM代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆