Converter solicitações HTTP para SOCKS5

39

Atualmente, estou fazendo alguns testes com o TOR e corri para um pequeno problema. O cliente do Tor suporta apenas o recebimento de conexões através de um protocolo SOCKS5, mas os aplicativos que estou usando só suportam Protocals de Proxy HTTP.

É possível colocar algo no meio? Então, por exemplo, foi.

Meu programa (somente HTTP) > Conversor HTTP para SOCKS > Servidor SOCKS5 Tor

    
por Dustin 12.05.2012 / 05:21

6 respostas

41

Parece que o DeleGate pode fazer isso, com algo como o seguinte (onde o DeleGate aceitará conexões HTTP na porta 8080 e encaminhará para um servidor SOCKS na porta 9050):

delegated -P8080 SERVER=http SOCKS=localhost:9050
    
por 12.05.2012 / 07:00
7

O pacote Tor já não tem polipo, aqui é do FAQ oficial do responsável :

In the past, Tor bundles included an HTTP proxy like Privoxy or Polipo, solely to work around a bug in Firefox that was finally fixed in Firefox 6. Now you don't need a separate HTTP proxy to use Tor, and in fact leaving it out makes you safer because Torbutton has better control over Firefox's interaction with websites.

If you are trying to use some external application with Tor, step zero should be to reread the set of warnings for ways you can screw up. Step one should be to try to use a Socks proxy rather than an http proxy — Tor runs a Socks proxy on port 9050 on Windows, or see above for OSX and Linux.

If that fails, feel free to install privoxy. However, please realize that this approach is not recommended for novice users. Privoxy has an example configuration of Tor and Privoxy.

    
por 09.08.2013 / 07:58
5

Você não especificou um sistema operacional. Por favor, faça isso no futuro.

Esta resposta recomenda o Polipo, que está incluído no pacote Vidalia hospedado pelo projeto Tor e, portanto, provavelmente recomendado por eles para o Windows. Polipo também tem uma versão * nix (e foi originalmente projetada para * nix), então eu incluí instruções sobre como configurá-lo - veja a segunda seção abaixo. É uma solução bastante leve, se for importante.

Windows

Faça o download do pacote Vidalia. Ele inclui o Vidalia GUI e um programa chamado Polipo, junto com o Tor. No pacote, o Polipo, por padrão, executa um proxy HTTP na porta 8118 que redireciona através do proxy Tor SOCKS na porta 9050.

Configuração avançada

Também é possível configurar o Polipo manualmente, sem o pacote do Vidalia.

Extraído do link

Eles também fornecem binários que você deve baixar.

Configuração

Polipo is configured by setting a number of configuration variables in Polipo's configuration file, which is a plain text file. In order to tell Polipo to use tor and not to cache any fetched pages on disk, you will want to add the following lines to your configuration file:

socksParentProxy = localhost:9050
diskCacheRoot=""

You will also want to disable the local configuration interface in order to protect yourself from browser vulnerabilities:

disableLocalInterface=true

Executando

When running Polipo, you should specify the location for the configuration file, by using the -c flag on Polipo's command line:

> polipo.exe -c "/Program Files/Polipo/config.txt"

Note that even under Windows you must use Unix syntax for the filename (using forward slashes) and you cannot specify a device (“drive”) to use.

A porta de escuta padrão do Polipo é 8123.

A configuração padrão do pacote do Vidalia está incluída na parte inferior desta resposta.

* nix

Inclui Linux, Unix, BSD, OS X, a maioria dos principais sistemas operacionais modernos (2012) que não são baseados no NT (Windows).

Mais uma vez, tirada do link

Baixe um pacote de qualquer repositório que você usa. O Google pode ajudar aqui. Alternativamente, um binário direto pode ser baixado.

Configuração

Polipo is configured by setting a number of configuration variables in Polipo's configuration file, which is either ~/.polipo or /etc/polipo/config, whichever exists. In order to tell Polipo to use tor and not to cache any fetched pages on disk, you will want to add the following lines to your configuration file:

socksParentProxy = localhost:9050
diskCacheRoot=""

You will also want to disable the local configuration interface in order to protect yourself from browser vulnerabilities:

disableLocalInterface=true

If you want to specify a different location for the configuration file, you can specify it by using the -c flag on Polipo's command line.

Note that if you installed Polipo from a distribution-provided binary, it will probably not take ~/.polipo into account — you will need to edit /etc/polipo/config.

Executando

If you installed Polipo from a distribution-provided package, Polipo is probably already running; you will need to restart it so it takes its new configuration into account. Otherwise, just grab a free terminal window and type:

$ polipo

If you are using a non-standard location for Polipo's configuration file, specify it on the command line, for example:

$ polipo -c "/Program Files/Polipo/config.txt"

A porta de escuta padrão do Polipo é 8123.

A configuração padrão do pacote do Vidalia está incluída na parte inferior desta resposta.

Configuração padrão do Polipo (pacote Vidalia)

Esta é a minha configuração padrão do Polipo a partir do pacote do Vidalia para Windows. Do ponto de vista, ele deve funcionar em * nix também - não há nada específico de plataforma, tanto quanto eu posso dizer. Sim, é uma configuração IPv4.

### $Id$
#
### Basic configuration
### *******************

# Uncomment one of these if you want to allow remote clients to
# connect:

# proxyAddress = "::0"        # both IPv4 and IPv6
# proxyAddress = "0.0.0.0"    # IPv4 only

proxyAddress = "127.0.0.1"
proxyPort = 8118

