Commit Graph

693 Commits

Author SHA1 Message Date
bcoles 5aa91bd57c Rubocop: Resolve Rubocop Style/RedundantRegexpArgument violations 2025-05-24 13:34:32 +10:00
Spencer McIntyre 468f168f04 Call LDAP whoami when the username is not present 2025-03-27 15:00:53 -04:00
msutovsky-r7 7a1892e6e7 Land #19745, applying argument escaping to other shells
Apply escaping args to other command shells
2025-03-05 09:24:15 +01:00
Ashley Donaldson fa4dd1d420 Add error handling on unknown shell type 2025-03-05 18:16:31 +11:00
jheysel-r7 6861b1fb67 Merge pull request #19729 from sempervictus/bug/shell_command_overlap
Fix overlap of shell built-in commands with host's
2025-02-06 10:27:12 -08:00
Ashley Donaldson e024c115f3 Don't do any escaping on platforms with unknown escaping 2025-01-10 11:20:28 +11:00
Ashley Donaldson 851beb77b0 Change from code review
Co-authored-by: Julien Voisin <jvoisin@users.noreply.github.com>
2024-12-20 08:48:38 +11:00
Ashley Donaldson 25cb21908a Apply escaping args to other command shells 2024-12-18 10:44:38 +11:00
Ashley Donaldson 40f2eaaab1 Recognise broken SMB sessions and close them 2024-12-16 19:52:19 +11:00
RageLtMan df6bd846e5 Add . prefix tip to shell command help 2024-12-15 18:28:18 -05:00
RageLtMan 54bec338c3 Fix overlap of shell built-in commands with host's
When a shell session is established against a system which offers
limited shells, its very common to run into something like "help"
being a native command in the target. MSF now intercepts those as
built-ins and presents the MSF shell help instead of letting the
user see the relevant output from the target.

Implement a fix by allowing the user to prepend built-ins with '.'
to pass-through execution of the intended command (such as '.help'
being executed as 'help') to the target.

Testing:
  Local testing with racadm SSH shell - works as intended
2024-12-15 18:06:33 -05:00
sjanusz-r7 566e12b69e Add error_callback to SSH Command Stream 2024-11-25 16:43:59 +00:00
sjanusz-r7 358e79bd3c Handle SSH errors by closing the session 2024-11-17 14:53:42 +00:00
adfoster-r7 26e041dbfe Merge pull request #19108 from smashery/new_cmd_exec
New process launch API
2024-10-17 00:08:06 +01:00
Ashley Donaldson 9972587fef Handle weird PowerShell edge case 2024-10-16 16:04:39 +11:00
Ashley Donaldson 205adfe2fd Handle edge case in command shell when input contains backslash-quote combination already 2024-10-16 10:26:29 +11:00
Ashley Donaldson 1c4b22028d Comment neatening from code review 2024-10-12 14:36:09 +11:00
Ashley Donaldson 0cf227ff00 Change API. Support backwards compatibility for PHP 2024-10-12 14:36:09 +11:00
Ashley Donaldson c543971b8a Support uploading files on linux shell containing quote characters 2024-10-12 14:36:09 +11:00
Ashley Donaldson ec4e944405 Fix file upload in PowerShell 2024-10-12 14:36:09 +11:00
Ashley Donaldson 0ab16ae3af Fix bug when no arguments are present 2024-10-12 14:36:08 +11:00
Ashley Donaldson d9ed8ec4dc Rework unix command line based on testing 2024-10-12 14:36:08 +11:00
Ashley Donaldson 5d71aa26e3 Treat old-style path separately to new (unescaped) path 2024-10-12 14:36:08 +11:00
Ashley Donaldson 7d30c67b01 Fix error sending legacy args 2024-10-12 14:36:08 +11:00
Ashley Donaldson fe61e46475 Changes from code review 2024-10-12 14:36:08 +11:00
Ashley Donaldson 85d019cd3c Handle CommandLineToArgv behaviour 2024-10-12 14:36:08 +11:00
Ashley Donaldson 0d4d6f345d create_process works for basic CommandShell instances 2024-10-12 14:36:08 +11:00
Ashley Donaldson e9f86c4865 Reworked unix create_process, as it was buggy 2024-10-12 14:36:08 +11:00
Ashley Donaldson e0aca71029 Add unix shell to create_process API 2024-10-12 14:36:08 +11:00
Ashley Donaldson 72e657a19c Implement new cmd_exec API for Windows cmd 2024-10-12 14:36:08 +11:00
Ashley Donaldson 955c675334 Implement new cmd_exec API for PowerShell 2024-10-12 14:36:08 +11:00
Ashley Donaldson c732fed617 Feedback from code review 2024-10-11 08:22:39 +11:00
Ashley Donaldson 22cf3f05d5 Send a benign LDAP request every 10 minutes to keep sessions alive 2024-10-11 08:22:39 +11:00
adfoster-r7 6a31ceb9e6 Improve setg SessionLogging support 2024-07-24 17:22:11 +01:00
dledda-r7 f92ebb34ca fix: moved begin/rescue inside the update_session_info; added logging 2024-06-28 03:21:42 -04:00
dledda-r7 1a8746f076 fix: updated warning messages, inverted is_weak_key logic 2024-06-14 10:19:56 -04:00
dledda-r7 acfaf52611 feat(meterpreter): display a warning when a weak encryption aes_key is used. skip module loading if encryption is weak. 2024-06-13 09:30:17 -04:00
Dean Welch 3cedb20f75 Add initial ldap session support 2024-05-15 15:12:51 +01:00
cgranleese-r7 aa3181cc26 Land #19112, add arch and platform detection for mssql sessions 2024-04-19 16:33:28 +01:00
Zach Goldman 5c89b6aa0e add arch and platform detection for mssql sessions 2024-04-19 08:54:27 -05:00
cgranleese-r7 3f2e32ef6a Add arch/platform detection for Postgres 2024-04-15 16:04:57 +01:00
sjanusz-r7 a862b16286 Add MySQL Arch & Platform detection by query 2024-04-09 13:38:07 +01:00
Dean Welch 434e85261b Add postgres client specs 2024-04-05 13:10:15 +01:00
Dean Welch 25a65c0ed7 Consolidate and simplify session tests 2024-04-05 13:10:15 +01:00
adfoster-r7 b461f08ba3 Land #18980, improves basic shell help command 2024-03-20 21:27:12 +00:00
Zach Goldman c16b8e6e64 adds help command to basic shells 2024-03-20 14:18:36 -05:00
Dean Welch 689caf4bd1 Add upload/download/delete/mkdir/rmdir to smb session 2024-03-12 11:56:29 +00:00
Dean Welch 2399c2a393 Fix smb session autorun 2024-03-05 15:07:53 +00:00
cgranleese-r7 d52220cccb Fixes the create session datastore option from appearing for payloads 2024-02-22 14:58:41 +00:00
sjanusz-r7 085071da02 Convert generic SQL mixin into a class 2024-02-21 18:01:55 +00:00