Posted By

Thresh on 05/28/09


Tagged

iframe virus replacer


Versions (?)

Iframe virus replacer


 / Published in: PHP
 

URL: www.laydo.net

iframe virus replacement php

  1. #!/usr/local/bin/php
  2. <?
  3. $arr = file('list.txt');
  4. $k = 1;
  5. foreach($arr as $line) {
  6. $filer = explode(':',$line);
  7. $res = replaceIT($filer[0]);
  8. if($res){
  9. ausgabe($k.'. '.$filer[0].'<br/>');
  10. }else {
  11. ausgabe($k.'. '.$filer[0].' <span style="color:red">FAIL</span> <br/>');
  12. }
  13. $k++;
  14. }
  15.  
  16.  
  17.  
  18.  
  19. function replaceIT($path)
  20. {
  21.  
  22. $oku = file_get_contents($path);
  23. // $yaz = str_replace('<br>','',$oku);
  24. $desen = '|<iframe .+?></iframe>|i';
  25. $yaz = preg_replace($desen,'',$oku);
  26. $res = file_put_contents($path,$yaz);
  27. return $res;
  28.  
  29. }
  30. function ausgabe ($text) {
  31. echo $text;
  32. for($j = 0; $j < 600; $j++) echo ' '; // extra spaces
  33. flush();
  34. }
  35. ?>

Report this snippet  

You need to login to post a comment.