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

portfwd seems broken #18291

Closed
fordpref opened this issue Aug 16, 2023 · 3 comments · Fixed by #18431
Closed

portfwd seems broken #18291

fordpref opened this issue Aug 16, 2023 · 3 comments · Fixed by #18431
Assignees
Labels
bug confirmed Issues confirmed by a committer not-stale Label to stop an issue from being auto closed

Comments

@fordpref
Copy link

fordpref commented Aug 16, 2023

Steps to reproduce

How'd you do it?

  1. Meterpreter session on internal host behind a proxy is not reporting the internal address
  2. Need to connect to another internal host
  3. setup portfwd add -l 445 -p 445 -r 10.10.120.15
  4. adds successfully, opens listener on local host, fails to foward traffic.
  5. has worked once today on one host and after shell lost will not work on any of them.
  6. Appears to be something wrong in logic as the output of portfwd list is below:
meterpreter > portfwd add -l 445 -L 127.0.0.1 -p 445 -r 10.10.120.15
[*] Forward TCP relay created: (local) 127.0.0.1:445 -> (remote) 10.10.120.15:445
meterpreter > portfwd list

Active Port Forwards
====================

   Index  Local             Remote         Direction
   -----  -----             ------         ---------
   1      10.10.120.15:445  127.0.0.1:445  Forward

1 total active port forwards.

Seems like local should be 127.0.0.1:445 and remote should be 10.10.120.15:445

Expected behavior

Expected to run local tools to 127.0.0.1:445 and get access to the internal host at 10.10.120.15

Current behavior

What happens instead?

Everything times out.
Even when trying to other ports like port 80 on other hosts

Metasploit version

Framework: 6.3.27-dev
Console : 6.3.27-dev

Additional Information

If your version is less than 5.0.96, please update to the latest version and ensure your issue is still present.

If the issue is encountered within msfconsole, please run the debug command using the instructions below. If the issue is encountered outisde msfconsole, or the issue causes msfconsole to crash on startup, please delete this section.

===8<=== CUT AND PASTE EVERYTHING BELOW THIS LINE ===8<===

Module/Datastore

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

Collapse
[framework/core]
ConsoleLogging=True
SessionLogging=True
LogLevel=5
TimestampOutput=True
PromptTimeFormat=%Y.%m.%d-%H:%M
Prompt=(%T %L sess:%S jobs:%J) msf:
SERVICE_DESCRIPTION=CATT Assessment Related
SERVICE_DISPLAY_NAME=CATT Process
SERVICE_NAME=CATTSVC

[framework/database/zc6OYjvR]
url=[Filtered]

[framework/ui/console]
ActiveModule=post/windows/manage/run_as
ActiveWorkspace=htb-rasta

[windows/manage/run_as]
WORKSPACE=
VERBOSE=false
SESSION=
EXE::EICAR=false
EXE::Custom=
EXE::Path=
EXE::Template=
EXE::Inject=false
EXE::OldMethod=false
EXE::FallBack=false
MSI::EICAR=false
MSI::Custom=
MSI::Path=
MSI::Template=
MSI::UAC=false
Powershell::persist=false
Powershell::prepend_sleep=
Powershell::prepend_protections_bypass=auto
Powershell::strip_comments=true
Powershell::strip_whitespace=false
Powershell::sub_vars=true
Powershell::sub_funcs=false
Powershell::exec_in_place=false
Powershell::exec_rc4=false
Powershell::remove_comspec=false
Powershell::noninteractive=true
Powershell::encode_final_payload=false
Powershell::encode_inner_payload=false
Powershell::wrap_double_quotes=true
Powershell::no_equals=false
Powershell::method=reflection
DOMAIN=
USER=
PASSWORD=
CMD=
CMDOUT=false
SETPASS=false

Database Configuration

The database contains the following information:

Collapse
Session Type: Connected to msf. Connection type: postgresql.
ID Hosts Vulnerabilities Notes Services
18 18 14 10 9
19 124 1 805 468
20 22 0 361 260
21 4 2 4 0
22 (Current) 17 1 5 21
Total (5) 185 18 1,185 761

History

The following commands were ran during the session and before this issue occurred:

Collapse
619    resource ~/.msf4/databasefu.rc
620    creds
621    run -j
622    resource ~/.msf4/databasefu.rc
623    ls -l /root/.msf*
624    ls -l /root/.msf
625    ls -l /root/.msf5
626    ls -l /root/.msf6
627    creds
628    previous
629    sessions
630    sessions -i 6
631    sessions
632    run
633    show options
634    set cmd delete
635    run
636    set subnet 10.10.120.0
637    run
638    set cmd autoadd
639    set session 5
640    run
641    set cmd add
642    set subnet 10.10.120.0
643    run
644    set cmd print
645    sessions -i 5
646    sessions
647    sessions -i 5
648    sessions
649    sessions -i 5
650    sessions
651    sessions -i 5
652    show options
653    run
654    set session 8
655    run
656    sessions -i 8
657    use post/windows/manage/run_as
658    show options
659    sessions -i 8
660    sesssions
661    sessions
662    services
663    sessions -i 9
664    exit
665    sessions -J
666    sessions -K
667    version
668    debug

