-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd2e0c0
commit 79b704b
Showing
6 changed files
with
230 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
Version 2, December 2004 | ||
|
||
Copyright (C) 2004 Sam Hocevar <[email protected]> | ||
|
||
Everyone is permitted to copy and distribute verbatim or modified | ||
copies of this license document, and changing it is allowed as long | ||
as the name is changed. | ||
|
||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
|
||
0. You just DO WHAT THE FUCK YOU WANT TO. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
mkfile_path := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
version := $(git tag -l | tail -n 1) | ||
build_path := $(mkfile_path)build/ | ||
version := $$(git tag -l | tail -n 1) | ||
|
||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
debug: ## Build a debug version | ||
@mkdir -p $(mkfile_path)build | ||
@go build main.go -o $(mkfile_path)open-go-knocking | ||
debug: clean-build ## Build a debug version | ||
@mkdir -p $(build_path) | ||
@go build -o $(build_path)open-go-knocking main.go | ||
@echo "Debug release done" | ||
|
||
release: clean-build build-linux build-darwin build-windows ## Build the release version | ||
|
||
clean-build: ## Clean the build directory | ||
@rm -fr @mkdir -p $(mkfile_path)build/* | ||
@rm -fr $(build_path)/* | ||
|
||
build-linux: ## Build release version for GNU/Linux | ||
@mkdir -p $(mkfile_path)build | ||
@GOOS="linux" GOARCH="amd64" go build -ldflags="-X 'main.version=$(version)'" -o $(mkfile_path)open-go-knocking-$(version)-linux-amd64 main.go | ||
@GOOS="linux" GOARCH="arm64" go build -ldflags="-X 'main.version=$(version)'" -o $(mkfile_path)open-go-knocking-$(version)-linux-arm64 main.go | ||
@GOOS="linux" GOARCH="386" go build -ldflags="-X 'main.version=$(version)'" -o $(mkfile_path)open-go-knocking-$(version)-linux-386 main.go | ||
@mkdir -p $(build_path) | ||
@GOOS="linux" GOARCH="amd64" go build -ldflags="-X 'main.version=$(version)'" -o $(build_path)open-go-knocking-$(version)-linux-amd64 main.go | ||
@GOOS="linux" GOARCH="arm64" go build -ldflags="-X 'main.version=$(version)'" -o $(build_path)open-go-knocking-$(version)-linux-arm64 main.go | ||
@GOOS="linux" GOARCH="386" go build -ldflags="-X 'main.version=$(version)'" -o $(build_path)open-go-knocking-$(version)-linux-386 main.go | ||
|
||
build-darwin: ## Build release version for MacOS | ||
@mkdir -p $(mkfile_path)build | ||
@GOOS="darwin" GOARCH="amd64" go build -ldflags="-X 'main.version=$(version)'" -o $(mkfile_path)open-go-knocking-$(version)-darwin-amd64 main.go | ||
@GOOS="darwin" GOARCH="arm64" go build -ldflags="-X 'main.version=v0.0.1'" -o $(mkfile_path)open-go-knocking-$(version)-darwin-arm64 main.go | ||
@mkdir -p $(build_path) | ||
@GOOS="darwin" GOARCH="amd64" go build -ldflags="-X 'main.version=$(version)'" -o $(build_path)open-go-knocking-$(version)-darwin-amd64 main.go | ||
@GOOS="darwin" GOARCH="arm64" go build -ldflags="-X 'main.version=v0.0.1'" -o $(build_path)open-go-knocking-$(version)-darwin-arm64 main.go | ||
|
||
build-windows: ## Build release version for Windows | ||
@mkdir -p $(mkfile_path)build | ||
@GOOS="windows" GOARCH="amd64" go build -ldflags="-X 'main.version=$(version)'" -o $(mkfile_path)open-go-knocking-$(version)-windows-amd64.exe main.go | ||
@GOOS="windows" GOARCH="386" go build -ldflags="-X 'main.version=$(version)'" -o $(mkfile_path)open-go-knocking-$(version)-windows-386.exe main.go | ||
@mkdir -p $(build_path) | ||
@GOOS="windows" GOARCH="amd64" go build -ldflags="-X 'main.version=$(version)'" -o $(build_path)open-go-knocking-$(version)-windows-amd64.exe main.go | ||
@GOOS="windows" GOARCH="386" go build -ldflags="-X 'main.version=$(version)'" -o $(build_path)open-go-knocking-$(version)-windows-386.exe main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# OpenGoKnocking | ||
|
||
Simple and cross-platform port knocking client written in GoLang. | ||
|
||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/leblanc-simon/open-go-knocking/main/assets/open-go-knocking.png"> | ||
</p> | ||
|
||
## Installation | ||
|
||
To install OpenGoKnocking in your $GOPATH: | ||
|
||
```bash | ||
git clone https://github.com/leblanc-simon/open-go-knocking.git | ||
cd open-go-knocking | ||
go install | ||
``` | ||
|
||
alternatively, you can download binary from [releases](https://github.com/leblanc-simon/open-go-knocking/releases). | ||
Binaries are availables for GNU/Linux, MacOS and Windows | ||
|
||
## Usage | ||
|
||
```bash | ||
# Knock to the server example.com at port 1337 (tcp), then 1338 (UDP) and finally 1339 (TCP) | ||
open-go-knocking example.com 1337:tcp 1338:udp 1339:tcp | ||
|
||
# If the majority of ports are TCP ports, you can use the following syntax (ports without protocol will be in TCP) | ||
open-go-knocking --tcp example.com 1337 1338:udp 1339 | ||
|
||
# If the majority of ports are UDP ports, you can use the following syntax (ports without protocol will be in UDP) | ||
open-go-knocking --udp example.com 1337 1338:tcp 1339 | ||
``` | ||
|
||
## Options | ||
|
||
* `--tcp`: | ||
* `--udp`: | ||
* `--delay` (in ms): | ||
* `--version`: Show the current version | ||
* `--help`: Show the help | ||
|
||
## Errors | ||
|
||
Possible exit codes : | ||
|
||
* 0: all is fine :) | ||
* 1: Not enough arguments (host and port are required) | ||
* 2: Host is not a valid hostname or IP (v4 or v6) | ||
* 3: Problems with ports or protocols (check if you use `--tcp` or `--udp` that the option is located before the host) | ||
|
||
## Author | ||
|
||
* Simon Leblanc <[email protected]> | ||
|
||
## License | ||
|
||
[WTFPL](http://www.wtfpl.net/) | ||
|
||
## Logo | ||
|
||
Original Logo from [Takuya Ueda](https://twitter.com/tenntenn), you can find source [in the repository](https://github.com/golang-samples/gopher-vector). Licensed under the Creative Commons 3.0 Attributions license. | ||
|
||
Modified by Simon Leblanc. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters