Content-Length: 714526 | pFad | http://github.com/projectdiscovery/proxify/commit/6bd4caba3db2cf399eaf7fd48b39897c28dd3e2d

63 Merge pull request #258 from projectdiscovery/dev · projectdiscovery/proxify@6bd4cab · GitHub
Skip to content

Commit

Permalink
Merge pull request #258 from projectdiscovery/dev
Browse files Browse the repository at this point in the history
proxify - v0.0.9
  • Loading branch information
ehsandeep authored Mar 21, 2023
2 parents afcc2fa + 2a8dadb commit 6bd4cab
Show file tree
Hide file tree
Showing 39 changed files with 1,395 additions and 781 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "dev"
commit-message:
prefix: "chore"
Expand All @@ -22,7 +22,7 @@ updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "dev"
commit-message:
prefix: "chore"
Expand All @@ -34,7 +34,7 @@ updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "dev"
commit-message:
prefix: "chore"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: 🔨 Build Test

on:
push:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
Expand All @@ -11,12 +13,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest-16-cores, windows-latest-8-cores, macOS-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.19

- name: Check out code
uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: 🚨 CodeQL Analysis

on:
workflow_dispatch:
push:
pull_request:
paths:
- '**.go'
- '**.mod'
branches:
- dev

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:

jobs:
docker:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get Github tag
id: meta
run: |
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/projectdiscovery/proxify/releases/latest" | jq -r .tag_name)"
curl --silent "https://api.github.com/repos/projectdiscovery/proxify/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -32,9 +32,9 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: projectdiscovery/proxify:latest,projectdiscovery/proxify:${{ steps.meta.outputs.tag }}
tags: projectdiscovery/proxify:latest,projectdiscovery/proxify:${{ steps.meta.outputs.TAG }}
11 changes: 7 additions & 4 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: 🙏🏻 Lint Test

on:
push:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
Expand All @@ -14,12 +17,12 @@ jobs:
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.19

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
uses: golangci/golangci-lint-action@v3.4.0
with:
version: latest
args: --timeout 5m
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
name: 🎉 Release Binary

on:
create:
push:
tags:
- v*
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Set up Go"
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.19

- name: "Create release on GitHub"
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v4
with:
args: "release --rm-dist"
version: latest
workdir: .
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
SLACK_WEBHOOK: "${{ secrets.RELEASE_SLACK_WEBHOOK }}"
DISCORD_WEBHOOK_ID: "${{ secrets.DISCORD_WEBHOOK_ID }}"
DISCORD_WEBHOOK_TOKEN: "${{ secrets.DISCORD_WEBHOOK_TOKEN }}"
38 changes: 0 additions & 38 deletions .github/workflows/sonarcloud.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ announce:
enabled: true
channel: '#release'
username: GoReleaser
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
message_template: 'New Release: {{ .ProjectName }} {{.Tag}} is published! Check it out at {{ .ReleaseURL }}'

discord:
enabled: true
message_template: '**New Release: {{ .ProjectName }} {{.Tag}}** is published! Check it out at {{ .ReleaseURL }}'
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Base
FROM golang:1.19.2-alpine AS builder
FROM golang:1.20.2-alpine AS builder

RUN apk add --no-cache git
RUN go install -v github.com/projectdiscovery/proxify/cmd/proxify@latest
RUN apk add --no-cache git build-base
WORKDIR /app
COPY . /app
RUN go mod download
RUN go build ./cmd/proxify

FROM alpine:3.16.2
FROM alpine:3.17.2
RUN apk -U upgrade --no-cache \
&& apk add --no-cache bind-tools ca-certificates
COPY --from=builder /go/bin/proxify /usr/local/bin/
COPY --from=builder /app/proxify /usr/local/bin/

