Commit Graph

295 Commits

Author SHA1 Message Date
Spencer McIntyre 03698ec214 Fix how the psh mixing issues meterpreter commands 2017-03-16 08:45:10 -04:00
Brent Cook 836da6177f Cipher::Cipher is deprecated 2017-01-22 10:20:03 -06:00
Brent Cook f69b4a330e handle Ruby 2.4 Fixnum/Bignum -> Integer deprecations 2017-01-22 10:20:03 -06:00
OJ 0737d7ca12 Tidy code, remove regex and use comparison for platform checks 2016-10-29 13:41:20 +10:00
OJ 1d617ae389 Implement first pass of architecture/platform refactor 2016-10-28 07:16:05 +10:00
Brent Cook 63bf93be1b code and style cleanups 2016-10-08 21:04:15 -05:00
Pearce Barry 3f5ed75198 Relocate Rex::Platform:Windows content (fixes MS-1714) 2016-09-19 14:34:44 -05:00
wchen-r7 265adebd50 Fix typo 2016-08-19 10:44:24 -05:00
wchen-r7 0f4d26af19 Update yard doc 2016-08-18 17:18:16 -05:00
wchen-r7 2a61450511 Add new POST exploitation APIs for stealing a token 2016-08-18 17:08:21 -05:00
Brendan b25b2a5188 Cleaned up code per suggestions in the PR 2016-08-16 16:16:25 -05:00
Brendan 0778b77f7b Cleaned up a little 2016-08-15 12:20:28 -07:00
Brendan 7730e0eb27 Added ability to retrieve .NET versions 2016-08-15 11:29:00 -07:00
wchen-r7 e08c4a8bef Remove .Net check
cmd_exec doesn't seem to be the best way to go because there is
some issue grabbing the output sometimes.
2016-08-11 10:49:06 -05:00
wchen-r7 3851db7bcb Use powershell when possible 2016-08-10 15:14:11 -05:00
wchen-r7 766c0cc539 return nil if no .Net is installed 2016-08-05 11:36:32 -05:00
wchen-r7 11f94a6efc Do a different wmic query for newer systems 2016-08-04 14:50:46 -05:00
wchen-r7 3ea3d95744 Add methods to check .Net and Powershell versions 2016-08-03 17:49:15 -05:00
Brent Cook 194a84c793 Modify stdapi so it also uses exist? over exists? for ruby parity
Also add an alias for backward compatibility.
2016-04-23 17:31:22 -04:00
OJ 3898d11aa7 Add Windows 10 entry to the version check regex 2016-04-13 08:23:01 +10:00
jvazquez-r7 d5a010c230 Add support for registry_key_exist? 2015-10-22 16:07:38 -05:00
jvazquez-r7 53f995b9c3 Do first prototype 2015-09-10 19:35:26 -05:00
HD Moore a2d5511e39 Land #5379, new post modules to load into powershell sessions 2015-08-26 17:11:40 -05:00
HD Moore b14889ad5c Small typo fix 2015-08-26 17:09:33 -05:00
Meatballs ef33f36bda Remove untrusted il 2015-08-01 23:20:00 +01:00
Meatballs 2d9bc64457 Fix WMIC Post Library for SYSTEM
SYSTEM doesn't have a proper clipboard?
2015-08-01 23:11:09 +01:00
Meatballs 5bcb63476d Add high integrity level check 2015-08-01 23:10:51 +01:00
Mo Sadek 366d42a0d8 Land #5609, Fuzzer.rb and file_info.rb YARD doc update 2015-07-06 14:12:55 -05:00
jvazquez-r7 02cd2a9cd9 Fix #3951 Update Windows::Registry to use cmd_exec 2015-06-29 12:07:37 -05:00
wchen-r7 1d9caeffc0 Update documentation for fuzzer.rb and file_info.rb
See #5599
2015-06-26 11:22:30 -05:00
Tod Beardsley 15f9fc5d8f Land #5599, YARD for fuzzer.rb 2015-06-25 14:37:55 -05:00
Mo Sadek 31c35715fc YARD Documentation for file_info.rb 2015-06-25 11:08:35 -05:00
benpturner b3754d750f Compression on a pre-script does not work in this context. Removed the elsif part of this code 2015-06-14 22:46:42 +01:00
RageLtMan d9c046449d Fix comparison of string to Fixnum 2015-06-14 16:55:46 -04:00
RageLtMan 6d5e0b93d3 Use random id generator appropriately
Powershell::Script includes a random generator (@rig) which can
produce non repeating randomized identifiers to be used as var
names within the PSH code.