# If you do that, you'll want to restrict the set of hosts allowed to
# connect:

# allowedClients = "127.0.0.1, 134.157.168.57"
# allowedClients = "127.0.0.1, 134.157.168.0/24"

allowedClients = 127.0.0.1
allowedPorts = 1-65535

# Uncomment this if you want your Polipo to identify itself by
# something else than the host name:

proxyName = "localhost"

# Uncomment this if there's only one user using this instance of Polipo:

cacheIsShared = false

# Uncomment this if you want to use a parent proxy:

# parentProxy = "squid.example.org:3128"

# Uncomment this if you want to use a parent SOCKS proxy:

socksParentProxy = "localhost:9050"
socksProxyType = socks5


### Memory
### ******

# Uncomment this if you want Polipo to use a ridiculously small amount
# of memory (a hundred C-64 worth or so):

# chunkHighMark = 819200
# objectHighMark = 128

# Uncomment this if you've got plenty of memory:

# chunkHighMark = 50331648
# objectHighMark = 16384

chunkHighMark = 33554432

### On-disk data
### ************

# Uncomment this if you want to disable the on-disk cache:

diskCacheRoot = ""

# Uncomment this if you want to put the on-disk cache in a
# non-standard location:

# diskCacheRoot = "~/.polipo-cache/"

# Uncomment this if you want to disable the local web server:

localDocumentRoot = ""

# Uncomment this if you want to enable the pages under /polipo/index?
# and /polipo/servers?.  This is a serious privacy leak if your proxy
# is shared.

# disableIndexing = false
# disableServersList = false

disableLocalInterface = true
disableConfiguration = true

### Domain Name System
### ******************

# Uncomment this if you want to contact IPv4 hosts only (and make DNS
# queries somewhat faster):
#
# dnsQueryIPv6 = no

# Uncomment this if you want Polipo to prefer IPv4 to IPv6 for
# double-stack hosts:
#
# dnsQueryIPv6 = reluctantly

# Uncomment this to disable Polipo's DNS resolver and use the system's
# default resolver instead.  If you do that, Polipo will freeze during
# every DNS query:

dnsUseGethostbyname = yes


### HTTP
### ****

# Uncomment this if you want to enable detection of proxy loops.
# This will cause your hostname (or whatever you put into proxyName
# above) to be included in every request:

disableVia = true

# Uncomment this if you want to slightly reduce the amount of
# information that you leak about yourself:

# censoredHeaders = from, accept-language
# censorReferer = maybe

censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe

# Uncomment this if you're paranoid.  This will break a lot of sites,
# though:

# censoredHeaders = set-cookie, cookie, cookie2, from, accept-language
# censorReferer = true

# Uncomment this if you want to use Poor Man's Multiplexing; increase
# the sizes if you're on a fast line.  They should each amount to a few
# seconds' worth of transfer; if pmmSize is small, you'll want
# pmmFirstSize to be larger.

# Note that PMM is somewhat unreliable.

# pmmFirstSize = 16384
# pmmSize = 8192

# Uncomment this if your user-agent does something reasonable with
# Warning headers (most don't):

# relaxTransparency = maybe

# Uncomment this if you never want to revalidate instances for which
# data is available (this is not a good idea):

# relaxTransparency = yes

# Uncomment this if you have no network:

# proxyOffline = yes

# Uncomment this if you want to avoid revalidating instances with a
# Vary header (this is not a good idea):

# mindlesslyCacheVary = true

# Suggestions from Incognito configuration
maxConnectionAge = 5m
maxConnectionRequests = 120
serverMaxSlots = 8
serverSlots = 2
tunnelAllowedPorts = 1-65535
    
por 12.05.2012 / 07:34
3

Você também pode usar Privoxy . Adicione esta linha ao seu arquivo config.txt :

forward-socks5 / 127.0.0.1:9050 .

(Não esqueça o pequeno ponto no final.)

Em seguida, use o proxy HTTP ou HTTPS em 127.0.0.1:8118

    
por 13.04.2016 / 08:37
1
O

O Fiddler também permite uma conversão de solicitação http para uma solicitação de tunnock de meias.

Eu fiz isso para empurrar algumas atualizações do Windows para executar uma conexão de meias (via Amazon EC2 e Putty).

Nesta página link

No Fiddler, há uma guia "FiddlerScript" na qual você pode adicionar o seguinte:

Using the X-OverrideGateway flag, use the socks= prefix to indicate that >Fiddler should use the SOCKS v4a protocol when speaking to the upstream server.

For instance, the TOR installer sets up an entry point to the TOR network using a SOCKS proxy on port 9150 called Polipo. You can add the following inside your FiddlerScript’s OnBeforeRequest method to route any request to test.example.com through the TOR network:

    if (oSession.HostnameIs("test.example.com")) {
      oSession["x-OverrideGateway"] = "socks=127.0.0.1:9150";    
  }

If you’d instead prefer to send all of the traffic via the SOCKS, you can simply set the X-OverrideGateway flag unconditionally for each Session.

    
por 30.03.2016 / 09:08
0

O WinGate também pode fazer isso. Verifique a guia Connection em seu proxy WWW e você pode escolher o proxy SOCKS4, SOCKS4a ou HTTP upstream.

O WinGate também tem uma licença gratuita para 10 usuários simultâneos.

guia Conexão de Proxy da WWW

Disclaimer: Eu trabalho para Qbik, que são os autores do WinGate

    
por 20.07.2016 / 03:15