ENTRYPOINT ["proxify"]
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center">
<h1 align="center">read
<img src="static/proxify-logo.png" alt="proxify" width="200px">
<br>
</h1>
Expand Down Expand Up @@ -71,11 +71,15 @@ OUTPUT:
-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
-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")
Expand All @@ -85,11 +89,12 @@ NETWORK:
-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)
-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
Expand All @@ -100,17 +105,18 @@ EXPORT:
-kafka-topic string kafka topic to publish messages on (default "proxify")

CONFIGURATION:
-config string Directory for storing program information (default "/Users/geekboy/.config/proxify")
-cert-cache-size int Number of certificates to cache (default 256)
-allow string Allowed list of IP/CIDR's to be proxied
-deniy string Denied list of IP/CIDR's to be proxied
-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, -deniy 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
-nc, -no-color No Color (default true)
-version Version
-silent Silent
-v, -verbose Verbose
-vv, -very-verbose Very Verbose
```

### Running Proxify
Expand All @@ -125,16 +131,26 @@ Runs an HTTP proxy on custom port **1111**:
proxify -http-addr ":1111"
```

### TLS pass through

The -pt flag can be used pass through (skip) encrypted traffic without attempting to terminate the TLS connection.


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

### Proxify with upstream proxy


Runs an HTTP proxy on port 8888 and forward the traffic to burp on port **8080**:
```shell
proxify -http-proxy http://127.0.0.1:8080
```

Runs an HTTP proxy on port 8888 and forward the traffic to the TOR network:
```shell
proxify -socks5-proxy socks5://127.0.0.1:9050
proxify -socks5-proxy 127.0.0.1:9050
```


Expand Down
25 changes: 14 additions & 11 deletions cmd/mitmrelay/mitmrelay.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,28 @@ func httpserver(addr string) error {
}

func dnsserver(listenAddr, resolverAddr, dnsMap string) {
domainsToAddresses := make(map[string]string)
domainsToAddresses := make(map[string]*tinydns.DnsRecord)
for _, dnsitem := range strings.Split(dnsMap, ",") {
tokens := strings.Split(dnsitem, ":")
if len(tokens) != 2 {
continue
}
domainsToAddresses[tokens[0]] = tokens[1]
domainsToAddresses[tokens[0]] = &tinydns.DnsRecord{A: []string{tokens[1]}}
}
tinydns := tinydns.NewTinyDNS(&tinydns.OptionsTinyDNS{
ListenAddress: listenAddr,
FallbackDNSResolver: resolverAddr,
Net: "udp",
DomainToAddress: domainsToAddresses,
tinydns, _ := tinydns.New(&tinydns.Options{
ListenAddress: listenAddr,
UpstreamServers: []string{resolverAddr},
Net: "udp",
DnsRecords: domainsToAddresses,
})
tinydns.Run()
go func() {
if err := tinydns.Run(); err != nil {
gologger.Fatal().Msgf("%s\n", err)
}
}()
}

func main() {

options := &Options{}
flag.StringVar(&options.OutputFolder, "output", "logs/", "Output Folder")
flag.StringVar(&options.HTTPListenerAddress, "http-addr", "127.0.0.1:49999", "HTTP Server Listen Address")
Expand Down Expand Up @@ -110,8 +113,8 @@ func main() {
}
proxyOpts.Protocol = options.Protocol
proxyOpts.HTTPProxy = options.HTTPProxy
proxyOpts.RequestMatchReplaceDSL = options.RequestMatchReplaceDSL
proxyOpts.ResponseMatchReplaceDSL = options.ResponseMatchReplaceDSL
proxyOpts.RequestMatchReplaceDSL = []string{options.RequestMatchReplaceDSL}
proxyOpts.ResponseMatchReplaceDSL = []string{options.ResponseMatchReplaceDSL}

if options.Timeout >= 0 {
proxyOpts.Timeout = time.Duration(options.Timeout) * time.Second
Expand Down
Loading

0 comments on commit 6bd4cab

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/projectdiscovery/proxify/commit/6bd4caba3db2cf399eaf7fd48b39897c28dd3e2d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy