Commit graph

15517 commits

Author SHA1 Message Date
David Kennedy
884a24ed22
Merge pull request #955 from timgates42/bugfix_typos
docs: Fix a few typos
2024-05-24 09:55:18 -04:00
David Kennedy
46a4b14bb1
Merge pull request #985 from sysfox/master
Change the install path
2024-05-24 09:54:41 -04:00
David Kennedy
abdfa26fbc
Merge pull request #990 from Pri3st/master
Added "Urgent Security Updates" phishing template
2024-05-24 09:53:25 -04:00
David Kennedy
f3abbd4a78
Merge pull request #1052 from beraoudabdelkhalek/typo-1
fix typo in smtp_client.py
2024-05-24 09:53:04 -04:00
Mustafa Mehar
137722fb20
Fixed updated urllib syntax for python 3 2024-05-05 13:57:50 +05:00
letmewin
0c65a43b6e
fix typo in smtp_client.py
from "you will need to need to" to "you will need to"
2023-12-21 21:09:16 +01:00
Marios K. Pappas
388f27315b
Added "Urgent Security Updates" phishing template
A nice template supposedly coming from the Security Team urging recipients to run the malicious .exe file in order to install the latest Microsoft Windows updates to their systems and turn off Defender while doing so in order to avoid conflicts.
2023-03-12 20:01:36 +02:00
sysfox
592adacf50 Change the install path 2023-01-09 07:49:41 +08:00
Tim Gates
30425936d6
docs: Fix a few typos
There are small typos in:
- src/core/webserver.py
- src/payloads/set_payloads/uac_bypass/source/TIOR/TIOR.cpp
- src/teensy/ino_gen.py

