如何在反向代理模式下对 Fiddler 进行编程以限制 IP 范围?
我已将 Fiddler 配置为端口 8888 上的反向代理(转发到 80 )使用其规则文件。现在我想限制可以访问反向代理的IP范围作为安全措施。
是否可以仅使用 Fiddler 规则文件来完成此操作,而无需配置防火墙或 Fiddler 编程之外的任何内容?
I've configured Fiddler as a reverse proxy on port 8888 (to forward to 80) using its rules file. Now I want to restrict the IP range that can access the reverse proxy as a security measure.
Is it possible to do this using only the Fiddler rules file without needing to configure the firewall or anything external to the Fiddler programming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
规则>自定义规则。滚动到 OnBeforeRequest。
在那里,您可以使用属性
oSession["X-CLIENTIP"]
获取客户端的 IP 地址,如果您对该值不满意,请执行oSession.oRequest.FailSession 之类的操作(403,“代理访问被拒绝”,“您无权使用此站点。”);
由问题作者更新
使用的示例脚本:
另请注意,IPv6 可能会带来麻烦进入事物,因为X-CLIENTIP 可以
192.168.100.139
或::ffff:192.168.100.139
此时,程序员可能会考虑使用正则表达式测试,例如与 IP# 的任一形式匹配的正则表达式测试:Rules > Customize Rules. Scroll to OnBeforeRequest.
There, you can get the client's IP address using the property
oSession["X-CLIENTIP"]
, and if you're not satisfied with the value, do something likeoSession.oRequest.FailSession(403, "Proxy access denied", "You are not permitted to use this site.");
Update by question author
Sample script used:
Also note that IPv6 might throw a monkey wrench into things because X-CLIENTIP can be
192.168.100.139
or::ffff:192.168.100.139
At this point the programmer might consider using regex tests like this one that matches either incarnation of the IP#: