Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Forwarding question

1 view
Skip to first unread message

vnpenguin

unread,
May 23, 2009, 4:32:29 PM5/23/09
to
Hi list,
Here is my networking schema :

[Laptop]------[Firewall]------[Server1]------[Server2]
(outside) (LAN)

I would like to acces to port 80 of Server2 via Server1 from outside
of firewall with my laptop. So I try:

ssh -L 8888:Server2:80 me@Server1

(Server1, Server2 is the local names, given by a local DNS server in
LAN)

From my laptop when I try to load http://localhost:8888/ I was
forwarded to http://server2/. Because "server2" is the name of local
server so from outside I can not load this page. I try to replace
"Server2" by its LAN IP, but I have the same problem.

"server1" is running CentOS 5.3 with openssh-4.3p2. I miss something
on my sshd config ?

Thanks in advance,

Todd H.

unread,
May 24, 2009, 12:10:26 AM5/24/09
to
vnpenguin <vnpe...@gmail.com> writes:

The http server is probably needing a valid Host: header in the HTTP
requests in order to be successful. The trick is to fool the web
browser into providing that host header info somehow.

One possible workaround for this is to add an entry for server2 in
your local machine's host table.

/etc/hosts for *nix
C:\WINDOWS\system32\drivers\etc\hosts for windows

server2 127.0.0.1

would be the entry. Then reference http://server2:8888 as the
URL.

But... since the result needs to be 127.0.0.1.... I'm not entirely
sure that'll work.

Then you have to get a little less convenient and run an intercepting
web proxy like Paros, burp, or webscarab and set it to automagically
modify the outgoing hosts headers, swapping 127.0.0.1 for Server2

Of course there's probably a more obvious solution I've overlooked in
my minute thinking about this for ya that hopefully someone else will
contribute. There's bound to be a firefox plugin perhaps to solve
this issue too.


--
Todd H.
http://www.toddh.net/

Richard E. Silverman

unread,
May 25, 2009, 10:49:16 PM5/25/09
to
>>>>> "TH" == Todd H <comp...@toddh.net> writes:

TH> vnpenguin <vnpe...@gmail.com> writes:
>> Hi list, Here is my networking schema :
>>
>> [Laptop]------[Firewall]------[Server1]------[Server2] (outside)
>> (LAN)
>>
>> I would like to acces to port 80 of Server2 via Server1 from
>> outside of firewall with my laptop. So I try:
>>
>> ssh -L 8888:Server2:80 me@Server1
>>
>> (Server1, Server2 is the local names, given by a local DNS server
>> in LAN)
>>
>> From my laptop when I try to load http://localhost:8888/ I was
>> forwarded to http://server2/. Because "server2" is the name of
>> local server so from outside I can not load this page. I try to
>> replace "Server2" by its LAN IP, but I have the same problem.
>>
>> "server1" is running CentOS 5.3 with openssh-4.3p2. I miss
>> something on my sshd config ?
>>
>> Thanks in advance,

TH> The http server is probably needing a valid Host: header in the
TH> HTTP requests in order to be successful. The trick is to fool the
TH> web browser into providing that host header info somehow.

TH> One possible workaround for this is to add an entry for server2 in
TH> your local machine's host table.

TH> /etc/hosts for *nix C:\WINDOWS\system32\drivers\etc\hosts for
TH> windows

TH> server2 127.0.0.1

TH> would be the entry. Then reference http://server2:8888 as the
TH> URL.

TH> But... since the result needs to be 127.0.0.1.... I'm not entirely
TH> sure that'll work.

TH> Then you have to get a little less convenient and run an
TH> intercepting web proxy like Paros, burp, or webscarab and set it
TH> to automagically modify the outgoing hosts headers, swapping
TH> 127.0.0.1 for Server2

TH> Of course there's probably a more obvious solution I've overlooked
TH> in my minute thinking about this for ya that hopefully someone
TH> else will contribute. There's bound to be a firefox plugin
TH> perhaps to solve this issue too.

Assuming he's using the OpenSSH client, the poster can use the SOCKS proxy
built into ssh. Use "ssh -D<port> ...", and point the browser at
localhost:<port> as its SOCKS proxy.

TH> -- Todd H. http://www.toddh.net/

--
Richard Silverman
r...@qoxp.net

0 new messages