Commit graph

15826 commits

Author SHA1 Message Date
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
af5b75b2a0
Make seautomate functional with Python 3.
Per Debian policy, Python versions 3 and greater must be called from the
`python3` executable, not the `python` executable. This means
Debian-based systems with Python 3 installed but not Python 2 will fail
to launch SET through `seautomate` because the `python` executable is
hard-coded into the call to `pexpect.spawn()`.

This commit uses the standard library's
`distutils.spawn.find_executable()` method to locate the correct path to
`python3` or, failing that, the correct path to the `python` executable
and uses the result of that call as the first command line word with
which to invoke `setoolkit`.

The `distutils.spawn.find_executable()` method is available at that
exact name in both Python 2 and 3, so this should be portable across all
Python versions.

Note that the shebang line references `python`, and so Python 3-only
systems such as newer Debian-based builds may need to invoke
`seautomate` using an explicit interpreter for it to work:

```sh
sudo python3 ./seautomate /path/to/script/file.txt
```
2020-03-10 14:33:22 -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
bc1459567d update readme info 2020-02-04 18:43:49 -05:00
David Kennedy
69c24714e0 update readme install 2020-02-04 18:42:52 -05:00
David Kennedy
97450f9cf3 update readme 2020-02-04 18:41:51 -05:00
David Kennedy
e1d3f830fe update license date 2020-02-04 16:45:29 -05:00
David Kennedy
d400eccbcf Merge branch 'master' of https://github.com/trustedsec/social-engineer-toolkit 2020-02-04 16:26:57 -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
trustedsec
ee32d6556e
Merge pull request #682 from cclauss/patch-2
Use print() function in both Python 2 and Python 3
2020-02-03 23:33:11 -05:00
Christian Clauss
333f71bca6
Use print() function in both Python 2 and Python 3 2020-02-04 06:20:34 +02:00
David Kennedy
5a119afdc3 fix payload creation base64 error 2020-02-03 21:03:07 -05:00
David Kennedy
c5b0851a14 fix java applet encoding for create payloads 2020-02-03 21:02:42 -05:00
David Kennedy
8b9e6dd516 fix ratte showing up in modules 2020-02-03 20:52:04 -05:00
David Kennedy
39792950e2 fix browser autopwn not launching listener 2020-02-03 20:40:32 -05:00
David Kennedy
20c9d66a50 update changelog 2020-02-03 20:09:21 -05:00
David Kennedy
005422e472 add better description 2020-02-03 20:08:52 -05:00
David Kennedy
8fb8b406b4 remove patched folder 2020-02-03 20:06:01 -05:00
David Kennedy
55ba216a71 fix python3 raw input 2020-02-03 19:58:42 -05:00
David Kennedy
fe69551c41 Merge branch 'master' of https://github.com/trustedsec/social-engineer-toolkit 2020-02-03 19:55:42 -05:00
David Kennedy
f02f283e53 remove old path structure 2020-02-03 17:28:10 -05:00
David Kennedy
57ab04620e remove old directory path 2020-02-03 17:27:49 -05:00
David Kennedy
bbe2a48ef3 add setup.py installer for non-standalone 2020-02-03 17:26:50 -05:00
David Kennedy
1252ee4ce2 fix python3 compat file open issues 2020-02-03 17:11:08 -05:00
trustedsec
b424969d30
Merge pull request #669 from cclauss/patch-2
GitHub Actions: Python 3.5, 3.6, 3.7 on Ubuntu
2020-02-03 17:09:20 -05:00
Christian Clauss
7257a9d8cd
GitHub Actions: Python 3.5, 3.6, 3.7 on Ubuntu 2019-12-19 00:01:27 +01:00
trustedsec
09b56b105f
Merge pull request #668 from cclauss/patch-2
GitHub Actions: Lint and test our Python code
2019-12-18 13:32:47 -05:00
trustedsec
67506ba921
Merge pull request #666 from meitar/fix-pymssql
Fixes #651, fixes #660: Pin pymssql requirement to existing version.
2019-12-18 13:31:31 -05:00
Christian Clauss
0c8cd8c21c GitHub Actions: Lint and test our Python code 2019-12-16 22:52:00 +01:00
Meitar M
04dbf5c263
Fixes #651, fixes #660: Pin pymssql requirement to existing version.
See also pymssql/pymssql#668 which describes the discontinuance of the
pymssql project.

