Jump to content

AutoSSH & UI


raz0r

Recommended Posts

Hey all

Can someone please help finally managed to get Autossh to work god knows why it took me so long !!!.

Question is i have the tunnel working to my VPS and visa verser, now ! how do i get it to connect to the UI on port 1471 via the browser. ?

Ill post my config in a bit as im away at the mo.


config autossh
option gatetime '0'
option monitorport '20000'
option poll '600'
option ssh '-i /etc/dropbear/id_rsa -N -T -R 2222:localhost:22 root@server -p 2203'

Regards

Raz0r

Edited by raz0r
Link to comment
Share on other sites

Raz0r,

I keep trying to catch you in IRC. I was trying to tell you in the other thread that your VPS (relay server) doesn't normally connect to your pineapple, it's the other way around.

I've posted this in other topics, but my /etc/config/autossh "option ssh" line looks like:

-i /root/.ssh/id_rsa -N -T -R 1471:localhost:1471 -R 2223:localhost:22 tunnel@my-server.org -p 222

To connect to my pineapple via Putty, I just created (and saved) root@localhost port 2223, and under the session's "local proxy command" I have:

"C:\Program Files (x86)\PuTTY\plink.exe" my-server.org -P 222 -l tunnel-agent -nc %host:%port

To browse to the pineapple, I create a "shortcut," that contains:

"C:\Program Files (x86)\PuTTY\plink.exe" -N -L 1471:localhost:1471 tunnel@my-server.org -P 222

Then I browse to: http://localhost:1471

I hope this helps. (It's almost the same using an SSH client in Linux and you probably won't need the "-P 222"; my server is on a no-standard port.)

Link to comment
Share on other sites

It was buddy i got the SSH connection working a few days ago i was missing the -p 2203 switch which wasn't available on the infusion rather then using the standard port 22 i think that would be hand to have the option on the infusion so you can change the port from the standard 22.

Also noticed this when using your config http://share.pho.to/6EUZX

I take it you have modified the infusion so this doesn't happen.

I was trying now to get to the UI i have used your config then from my VPS opened Firefox and put http://localhost:1471 but it doesn't connect i have also configured the proxy part on Firefox too.

Kind Regards

Raz0r

Edited by raz0r
Link to comment
Share on other sites

I'm sorry you are having so much trouble raz0r. The infusion does not parse the autossh command line but rather just assumes that certain args will be in certain positions. When you change the command line, the infusion doesn't keep up. I copied and modified the infusion to just let me edit the entire command line. (Until then, I simply edited the /etc/config/autossh file with vi.) When you change the command line outside the infusion, the infusion won't look right, but you can do so much more.

I used different port numbers in my example to keep them all straight, but SSH on your VPS will probably be on the standard SSH port 22 (not 222), so you could drop the -p 222 (-P 222) everywhere.

If you are on your VPS running Firefox (a temporary step I assume), and your pineapple has opened a tunnel to your VPS with a port forward to localhost:1471 on your VPS, then just open that without any proxy in Firefox.

If you are on your windows laptop and want to do the same thing, run the shortcut I described (modified for your specific configuration of course) and browse to localhost:1471 there. (If you are on a Linux laptop, you can do the same thing with the SSH client and config file.)

Did the Hak5 segment I referenced in another topic help? I thought that would help to understand conceptually what is going on. Actually, the whole SSH series was pretty good as I recall.

If you're just trying to get started, why don't you use the infusion as is, doing SSH first, and when you get that working, do just port 1471. After that works separately, put it all together.

Link to comment
Share on other sites

Brilliant :)

Done just what you said and it works all i need now is both working :)

Yes the Hak5 segment helped a lot but nothing is for the Mark V that's why I'm always getting confused lol

Would you mind sending your modified infusion for Autossh over.

Thanks again for your help fella.

Raz0r

Edited by raz0r
Link to comment
Share on other sites

Excellent!

If you compare the /etc/conf/autossh file for both configurations, you'll easily see what you have to to to get both working at the same time. So if you have it set up for SSH, then you can edit /etc/conf/autossh (with vi or nano) and insert "-R 1471:localhost:1471" just before your VPS host name. (Don't change the setup/Settings in the infusion after you've done this.)

Post your final command line here (redact your server) and lets see how it works for you.

Darren says they're going to update the infusion soon, so I'm planning to delete my hacked up clone.

Link to comment
Share on other sites

I have managed to get it to work like you said i changed the port to 1471 and it worked 100% no problem but i cant get both to work at the same time with the config you posted.

As this is the problem i have http://share.pho.to/6EUZX i know that you have modified the script to get it to work what helped me in /etc/conf/autossh that i see was just at the end you had the -p option to change the port :)

I totally understand the ssh tunnel now but when i try to use it with the infusion it cancels my port number due to the fact I'm not using port 22 on my VPS I'm using 2203 if you save this in the infusion check it after you see that it doesn't save your custom port number maybe this is something that needs to be looked at no wounder i was having so many problems.

It would be nice to see not only the ability to be able to use a custom port rather then 22 but also to be able to use 2 ports for the Pineapple IE 2222 and 1471.

Thanks again for your help fella

Kind Regards

Raz0r

Edited by raz0r
Link to comment
Share on other sites

I think you missed the part where I said: "(Don't change the setup/Settings in the infusion after you've done this.)"

Either edit the config file via the infusion, or via the editor (e.g. nano), but not both. If you want both ports forwarded, you must choose the editor and ignore the Settings portion of the infusion and its Save button.

As I also explained: "The infusion does not parse the autossh command line but rather just assumes that certain args will be in certain positions. When you change the command line, the infusion doesn't keep up." So when you edit the arguments in the config file, they will not look right in the infusion. You can still use all the other parts of the infusion, but if you want to forward both ports, stay away from and ignore the "Settings" section under the "Setup" tab.

What I did recommend, was setting both up separately via the infusion, and examining the config file of both. Go ahead and post both versions of the "option ssh" here, redacting your relay host name (or IP). Also post the final version that you think is correct and I'll have a look for you. They should look like:

-i /etc/dropbear/id_rsa -N -T -R 1471:localhost:1471 raz0r-relay.org
-i /etc/dropbear/id_rsa -N -T -R 2203:localhost:22 raz0r-relay.org
-i /etc/dropbear/id_rsa -N -T -R 1471:localhost:1471 -R 2203:localhost:22 raz0r-relay.org

So I would expect your final option ssh config line to look like:

        option ssh '-i /etc/dropbear/id_rsa -N -T -R 1471:localhost:1471 -R 2203:localhost:22 raz0r-relay.org'
Edited by fringes
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...