瑞士军刀代理工具,用于随时随地捕获、操作和重放 HTTP/HTTPS 流量

admin 2023年4月4日04:18:36评论74 views字数 4015阅读13分23秒阅读模式

用于快速部署的瑞士军刀代理。支持多种操作,例如通过 DSL 语言、上游 HTTP/Socks5 代理的请求/响应转储、过滤和操作。此外,重播实用程序允许通过简单地将上游代理设置为代理,将转储的流量(具有正确域名的请求/响应)导入 BurpSuite 或任何其他代理。

瑞士军刀代理工具,用于随时随地捕获、操作和重放 HTTP/HTTPS 流量

  • 拦截/操纵HTTP/HTTPS非 HTTP流量

  • 不可见和胖客户端流量代理支持

  • TLS MITM 支持客户端/服务器证书

  • 对上游代理的HTTPSOCKS5支持

  • 流量匹配/过滤和替换DSL 支持

  • 完整的流量转储到文件(请求/响应)

  • 本机嵌入式 DNS 服务器

  • 插件支持解码特定协议(例如 XMPP/SMTP/FTP/SSH/)

  • 在 Burp 中代理流量重放

安装

下载准备运行的二进制文件或使用 GO 安装/构建

go install -v github.com/projectdiscovery/proxify/cmd/proxify@latest

用法

proxify -h

这将显示该工具的帮助。这是它支持的所有开关。

Usage:  ./proxify [flags]
Flags:OUTPUT: -o, -output string Output Directory to store HTTP proxy logs (default "logs") -dump-req Dump only HTTP requests to output file -dump-resp Dump only HTTP responses to output file
UPDATE: -up, -update update proxify to latest version -duc, -disable-update-check disable automatic proxify update check
FILTER: -req-fd, -request-dsl string[] Request Filter DSL -resp-fd, -response-dsl string[] Response Filter DSL -req-mrd, -request-match-replace-dsl string[] Request Match-Replace DSL -resp-mrd, -response-match-replace-dsl string[] Response Match-Replace DSL
NETWORK: -ha, -http-addr string Listening HTTP IP and Port address (ip:port) (default "127.0.0.1:8888") -sa, -socks-addr string Listening SOCKS IP and Port address (ip:port) (default "127.0.0.1:10080") -da, -dns-addr string Listening DNS IP and Port address (ip:port) -dm, -dns-mapping string Domain to IP DNS mapping (eg domain:ip,domain:ip,..) -r, -resolver string Custom DNS resolvers to use (ip:port)
PROXY: -hp, -http-proxy string[] Upstream HTTP Proxies (eg http://proxy-ip:proxy-port) -sp, -socks5-proxy string[] Upstream SOCKS5 Proxies (eg socks5://proxy-ip:proxy-port) -c int Number of requests before switching to the next upstream proxy (default 1)
EXPORT: -max-size int Max export data size (request/responses will be truncated) (default 9223372036854775807) -elastic-address string elasticsearch address (ip:port) -elastic-ssl enable elasticsearch ssl -elastic-ssl-verification enable elasticsearch ssl verification -elastic-username string elasticsearch username -elastic-password string elasticsearch password -elastic-index string elasticsearch index name (default "proxify") -kafka-address string address of kafka broker (ip:port) -kafka-topic string kafka topic to publish messages on (default "proxify")
CONFIGURATION: -config string Directory for storing program information (default "$HOME/.config/proxify") -cert-cache-size int Number of certificates to cache (default 256) -a, -allow string[] Allowed list of IP/CIDR's to be proxied -d, -deny string[] Denied list of IP/CIDR's to be proxied -pt, -passthrough string[] List of passthrough domains
DEBUG: -nc, -no-color No Color (default true) -version Version -silent Silent -v, -verbose Verbose -vv, -very-verbose Very Verbose

运行代理

在端口8888上运行 HTTP 代理

proxify

在自定义端口1111上运行 HTTP 代理

proxify -http-addr ":1111"

TLS 通过

-pt 标志可用于传递(跳过)加密流量而不尝试终止 TLS 连接。

proxify -pt '(.*.)?google.co.in.*'

使用上游代理进行代理

在端口 8888 上运行 HTTP 代理并将流量转发到端口8080上的 burp :

proxify -http-proxy http://127.0.0.1:8080

在端口 8888 上运行 HTTP 代理并将流量转发到 TOR 网络:

proxify -socks5-proxy 127.0.0.1:9050

转储所有 HTTP/HTTPS 流量

将所有流量转储到单独的文件中,请求后跟响应:

proxify -output logs

默认情况下,代理请求/响应存储在日志文件夹中。此外,dump-reqdump-resp标志可用于将请求的特定部分保存到文件中。

使用本地 DNS 解析器的主机名映射

Proxify 支持嵌入 DNS 解析器以将主机名映射到特定地址并为任何其他域名定义上游 dns 服务器

8888使用嵌入式 dns 服务器在端口上运行 HTTP 代理侦听端口53并解析www.google.it192.168.1.1,所有其他都fqdn向上游转发到1.1.1.1

proxify -dns-addr ":53" -dns-mapping "www.google.it:192.168.1.1" -dns-resolver "1.1.1.1:53"

例如,实用程序使用此功能replay来劫持连接和模拟响应。在使用私有 DNS 服务器进行内部评估时,它可能很有用。使用*as 域名匹配所有 dns 请求。

使用 DSL 匹配/过滤流量

如果请求或响应与过滤器匹配,则转储被标记为.match.txt后缀:

proxify -request-dsl "contains(request,'firefox')" -response-dsl "contains(response, md5('test'))"

即时匹配和替换

Proxify 支持使用 DSL 语言动态修改请求和响应。

firefox这是一个将单词从请求替换为的示例chrome

proxify -request-match-replace-dsl "replace(request,'firefox','chrome')"

另一个使用基于正则表达式的响应替换的例子:

proxify -response-match-replace-dsl "replace_regex(response, '^authentication failed$', 'authentication ok')"

将所有流量重放成Burp

如果未指定,则将所有转储的请求/响应重播到目标 URL ( http://127.0.0.1:8080 )。为此,必须将 burp 配置为使用 proxify 作为上游代理,因为它将注意劫持 dns 解析并使用转储请求模拟远程服务器。这允许在 burp 历史记录中准确地包含所有请求/响应,就好像它们最初是通过它发送的一样,例如允许在云上执行远程拦截,并在 burp 中本地合并所有结果。

replay -output "logs/"

安装 SSL 证书

~/.config/proxify/为proxify生成一个证书颁发机构,默认存放在文件夹中,手动可以通过-configflag指定。可以通过在连接到 proxify 的浏览器中访问http://proxify/cacert.crt来导入生成的证书。

根证书的安装步骤类似于其他代理工具,包括将证书添加到系统受信任的根存储。


项目地址:https://github.com/projectdiscovery/proxify

原文始发于微信公众号(Ots安全):瑞士军刀代理工具,用于随时随地捕获、操作和重放 HTTP/HTTPS 流量

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年4月4日04:18:36
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   瑞士军刀代理工具,用于随时随地捕获、操作和重放 HTTP/HTTPS 流量https://cn-sec.com/archives/1649135.html

发表评论

匿名网友 填写信息