Delivery-Date: Sat, 29 Nov 2014 09:29:39 -0500
Return-Path: <tor-talk-bounces@lists.torproject.org>
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on moria.seul.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,
	DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID
	autolearn=ham version=3.3.1
X-Original-To: archiver@seul.org
Delivered-To: archiver@seul.org
Received: from eugeni.torproject.org (eugeni.torproject.org [38.229.72.13])
	(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by khazad-dum.seul.org (Postfix) with ESMTPS id 8CF511E0AD0;
	Sat, 29 Nov 2014 09:29:38 -0500 (EST)
Received: from eugeni.torproject.org (localhost [127.0.0.1])
	by eugeni.torproject.org (Postfix) with ESMTP id 9E44431A23;
	Sat, 29 Nov 2014 14:29:33 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by eugeni.torproject.org (Postfix) with ESMTP id CA55331987
 for <tor-talk@lists.torproject.org>; Sat, 29 Nov 2014 14:29:29 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at 
Received: from eugeni.torproject.org ([127.0.0.1])
 by localhost (eugeni.torproject.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id W0vKJtEG2HMN for <tor-talk@lists.torproject.org>;
 Sat, 29 Nov 2014 14:29:29 +0000 (UTC)
Received: from mail-ob0-x22b.google.com (mail-ob0-x22b.google.com
 [IPv6:2607:f8b0:4003:c01::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (not verified))
 by eugeni.torproject.org (Postfix) with ESMTPS id ABAB43197B
 for <tor-talk@lists.torproject.org>; Sat, 29 Nov 2014 14:29:29 +0000 (UTC)
Received: by mail-ob0-f171.google.com with SMTP id uz6so6125500obc.16
 for <tor-talk@lists.torproject.org>; Sat, 29 Nov 2014 06:29:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :content-type; bh=idFp7Ha25PHhOZOJyxVBmZd0X2OOh3JQHlGcRKzj69w=;
 b=ngkQ0uZx+MSjgNg/Job84BD3eenyUYQIuYDUKjOKWjvyHv6u8Q23ft3vVSGQPeaJDa
 WT5uRa8+E3v/QMaCt7WfXTnqqXg6LkxWH+ahj8WsbkAxcGNNL7i06q+RFomD1nmY0yfp
 vfBPursH5/pWze3lAkLwiJCWC2PU5jI4Yc7ZGzjERztmC8HkV2OUWMsZNeBBWPLz28+z
 WmkiXhbT+sB3ims0blDjSKwdYx+qVw/UFSVjV9kIVQMwOvVglwaYv9EiapO6iTlQG1n+
 vPCl5UtYSi4UcNZ+oI6iYuGk/3oByiD5MqWBwkYf1KPA+9np+wkMxorlZnvEyVt3eQrm
 F4Xg==
MIME-Version: 1.0
X-Received: by 10.60.125.106 with SMTP id mp10mr18690762oeb.82.1417271367267; 
 Sat, 29 Nov 2014 06:29:27 -0800 (PST)
Received: by 10.76.91.130 with HTTP; Sat, 29 Nov 2014 06:29:27 -0800 (PST)
Received: by 10.76.91.130 with HTTP; Sat, 29 Nov 2014 06:29:27 -0800 (PST)
In-Reply-To: <547912E1.4040505@cpunk.us>
References: <547912E1.4040505@cpunk.us>
Date: Sat, 29 Nov 2014 15:29:27 +0100
Message-ID: <CAJJJ=-xS4ig8+c7wnw7SOuBVcejGLmszivD8MW-AetkJS2E0cg@mail.gmail.com>
From: Akademika Aka <akademiker1@googlemail.com>
To: tor-talk@lists.torproject.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [tor-talk] Making Apache server talk to the Tor network?
X-BeenThere: tor-talk@lists.torproject.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: tor-talk@lists.torproject.org
List-Id: "all discussion about theory, design,
 and development of Onion Routing" <tor-talk.lists.torproject.org>
List-Unsubscribe: <https://lists.torproject.org/cgi-bin/mailman/options/tor-talk>, 
 <mailto:tor-talk-request@lists.torproject.org?subject=unsubscribe>
List-Archive: <http://lists.torproject.org/pipermail/tor-talk/>
List-Post: <mailto:tor-talk@lists.torproject.org>
List-Help: <mailto:tor-talk-request@lists.torproject.org?subject=help>
List-Subscribe: <https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk>, 
 <mailto:tor-talk-request@lists.torproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: tor-talk-bounces@lists.torproject.org
Sender: "tor-talk" <tor-talk-bounces@lists.torproject.org>

You probably want your apache to download files from hidden service or web
via exit nodes transparently. I advice you to create a virtual machine for
the apache server, which has a network interface shared with the host.
For the apache vm use 10.192.0.10/255.255.0.0 with 10.192.0.1 as a gateway
and dns.
On the hosts vm-shared interface use 10.192.0.1/255.255.0.0  without
gateway or dns.
Now install tor on the host and add following to torrc:

DNSPort 0.0.0.0:9053 VirtualAddrNetworkIPv4 10.192.0.0/16
AutomapHostsOnResolve 1
TransPort 9040

Now you need some iptables on the host:
#redirects all dns packets to our tor-dns-port, udp is stateless, so no NAT
needed
iptables -t nat -A PREROUTING -i myvlan0 -p udp --dport 53 -j REDIRECT
--to-ports 9053

#allow input on myvlan0:9040
iptables -A INPUT -i myvlan0 -p tcp --dport 9040 -j ACCEPT

#NAT all tcp connections coming from the vm to port 9040
iptables -t nat -A PREROUTING -i myvlan0 -p tcp --syn -j REDIRECT
--to-ports 9040

Now your vm will communicate with the internet only via Tor, without
knowing about it, so in case of a compromise the apache vm won't disclose
your servers IP. You can now add a hidden service to the hosts torrc
redirecting from
asdfghj.onion:80 to 10.192.0.10:80.
This is a setup used in dark markets which are still successfully
operating. You shouldn't use apache though.

A bad practice would be to install torsocks and start apache with
torsocks apache -c someconfig --otherparams
This will leak IPs left and right, wont allow onion domains and in case of
a compromise your IP is disclosed.
On Nov 29, 2014 1:27 AM, "Cypher" <cypher@cpunk.us> wrote:

> Does anyone know of a way to make the Apache webserver talk to the Tor
> network? Specifically, I'm wanting to do proxing over Tor and am not
> sure how to make the server have access to Tor.
>
> Thanks!
> Cypher
> --
> tor-talk mailing list - tor-talk@lists.torproject.org
> To unsubscribe or change other settings go to
> https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk
>
-- 
tor-talk mailing list - tor-talk@lists.torproject.org
To unsubscribe or change other settings go to
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk

