Commit Graph

100 Commits

Author SHA1 Message Date
Jeffrey Martin 6b5948a69d restore raw_send_recv for module using SMTP mixin
changes in #16153 adjusted modules that were not utilizing
`Exploit::Remote::SMTPDeliver` in error restore calls to `raw_send_recv`
that is no longer shadowed by in `SMTPDeliver`.
2023-01-04 14:45:58 -06:00
Jeffrey Martin af3fa09896 refactor smtp delivery to support continuation
When dealing with SMTP servers the communication needs to flow
a known protocol. To ensure the socket is in the correct state
after a send and receive it needs to be read until a line return
a response code followed by a `space` and additional data and `\r\n`
or the response code immediately followed by `\r\n` is returned.
2022-02-14 16:55:49 -06:00
h00die a5674683f0 remove duplicate autocheck 2021-08-27 20:08:58 -04:00
cgranleese-r7 3a2932b798 Migrate old uses of manual autocheck to use the new prepend autocheck 2021-02-02 10:15:46 +00:00
William Vu 7ce10f68ae RuboCop for great justice
And update docs.
2021-01-21 10:44:18 -06:00
Spencer McIntyre 131bf632bd Update the OpenSMTPD target versions and add the EDB reference 2021-01-21 09:09:42 -05:00
William Vu a336ee483a Update exploit/unix/smtp/opensmtpd_mail_from_rce
Failure was caused by POSIX read requiring an argument.
2021-01-21 03:56:19 -06:00
zomfg-zombie 364591069c Fix payload failing to trigger
For whatever reason,  `;for #{rand_text_alpha(1)} in #{iter};do read;done;sh;exit 0;` causes an issue with the payload triggering.

Editing `do read` to `do read r`, as taken from the PoC script at https://www.exploit-db.com/exploits/48051, causes the `MAIL_FROM` field to exceed 64 characters.

However, this seems to make 0 difference to the payload, so I commented out the length check.

Reliably working on OpenSMTPd 6.6.0 on an Ubuntu 20.04 host.
2021-01-19 18:31:35 +10:00
Alan Foster 30809787c4 Convert disclosure dates to iso8601 2020-10-02 21:00:37 +01:00
William Vu a6f7c0c0de Backport miscellaneous fixes to my modules 2020-08-14 13:40:23 -05:00
Alan Foster b841246536 Update autocheck to use prepend instead of include, add ForceExploit functionality 2020-06-30 11:40:46 +01:00
William Vu 823c29a127 Update post-RuboCop style in my recent modules
Mostly 80 columns (yeah, I know) and additional whitespace to complement
the lack of alignment.
2020-04-22 10:52:00 -05:00
Alan Foster f2c3fc5f00 Rubocop recently landed modules 2020-04-17 11:55:04 +01:00
William Vu 6276247bf8 Move Expect mixin to Msf::Exploit::Remote
I don't think we'll ever see it used beyond remote exploits.
2020-04-15 15:47:50 -05:00
Alan Foster 3a046f01da Run rubocop -a on subset of files 2020-03-06 10:41:45 +00:00
William Vu 975eb742cb Add old grammar target and refactor check 2020-03-03 17:41:04 -06:00
William Vu 260aa0533a Add check method and reorder mixins for super
Also fix copypasta'd vulnerable commit.
2020-03-03 17:41:04 -06:00
William Vu cc974e7f25 Add module notes to my recent modules 2020-03-02 14:15:52 -06:00
William Vu e92b9ef97c Use AutoCheck mixin in OpenSMTPD CVE-2020-7247
Also updates the check to be more precise. I had originally copied the
check method from the Morris worm Sendmail exploit:

220 simh Sendmail 5.51/5.17 ready at Wed, 18 Dec 85 11:14:07 PST

Note that there was no "ESMTP" string in 1985's Sendmail.
2020-02-28 10:42:02 -06:00
William Vu 4cd52c5f32 Reorder Expect mixin's send_expect parameters 2020-02-27 02:48:11 -06:00
William Vu 8820944696 Fix exploit/unix/smtp/opensmtpd_mail_from_rce 2020-02-27 02:11:08 -06:00
William Vu 62c98710ad Reword vulnerable commit range 2020-02-06 11:03:20 -06:00
William Vu e053ed7a1e Add Msf::Exploit::Expect mixin and refactor again 2020-02-05 21:16:24 -06:00
William Vu 95fa8602bc Refactor modules that use Expect 2020-02-05 21:16:21 -06:00
William Vu 81f9fc7608 Refactor arbitrary payload support 2020-02-05 17:01:54 -06:00
William Vu dae06ab0c9 Reword comments in morris_sendmail_debug
Not sure why I used singular, but it was probably reading too much RFC.
2020-02-05 14:23:29 -06:00
RageLtMan e2d0d8f011 Cleanup module and permit alternate payload scheme
The original Qualys exploit uses an inline-shell for loop to read
and thereby consume lines from the input stream preceeding the
intended script for execution in the body section. Payloads which
do not contain bad characters (encoded or coincidentally simple)
can be placed directly into the FROM field and executed in place
of the original for loop filter.
2020-02-01 15:04:22 -05:00
RageLtMan 312a3466ee Update 2020-7247 to execute from body
Using method from
https://www.openwall.com/lists/oss-security/2020/01/28/3

