browserterminaltelnetmobaxterm

How to use MobaXterm as default telnet handler in EVE-NG?


I was trying to find a way to open the EVE-NG's telnet://A.B.C.D:xxx links directly via MobaXterm (Actually, Putty and SecureCRT work fine on my machine).

But when I installed the software, I even cannot see that option in the Default Apps window (Choose default apps by protocol, Windows 10). So, like SecureCRT I create a .reg file like below,

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet]
@="telnet"

[HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\DefaultIcon]
@="C:\\Program Files (x86)\\Mobatek\\MobaXterm\\MobaXterm.exe, 0"

[HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\shell]

[HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\shell\open]

[HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\shell\open\command]
@="\"C:\\Program Files (x86)\\Mobatek\\MobaXterm\\MobaXterm.exe\" /T %1"

[HKEY_CURRENT_USER\SOFTWARE\MobaXterm]

[HKEY_CURRENT_USER\SOFTWARE\MobaXterm\Capabilities]

[HKEY_CURRENT_USER\SOFTWARE\MobaXterm\Capabilities\URLAssociations]
"telnet"="MobaXterm.telnet"

[HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications]
"MobaXterm"="Software\\MobaXterm\\Capabilities"

Then, I can see the MobaXterm option in the Default Apps. After changing the default program, the new terminal can be invoked immediately when clicking the EVE-NG icon on browser, but it still cannot connect to the running device. That is to say, MobaXterm can pop up automatically, but I can only see the starting interface of the software, and still cannot manipulate the device.

I am not sure if it is because the parameters added to the Registry Key are not correct (like "/t, %h, %p"). Can anyone give some advice to me?

Thanks in advance!


Solution

  • I also was interested in this and made a solution for it. First of all I analyzed what parameters MobaXterm has and found them on their official website: https://blog.mobatek.net/post/mobaxterm-command-lines/

    If we want to open a new session in MobaXterm, we should use -newtab parameter followed by command we want to run or to connect to. For telnet you should use command like this: telnet -r {host} {port}. Here the problem is that when you click on the host in EVE-NG, it calls telnet://host:port, so we can't call MobaXterm using it directly. So I created a batch script that will split the host and port and call MobaXterm in proper way.

    Here is the instruction how to configure it:

    1. Create file named start_mobaxterm.bat in C:\Program Files\EVE-NG

    2. Paste next code into it:

      @echo off
      
       SET input=%1
       FOR /f "tokens=1,2,3 delims=:" %%a IN ("%input%") do SET host=%%b&SET port=%%c
      
       SET host=%host:~2%
       echo %host%
       echo %port%
      
       cd C:\Program Files (x86)\Mobatek\MobaXterm
       MobaXterm.exe -newtab "telnet -r %host% %port%"
       
    3. Create a file named win10_64bit_MobaXterm.reg (or whatever you like)

    4. Paste code:

      Windows Registry Editor Version 5.00
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet]
       @="telnet"
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\DefaultIcon]
       @="C:\\Program Files (x86)\\Mobatek\\MobaXterm\\MobaXterm.exe, 0"
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\shell]
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\shell\open]
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\MobaXterm.telnet\shell\open\command]
       @="\"C:\\Program Files\\EVE-NG\\start_mobaxterm.bat\" %1"
      
       [HKEY_CURRENT_USER\SOFTWARE\MobaXterm]
      
       [HKEY_CURRENT_USER\SOFTWARE\MobaXterm\Capabilities]
      
       [HKEY_CURRENT_USER\SOFTWARE\MobaXterm\Capabilities\URLAssociations]
       "telnet"="MobaXterm.telnet"
      
       [HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications]
       "MobaXterm"="Software\\MobaXterm\\Capabilities"
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\telnet\shell]
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\telnet\shell\open]
      
       [HKEY_CURRENT_USER\SOFTWARE\Classes\telnet\shell\open\command]
       @="\"C:\\Program Files\\EVE-NG\\start_mobaxterm.bat\" %1"
      
       [Computer\HKEY_CLASSES_ROOT\telnet\shell\open\command]
       @="\"C:\\Program Files\\EVE-NG\\start_mobaxterm.bat\" %1"
       
    5. Reboot your computer

    Now when you will click on the host in EVE-NG, it will call this script which will call MobaXterm with required parameters.

    P.S. If after reboot when you click on the host it is still openning Putty, do next:

    1. Go to Windows "Default apps"
    2. Click on "Choose default apps by protocol"
    3. Find "TELNET" and choose "start_mobaxterm"