
BinProxy는 임의의 TCP 연결을 위한 프록시입니다. BinData gem을 사용하여 사용자 정의 메시지 형식을 정의할 수 있습니다.
BinProxy는 임의의 TCP 연결을 위한 프록시입니다. BinData gem을 사용하여 사용자 정의 메시지 형식을 정의할 수 있습니다.
sudo apt install build-essential ruby-dev 명령어면 충분합니다.--tls를 사용하려면 openssl 바이너리가 필요합니다.gem install binproxy
Ruby 설치에 따라 sudo를 사용해야 할 수 있습니다.
git clone https://github.com/nccgroup/BinProxy.git binproxy
cd binproxy
# Install ruby dependencies.
# Depending on your setup, one or both of these may require sudo.
gem install bundler && bundle
# The UI is built with a webpack/babel toolchain:
(cd ui && npm install) \
&& rake build-ui
# Confirm that everything works
# run.sh sets up the environment and passes all args to binproxy
./run.sh --help
gem 패키지를 빌드하고 설치하려면:
gem build binproxy.gemspec
# Again, you may need sudo here
gem install binproxy-1.0.0.gem
설치 문제에 대한 버그 보고는 환영합니다!
binproxy를 실행합니다.전체 목록은 --help를 참조하세요. 간단히 설명하면:
binproxy -c <class> [<local-host>] <local-port> <remote-host> <remote-port>
-c 인수를 생략하면 간단한 16진수 덤프가 표시됩니다.
로컬 호스트를 생략하면 binproxy는 localhost를 가정합니다.
--socks-proxy 또는 --http-proxy 옵션을 사용하면 원격 호스트와 포트가 동적으로 결정되며 지정해서는 안 됩니다.
# Proxy from localhost:9000 -> example.com:9000
binproxy localhost 9000 example.com 9000
# Act as a SOCKS proxy on localhost:1080
# MITM and unwrap TLS on the proxied traffic, using a self-signed cert and key
binproxy -S --tls 1080
# "Poor substitute for Burp" mode:
#
# HTTP proxy; MITM TLS w/ pre-generated cert; simple header parsing
# Note: this will only work on HTTPS traffic, not plain HTTP!
# If you're working with the source repo, you generate the certs with:
# rake makecert[example.com]
# And then import certs/ca-cert.pem into your browser or OS's trust store.
binproxy -H --tls \
--tls-cert certs/example.com-cert.pem \
--tls-key certs/example.com-key.pem \
--class-name DumbHttp::Message \
localhost 8080
기본적으로 프록시는 내장된 RawMessage 클래스를 사용하며, 각 메시지의 16진수 덤프를 제공합니다(메시지와 TCP 패킷이 1:1이라고 가정).
--class 명령줄 인수로 BinData::Record 하위 클래스†를 지정하면 구문 분석된 프로토콜 정보를 볼 수 있습니다.
클래스에 다음을 정의할 수도 있습니다:
def summary
# return a single-line description of this record
end
# currently supported options are
# - nil : use default display
# - "anon" : for structs, show contents directly
# - "hex" : for numbers, display as 0x1234ABCD
# - "hexdump" : for strings, display like `hexdump -C`
default_parameter display_as: "..."
# TODO: document state stuff
def self.initial_state
end
def current_state
end
def update_state
end
† 기술적으로 BinData::Base의 모든 하위 클래스가 작동합니다.
기본적으로 BinProxy는 모든 트래픽을 고정 업스트림 호스트 및 포트로 중계합니다. 또한 각각 --socks-proxy 및 --http-proxy 플래그를 사용하여 SOCKS(v4 또는 v4a) 또는 HTTP 프록시로 작동하도록 구성할 수 있습니다.
참고: 현재 HTTP 프록시는 HTTP CONNNECT 동사로 터널링된 연결만 지원합니다. 원시 HTTP GET, POST 등의 요청은 프록시할 수 없습니다. 실제로 이는 클라이언트가 curl -p와 같이 터널링을 강제하는 플래그를 지원하지 않는 한 HTTPS 트래픽은 작동하지만 일반 HTTP 트래픽은 작동하지 않음을 의미합니다.
--tls 플래그를 사용하여 메시지를 처리하기 전에 TLS 암호화를 해제합니다. 기본적으로 BinProxy는 자체 서명된 인증서를 생성합니다. --tls-cert 및 --tls-key로 인증서와 키가 포함된 PEM 파일을 지정할 수 있습니다. (소스 리포지토리를 클론한 경우 rake makecert[example.com]를 사용하여 정적 CA와 적절한 호스트 이름의 인증서를 생성합니다.)
임의의 아이디어와 희망 사항 목록은 TODO 파일도 참조하세요.
BinProxy의 핵심 TCP 프록시 기능은 Sean Devlin이 작성한 특수 목적 프록시에서 비롯되었습니다. Rusty Burchfield가 해당 프록시의 HTML UI를 기여했습니다. 코드가 충분히 변경되어 더 이상 현재 버그에 대해 비난할 수 없지만, BinProxy는 그들의 작업 없이는 존재하지 않았을 것입니다.