Skip to content

Commit 8d964db

Browse files
committed
Add custom overrides file.
Enable custom plink paths. Fix bug with non pivot mode. Signed-off-by: elModo7 <elmodo7yt@gmail.com>
1 parent 59d8888 commit 8d964db

3 files changed

Lines changed: 46 additions & 16 deletions

File tree

Tunnel Manager.ahk

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
global compiledForConsole := 0 ; ¡¡Important!! Depending on how you want to compile the script, output will be given via console (Chalk) or native MsgBox
2-
; Last changed date: 23/10/2025 19:15
2+
; Last changed date: 04/04/2026 18:45
33
; OS Version ...: Windows 10 x64 and Above (Support not guaranteed on Windows 7)
44
;@Ahk2Exe-SetName elModo7's Tunnel Manager
55
;@Ahk2Exe-SetDescription SSH Tunnel Manager for proxying`, securing and pivoting.
6-
;@Ahk2Exe-SetVersion 1.3.4
6+
;@Ahk2Exe-SetVersion 1.3.5
77
;@Ahk2Exe-SetCopyright Copyright (c) 2025`, elModo7 / VictorDevLog
88
;@Ahk2Exe-SetOrigFilename Tunnel Manager.exe
99
; INITIALIZE
@@ -77,10 +77,13 @@ FUTURE PLANS:
7777
#MaxHotkeysPerInterval, 999 ; Not really used but in case other programs may send hotkeys really fast ignoring this line could be an issue
7878
SetWorkingDir, %A_ScriptDir%
7979
SetBatchLines, -1
80-
global version := "1.3.4"
80+
global version := "1.3.5"
8181
global isVisible := 1
8282
global cmdProxy, programData, programDataJson, notificationsData, notificationsDataJson, profile, mytcp
83+
global plinkExe := "proxy.exe"
84+
global plinkPath := A_Temp
8385

86+
checkOverrides() ; Custom override config
8487
plinkPromptDownload() ; PLink install
8588
FileInstall, lib/quricol64.dll, % A_Temp "\quricol64.dll", 0 ; Install but do not overwrite quircol64.dll
8689
FileCreateDir, % A_Temp "\Tunnel_Manager"
@@ -182,13 +185,13 @@ if(!nogui){
182185
neutron.Show("w1200 h500")
183186
}
184187