Fixes:
- Should read `remaining` rather than `remaning`.
- Should read `processes` rather than `proceses`.
- Should read `parameters` rather than `paremeters`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-07-17 23:04:20 +10:00
David Kennedy
3611133a5a
Merge pull request #916 from honuonhval/patch-depre-cgi
Allow import cgi on older python versions
2022-01-25 20:58:47 -05:00
Elisha Hollander
dd4d02f1af
remove nested statement with the same condition 2022-01-19 20:19:21 +02:00
Jee L
64c33fe632 Allow import cgi on older python versions 2021-12-29 20:53:12 +08:00
yesimxev
a722584c4f Added HTML support for templates 2021-11-20 01:16:21 +00:00
yesimxev
50e34f4af4 Recovered email templates support 2021-11-18 02:10:59 +00:00
David Kennedy
80fe70d706
Merge pull request #882 from santosomar/patch-2
Correcting spelling errors on menu options and explanations
2021-07-19 22:04:52 -04:00
David Kennedy
38a6a25f92
Merge pull request #878 from CryptoJones/master
Added new years
2021-07-19 22:04:39 -04:00
David Kennedy
f4fc6ce0d5
Merge pull request #879 from Digheads/master
py3 file open fix
2021-07-19 22:04:20 -04:00
Omar Santos
e73c11d5b3
Grammar and spelling errors
While creating different write-ups of the attacks supported in SET in one of my latests books, I noticed several spelling and grammar errors. Thus, I humbly suggest the included minor changes.
2021-06-28 22:56:30 -04:00
Omar Santos
71d4ee0636
Correcting spelling errors on menu options
While creating different write-ups of the attacks supported in SET, I noticed several spelling and grammar errors. Thus, I humbly suggest the included minor changes.
2021-06-28 22:45:18 -04:00
Digheads
4ac7350154
py3 file open fix
'file' built in function is obsolete in py3, therefore to send mails with atachments an error occours. This commit fixes this problem.
2021-06-22 08:13:12 +02:00
CryptoJones
89680d3e97 Added new years 2021-06-14 23:41:13 -04:00
Debjeet Banerjee
fe1a78b0c0
Update harvester.py 2021-04-21 10:34:05 +05:30
David Kennedy
60ad49a1f7
Merge pull request #776 from x4e/master
Fix missing space in setprompt
2021-04-12 15:29:05 -04:00
David Kennedy
087123f0ae
Merge pull request #801 from theCow61/master
non needed library after cgi.escape was changed to html.escape
2021-04-12 15:28:57 -04:00
David Kennedy
632afa6791
Merge pull request #826 from udit19281/master
Update smtp_web.py
2021-04-12 15:07:51 -04:00
David Kennedy
ab0a8ab2a8
Merge pull request #839 from verhelstq/master
Fix path #838
2021-04-12 15:05:55 -04:00
Affan Ahmad
fc43b655d5
fixing web cloner - fallback option with urllib 2021-03-23 14:10:52 +00:00
verhelstq
cb326541c9 Fix path #838 2021-01-08 15:52:58 +01:00
udit19281
72f7ec5ec2
Update smtp_web.py
This solves the TypeError: a byte like object is required,not 'str' issue
2020-10-19 01:27:16 +05:30
Zane Salti
4f357eced5 non needed library after cgi.escape was changed to html.escape 2020-08-29 14:03:11 -05:00
cookiedragon234
1594724616
Fix missing space in setprompt
Resulted in prompts without a trailing space e.g. ![](https://i.binclub.dev/kcltsjjp.png)
2020-07-14 12:02:38 +01:00
swam-htet-a
4e0fb3c1a6
Update harvester.py
I fixed attribute error in this code for latest python3 versions.
Errors =>  "Module 'cgi' has no attribute escape
2020-05-05 21:26:59 +06:30
Климентий Титов
739756b0a9
Merge pull request #1 from kollieartwolf/patch-3
Fix utf-8 codec error (2/2)
2020-04-09 23:01:28 +03:00
Климентий Титов
b71a57a148
Fix utf-8 codec error (2/2)
This is necessary in order to fix the error with the site cloner:
"Something went wrong, printing the error: 'utf-8' codec can't decode byte 0xc2 in position 387: invalid continuation byte"
The same error is also contained in src/webattack/web_clone/cloner.py file
2020-04-09 22:57:54 +03:00
Климентий Титов
81f559c2c2
Fix utf-8 codec error (1/2)
This is necessary in order to fix the error with the site cloner:
"Something went wrong, printing the error: 'utf-8' codec can't decode byte 0xc2 in position 387: invalid continuation byte"
The same error is also contained in src/webattack/harvester/scraper.py file
2020-04-09 22:55:31 +03:00
Meitar M
390160d74b
Fix HTTP headers, use HTTP 302 Found in response to POST requests.
This commit brings the SET Harvester into better conformance with the
HTTP specification. Notably, this makes it possible to use the Harvester
module behind strict layer 7 reverse proxies (such as Cloudflare, Ngrok,
and similar) that require proper HTTP response headers for all replies.

The major change is the addition of a proper HTTP `302 Found` redirect
using the `Location` HTTP header and the addition of an HTML5 document
type declaration (`<!doctype html>`) prepening the body of the reply
sent to a visitor when submitting the SET Harvester's phishing login
form. Smaller changes include correcting misspellings in other HTTP
headers (`Content_type` -> `Content-Type`) in various places.
2020-03-19 23:35:50 -04:00
Meitar M
ec37d317c9
Bitwise AND should be with decimal 31 to also compare QR flag.
The original version of pyminifakedns ignored the value of the
Query/Response Flag ("QR flag"), which is the bit immediately prior to
the DNS opcode field. The value of the QR flag should be checked for the
value 0 along with the opcode bits, which should also be zero.
2020-03-14 02:45:50 -04:00
Meitar M
bee1a38d05
Port original pyminifakedns, circa 2006, to Python 3.
This commit completes porting the internals of the MiniFakeDNS server
class to Python 3. This primarily means converting the Python 2 `str`
types to Python 3's `bytes` objects.

In the process, I've also translated the variable names from their
original Spanish into English, and added explanatory comments for how
the DNS header parsing is accomplished to enhance the educational
potential of SET.

Another small change is the addition of a new core helper function,
`detect_public_ip()`, which makes a couple parts of the codebase a
little more DRY by reducing code duplication across the `set.py` and
`setcore.py` files. This change also makes it possible to parameterize
the IP address that MiniFakeDNS server responds to requests with.
2020-03-14 02:18:18 -04:00
Meitar M
3a2ba0a500
Move the DNS server into its own module. Refactor how to call to it.
This is a relatively large commit because it refactors SET's interface
to the build-in DNS server it runs. Instead of a block of code inside of
the `setcore.py` file, a new module called `minifakedns` is added, which
houses all of the DNS-related code. Note that this commit *only*
refactors the DNS interface and its internals, it does not actually fix
the exception caused by receiving some DNS query, nor does it complete
the work required to set parameters for the DNS server, such as which IP
address it should respond with. It is just intended to make these
changes easier to introduce moving forward in upcoming chunks of work.

This replaces the `core.start_dns()` function with a new helper, whose
full path is `src.core.minifakedns.start_dns_server()`.

The previous implementation assumed the DNS server would be run from the
main thread, and thus have access to SIGINT, but this was never actually
possible because a `KeyboardInterrupt` was actually intercepted by SET
itself, before the DNS server code ever got to see it. This means that
the DNS server would never shut down cleanly.

This implementation changes that by using a simplistic sentinel value
(called `stop_flag`) that can be set as an instance attribute on the new
`MiniFakeDNS` object. When the sentinel value is `True`, the DNS server
thread will exit its listening loop.

Another change this introduces is the fact that, due to this new design,
the DNS server stops when `core.cleanup_routine()` is run. And, as a
note about that, this was running twice, once upon *startup* rather than
when SET shut down. This looked like a bug to me, and it was causing
problems for this DNS server design, so I removed that extra call and
performed some simplistic tests of various SET functionality to make
sure everything still works. (It seems fine, but might warrant a second
look.)

Finally, note that this commit breaks Python 2 compatibility due to the
use of a context manager handling the UDP socket. Given that the DNS
server was not really functional for some period of time before I
started looking at it more closely, the fact that Python 2 is officially
end-of-life'd (as of January 2020), the relative complexity of writing a
Python 2 and Python 3 implementation, and the fact that many comments
elsewhere in the SET codebase all seem to be nudging towards a Python 3
compatible upgrade, I am choosing to drop support for Python 2 in my own
patches, unless there is some considerable objection.
2020-03-12 19:25:28 -04:00
Meitar M
67c2210c3e
Begin work to revive SET's built-in DNS spoofer.
The DNS server in SET assumes that it's going to be able to bind to port
53 on all interfaces, but on most modern *nix machines, that's no longer
reasonable because `systemd-resolved` runs a stub resolver there. This
means an unhandled exception is raised as soon as `DNS_SERVER=ON` in the
`set.config` file.

While there are other issues with this setting, the first chunk of work
is represented in this patch. It checks to see whether the system is
likely configured in the way systemd recommends, with `/etc/resolv.conf`
set to be a symlink pointing at `/run/systemd/resolve/stub-resolv.conf`.
If so, SET uses its root privileges to automatically reconfigure the
system in such a way as to disable `systemd-resolved`'s stub DNS
resolver, clearing port 53, and then setting the system to use Quad Nine
(`9.9.9.9`) as its DNS resolver. Quad Nine is a free service run by the
security community that provides a fast, anycast public recursive DNS
resolver. This was chosen over Cloudflare (at `1.1.1.1`) or Google
(at `8.8.8.8`) because Quad Nine also provides some malware filtering.
See https://quad9.net for details about this service.

In any event, once the reconfiguration is complete, we register a
cleanup function that will undo our configuration, ceding our own setup
back to the original system configuration just before the DNS server
thread exits, ensuring no permanent changes are made to the system.

This only works on GNU/Linux systems, of course, since Apple macOS do
not run systemd, even though they are POSIX. Of course, Apple also
doesn't run its own local stub resolver, so this is not a problem in
need of a solution of macOS. For this reason, `check_os()` is not used.
2020-03-12 02:57:48 -04:00
David Kennedy
3c56c68b5c
Merge pull request #685 from yichi-yang/master
harvester set Content-Type and Content-Length
2020-03-11 16:36:44 -04:00
David Kennedy
3a6090ee40
Merge pull request #696 from meitar/issue-686
Fixes #686: Starting SSL server causes import error.
2020-03-11 16:36:31 -04:00
Meitar M
696e09e29d
Fix NameErrors that were swallowed by blanket except blocks.
The actual `socketserver` variable was sometimes called `server` and
sometimes called `httpd`. This meant that invisible `NameError`
exceptions were being raised in several places when the server's socket
was supposed to be closed (with calls to `socket.close()`.

This commit converges on the variable name `server` for the socket
server, and continues to move code responsible solely for generating
reports into the `generate_reports()` helper function. By doing so, the
functions where the servers are being handled are shorter, making it
easier to spot name errors such as the ones fixed here.
2020-03-10 21:22:24 -04:00
Meitar M
46481e0147
Fixes report generation for built-in SSL server.
Turns out, the `shutdown_request()` method was not ever catching
`KeyboardInterrupt` exceptions because they were never raised there.
This means we can at least catch the exception in that block, and move
the exception handling closer to where it should be.

That turns out to be in `ssl_server()` itself, which AFAICT was never
going to generate reports the same way that the non-SSL server was,
visible in the `run()` method.

This commit revives the report generation capabilities in `ssl_server()`
by moving the same logic used by `run()` into a new function,
`generate_reports()` and calling it in both code paths.
2020-03-10 21:07:55 -04:00
Meitar M
9954c23611
First pass at surviving certain TLS connection issues. See #696.
This is probably a kludge because I am not super familiar with TLS
socket programming or SET generally, but it achieves the result, which
is not to shutdown the (HTTPS) socket server when a TLS client responds
to a TLS Server Hello message with a fatal Alert message.

One example of a client that does this is recent Firefox. What this
means is that if you run SET with `WEBATTACK_SSL=ON` and
`SELF_SIGNED_CERT=ON`, your victim can turn off your HTTPS server simply
by navigating to your attack page.

This is caused by the underlying OpenSSL library raising an error that
`pyopenssl`, in turn, `raise`s through the socket server libraries.
Ultimately, it bubbles up to the `harvester` module through its
`shutdown_request` method, called by the underlying socket server's
`_handle_request_noblock` method. See the backtrace printed in the
comments of Pull Request #696 for a complete example.

The bottom line is that this unhandled exception ultimately causes the
HTTPS server to die before it gets a chance to be useful. Since I assume
that SET doesn't particularly care what certificate validation alerts the
client is sending us, this patch addresses the issue by ignoring every
raised exception from the underlying libraries except for a
`KeyboardInterrupt` so that the SET user can cause a server shutdown
themselves, with the expected `C-c` interrupt signal.

There is probably a more graceful way to handle this, though? Also, note
that this only fixes the HTTPS issues for Python 3. Python 2 exhibits a
different error altogether.
2020-03-10 17:52:09 -04:00
Meitar M
ed4c3bc3d2
Fixes #686: Starting SSL server causes import error.
This resolves the first issue in a line of several preventing the
SSL-capable server from spinning up correctly as described in the
referenced issue number. The cause is simply a missing import when
`setoolkit` is run under Python 3.
2020-03-10 08:10:34 -04:00
Yichi Yang
070e15fdf3 harvester set Content-Type and Content-Length 2020-02-11 13:09:50 -05:00
David Kennedy
af2085157b bump version 2020-02-04 16:26:40 -05:00
David Kennedy
cf4d80a7e0 fix message prompt 2020-02-04 16:25:49 -05:00
David Kennedy
c5b0851a14 fix java applet encoding for create payloads 2020-02-03 21:02:42 -05:00