Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

How to create a batch file that runs a hidden reverse SSH tunnel in background?

So i tried to create a batch file that does this in the startup folder, trying to make it as minimize as possible to avoid AV detection, for example i don't want to try scheduled task or VBS. so just a batch file




So these are the things i tried in the batch file but non worked :

ssh with -f and/or -o flag

start /min cmd.exe /C "ssh ..."

start /B cmd.exe /C "ssh ..."

non of them worked, they either didn't connect, or not really stealthy (with a new CMD spawning and not dying)



when i dont include option N and say -f, it doesn't work and i cannot connect from other side

when i do say -fN, weirdly enough (with or without /min) a new empty cmd shell spawns, and even when i close it manually i can still connect! tried killing cmd.exe after a timeout to close it automatically but that didnt work


but there has to be a way, how can i send a reverse ssh tunnel in a batch file without user noticing it?
just drop your rsa keys into their .authorized_keys, use the libssh2 library and reverse tunnel.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:02 AM 4 214 Sep 24, 2026 10:02 AM
Last Post: Anonynuk
[Shell] by Eternal BlueMay 14, 2022 04:02 PM 4 227 May 14, 2022 04:02 PM
Last Post: Sajuuk
[Shell] by fisica638Oct 30, 2019 11:05 AM 1 534 Oct 30, 2019 11:05 AM
Last Post: Hackoo