185-
if(ProcessExist("proxy.exe")){
188+
if(ProcessExist(plinkExe)){
186189
OnMessage(0x44, "OnMsgBox")
187190
MsgBox 0x2, Proxy is already running!, A previous instance of the Proxy has been detected.`nIt is recommended to close previous instances before continuing.`n`nWhat will you do?
188191
OnMessage(0x44, "")
189192
IfMsgBox Abort, {
190193
; Close previous instance of Proxy
191-
RunWait, taskkill /IM proxy.exe /F,, Hide
194+
RunWait, taskkill /IM %plinkExe% /F,, Hide
192195
} Else IfMsgBox Retry, {
193196
; Continue Anyways
194197
} Else IfMsgBox Ignore, {
@@ -374,7 +377,7 @@ runTunnel(unhandledParam := ""){
374377
programData := JSON.Load(neutron.doc.getElementById("programDataJson").innerHTML)
375378
}
376379
sendNotificationOnce := 1
377-
RunWait, taskkill /IM proxy.exe /F,, Hide
380+
RunWait, taskkill /IM %plinkExe% /F,, Hide
378381
if(!tunneling){
379382
tunneling := 1
380383
setTrayTunneling()
@@ -395,12 +398,12 @@ stopTunnel(unhandledParam := ""){
395398
SetTimer, runTunnelThread, Off
396399
tunneling := 0
397400
setTrayTunneling()
398-
RunWait, taskkill /IM proxy.exe /F,, Hide
401+
RunWait, taskkill /IM %plinkExe% /F,, Hide
399402
sendNotifications("Tunnel Manager", A_ComputerName "_" A_UserName " - Tunnel Manager Stopped")
400403
}
401404

402405
runTunnelThread:
403-
if(!ProcessExist("proxy.exe"))
406+
if(!ProcessExist(plinkExe))
404407
{
405408
passwd := Crypt.Decrypt.String("AES", "ECB", programData.proxy_password, "elModo7Soft-2023")
406409
str_tunnels := ""
@@ -412,7 +415,7 @@ runTunnelThread:
412415
StringUpper, type, % tunnel.type
413416
tunnel.type := type
414417
str_tunnels .= "-" tunnel.type " "
415-
local_interface := programData.pivoting_enabled ? "0.0.0.0:" : "127.0.0.1" ; Listen on all interfaces
418+
local_interface := programData.pivoting_enabled ? "0.0.0.0:" : "127.0.0.1:" ; Listen on all interfaces
416419
if(tunnel.type == "L" || tunnel.type == "R"){
417420
if(tunnel.source_port == ""){
418421
showErrorModal("Rule Configuration Error:", "Error in Source Port, undefined source port.")
@@ -473,8 +476,9 @@ runTunnelThread:
473476
showErrorModal("Rule Configuration Error:", "No tunnels created or none active found!")
474477
return
475478
}
476-
cmdProxy := A_Temp "\proxy.exe " str_tunnels " -N -batch -no-antispoof -pw " passwd " " programData.proxy_user "@" programData.proxy_ip " -P " programData.proxy_port
477-
cmdProxyAcceptKey := "cmd /c echo yes | " A_Temp "\proxy.exe -agent -pw " passwd " " programData.proxy_user "@" programData.proxy_ip " -P " programData.proxy_port
479+
cmdProxy := """" plinkPath "\" plinkExe """ " str_tunnels " -N -batch -no-antispoof -pw " passwd " " programData.proxy_user "@" programData.proxy_ip " -P " programData.proxy_port
480+
clipboard := cmdProxy
481+
cmdProxyAcceptKey := "cmd /c echo yes | " plinkPath "\" plinkExe " -agent -pw " passwd " " programData.proxy_user "@" programData.proxy_ip " -P " programData.proxy_port
478482
if(!programData.accepted_key){
479483
RunWait, %cmdProxyAcceptKey%,, % programData.console_enabled ? "" : "Hide" ; Automatically accepts key of SSH Server once
480484
programData.accepted_key := "1"
@@ -642,18 +646,40 @@ lookForUpdates:
642646
neutron.wnd.showVersionCheckModal()
643647
return
644648

649+
checkOverrides() {
650+
global
651+
if(FileExist("overrides.conf")) {
652+
Fileread, overrides, overrides.conf
653+
Loop, Parse, overrides, `n
654+
{
655+
StringReplace, row, % A_LoopField, `n,, All
656+
StringReplace, row, % row, `r,, All
657+
row := Trim(row)
658+
if(row == "" || SubStr(row, 1, 1) == "#") {
659+
continue
660+
}
661+
rowData := StrSplit(row, "=")
662+
Switch rowData[1]
663+
{
664+
Case "plink":
665+
SplitPath, % rowData[2], plinkExe, plinkPath
666+
}
667+
}
668+
}
669+
}
670+
645671
plinkPromptDownload(){
646672
global
647673
; 1.2.28 GitHub sometimes has issues with compiled files on the repo, add download
648-
if(!FileExist(A_Temp "\proxy.exe")){
674+
if(!FileExist(plinkPath "\" plinkExe)){
649675
OnMessage(0x44, "OnMsgBoxPromptPlink")
650676
MsgBox 0x31, PLink.exe not found, This software requires plink.exe to run`, you can either download the latest version or use the built in one (recommended).`n
651677
OnMessage(0x44, "")
652678

653679
IfMsgBox OK, {
654-
FileInstall, lib/proxy.exe, % A_Temp "\proxy.exe", 0 ; 1.2.28: Do not replace Plink each time
680+
FileInstall, lib/proxy.exe, % plinkPath "\" plinkExe, 0 ; 1.2.28: Do not replace Plink each time
655681
} Else IfMsgBox Cancel, {
656-
DownloadFile("https://the.earth.li/~sgtatham/putty/latest/w64/plink.exe", A_Temp "\proxy.exe")
682+
DownloadFile("https://the.earth.li/~sgtatham/putty/latest/w64/plink.exe", plinkPath "\" plinkExe)
657683
}
658684
}
659685
}
@@ -758,7 +784,7 @@ return
758784
NeutronClose:
759785
GuiClose:
760786
ExitSub:
761-
RunWait, taskkill /IM proxy.exe /F,, Hide
787+
RunWait, taskkill /IM %plinkExe% /F,, Hide
762788
ExitApp
763789

764790
showAboutScreen:

Tunnel_manager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
<body class="d-flex flex-column main_body">
386386
<header>
387387
<div class="d-flex align-items-stretch bg-dark text-white" oncontextmenu="return false;">
388-
<span class="flex-grow-1 px-2 py-1" onmousedown="neutron.DragTitleBar()">Tunnel Manager - elModo7 / VictorDevLog v1.3.4</span>
388+
<span class="flex-grow-1 px-2 py-1" onmousedown="neutron.DragTitleBar()">Tunnel Manager - elModo7 / VictorDevLog v1.3.5</span>
389389
<span class="title-btn" onclick="neutron.Minimize()">0</span>
390390
<span class="title-btn" onclick="neutron.Maximize()">1</span>
391391
<span class="title-btn title-btn-close" onclick="neutron.Close()">r</span>

overrides.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# You can uncomment parameters in this file for custom behaviour
2+
3+
# Custom Plink Path
4+
#plink=C:\Program Files\PuTTY\plink.exe

0 commit comments

Comments
 (0)