Attempted several other line readers via awk, while, for. Tried
without pipes or `>` in the strings. It appears other characters
are also illegal (conditional brackets likely culprits).

Initial testing on wide-open-configured opensmtpd on OpenBSD 6.6
libvirt Vagrant image produces shells, python meterpreter sessions,
and executes generic commands.
2020-01-31 04:32:03 -05:00
William Vu 81b8d5b58a Add OpenSMTPD MAIL FROM RCE 2020-01-29 05:10:43 -06:00
William Vu 01b6bc112d Rescue EOFError for good measure 2019-12-23 19:02:13 -06:00
William Vu 81f8f4f67f Add ForceExploit to 4.3BSD (VAX) exploits 2019-12-23 18:17:09 -06:00
William Vu 32334c2386 Update all module splats from http:// to https:// 2019-08-15 18:10:44 -05:00
William Vu 90b9204703 Update DisclosureDate to ISO 8601 in my modules
Basic msftidy fixer:

diff --git a/tools/dev/msftidy.rb b/tools/dev/msftidy.rb
index 9a21b9e398..e9ff2b21e5 100755
--- a/tools/dev/msftidy.rb
+++ b/tools/dev/msftidy.rb
@@ -442,6 +442,8 @@ class Msftidy
     # Check disclosure date format
     if @source =~ /["']DisclosureDate["'].*\=\>[\x0d\x20]*['\"](.+?)['\"]/
       d = $1  #Captured date
+      File.write(@full_filepath, @source.sub(d, Date.parse(d).to_s))
+      fixed('Probably updated traditional DisclosureDate to ISO 8601')
       # Flag if overall format is wrong
       if d =~ /^... (?:\d{1,2},? )?\d{4}$/
         # Flag if month format is wrong
2018-11-16 12:18:28 -06:00
William Vu 458f635159 Add supported payloads to module description 2018-10-24 01:30:27 -05:00
William Vu 839c4e0467 Drop rank to AverageRanking for now 2018-10-24 01:30:17 -05:00
William Vu 37560760df Add RequiredCmd for generic and telnet 2018-10-24 01:23:15 -05:00
William Vu 58a6c4137d Add a better timeout than expect can provide 2018-10-20 13:56:37 -05:00
William Vu a965abaf36 Add full payload support by setting $PATH 2018-10-20 13:56:33 -05:00
William Vu 60c4b87ad1 Prefer expect over sleeping between writes 2018-10-20 13:15:15 -05:00
William Vu ad6f15c8ca Add Morris worm sendmail debug mode exploit 2018-10-20 13:15:01 -05:00
William Vu 4c036e70c1 Fix http://seclists.org links to https://
I have no idea how this happened in my own code. I was seeing https://.
2018-09-15 18:54:45 -05:00
Wei Chen 3d0d8f7773 Update false negatives on post auth information 2018-08-20 15:43:07 -05:00
Patrick Webster 2f6da89674 Change author name to nick. 2017-11-09 03:00:24 +11:00
William Vu 9b75ef7c36 Land #8343, qmail Shellshock module 2017-09-29 00:28:30 -05:00
William Vu daedf0d904 Clean up module 2017-09-29 00:27:22 -05:00
Brent Cook 6300758c46 use https for metaploit.com links 2017-07-24 06:26:21 -07:00
g0tmi1k b8d80d87f1 Remove last newline after class - Make @wvu-r7 happy 2017-07-19 11:19:49 +01:00
Gabriel Follon a8983c831d Updated links and authors 2017-05-04 18:25:45 -04:00
Gabriel Follon afe801b9e8 Updated target to 'universal' 2017-05-04 16:25:41 +02:00
Gabriel Follon 073cd59cd3 Added qmail_bash_env_exec exploit module, which exploit the ShellShock flaw via Qmail. 2017-05-04 15:44:18 +02:00