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

Shell 

Looking for a method to reverse SSH back home

Hi all, I'm working on a project and I'm trying to figure out a way to have my device phone home and open up a terminal when connected to the internet. I'm unsure as to how to go about this properly. I've looked into AutoSSH but it doesn't seem like exactly what I need (I could be wrong here). Thanks in advance.
Have you looked into using a tertiary server that you could have a home computer connected to and SSH into that?

i.e. Have home server A connect to a cloud server B on a cron interval. Then have your device (when mobile) connect to server B. While on server B, ssh -p [port] where port is the current port that server A is ssh'd on.
wait open a terminal on your computer at home as soon as it's on the internet?

if so, use this
Code
@echo off
:here
if not %ERRORLEVEL%==0 goto terminal
::this will keep loopning until its connected to the internet
goto here

:terminal
::okay so lets say it has connected to the internet, it should start your terminal now
::idk which terminal you use, so i'll use Putty as example?
echo Device is connected to the internet
start C:\Program^ Files\PuTTY\putty.exe
pause & exit

I think this is what you're looking for?
(Apr 24, 2018 08:01 PM)the-aphelion Wrote:  Hi all, I'm working on a project and I'm trying to figure out a way to have my device phone home and open up a terminal when connected to the internet

What device are you using to "phone home", E.T.?
(May 1, 2018 07:30 AM)ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ Wrote:  What device are you using to "phone home", E.T.?

I'm an idiot for leaving out something that important. Device is a Pi 3.


(Apr 30, 2018 10:48 PM)FantaŠec Wrote:  Have you looked into using a tertiary server that you could have a home computer connected to and SSH into that?

i.e. Have home server A connect to a cloud server B on a cron interval. Then have your device (when mobile) connect to server B. While on server B, ssh -p [port] where port is the current port that server A is ssh'd on.

Well the plan was to have the Pi 3 phone to a permanent home server and use it as an intermediary. However I didn't know that you can forward through the tertiary server like that. I looked up as much as I could during my research but apparently I didn't research well enough. I'm going to give that a try. And I'll report back.
(May 1, 2018 05:26 PM)the-aphelion Wrote:  I'm an idiot for leaving out something that important. Device is a Pi 3.



Well the plan was to have the Pi 3 phone to a permanent home server and use it as an intermediary. However I didn't know that you can forward through the tertiary server like that. I looked up as much as I could during my research but apparently I didn't research well enough. I'm going to give that a try. And I'll report back.

Did you every get this successfully working? This is basically a reverse tunnel over a tertiary server and is used a lot in practice in security and system administration.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by Tr0jandogOct 11, 2019 08:32 PM 1 204 Oct 11, 2019 08:32 PM
Last Post: stderr
[C] by MeterpreterJun 25, 2018 06:22 PM 0 132 Jun 25, 2018 06:22 PM
Last Post: Meterpreter
[C#] by LrrrJul 15, 2015 09:55 AM 1 205 Jul 15, 2015 09:55 AM
Last Post: Sir Panda