This commit addresses the issue by simplistically pinning the dependency
on pymssql to an existing version.
2019-12-10 00:43:19 -05:00
trustedsec
65e3101f13
Merge pull request #659 from DMofGM/master
Found a lingering instance of raw_input in powershell.py
2019-11-19 19:57:51 -05:00
DMofGM@gmail.com
b760505175 Found a lingering instance of raw_input in powershell.py 2019-10-31 03:26:36 +00:00
trustedsec
e8ace04b00
Merge pull request #648 from buzzdeee/py3_cStringIO_fix
python3 compatibility fix regarding cStringIO
2019-09-24 13:46:43 -04:00
trustedsec
f164e06e1c
Merge pull request #649 from buzzdeee/py3_email_fix
Fix py3 incompatibility with regard to email module
2019-09-24 13:46:18 -04:00
Sebastian Reitenbach
973e0c3dbb Fix py3 incompatibility with regard to email module
Getting into Social-Engineering Attacks -> Mass Mailer Attack,
errors are thrown regarding the import of email modules.

This needs the fix in PR #648
2019-09-03 10:28:41 +02:00
Sebastian Reitenbach
8ded4aca69 Using Python 3, and getting into Social-Engineering Attacks ->
Mass Mailer Attack, SET throws an error:

Something went wrong, printing the error: No module named 'cStringIO'

This fixes it, the change to socket.py fixes the module name,
and the change to smtp_web fixes the exception name.
2019-09-03 09:59:10 +02:00
trustedsec
71d349d4df
Merge pull request #642 from meitar/fix-harvester-traversal
Fix bug where files for Tabnabbing and Webjacking were not served.
2019-07-23 11:30:38 -04:00
David Kennedy
c3f4a0eeca fix hta attack vector issues on main menu 2019-07-23 11:28:23 -04:00
Meitar M
a4cdcd1478
Fix bug where files for Tabnabbing and Webjacking were not served.
This commit fixes a bug in the credential harvester Web attack
method that prevented these attacks from being successful.
Specifically, files needed for these attacks (e.g., `source.js`) in
the Web server's document root (`web_clone` folder) were treated as
though they were path traversal attacks, resulting an HTTP 404 sent
back to the (victim) browser; these attacks would fail.

In fact, files requested via URLs such as `/source.js` are valid
paths, but since they were not explicitly checked for in the same way
that the `index.html` and `index2.html` files were, these helper files
were not being served.

This fix improves URL handling by using Python's `os.path.relpath()`
method to ensure that all requested URLs are treated as relative to
the Web server's document root (`webroot` variable). This also
reliably prevents path traversal attacks because the
`requested_file` variable is always prepended with the Web root after
path calculations (normalizing `../` sequences, etcetera) have been
performed. As a result, the explicit check for the path traversal
detection is no longer needed; such requests will always error 404.
2019-07-17 13:35:33 -04:00
David Kennedy
0018154022 Merge branch 'master' of https://github.com/trustedsec/social-engineer-toolkit 2019-04-23 17:00:55 -04:00
David Kennedy
0187af1533 fix credential harvester issue when importing index.html 2019-04-23 16:58:21 -04:00
trustedsec
6109bc2dab
Merge pull request #609 from Lin8x/master
Changed the README.md
2019-04-03 09:33:57 -04:00
trustedsec
2b447fc8fd
Merge branch 'master' into master 2019-04-03 09:33:43 -04:00
TrustedSec
a0ee439c9f update to version 8.0 beta 2019-03-21 18:44:20 -04:00
Lin8x
6c2f539c40
Update README.md 2019-03-12 08:40:04 -04:00
Lin8x
2f9c62de43
Update README.md 2019-03-12 08:39:38 -04:00
Lin8x
94f7e17a79
Update README.md 2019-03-12 08:38:50 -04:00
Lin8x
2fdb2c6861
Update README.md 2019-03-12 08:38:38 -04:00