All Projects → chenjj → Espoofer

chenjj / Espoofer

Licence: mit
An email spoofing testing tool that aims to bypass SPF/DKIM/DMARC and forge DKIM signatures.🍻

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Espoofer

domfind
A Python DNS crawler to find identical domain names under different TLDs.
Stars: ✭ 22 (-91.94%)
Mutual labels:  phishing
FreeFire-Phishing
Free Fire Phishing Tool ID Hack Tool For Online Hacking
Stars: ✭ 140 (-48.72%)
Mutual labels:  phishing
Kamifaka
一款基于VUE3.0的开源免费的卡密发卡系统,高效、稳定可靠。
Stars: ✭ 253 (-7.33%)
Mutual labels:  smtp
dist-detect
Try to determine what Linux/Unix distribution is running on a remote host and get a hint if security updates are applied.
Stars: ✭ 14 (-94.87%)
Mutual labels:  smtp
Excision-Mail
Fullstack, security focused mailserver based on OpenSMTPD for OpenBSD using ansible
Stars: ✭ 108 (-60.44%)
Mutual labels:  smtp
mxclient
A minimalist client for sending mail direct to recipient's MX
Stars: ✭ 29 (-89.38%)
Mutual labels:  smtp
tmail
A throwaway smtp server with API
Stars: ✭ 13 (-95.24%)
Mutual labels:  smtp
Streamingphish
Python-based utility that uses supervised machine learning to detect phishing domains from the Certificate Transparency log network.
Stars: ✭ 271 (-0.73%)
Mutual labels:  phishing
Elliot
A pentesting tool inspired by mr robot and derived by zphisher
Stars: ✭ 23 (-91.58%)
Mutual labels:  phishing
Maildev
📫 SMTP Server + Web Interface for viewing and testing emails during development.
Stars: ✭ 3,102 (+1036.26%)
Mutual labels:  smtp
LordPhish
The most complete phishing tool
Stars: ✭ 158 (-42.12%)
Mutual labels:  phishing
ESP-Mail-Client
⚡️Arduino Mail Client Library to send, read and get incoming mail notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.
Stars: ✭ 78 (-71.43%)
Mutual labels:  smtp
Notqmail
Collaborative open-source successor to qmail
Stars: ✭ 255 (-6.59%)
Mutual labels:  smtp
haraka-plugin-mongodb
Plugin for the Haraka SMTP server to store incoming and outgoing emails to MongoDB
Stars: ✭ 25 (-90.84%)
Mutual labels:  smtp
Mercure
Mercure is a tool for security managers who want to train their colleague to phishing.
Stars: ✭ 262 (-4.03%)
Mutual labels:  phishing
CamHacker
Camera phishing tool. If anyone opens link generated by CamHacker and permits camera access his/her photo will be captured!
Stars: ✭ 280 (+2.56%)
Mutual labels:  phishing
jolimail
Send nice emails
Stars: ✭ 78 (-71.43%)
Mutual labels:  smtp
Phishapi
Comprehensive Web Based Phishing Suite for Rapid Deployment and Real-Time Alerting!
Stars: ✭ 272 (-0.37%)
Mutual labels:  phishing
Dnstwist
Domain name permutation engine for detecting homograph phishing attacks, typo squatting, and brand impersonation
Stars: ✭ 3,124 (+1044.32%)
Mutual labels:  phishing
Stalkphish
StalkPhish - The Phishing kits stalker, harvesting phishing kits for investigations.
Stars: ✭ 256 (-6.23%)
Mutual labels:  phishing

espoofer

espoofer is an open-source testing tool to bypass SPF, DKIM, and DMARC authentication in email systems. It helps mail server administrators and penetration testers to check whether the target email server and client are vulnerable to email spoofing attacks or can be abused to send spoofing emails.


Figure 1. A case of our spoofing attacks on Gmail (Fixed, Demo video)

Why build this tool?

Email spoofing is a big threat to both individuals and organizations (Yahoo breach, John podesta). To address this problem, modern email services and websites employ authentication protocols -- SPF, DKIM, and DMARC -- to prevent email forgery.

Our latest research shows that the implementation of those protocols suffers a number of security issues, which can be exploited to bypass SPF/DKIM/DMARC protections. Figure 1 demonstrates one of our spoofing attacks to bypass DKIM and DMARC in Gmail. For more technical details, please see our Black Hat USA 2020 talk or USENIX security 2020 paper.

In this repo, we summarize all test cases we found and integrate them into this tool to help administrators and security-practitioners quickly identify and locate such security issues.

Installation

  • Download this tool
git clone https://github.com/chenjj/espoofer
  • Install dependencies
sudo pip3 install -r requirements.txt

Python version: Python 3 (>=3.7).

Usage

espoofer has three work modes: server ('s', default mode), client ('c') and manual ('m'). In server mode, espoofer works like a mail server to test validation in receiving services. In client mode, espoofer works as an email client to test validation in sending services. Manual mode is used for debug purposes.


Figure 2. Three types of attackers and their work modes

Server mode

To run espoofer in server mode, you need to have: 1) an IP address (1.2.3.4), which outgoing port 25 is not blocked by the ISP, and 2) a domain (attack.com).

  1. Domain configuration
  • Set DKIM public key for attack.com
selector._domainkey.attacker.com TXT  "v=DKIM1; k=rsa; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNjwdrmp/gcbKLaGQfRZk+LJ6XOWuQXkAOa/lI1En4t4sLuWiKiL6hACqMrsKQ8XfgqN76mmx4CHWn2VqVewFh7QTvshGLywWwrAJZdQ4KTlfR/2EwAlrItndijOfr2tpZRgP0nTY6saktkhQdwrk3U0SZmG7U8L9IPj7ZwPKGvQIDAQAB"
  • Set SPF record for attack.com
attack.com TXT "v=spf1 ip4:1.2.3.4 +all"
  1. Configure the tool in config.py
config ={
	"attacker_site": b"attack.com", # attack.com
	"legitimate_site_address": b"[email protected]", # legitimate.com
	"victim_address": b"[email protected]
	"case_id": b"server_a1", # server_a1
}

You can list find the case_id of all test cases using -l option:

python3 espoofer.py -l
  1. Run the tool to send a spoofing email
python3 espoofer.py

You can change case_id in the config.py or use -id option in the command line to test different cases:

python3 espoofer.py -id server_a1

Client mode

To run epsoofer in client mode, you need to have an account on the target email services. This attack exploits the failure of some email services to perform sufficient validation of emails received from local MUAs. For example, [email protected] tries to impersonate [email protected]

  1. Configure the tool in config.py
config ={
	"legitimate_site_address": b"[email protected]",  
	"victim_address": b"[email protected]", 
	"case_id": b"client_a1",

	"client_mode": {
		"sending_server": ("smtp.gmail.com", 587),  # SMTP sending serve ip and port
		"username": b"[email protected]", # Your account username and password
		"password": b"your_passward_here",
	},
}

You can list find the case_id of all test cases using -l option:

python3 espoofer.py -l

Note: sending_server should be the SMTP sending server address, not the receiving server address.

  1. Run the tool to send a spoofing email
python3 espoofer.py -m c

You can change case_id in the config.py and run it again, or you can use -id option in the command line:

python3 espoofer.py -m c -id client_a1

Manual mode

Here is an example of manual mode:

python3 espoofer.py -m m -helo attack.com -mfrom <[email protected]> -rcptto <[email protected]> -data raw_msg_here -ip 127.0.0.1 -port 25

Bugs found with this tool

Welcome to send a pull request to file your bug report here.

Q&A

  1. How do I know if the email has bypassed DMARC authentication successfully?

You can check it in the Authentication-results header in the raw message headers. If the header shows dmarc=pass, it means the email has passed the DMARC authentication.  You can check some demos video here.

  1. Why do emails fail to send?

There are several possible reasons if you fail to send an email: 1) your ISP blocks outgoing emails to port 25 to prevent spam. In this case, you need to ask for permission from the ISP; 2) the IP address is in the spam list of the target email services. In many cases, you resolve the problem here, https://www.spamhaus.org/lookup/ ;  3) some email services check if there is a PTR record for the sending IP, you may also need to set the PTR record to bypass this check; 4) the email cannot pass the format validation of the target email service, you may want to try a different test case.

  1. Why the email goes to the spam folder? Any way to avoid this?

Currently, espoofer focuses on bypassing SPF/DKIM/DMARC authentication and doesn't aim for spam filter bypass. But you could try to use a reputable sending IP address, domain, and benign message content to bypass the spam filter.

  1. Why I send an email successfully but the email didn't show up in either inbox or spam folder?

In our prior experiences, some email services filter suspicious emails silently.

Credits

Welcome to add more test cases.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].