Unwrap script handling in powershell env stager to instantate a
method-local Powershell::Script object and access its :rig to
generate identifiers.
2015-06-14 14:53:51 -04:00
RageLtMan f575b31d58 Remove double assignment typo 2015-05-29 05:05:35 -04:00
RageLtMan 1a08da09cb Fix compression check logic
Initial check logic would compress any script, even those which
would not need it since an uncompressed script fitting the buffer
would likely fit compressed (unless its uncompressable and the
decoder stub overflows). Ensure that compression occurs only when
a compressed script would fit while the uncompressed one does not.
2015-05-29 04:15:57 -04:00
RageLtMan e9821f6a70 Update stage_psh_env method
Replace variable names with generated strings to increase entropy.

Add compression test for stager to determine if a compressed PSH
script will fit into the allowed space. If so, compress and exec
without staging.

Add variable name cleanup to stager mechanism - Remove-Variable
with -ErrorAction SilentlyContinue is called on each stager var
name after the stager executes.

TODO: Update method documentation
2015-05-29 04:04:51 -04:00
RageLtMan f575fb8df9 Merge branch 'feature-merge_psh_updates_201505'
Conflicts:
	lib/msf/core/post/windows/powershell.rb

Rename upload_script_via_psh to stage_psh_env within post PSH lib.
Perform the same rename within load_script post module.
2015-05-29 03:42:25 -04:00
benpturner e06f47b2bd Updates load_script to have support for folders and to include the stager process in the mixin module for other post mods 2015-05-25 15:48:27 +01:00
RageLtMan 27e12754fe Import Powershell libraries and sample post module
Sync critical functionality from Rex and Msf namespaces dealing
with encoding and processing of powershell script for exploit
or post namespaces.

Import Post module. Primarily adds a psh_exec method which will be
replaced in the next PR with @benpturner's work integrated into
the Post module namespace.

Provide a sample metasploit windows post module to show the
execution pipeline - entire subs process can be removed and the
module reduced to a psh_exec(datastore['SCRIPT']).

This commit is designed to provide sync between the SVIT fork and
upstream. Pending commits to be based on this work will provide
access to .NET compiler in the Post namespace to be used for
dynamic persistent payload creation on target and the import of
@benpturner's work.
2015-05-20 18:18:51 -04:00
David Maloney 92799266c6 fix typo
you happy now?
2015-05-14 15:06:01 -05:00
David Maloney 9308da7956 2003 code path working
using VSS directly on server 2003 and repairing
the database with esentutl is now working

MSP-12358
2015-05-13 12:25:44 -05:00
jvazquez-r7 4224008709 Delete print_debug/vprint_debug 2015-04-21 11:14:03 -05:00
root 51dd88114b Fix grammer in comments 2015-04-13 13:21:41 +05:00
Jon Cave b1a7e77fa9 Correct domain controller server type constants
The should be specified in hex as BAKCTRL is 16, not 10. CTRL should
be 8. See documentation for NetServerEnum.
2015-04-05 11:12:18 +01:00
root 0dd987d873 Updated as per jlee-r7 feedback 2015-04-03 10:17:54 +05:00
root 4ba761986f Correct YARD doc comments 2015-04-02 16:14:25 +05:00
Meatballs 9eca3a0ab5 Impersonation spec 2015-03-29 00:52:27 +00:00
Meatballs f7e3abf760 sqlcmd specs and fixes 2015-03-28 23:23:00 +00:00