Firefox over SSH's SOCKS-proxy

Pagina: 1
Acties:

  • Ivo
  • Registratie: Juni 2001
  • Laatst online: 14-01-2025
Ik probeer iets uiterst triviaals, maar het lukt niet. Ik wil een artikel lezen dat op de portal van ACM staat, dus moet ik vanaf een machine op de universiteit verbinden. Nu heb ik een shell-account op een bak die SSH draait. Dus ik doe "ssh -D 8080 user@host -Nf" en op poort 8080 luistert een SOCKS-proxy. Inloggen werkt prima zonder wachtwoord via sleutelondertekening, dus dat is niet het probleem.

Vervolgens stel ik in Firefox in dat ik een proxy wil gebruiken en ik vul bij SOCKS "localhost" en de poort "8080" in. Ik kies SOCKS5 als protocol en vervolgens denk ik te kunnen surfen via de proxy, maar niets is minder waar: Na een tijdje krijg ik gewoon een time-out. Iemand enig idee wat hier mis gaat?

OpenBSD 4.1-stable
OpenSSH 4.6
Firefox 2.0.0.3

  • BarthezZ
  • Registratie: Juli 2004
  • Niet online

BarthezZ

anti voetbal en slechte djs!

Uit man ssh:
-D [bind_address:]port
Specifies a local “dynamic” application-level port forwarding. This works by allocating a socket to listen
to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to
this port, the connection is forwarded over the secure channel, and the application protocol is then used to
determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are sup‐
ported, and ssh will act as a SOCKS server. Only root can forward privileged ports. Dynamic port forward‐
ings can also be specified in the configuration file.


-L [bind_address:]port:host:hostport
Specifies that the given port on the local (client) host is to be forwarded to the given host and port on
the remote side. This works by allocating a socket to listen to port on the local side, optionally bound to
the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over
the secure channel, and a connection is made to host port hostport from the remote machine. Port forward‐
ings can also be specified in the configuration file. IPv6 addresses can be specified with an alternative
syntax: [bind_address/]port/host/hostport or by enclosing the address in square brackets. Only the supe‐
ruser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts
setting. However, an explicit bind_address may be used to bind the connection to a specific address. The
bind_address of “localhost” indicates that the listening port be bound for local use only, while an empty
address or ‘*’ indicates that the port should be available from all interfaces.
Eventueel zou je -L dus kunnen gebruiken en een target selecteren om via de bak waar je shell acces op heb verkeern aar de webserver te sturen

  • Ivo
  • Registratie: Juni 2001
  • Laatst online: 14-01-2025
Dan zou ik dus op die remote machine zelf een proxy moeten installeren. Het lijkt me een stuk praktischer om de ingebouwde SSH-proxy te gebruiken. Op de eerste plaats hoef ik dan niet uit te zoeken wat geinstalleerd is en eventueel in mijn user-dir dingen gaan zitten compilen. Op de tweede plaats zou -D prima moeten werken, getuige iemand anders die hetzelfde procede volgt op een Debian-machine.

Edit: Het werkt in ieder geval als ik in plaats van "localhost" direct "127.0.0.1" invul. Dit lost mijn probleem op, maar ik begrijp niet wat het verschil is tussen deze twee? Gebruikt firefox geen gethostbyname() en wordt daarom de hosts-file genegeerd?

Edit2: Waarschijnlijk is het probleem inderdaad dat firefox geen gethostbyname() gebruikt.

[ Voor 30% gewijzigd door Ivo op 17-10-2007 23:52 ]