myph.git


myph

~ shellcode loader for your evasion needs
git clone https://github.com/matro7sh/myph.git
log | files | refs | archive | README | LICENSE

commit aed0e9d6e90533f3d9f92ad1b093677b86c05bcd
Author: winds0r <[email protected]>
Date: Fri, 3 Feb 2023 22:21:48 +0900

feat(cli): project setup (cli parser, docs, github actions)

Diffstat:
A.github/workflows/release.yml | 29+++++++++++++++++++++++++++++
A.gitignore | 24++++++++++++++++++++++++
A.goreleaser.yml | 30++++++++++++++++++++++++++++++
ADockerfile | 22++++++++++++++++++++++
AMakefile | 22++++++++++++++++++++++
AREADME.md | 4++++
Acli/defaults.go | 11+++++++++++
Acli/parser.go | 28++++++++++++++++++++++++++++
Acli/types.go | 10++++++++++
Ago.mod | 9+++++++++
Ago.sum | 10++++++++++
Amain.go | 12++++++++++++

12 files changed, 211 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
@@ -0,0 +1,29 @@
+name: Publish github release
+
+on:
+  create:
+    tags: ["v*"]
+
+jobs:
+  generate-artifacts:
+    name: Generate cross-platform builds
+    runs-on: ubuntu-latest
+    steps:
+      - name: Set up Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: 1.19
+
+      - name: Checkout
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+
+      - name: Run GoReleaser
+        uses: goreleaser/goreleaser-action@v2
+        with:
+          version: latest
+          args: release --rm-dist
+          workdir: ./
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,24 @@
+# ---> Go
+# If you prefer the allow list template instead of the deny list, see community template:
+# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
+#
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+myph
+
+# Test binary, built with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
+
+# Dependency directories (remove the comment below to include it)
+# vendor/
+
+# Go workspace file
+go.work
+*.raw
diff --git a/.goreleaser.yml b/.goreleaser.yml
@@ -0,0 +1,30 @@
+before:
+  hooks:
+  - go mod download
+builds:
+- <<: &build_defaults
+    ldflags:
+      - -s -w
+  env:
+    - CGO_ENABLED=0
+  goos:
+    - linux
+    - darwin
+    - windows
+  goarch:
+    - 386
+    - amd64
+    - arm
+    - arm64
+archives:
+  -
+    replacements:
+      darwin: Darwin
+      linux: Linux
+      windows: Windows
+      386: i386
+      amd64: x86_64
+    format_overrides:
+      -
+        goos: windows
+        format: zip
diff --git a/Dockerfile b/Dockerfile
@@ -0,0 +1,22 @@
+FROM golang:1.19-alpine as builder
+
+WORKDIR /root
+RUN apk update --no-cache && \
+    apk upgrade --no-cache && \
+    apk add --no-cache \
+    make \
+    build-base
+
+COPY go.mod .
+RUN go mod download
+
+COPY . .
+RUN go build -o myph main.go
+
+FROM alpine:3.16.2
+
+WORKDIR /app
+
+COPY --from=builder /root/myph .
+
+ENTRYPOINT [ "/app/myph" ]
diff --git a/Makefile b/Makefile
@@ -0,0 +1,22 @@
+TARGET 		= myph
+SRC 		= main.go
+
+.PHONY: all
+all: compile
+
+.PHONY: help
+help:
+	@echo "\033[34mgork targets:\033[0m"
+	@perl -nle'print $& if m{^[a-zA-Z_-\d]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-22s\033[0m %s\n", $$1, $$2}'
+
+.PHONY: compile
+compile: ## compile the project
+	@go build -o $(TARGET) $(SRC)
+	.
+.PHONY: clean
+clean: ## clean up the project directory
+	@rm -f $(TARGET)
+
+.PHONY: docker
+docker: ## build a local docker image
+	@docker build . -t gork:latest
diff --git a/README.md b/README.md
@@ -0,0 +1,4 @@
+# myph
+
+AV/EDR bypass payload creation tool
+
diff --git a/cli/defaults.go b/cli/defaults.go
@@ -0,0 +1,11 @@
+package cli
+
+// Get default value for Options struct
+func GetDefaultCLIOptions() Options {
+    opts := Options{
+        ShellcodePath: "",
+        Outfile: "slipak",
+    }
+
+    return opts
+}
diff --git a/cli/parser.go b/cli/parser.go
@@ -0,0 +1,28 @@
+package cli
+
+import (
+	"github.com/spf13/cobra"
+)
+
+func GetParser(opts *Options) *cobra.Command {
+    version := "0.0.1"
+    var cmd = &cobra.Command{
+        Use: "myph",
+        Version: version,
+        DisableSuggestions : true,
+        Short: "AV bypass shellcode creation framework",
+        Long: `CLI to prepare your shellcode and do AV/EDR bypass`,
+        Run: func(cmd *cobra.Command, args []string) {
+
+            println("pee is stored in the balls")
+        },
+
+    }
+
+    defaults := GetDefaultCLIOptions()
+
+    cmd.PersistentFlags().StringVarP(&opts.Outfile, "outfile", "o", defaults.Outfile, "output filepath")
+    cmd.PersistentFlags().StringVarP(&opts.ShellcodePath, "shellcode", "s", defaults.ShellcodePath, "shellcode path")
+
+    return cmd
+}
diff --git a/cli/types.go b/cli/types.go
@@ -0,0 +1,10 @@
+package cli
+
+type Options struct {
+
+    // Shellcode path
+    ShellcodePath string
+
+    // Outfile path
+    Outfile string
+}
diff --git a/go.mod b/go.mod
@@ -0,0 +1,9 @@
+module github.com/cmepw/myph
+
+go 1.19
+
+require (
+	github.com/inconshreveable/mousetrap v1.0.1 // indirect
+	github.com/spf13/cobra v1.6.1 // indirect
+	github.com/spf13/pflag v1.0.5 // indirect
+)
diff --git a/go.sum b/go.sum
@@ -0,0 +1,10 @@
+github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
+github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
+github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/main.go b/main.go
@@ -0,0 +1,12 @@
+package main
+
+import (
+    "github.com/cmepw/myph/cli"
+)
+
+func main() {
+    opts := cli.GetDefaultCLIOptions()
+    parser := cli.GetParser(&opts)
+
+    parser.ExecuteC()
+}