Skip to content

Commit 35c2a62

Browse files
authored
add makefile and design (#13)
Co-authored-by: sanctuary <[email protected]>
1 parent 04f18a4 commit 35c2a62

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Build configuration
2+
# -------------------
3+
4+
APP_NAME = 221b
5+
APP_VERSION = 0.0.3
6+
GIT_REVISION = `git rev-parse HEAD`
7+
# Introspection targets
8+
# ---------------------
9+
10+
.PHONY: all
11+
all: compile
12+
13+
14+
.PHONY: compile
15+
compile: ## compile the project
16+
@echo "[ *** build 221b binary *** ]"
17+
@go build -o $(APP_NAME) .
18+
@echo "[ *** build successful, use -h *** ]"
19+
20+
.PHONY: clean
21+
clean: ## clean up the project directory
22+
@rm -vf $(APP_NAME)
23+

cli/bake.go

+35-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package cli
22

33
import (
44
"fmt"
5-
"github.com/spf13/cobra"
65
"os"
76
"path/filepath"
87
"strings"
98

9+
"github.com/spf13/cobra"
10+
1011
"github.com/cmepw/221b/loader"
1112
"github.com/cmepw/221b/logger"
1213
)
@@ -18,15 +19,46 @@ var (
1819
method string
1920
)
2021

22+
const ASCII_ART = `
23+
+.
24+
%: -==[ 2 2 1 b ]==-
25+
%: : -
26+
.+*+===++===-----%: :%- =#:
27+
#- %- =@: .@@.
28+
.# %-=%@= -%#.
29+
.% %#@@* #@#
30+
%. %@%- .#@%. -
31+
#: %% =@@* :%*
32+
-% %- .#@@+ =@=
33+
=@: %- .%@%= +@@=
34+
@% %- -@@* *@@*
35+
:@* %-*@@= :#@%- AV evasion framework
36+
:@# :---:.. %%@@- -@@%:. -
37+
@% +%%###*+-: %@+. :=++%@%%*. .+%*
38+
*@ .*@####%@*- %+ :#%%###%#. %@@.
39+
:@- .:*%%%%#+: %- .*@%%%*=. :%@*.
40+
+* ..... %- *@*.. -@@+
41+
#= %- +%: -@#-
42+
-%#: %-=%* -#:
43+
= #*. %*%: =#
44+
-*= %* .-
45+
+%. %-
46+
-=.==-::::.%-
47+
*- .....%: CMEPW Team
48+
:. %:
49+
%:
50+
`
51+
2152
var (
2253
ErrMissingShellPath = fmt.Errorf("missing shellPath argument")
2354
ErrMissingKey = fmt.Errorf("missing key argument")
24-
ErrMethodNotSupported = fmt.Errorf("provided encryption method isn't supported, please choose: 'aes', 'xor'")
55+
ErrMethodNotSupported = fmt.Errorf("provided encryption method isn't supported, please choose: 'aes', 'xor', 'chacha20'")
2556
)
2657

2758
var bake = &cobra.Command{
2859
Use: "bake",
2960
Short: "Build a windows payload with the given shell encrypted in it to bypass AV",
61+
Long: ASCII_ART,
3062
Run: func(cmd *cobra.Command, args []string) {
3163
if shellPath == "" {
3264
logger.Fatal(ErrMissingShellPath)
@@ -86,5 +118,5 @@ func init() {
86118
bake.Flags().StringVarP(&shellPath, "shellPath", "s", "", "path to the shell scrypt")
87119
bake.Flags().StringVarP(&key, "key", "k", "", "key to use for the xor")
88120
bake.Flags().StringVarP(&output, "output", "o", "", "output path (e.g., /home/bin.exe)")
89-
bake.Flags().StringVarP(&method, "method", "m", "xor", "encryption method")
121+
bake.Flags().StringVarP(&method, "method", "m", "xor", "encryption method : chacha20, aes, xor")
90122
}

cli/cli.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import (
99
var debug bool
1010

1111
var rootCmd = &cobra.Command{
12-
Version: "v0.0.1",
12+
Version: "v0.0.3",
1313
Use: "221b",
14+
Short: "221b AV evasion framework",
15+
Long: ASCII_ART,
1416
PersistentPreRun: func(_ *cobra.Command, _ []string) {
1517
logger.DebugMode = debug
1618
},

0 commit comments

Comments
 (0)