Skip to contentSkip to conversation

Is this possible?

DISCUSSION Michael Thompson 4 participants 5 messages Feb 11, 2005 – Feb 15, 2005

lore
Share & tools
lore
#0 lore raw

I have a issue where I cannot connect to my server because the firewall only allows ports 80 and 443 out.

I previously ran SSH on port 443 to overcome this, but I have had to implement a HTTPS solution for users who wanted secure access, so that is now gone.

This system has DNS records for ssh.server.co.uk and www.server.co.uk, so can I use IPTables or similar to recognise if it is being connected to via ssh.server.co.uk on port 443 and forward the traffic to port 22? If www.server.co.uk:443 is used apache gets the traffic? Or is this (As I suspect) Impossible?

#1 lore raw
Quoted 7 lines · Michael Thompson

I have a issue where I cannot connect to my server because the firewall only allows ports 80 and 443 out.

I previously ran SSH on port 443 to overcome this, but I have had to implement a HTTPS solution for users who wanted secure access, so that is now gone.

Quoted 5 lines

This system has DNS records for ssh.server.co.uk and www.server.co.uk, so can I use IPTables or similar to recognise if it is being connected to via ssh.server.co.uk on port 443 and forward the traffic to port 22? If www.server.co.uk:443 is used apache gets the traffic? Or is this (As I suspect) Impossible?

I think the DNS trick it's impossible.
You should ask the administrator to open you the ssh port, if he let you use the 443 to run sshd then why he doesn't let you do the same in port 22/tcp or at least any other port he has open in his firewall.

Regards.

Signature · 12 lines
Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
[email protected]
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
                -- Jack Kerouac, "On the Road"
#2 lore raw
In reply to Michael Thompson
Quoted 1 line

I have a issue where I cannot connect to my server because the

firewall

Quoted 11 lines

only allows ports 80 and 443 out.

I previously ran SSH on port 443 to overcome this, but I have had to implement a HTTPS solution for users who wanted secure access, so that is now gone.

This system has DNS records for ssh.server.co.uk and www.server.co.uk, so can I use IPTables or similar to recognise if it is being connected to via ssh.server.co.uk on port 443 and forward the traffic to port 22? If www.server.co.uk:443 is used apache gets the traffic? Or is this (As I suspect) Impossible?

I don't think that's possible, because the address resolution happens on the client side. Both names are resolved to your one IP address before you ever see any packets.

One option would be to get a second IP address. Another would be to get the client admins to open an outgoing port in their firewall, as Jose suggests.

A third possibility would be to direct both sets of traffic to port 443, and use application-level filtering to distinguish them. See for example
http://l7-filter.sourceforge.net/. I see that they have a pattern for recognizing SSH, that's supposed to work well. They don't have one for HTTPS, but you could either assume that as the default for non-SSH traffic, or maybe write your own pattern.

Good luck,
Andrew.

#3 lore raw

If your firewall is using a proxy to allow this access, most default to allow 563 nntps as well, run your ssh server on that port

Alex

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andrew Schulman
Sent: Tuesday, 15 February 2005 3:54 AM
To: [email protected]
Subject: Re: Is this possible?

Quoted 1 line

I have a issue where I cannot connect to my server because the

firewall

Quoted 11 lines

only allows ports 80 and 443 out.

I previously ran SSH on port 443 to overcome this, but I have had to implement a HTTPS solution for users who wanted secure access, so that is now gone.

This system has DNS records for ssh.server.co.uk and www.server.co.uk, so can I use IPTables or similar to recognise if it is being connected to via ssh.server.co.uk on port 443 and forward the traffic to port 22? If www.server.co.uk:443 is used apache gets the traffic? Or is this (As I suspect) Impossible?

I don't think that's possible, because the address resolution happens on the client side. Both names are resolved to your one IP address before you ever see any packets.

One option would be to get a second IP address. Another would be to get the client admins to open an outgoing port in their firewall, as Jose suggests.

A third possibility would be to direct both sets of traffic to port 443, and use application-level filtering to distinguish them. See for example
http://l7-filter.sourceforge.net/. I see that they have a pattern for recognizing SSH, that's supposed to work well. They don't have one for HTTPS, but you could either assume that as the default for non-SSH traffic, or maybe write your own pattern.

Good luck,
Andrew.

#4 lore raw

Quoting Alex Samad <[email protected]>:

Quoted 5 lines

If your firewall is using a proxy to allow this access, most default to allow 563 nntps as well, run your ssh server on that port

Alex

<Snip>

Thanks for all your suggestions I solved it by adding a aliase to the Internet NIC and slapping a unused IP onto it. Then I run a portforward from there to port 22 on the system.

That way I still have HTTPS and can access 443 on a different IP, and they all lived happily ever after.

Works well.

Signature · 6 lines
Mike

----------------------------------------------------------------
This message was sent for a thompsonmike.co.uk address, and may
not reflect the views or opinions of the Network owner. All Views
and Opinions are those of the author.