Framework Errors

The following framework errors occurred before the issue occurred:

Collapse
[08/16/2023 12:53:14] [e(0)] core: Thread Exception: StreamMonitorRemote  critical=false    source:
    /usr/share/metasploit-framework/lib/metasploit/framework/thread_factory_provider.rb:25:in `spawn'
    /usr/share/metasploit-framework/lib/rex/thread_factory.rb:22:in `spawn'
    /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:136:in `monitor_rsock'
    /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/stream_abstraction.rb:30:in `initialize_abstraction'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/channels/socket_abstraction.rb:56:in `initialize'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb:73:in `initialize'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/channel.rb:124:in `new'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/channel.rb:124:in `create'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb:36:in `open'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb:124:in `create_tcp_client_channel'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb:93:in `create'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb:673:in `create_tcp_channel'
    /usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb:502:in `block in cmd_portfwd'
    /usr/share/metasploit-framework/lib/rex/services/local_relay.rb:58:in `on_local_connection'
    /usr/share/metasploit-framework/lib/rex/services/local_relay.rb:437:in `accept_relay_conn'
    /usr/share/metasploit-framework/lib/rex/services/local_relay.rb:509:in `block in monitor_relays'
    /usr/share/metasploit-framework/lib/rex/services/local_relay.rb:505:in `each'
    /usr/share/metasploit-framework/lib/rex/services/local_relay.rb:505:in `monitor_relays'
    /usr/share/metasploit-framework/lib/rex/services/local_relay.rb:184:in `block in start'
    /usr/share/metasploit-framework/lib/rex/thread_factory.rb:22:in `block in spawn'
    /usr/share/metasploit-framework/lib/msf/core/thread_manager.rb:105:in `block in spawn' - Rex::TimeoutError Send timed out
Call stack:
/usr/share/metasploit-framework/lib/rex/post/meterpreter/packet_dispatcher.rb:181:in `send_request'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/channel.rb:260:in `_write'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/channels/socket_abstraction.rb:102:in `_write'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/channel.rb:228:in `write'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:180:in `block (2 levels) in monitor_rsock'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:137:in `loop'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:137:in `block in monitor_rsock'
/usr/share/metasploit-framework/lib/rex/thread_factory.rb:22:in `block in spawn'
/usr/share/metasploit-framework/lib/msf/core/thread_manager.rb:105:in `block in spawn'
[08/16/2023 12:53:14] [e(0)] rex: Error in #<Rex::Services::LocalRelay:0x00007f9ef5a1c278> monitor_relays - Rex::TimeoutError Send timed out
Call stack:
/usr/share/metasploit-framework/lib/rex/post/meterpreter/packet_dispatcher.rb:181:in `send_request'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/channel.rb:260:in `_write'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/channels/socket_abstraction.rb:102:in `_write'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/channel.rb:228:in `write'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:180:in `block (2 levels) in monitor_rsock'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:137:in `loop'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-core-0.1.31/lib/rex/io/socket_abstraction.rb:137:in `block in monitor_rsock'
/usr/share/metasploit-framework/lib/rex/thread_factory.rb:22:in `block in spawn'
/usr/share/metasploit-framework/lib/msf/core/thread_manager.rb:105:in `block in spawn'
[08/16/2023 14:19:56] [e(0)] meterpreter: Error running command portfwd: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:445).
[08/16/2023 14:19:56] [e(0)] core: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:445).
Call stack:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:192:in `rescue in create_by_type'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:179:in `create_by_type'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:36:in `create'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:51:in `create_param'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:58:in `create_tcp'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:65:in `create_tcp_server'
/usr/share/metasploit-framework/lib/rex/services/local_relay.rb:259:in `start_tcp_relay'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb:497:in `cmd_portfwd'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:102:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:565:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:53:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1681:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:168:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[08/16/2023 14:28:14] [e(0)] core: Error in script: post/windows/manage/run_as - Rex::ArgumentParseError Invalid option specified: -h
Call stack:
/usr/share/metasploit-framework/lib/msf/core/data_store_with_fallbacks.rb:170:in `each'
/usr/share/metasploit-framework/lib/msf/core/data_store_with_fallbacks.rb:170:in `import_options_from_s'
/usr/share/metasploit-framework/lib/msf/base/simple/module.rb:24:in `_import_extra_options'
/usr/share/metasploit-framework/lib/msf/base/simple/post.rb:48:in `run_simple'
/usr/share/metasploit-framework/lib/msf/base/simple/post.rb:91:in `run_simple'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb:1492:in `cmd_run'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:102:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:565:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:53:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1681:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:168:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[08/16/2023 14:28:19] [e(0)] core: Error in script: post/windows/manage/run_as - Msf::OptionValidateError One or more options failed to validate: DOMAIN, USER, PASSWORD, CMD.
Call stack:
/usr/share/metasploit-framework/lib/msf/core/option_container.rb:251:in `validate'
/usr/share/metasploit-framework/lib/msf/base/simple/post.rb:58:in `run_simple'
/usr/share/metasploit-framework/lib/msf/base/simple/post.rb:91:in `run_simple'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb:1492:in `cmd_run'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:102:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:565:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:53:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1681:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:168:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[08/16/2023 14:48:07] [e(0)] meterpreter: core_channel_open: Operation failed: Access is denied.
[08/16/2023 14:48:57] [e(0)] meterpreter: core_channel_open: Operation failed: Access is denied.
[08/16/2023 15:15:20] [e(0)] meterpreter: Error running command portfwd: Rex::BindFailed The address is already in use or unavailable: (10.10.120.15:445).
[08/16/2023 15:15:20] [e(0)] core: Rex::BindFailed The address is already in use or unavailable: (10.10.120.15:445).
Call stack:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:192:in `rescue in create_by_type'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:179:in `create_by_type'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:36:in `create'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:51:in `create_param'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:58:in `create_tcp'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:65:in `create_tcp_server'
/usr/share/metasploit-framework/lib/rex/services/local_relay.rb:259:in `start_tcp_relay'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb:497:in `cmd_portfwd'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:102:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:565:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:53:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1681:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:168:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'

