Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: BigBear en 1 Diciembre 2011, 22:09 pm



Título: [Perl] DestroyerShells 0.3
Publicado por: BigBear en 1 Diciembre 2011, 22:09 pm
Un programa para buscar phpshells en nuestra computadora y poder borrarlas si nos molesta

Código
  1. #!usr/bin/perl
  2. #DestroyerShells 0.3
  3. #Writtten By Doddy H
  4.  
  5. use File::Find;
  6.  
  7. my @nombres = ("C99Shell","r57shell","DxShell","HiddenShell","~ Andr3a92 ~ Sh3ll ~","CShell","Dark Shell","GsC SheLL","N3fa5t1cA Sh3ll","ONBOOMSHELL",
  8. "StAkeR ~ Shell","MoDDeD By KinG-InFeT","31337 Shel");
  9. my @founds;
  10.  
  11. print "\n-- == DestroyerShells 0.3 == --\n";
  12. unless($ARGV[0]) {
  13. print "\n[+] sintax : $0 <dir>\n";
  14. } else {
  15. start($ARGV[0]);
  16. }
  17. print "\n\n[+] Written By Doddy H\n\n";
  18.  
  19. sub start {
  20. my $dir = shift;
  21. print "\n\n[+] Searching in directory $dir\n\n";
  22.  
  23.  
  24. find(\&finder,$dir);
  25.  
  26. sub finder {
  27. my $file = $_;
  28. if(-f $file) {
  29. if ($file =~ /\.txt$/ or $file =~ /\.php$/){
  30. my $abrir = $File::Find::name;
  31.  
  32. open(FILE,$abrir);
  33. my $words = join q(),<FILE>;
  34. close(FILE);
  35.  
  36. for my $rastro(@nombres) {
  37. chomp $rastro;
  38. if ($words=~/$rastro/ig) {
  39. push(@founds,$abrir);
  40. }}}}}
  41.  
  42. my @founda = repes(@founds);
  43.  
  44. print "[+] Number of files found : ".int(@founda)."\n\n";
  45.  
  46. if (int(@founda) ne "0") {
  47. for(@founda) {
  48. print "[+] File Found : $_\n";
  49. }
  50.  
  51. print "\n[+] Delete files y/n : ";
  52. chomp(my $op=<stdin>);
  53.  
  54. if ($op=~/y/ig) {
  55. for(@founda) { unlink($_);}
  56. print "\n[+] Files Deleted\n";
  57. }
  58. elsif ($op=~/n/ig) {
  59. print "\n[+] Good Bye\n";
  60. } else {
  61. print "\n[+] Write good stupid\n";
  62. }
  63. }
  64. }
  65.  
  66. sub repes {
  67. foreach $test(@_) {
  68. push @limpio,$test unless $repe{$test}++;
  69. }
  70. return @limpio;
  71. }
  72.  
  73. # The End ?
  74.