Red Team tool for exfiltrating files from a target's Google Drive that you have access to, via Google's API.

Related tags

Deep LearningGD-Thief
Overview

GD-Thief

Red Team tool for exfiltrating files from a target's Google Drive that you(the attacker) has access to, via the Google Drive API. This includes includes all shared files, all files from shared drives, and all files from domain drives that the target has access to.

HOW TO

For an illustrated walkthrough, check out my blog post.

Create a new Google Cloud Platform (GCP) project

Steps to get the Google API Access Token needed for connecting to the API

  1. Create a burner Gmail/google account
  2. Login to said account
  3. Navigate to the Google Cloud Console
  4. Next to "Google Cloud Platform," click the "Select a project" Down arrow. A dialog listing current projects appears.
  5. Click New Project. The New Project screen appears.
  6. In the Project Name field, enter a descriptive name for your project.
  7. (Optional) To edit the Project ID, click Edit. The project ID can't be changed after the project is created, so choose an ID that meets your needs for the lifetime of the project.
  8. Click Create. The console navigates to the Dashboard page and your project is created within a few minutes.

Enable a Google Workspace API

  1. Next to "Google Cloud Platform," click the Down arrow and select the project you just created from the dropdown list.
  2. In the top-left corner, click Menu > APIs & Services.
  3. Click Enable APIs and Services. The "Welcome to API Library" page appears.
  4. In the search field, enter "Google Drive".
  5. Click the Google Drive API. The API page appears.
  6. Click Enable. The Overview page appears.

Configure OAuth Consent screen

  1. On the left side of the Overview page click Credentials. The credential page for your project appears.
  2. Click Configure Consent Screen. The "OAuth consent screen" screen appears.
  3. Click the External user type for your app.
  4. Click Create. A second "OAuth consent screen" screen appears.
  5. Fill out the form:
    • Enter an Application Name in the App name field
    • Enter your burner email address in the User support email field.
    • Enter your burner email address in the Developer contact information field.
  6. Click Save and Continue. The "Scopes" page appears.
  7. Click Add or Remove Scopes. The "Update selected scopes" page appears.
  8. Check all of the Google Drive scopes to use in the app. GD scopes cover 2 pages, so click the next page and ensure that you check them all.
  9. Click Update. A list of scopes for your app appears.
  10. Click Save and Continue. The "Edit app registration" page appears.
  11. Click Save and Continue. The "OAuth consent screen" appears.

Create a credential

  1. Click Create Credentials and select OAuth client ID. The "Create OAuth client ID" page appears.
  2. Click the Application type drop-down list and select Desktop Application.
  3. In the name field, type a name for the credential. This name is only shown in the Cloud Console.
  4. Click Create. The OAuth client created screen appears. This screen shows the Client ID and Client secret.
  5. Click OK. The newly created credential appears under "OAuth 2.0 Client IDs."
  6. Click the download button to the right of the newly-created OAuth 2.0 Client ID. This copies a client secret JSON file to your desktop. Note the location of this file.
  7. Rename the client secret JSON file to "credentials.json" and move it to the gd_thief/credentials directory.

Add the victim's Google account to the Application's Test Users

In order to be able to run this script against the victim, you will need to add their Google account to the Test Users list for the App you just created

  1. On the Left side of the screen click OAuth consent screen. You "OAuth Consent Screen" page appears.
  2. Under Test Users click the Add Users button.
  3. Enter the victim's Gmail address in the email address field.
  4. Click the save button.

First Time running gd_thief

Upon gaining access to a Target's Google account, you can run gd_thief

  1. The first time running gd_thief, the script opens a new window prompting you to authorize access to your data:
    1. If you are signed in to multiple Google accounts, you are asked to select one account to use for the authorization. Make sure you select the victim's Google account

Dependencies

Google API Libraries: pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

Usage:

usage:
python3 gd_thief.py [-h] -m [{dlAll, dlDict[-d <DICTIONARY FILE PATH>]}
	[-t <THREAD COUNT>]

help:

This Module will connect to Google's API using an access token and exfiltrate files
from a target's Google Drive.  It will output exfiltrated files to the ./loot directory

arguments:
        -m [{dlAll, dlDict}],
                --mode [{dlAll, dlDict}]
                The mode of file download
                Can be "dlAll", "dlDict [-d <DICTIONARY FILE PATH>]", or... (More options to come)

optional arguments:
        -d <DICTIONARY FILE PATH>, --dict <DICTIONARY FILE PATH>
                        Path to the dictionary file. Mandatory with download mode"-m, --mode dlDict"
                        You can use the provided dictionary, per example: "-d ./dictionaries/secrets-keywords.txt"
        -t <THREAD COUNT>, --threads <THREAD COUNT>
                        Number of threads. (Too many could exceeed Google's rate limit threshold)

        -h, --help
                show this help message and exit

NOTES:

  • Setting the thread count too high will cause an HTTP 403 "Rate limit exceeded," indicating that the user has reached Google Drive API's maximum request rate.
    • The thread count limit vaires from machine to machine. I've set it to 250 on a Macbook Pro, while 250 was too high for my Windows 10 Desktop

REFERENCES:

TODO:

  1. Threading
  2. Error Checking
  3. Wordlist file content search and download
  4. File type download
  5. Snort Sensitive Data regex file content search and download
  6. Optical Character Recognition (OCR)

Special Thanks:

Thank you to my good friend Cedric Owens for helping me with the threading piece!

Owner
Antonio Piazza
Antonio Piazza
curl-impersonate: A special compilation of curl that makes it impersonate Chrome & Firefox

curl-impersonate A special compilation of curl that makes it impersonate real browsers. It can impersonate the four major browsers: Chrome, Edge, Safa

lwthiker 1.9k Jan 03, 2023
3D detection and tracking viewer (visualization) for kitti & waymo dataset

3D detection and tracking viewer (visualization) for kitti & waymo dataset

222 Jan 08, 2023
Predict the latency time of the deep learning models

Deep Neural Network Prediction Step 1. Genernate random parameters and Run them sequentially : $ python3 collect_data.py -gp -ep -pp -pl pooling -num

QAQ 1 Nov 12, 2021
PyTorch implementation of Densely Connected Time Delay Neural Network

Densely Connected Time Delay Neural Network PyTorch implementation of Densely Connected Time Delay Neural Network (D-TDNN) in our paper "Densely Conne

Ya-Qi Yu 64 Oct 11, 2022
GRF: Learning a General Radiance Field for 3D Representation and Rendering

GRF: Learning a General Radiance Field for 3D Representation and Rendering [Paper] [Video] GRF: Learning a General Radiance Field for 3D Representatio

Alex Trevithick 243 Dec 29, 2022
CharacterGAN: Few-Shot Keypoint Character Animation and Reposing

CharacterGAN Implementation of the paper "CharacterGAN: Few-Shot Keypoint Character Animation and Reposing" by Tobias Hinz, Matthew Fisher, Oliver Wan

Tobias Hinz 181 Dec 27, 2022
Learning to Simulate Dynamic Environments with GameGAN (CVPR 2020)

Learning to Simulate Dynamic Environments with GameGAN PyTorch code for GameGAN Learning to Simulate Dynamic Environments with GameGAN Seung Wook Kim,

199 Dec 26, 2022
Autonomous Movement from Simultaneous Localization and Mapping

Autonomous Movement from Simultaneous Localization and Mapping About us Built by a group of Clarkson University students with the help from Professor

14 Nov 07, 2022
Object Detection with YOLOv3

Object Detection with YOLOv3 Bu projede YOLOv3-608 modeli kullanılmıştır. Requirements Python 3.8 OpenCV Numpy Documentation Yolo ile ilgili detaylı b

Ayşe Konuş 0 Mar 27, 2022
ShuttleNet: Position-aware Fusion of Rally Progress and Player Styles for Stroke Forecasting in Badminton (AAAI 2022)

ShuttleNet: Position-aware Rally Progress and Player Styles Fusion for Stroke Forecasting in Badminton (AAAI 2022) Official code of the paper ShuttleN

Wei-Yao Wang 11 Nov 30, 2022
The official implementation of Equalization Loss for Long-Tailed Object Recognition (CVPR 2020) based on Detectron2

Equalization Loss for Long-Tailed Object Recognition Jingru Tan, Changbao Wang, Buyu Li, Quanquan Li, Wanli Ouyang, Changqing Yin, Junjie Yan ⚠️ We re

Jingru Tan 197 Dec 25, 2022
Research code for Arxiv paper "Camera Motion Agnostic 3D Human Pose Estimation"

GMR(Camera Motion Agnostic 3D Human Pose Estimation) This repo provides the source code of our arXiv paper: Seong Hyun Kim, Sunwon Jeong, Sungbum Park

Seong Hyun Kim 1 Feb 07, 2022
The official PyTorch implementation of recent paper - SAINT: Improved Neural Networks for Tabular Data via Row Attention and Contrastive Pre-Training

This repository is the official PyTorch implementation of SAINT. Find the paper on arxiv SAINT: Improved Neural Networks for Tabular Data via Row Atte

Gowthami Somepalli 284 Dec 21, 2022
Rust bindings for the C++ api of PyTorch.

tch-rs Rust bindings for the C++ api of PyTorch. The goal of the tch crate is to provide some thin wrappers around the C++ PyTorch api (a.k.a. libtorc

Laurent Mazare 2.3k Dec 30, 2022
A High-Performance Distributed Library for Large-Scale Bundle Adjustment

MegBA: A High-Performance and Distributed Library for Large-Scale Bundle Adjustment This repo contains an official implementation of MegBA. MegBA is a

旷视研究院 3D 组 336 Dec 27, 2022
Convolutional 2D Knowledge Graph Embeddings resources

ConvE Convolutional 2D Knowledge Graph Embeddings resources. Paper: Convolutional 2D Knowledge Graph Embeddings Used in the paper, but do not use thes

Tim Dettmers 586 Dec 24, 2022
[ICCV 2021] Official PyTorch implementation for Deep Relational Metric Learning.

Ranking Models in Unlabeled New Environments Prerequisites This code uses the following libraries Python 3.7 NumPy PyTorch 1.7.0 + torchivision 0.8.1

Borui Zhang 39 Dec 10, 2022
Locally cache assets that are normally streamed in POPULATION: ONE

Population One Localizer This is no longer needed as of the build shipped on 03/03/22, thank you bigbox :) Locally cache assets that are normally stre

Ahman Woods 2 Mar 04, 2022
An auto discord account and token generator. Automatically verifies the phone number. Works without proxy. Bypasses captcha.

JOIN DISCORD SERVER https://discord.gg/uAc3agBY FREE HCAPTCHA SOLVING API Discord-Token-Gen An auto discord token generator. Auto verifies phone numbe

3kp 271 Jan 01, 2023
Namish Khanna 40 Oct 11, 2022