Web Service Errors

The following web service errors occurred before the issue occurred:

Collapse
msf-ws.log does not exist.

Framework Logs

The following framework logs were recorded before the issue occurred:

Collapse
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb:497:in `cmd_portfwd'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:102:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:565:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:53:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1681:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:168:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[08/16/2023 15:15:20] [e(0)] core: Rex::BindFailed The address is already in use or unavailable: (10.10.120.15:445).
Call stack:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:192:in `rescue in create_by_type'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:179:in `create_by_type'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket/comm/local.rb:36:in `create'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:51:in `create_param'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:58:in `create_tcp'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/rex-socket-0.1.52/lib/rex/socket.rb:65:in `create_tcp_server'
/usr/share/metasploit-framework/lib/rex/services/local_relay.rb:259:in `start_tcp_relay'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb:497:in `cmd_portfwd'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:102:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:64:in `block in interact'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:163:in `run'
/usr/share/metasploit-framework/lib/rex/post/meterpreter/ui/console.rb:62:in `interact'
/usr/share/metasploit-framework/lib/msf/base/sessions/meterpreter.rb:565:in `_interact'
/usr/share/metasploit-framework/lib/rex/ui/interactive.rb:53:in `interact'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/core.rb:1681:in `cmd_sessions'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:168:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:23:in `<main>'
[08/16/2023 15:18:18] [d(0)] core: HistoryManager.pop_context name: :meterpreter

Web Service Logs

The following web service logs were recorded before the issue occurred:

Collapse
msf-ws.log does not exist.

Version/Install

The versions and install method of your Metasploit setup:

Collapse
Framework: 6.3.27-dev
Ruby: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]
OpenSSL: OpenSSL 3.0.8 7 Feb 2023
Install Root: /usr/share/metasploit-framework
Session Type: Connected to msf. Connection type: postgresql.
Install Method: Other - Please specify

also, database drops all the time, had to create a databasefu.rc script to disconnect then reconnect. No idea why

@github-actions
Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Sep 20, 2023
@smcintyre-r7 smcintyre-r7 added the not-stale Label to stop an issue from being auto closed label Oct 5, 2023
@smcintyre-r7 smcintyre-r7 self-assigned this Oct 5, 2023
@smcintyre-r7
Copy link
Contributor

I remember seeing and I think fixing an issue similar to this in the past.

@smcintyre-r7 smcintyre-r7 moved this to In Progress in Metasploit Kanban Oct 5, 2023
@smcintyre-r7 smcintyre-r7 added the confirmed Issues confirmed by a committer label Oct 5, 2023
@smcintyre-r7
Copy link
Contributor

Yeah I was able to confirm this, thanks for reporting it to us. It looks like the output of portfwd list has the local and remote columns swapped. From what I can tell, the arguments result in the correct forwarding being configured so I think it's just the output that needs to be updated.

In this screenshot the top left window is where I setup a normal port from my host to a webserver that's running on 192.168.250.5. In the top right I'm confirming it's listening as I would expect it to be and then in the bottom right, I'm testing that I can connect to my web server through it.
image

@github-actions github-actions bot removed the Stale Marks an issue as stale, to be closed if no action is taken label Oct 6, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Metasploit Kanban Oct 10, 2023
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 not-stale Label to stop an issue from being auto closed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants