Last active
July 23, 2020 14:04
-
-
Save terenty-rezman/48f0ef8b435ae98b6092a479e65b5cee to your computer and use it in GitHub Desktop.
EVE-NG mobaXterm wrapper Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python "C:\Program Files\EVE-NG\mobaxterm_wrapper.py" %1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
import re | |
arg_str = sys.argv[1] | |
# parse protocol, host, port from arg line | |
protocol_re = r'^\w+(?=:)' | |
host_re = r'(?<=:\/\/)[^:]+(?=:)' | |
port_re = r'(?<=:)[\d|.]+' | |
protocol_match = re.search(protocol_re, arg_str) | |
host_match = re.search(host_re, arg_str) | |
port_match = re.search(port_re, arg_str) | |
protocol = protocol_match.group() | |
host = host_match.group() | |
port = port_match.group() | |
# mobaxterm run example: | |
# $ MobaXterm.exe -newtab "telnet 192.168.231.110 32771" | |
moba_command = f'{protocol} {host} {port}' | |
# launch mobaxterm with corret args from where it's installed | |
subprocess.Popen(["E:/games/Mobatek/MobaXterm/MobaXterm.exe", "-newtab", moba_command]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need python3 installed on your system obviously,
And you need to somehow point your Windows to use your
mobaxterm_wrapper.bat
whenever it triestelnet://192.168.231.110:32771
protocol for example.In my case I installed PuTTY first and then overridden the following key in
regedit
Computer\HKEY_CLASSES_ROOT\Putty.telnet\shell\open\command
to point to mymobaxterm_wrapper.bat
instead ofpytty.exe
.A bit ugly though, but works perfectly.