Skip to content

Commit 31e4ade

Browse files
authored
Merge pull request #27 from MattKeeley/26-spoofing-not-possible-without-spf-or-dmarc-record
New improvements and test cases
2 parents 6875a54 + b3fd5e9 commit 31e4ade

File tree

20 files changed

+1034
-562
lines changed

20 files changed

+1034
-562
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Set up Python
11-
uses: actions/setup-python@v2
12-
with:
13-
python-version: '3.x'
14-
- name: Install dependencies
15-
run: pip install -r requirements.txt
16-
- name: Run tests
17-
run: python3 test.py
9+
- uses: actions/checkout@v2
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: "3.x"
15+
16+
- name: Install dependencies
17+
run: |
18+
pip install -r requirements.txt
19+
pip install ruff
20+
21+
- name: Run Ruff
22+
run: ruff check .
23+
24+
- name: Run tests
25+
run: python3 test.py

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,56 @@
55
Spoofy
66
</h1>
77

8-
98
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
109
[![forthebadge](https://forthebadge.com/images/badges/contains-tasty-spaghetti-code.svg)](https://www.thewholesomedish.com/spaghetti/)
1110
[![forthebadge](https://forthebadge.com/images/badges/it-works-why.svg)](https://www.youtube.com/watch?v=kyti25ol438)
1211

13-
1412
## WHAT
13+
1514
`Spoofy` is a program that checks if a list of domains can be spoofed based on SPF and DMARC records. You may be asking, "Why do we need another tool that can check if a domain can be spoofed?"
1615

1716
Well, Spoofy is different and here is why:
17+
1818
> 1. Authoritative lookups on all lookups with known fallback (Cloudflare DNS)
1919
> 2. Accurate bulk lookups
20-
> 3. Custom, manually tested spoof logic (No guessing or speculating, real world test results)
21-
> 4. SPF lookup counter
20+
> 3. Custom, manually tested spoof logic (No guessing or speculating, real world test results)
21+
> 4. SPF DNS query counter
2222
2323
## PASSING TESTS
24+
2425
[![Spoofy CI](https://github.com/MattKeeley/Spoofy/actions/workflows/ci.yml/badge.svg)](https://github.com/MattKeeley/Spoofy/actions/workflows/ci.yml)
2526

2627
## HOW TO USE
28+
2729
`Spoofy` requires **Python 3+**. Python 2 is not supported. Usage is shown below:
2830

2931
```console
3032
Usage:
31-
./spoofy.py -d [DOMAIN] -o [stdout or xls]
33+
./spoofy.py -d [DOMAIN] -o [stdout or xls] -t [NUMBER_OF_THREADS]
3234
OR
33-
./spoofy.py -iL [DOMAIN_LIST] -o [stdout or xls]
34-
35+
./spoofy.py -iL [DOMAIN_LIST] -o [stdout or xls] -t [NUMBER_OF_THREADS]
36+
37+
Options:
38+
-d : Process a single domain.
39+
-iL : Provide a file containing a list of domains to process.
40+
-o : Specify the output format: stdout (default) or xls.
41+
-t : Set the number of threads to use (default: 4).
42+
43+
Examples:
44+
./spoofy.py -d example.com -t 10
45+
./spoofy.py -iL domains.txt -o xls
46+
3547
Install Dependencies:
3648
pip3 install -r requirements.txt
3749
```
3850

3951
## HOW DO YOU KNOW ITS SPOOFABLE
52+
4053
(The spoofability table lists every combination of SPF and DMARC configurations that impact deliverability to the inbox, except for DKIM modifiers.)
4154
[Download Here](/files/Master_Table.xlsx)
4255

43-
## METHODOLOGY
56+
## METHODOLOGY
57+
4458
The creation of the spoofability table involved listing every relevant SPF and DMARC configuration, combining them, and then conducting SPF and DMARC information collection using an early version of Spoofy on a large number of US government domains. Testing if an SPF and DMARC combination was spoofable or not was done using the email security pentesting suite at [emailspooftest](https://emailspooftest.com/) using Microsoft 365. However, the initial testing was conducted using Protonmail and Gmail, but these services were found to utilize reverse lookup checks that affected the results, particularly for subdomain spoof testing. As a result, Microsoft 365 was used for the testing, as it offered greater control over the handling of mail.
4559

4660
After the initial testing using Microsoft 365, some combinations were retested using Protonmail and Gmail due to the differences in their handling of banners in emails. Protonmail and Gmail can place spoofed mail in the inbox with a banner or in spam without a banner, leading to some SPF and DMARC combinations being reported as "Mailbox Dependent" when using Spoofy. In contrast, Microsoft 365 places both conditions in spam. The testing and data collection process took several days to complete, after which a good master table was compiled and used as the basis for the Spoofy spoofability logic.
@@ -63,7 +77,6 @@ Logo: cobracode
6377

6478
Tool was inspired by [Bishop Fox's](https://github.com/BishopFox/) project called [spoofcheck](https://github.com/BishopFox/spoofcheck/).
6579

66-
6780
## LICENSE
6881

6982
This project is licensed under the Creative Commons Zero v1.0 Universal - see the [LICENSE](LICENSE) file for details

libs/__init__.py

Whitespace-only changes.

libs/bimi.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

libs/dmarc.py

Lines changed: 0 additions & 81 deletions
This file was deleted.

libs/dns.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

libs/logic.py

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)