Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go version update #113

Merged
merged 3 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18

- name: Check out code
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
uses: actions/checkout@v3

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

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.1.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
fetch-depth: 0

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

- name: "Create release on GitHub"
uses: goreleaser/goreleaser-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

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

- name: Run unit Tests
run: |
Expand Down
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">
<img src="static/proxify-logo.png" alt="proxify" width="200px"></a>
<img src="static/proxify-logo.png" alt="proxify" width="200px">
<br>
</h1>

Expand All @@ -25,17 +25,17 @@
</p>

Swiss Army Knife Proxy for rapid deployments. Supports multiple operations such as request/response dump, filtering and manipulation via DSL language, upstream HTTP/Socks5 proxy.
Additionally a replay utility allows to import the dumped traffic (request/responses with correct domain name) into burp or any other proxy by simply setting the upstream proxy to proxify.
Additionally, a replay utility allows to import the dumped traffic (request/responses with correct domain name) into BurpSuite or any other proxy by simply setting the upstream proxy to proxify.

# Features

<h1 align="left">
<img src="static/proxify-run.png" alt="proxify" width="700px"></a>
<img src="static/proxify-run.png" alt="proxify" width="700px">
<br>
</h1>


- Intercept / Manipulate **HTTP/HTTPS** & **NON-HTTTP** traffic
- Intercept / Manipulate **HTTP/HTTPS** & **NON-HTTP** traffic
- **Invisible & Thick clients** traffic proxy support
- TLS MITM support with client/server certificates
- **HTTP** and **SOCKS5** support for upstream proxy
Expand All @@ -49,19 +49,19 @@ Additionally a replay utility allows to import the dumped traffic (request/respo

Download the ready to run [binary](https://github.com/projectdiscovery/proxify/releases/) or install/build using GO

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

# Usage

```sh
```shell
proxify -h
```

This will display help for the tool. Here are all the switches it supports.

```console
```shell
Usage:
./proxify [flags]

Expand Down Expand Up @@ -114,73 +114,73 @@ DEBUG:

### Running Proxify

Runs a HTTP proxy on port **8888**
```sh
Runs an HTTP proxy on port **8888**:
```shell
proxify
```

Runs a HTTP proxy on custom port **1111**
```sh
Runs an HTTP proxy on custom port **1111**:
```shell
proxify -http-addr ":1111"
```

### Proxify with upstream proxy

Runs a HTTP proxy on port 8888 and forward the traffic to burp on port 8080
```sh
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 a HTTP proxy on port 8888 and forward the traffic to the TOR network
```sh
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
```


### Dump all the HTTP/HTTPS traffic

Dump all the traffic into separate files with request followed by the response.
Dump all the traffic into separate files with request followed by the response:

```sh
```shell
proxify -output logs
```

As default, proxied request/resposed are stored in the **logs** folder. Additionally **dump-req** or **dump-resp** flag can be used for saving specfic part of the request to the file.
As default, proxied requests/responses are stored in the **logs** folder. Additionally, **dump-req** or **dump-resp** flag can be used for saving specific part of the request to the file.


### Hostname mapping with Local DNS resolver

Proxify supports embedding DNS resolver to map hostnames to specific addresses and define an upstream dns server for any other domain name

Runs a HTTP proxy on port `8888` using an embedded dns server listening on port `53` and resolving `www.google.it` to `192.168.1.1` and all other `fqdn` are forwarded upstream to `1.1.1.1`
Runs an HTTP proxy on port `8888` using an embedded dns server listening on port `53` and resolving `www.google.it` to `192.168.1.1` and all other `fqdn` are forwarded upstream to `1.1.1.1`:

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

This feature is used for example by the `replay` utility to hijack the connections and simulate responses. It may be useful during internal assessments with private dns servers. Using `*` as domain name matches all dns requests.

### Match/Filter traffic with with DSL language.
### Match/Filter traffic with DSL

If the request or response match the filters the dump is tagged with `.match.txt` suffix:

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

### Match and Replace on the fly

Proxify supports modifying Request and Responses on the fly with DSL language.

```sh
```shell
proxify -request-match-replace-dsl "replace(request,'firefox','chrome')" -response-match-replace-dsl "regex(response, '^authentication failed$', 'authentication ok')"
```

### Replay all traffic into burp

Replay all the dumped requests/responses into the destination URL (http://127.0.0.1:8080) if not specified. For this to work it's necessary to configure burp to use proxify as upstream proxy, as it will take care to hijack the dns resolutions and simulate the remote server with the dumped request. This allows to have in the burp history exactly all requests/responses as if they were originally sent through it, allowing for example to perform a remote interception on cloud, and merge all results locally within burp.

```sh
```shell
replay -output "logs/"
```

Expand All @@ -192,23 +192,23 @@ Installation steps for the Root Certificate is similar to other proxy tools whic

### Applications of Proxify

Proxify can be used for multiple places, here are some common example where Proxify comes handy:-
Proxify can be used for multiple places, here are some common example where Proxify comes handy:

<details>
<summary>👉 Storing all the burp proxy history logs locally. </summary>

Runs a HTTP proxy on port 8888 and forward the traffic to burp on port 8080
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
```

From burp, set the Upstream Proxy to forward all the traffic back to `proxify`
From BurpSuite, set the Upstream Proxy to forward all the traffic back to `proxify`:

```
User Options > Upstream Proxy > Proxy & Port > 127.0.0.1 & 8888
```
Now all the request/response history will be stored in `logs` folder that can be used later for post processing.
Now all the request/response history will be stored in `logs` folder that can be used later for post-processing.

</details>

Expand All @@ -221,12 +221,12 @@ While you browse the application, you can point the browser to `proxify` to stor

Start proxify on default or any port you wish,

```
```shell
proxify -output chrome-logs
```

Start Chrome browser in Mac OS,
```
Start Chrome browser in macOS,
```shell
/Applications/Chromium.app/Contents/MacOS/Chromium --ignore-certificate-errors --proxy-server=http://127.0.0.1:8888 &
```

Expand All @@ -236,20 +236,20 @@ Start Chrome browser in Mac OS,
<summary>👉 Store all the response of while you fuzz as per you config at run time. </summary>


Start proxify on default or any port you wish,
Start proxify on default or any port you wish:

```
```shell
proxify -output ffuf-logs
```

Run `FFuF` with proxy pointing to `proxify`
Run `FFuF` with proxy pointing to `proxify`:

```
```shell
ffuf -x http://127.0.0.1:8888 FFUF_CMD_HERE
```

</details>

------

Proxify is made with 🖤 by the [projectdiscovery](https://projectdiscovery.io) team. Community contributions have made the project what it is. See the **[Thanks.md](https://github.com/projectdiscovery/proxify/blob/master/THANKS.md)** file for more details.
`Proxify` is made with 🖤 by the [projectdiscovery](https://projectdiscovery.io) team. Community contributions have made the project what it is. See the **[Thanks.md](https://github.com/projectdiscovery/proxify/blob/master/THANKS.md)** file for more details.
2 changes: 1 addition & 1 deletion THANKS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Thanks

The project was inspired by the following tools and we invite you to try them out as well:
The project was inspired by the following tools, and we invite you to try them out as well:
- [Burp Suite](https://portswigger.net/burp)
- [Zaproxy](https://www.zaproxy.org/)
- [Mitmproxy](https://mitmproxy.org/)
Expand Down
56 changes: 51 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,74 @@
module github.com/projectdiscovery/proxify

go 1.15
go 1.17

require (
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
github.com/Mzack9999/roundrobin v0.0.0-20211108110706-e876335f5ad4
github.com/Shopify/sarama v1.32.0
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/elastic/go-elasticsearch/v7 v7.17.1
github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e
github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e // indirect
github.com/hashicorp/golang-lru v0.5.4
github.com/haxii/fastproxy v0.5.37
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/dsl v0.0.2
github.com/projectdiscovery/fastdialer v0.0.15
github.com/projectdiscovery/fileutil v0.0.0-20220215113056-ba188a0c8abc // indirect
github.com/projectdiscovery/goflags v0.0.8-0.20220304165250-2530b305a4a9
github.com/projectdiscovery/gologger v1.1.4
github.com/projectdiscovery/mapsutil v0.0.1
github.com/projectdiscovery/stringsutil v0.0.0-20220208075244-7c05502ca8e9
github.com/projectdiscovery/tinydns v0.0.1
github.com/rs/xid v1.4.0
github.com/spaolacci/murmur3 v1.1.0 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
)

require (
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
github.com/akrylysov/pogreb v0.10.1 // indirect
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/klauspost/compress v1.14.4 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/projectdiscovery/blackrock v0.0.0-20210415162320-b38689ae3a2e // indirect
github.com/projectdiscovery/cryptoutil v0.0.0-20210805184155-b5d2512f9345 // indirect
github.com/projectdiscovery/fileutil v0.0.0-20220215113056-ba188a0c8abc // indirect
github.com/projectdiscovery/hmap v0.0.2-0.20210917080408-0fd7bd286bfa // indirect
github.com/projectdiscovery/iputil v0.0.0-20210804143329-3a30fcde43f3 // indirect
github.com/projectdiscovery/mapcidr v0.0.8 // indirect
github.com/projectdiscovery/networkpolicy v0.0.1 // indirect
github.com/projectdiscovery/retryabledns v1.0.13-0.20210916165024-76c5b76fd59a // indirect
github.com/projectdiscovery/retryablehttp-go v1.0.2 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect
github.com/weppos/publicsuffix-go v0.15.1-0.20210928183822-5ee35905bd95 // indirect
github.com/yl2chen/cidranger v1.0.2 // indirect
github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521 // indirect
github.com/zmap/zcrypto v0.0.0-20211005224000-2d0ffdec8a9b // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading