parent
665ee33866
commit
77e55499a4
|
@ -26,7 +26,7 @@ steps:
|
||||||
# auto_tag: true
|
# auto_tag: true
|
||||||
mtu: 1000
|
mtu: 1000
|
||||||
# purge: true
|
# purge: true
|
||||||
repo: hub.kumoly.io/tools/breacher
|
repo: hub.kumoly.io/tools/breach
|
||||||
registry: hub.kumoly.io
|
registry: hub.kumoly.io
|
||||||
trigger:
|
trigger:
|
||||||
event: tag
|
event: tag
|
|
@ -8,10 +8,10 @@ COPY . .
|
||||||
RUN VERSION=$(git describe --tags --abbrev=0) BUILD=$(git rev-parse --short HEAD) && \
|
RUN VERSION=$(git describe --tags --abbrev=0) BUILD=$(git rev-parse --short HEAD) && \
|
||||||
GOOS=linux GOARCH=amd64 \
|
GOOS=linux GOARCH=amd64 \
|
||||||
go build -ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -w" \
|
go build -ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -w" \
|
||||||
-o /go/bin/breacher
|
-o /go/bin/breach
|
||||||
|
|
||||||
FROM alpine:3.14
|
FROM alpine:3.14
|
||||||
ENV PATH="/go/bin:${PATH}"
|
ENV PATH="/go/bin:${PATH}"
|
||||||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
||||||
COPY --from=builder /go/bin/breacher /go/bin/breacher
|
COPY --from=builder /go/bin/breach /go/bin/breach
|
||||||
ENTRYPOINT ["/go/bin/breacher"]
|
ENTRYPOINT ["/go/bin/breach"]
|
18
README.md
18
README.md
|
@ -1,11 +1,11 @@
|
||||||
# Breacher
|
# Breach
|
||||||
|
|
||||||
common ways to breach network. Including proxy, port forward, ssh tunnel, and backconnect in a single executable
|
common ways to breach network. Including proxy, port forward, ssh tunnel, and backconnect in a single executable
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo rm -f /usr/local/bin/breacher
|
sudo rm -f /usr/local/bin/breach
|
||||||
sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"
|
sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -13,31 +13,31 @@ sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
Usage:
|
Usage:
|
||||||
breacher [command]
|
breach [command]
|
||||||
|
|
||||||
Available Commands:
|
Available Commands:
|
||||||
forward port forwarding for UDP->UDP / TCP->TCP
|
forward port forwarding for UDP->UDP / TCP->TCP
|
||||||
help Help about any command
|
help Help about any command
|
||||||
proxy reverse proxy to url
|
proxy reverse proxy to url
|
||||||
tunnel ssh tunneling to access remote services
|
tunnel ssh tunneling to access remote services
|
||||||
version Print the version number of breacher
|
version Print the version number of breach
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-h, --help help for breacher
|
-h, --help help for breach
|
||||||
-s, --silent silent log output
|
-s, --silent silent log output
|
||||||
-v, --version version for breacher
|
-v, --version version for breach
|
||||||
|
|
||||||
Use "breacher [command] --help" for more information about a command.
|
Use "breach [command] --help" for more information about a command.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Systemd
|
## Systemd
|
||||||
|
|
||||||
```conf
|
```conf
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Breacher
|
Description=Breach
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/breacher tunnel :8080 :80 user@example.com -i ~/.ssh/id_rsa
|
ExecStart=/usr/local/bin/breach tunnel :8080 :80 user@example.com -i ~/.ssh/id_rsa
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package breacher
|
package breach
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -10,8 +10,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var Cmd = &cobra.Command{
|
var Cmd = &cobra.Command{
|
||||||
Use: "breacher",
|
Use: "breach",
|
||||||
Short: "Breacher is a tool to breach network protections",
|
Short: "breach is a tool to breach network protections",
|
||||||
Long: "",
|
Long: "",
|
||||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||||
if rsilent {
|
if rsilent {
|
||||||
|
@ -45,8 +45,8 @@ var (
|
||||||
)
|
)
|
||||||
var versionCmd = &cobra.Command{
|
var versionCmd = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "Print the version number of breacher",
|
Short: "Print the version number of breach",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Printf("breacher version %s - %s\n", Version, Build)
|
fmt.Printf("breach version %s - %s\n", Version, Build)
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package breacher
|
package breach
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
@ -19,9 +19,9 @@ var forwardCmd = &cobra.Command{
|
||||||
Short: "port forwarding for UDP->UDP / TCP->TCP",
|
Short: "port forwarding for UDP->UDP / TCP->TCP",
|
||||||
Long: `port forwarding, defaults to use tcp if no flags given
|
Long: `port forwarding, defaults to use tcp if no flags given
|
||||||
ex.
|
ex.
|
||||||
breacher forward :8080 kumoly.io:5080
|
breach forward :8080 kumoly.io:5080
|
||||||
breacher forward :8080 :8000
|
breach forward :8080 :8000
|
||||||
breacher forward --udp :8080 192.168.51.211:53
|
breach forward --udp :8080 192.168.51.211:53
|
||||||
`,
|
`,
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
|
@ -1,4 +1,4 @@
|
||||||
package breacher
|
package breach
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
@ -14,8 +14,8 @@ var proxyCmd = &cobra.Command{
|
||||||
Short: "reverse proxy to url",
|
Short: "reverse proxy to url",
|
||||||
Long: `reverse proxy,
|
Long: `reverse proxy,
|
||||||
ex.
|
ex.
|
||||||
* breacher reverse_proxy :8080 http://vpn.kumoly.io/
|
* breach reverse_proxy :8080 http://vpn.kumoly.io/
|
||||||
* breacher reverse_proxy :8080 https://kumoly.io/`,
|
* breach reverse_proxy :8080 https://kumoly.io/`,
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
targetUrl, err := url.Parse(args[1])
|
targetUrl, err := url.Parse(args[1])
|
|
@ -1,4 +1,4 @@
|
||||||
package breacher
|
package breach
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -30,9 +30,9 @@ var sshCmd = &cobra.Command{
|
||||||
Short: "ssh tunneling to access remote services",
|
Short: "ssh tunneling to access remote services",
|
||||||
Long: `ssh tunneling to access remote services
|
Long: `ssh tunneling to access remote services
|
||||||
ex.
|
ex.
|
||||||
breacher tunnel :8080 host:80 user@example.com -p paswd
|
breach tunnel :8080 host:80 user@example.com -p paswd
|
||||||
breacher tunnel :8080 :80 user@example.com -i ~/.ssh/id_rsa
|
breach tunnel :8080 :80 user@example.com -i ~/.ssh/id_rsa
|
||||||
breacher tunnel :8080 kumoly.io:443 user@example.com
|
breach tunnel :8080 kumoly.io:443 user@example.com
|
||||||
`,
|
`,
|
||||||
Args: cobra.ExactArgs(3),
|
Args: cobra.ExactArgs(3),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module kumoly.io/tools/breacher
|
module kumoly.io/tools/breach
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
|
|
10
main.go
10
main.go
|
@ -1,15 +1,15 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "kumoly.io/tools/breacher/breacher"
|
import "kumoly.io/tools/breach/breach"
|
||||||
|
|
||||||
var Version = "v0.0.0"
|
var Version = "v0.0.0"
|
||||||
var Build = "alpha"
|
var Build = "alpha"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
breacher.Version = Version
|
breach.Version = Version
|
||||||
breacher.Build = Build
|
breach.Build = Build
|
||||||
breacher.Cmd.Version = Version
|
breach.Cmd.Version = Version
|
||||||
}
|
}
|
||||||
func main() {
|
func main() {
|
||||||
breacher.Execute()
|
breach.Execute()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ if [ $? -ne 0 ]; then VERSION=$DRONE_TAG; fi
|
||||||
BUILD=$(git rev-parse --short HEAD)
|
BUILD=$(git rev-parse --short HEAD)
|
||||||
if [ $? -ne 0 ]; then BUILD=${DRONE_COMMIT:0:7}; fi
|
if [ $? -ne 0 ]; then BUILD=${DRONE_COMMIT:0:7}; fi
|
||||||
|
|
||||||
PROJ=breacher
|
PROJ=breach
|
||||||
HUB=hub.kumoly.io
|
HUB=hub.kumoly.io
|
||||||
HUB_PROJECT=tools
|
HUB_PROJECT=tools
|
||||||
DIST=dist
|
DIST=dist
|
||||||
|
|
Loading…
Reference in New Issue