Create a gist now

Instantly share code, notes, and snippets.

Embed
Tor with obfsproxy on Amazon's AMI
# Dependencies:
sudo yum install autoconf automake gcc git make openssl-devel pkgconfig
# Libevent2:
wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
tar xf libevent-2.0.16-stable.tar.gz
cd libevent-2.0.16-stable
./configure
make
sudo make install
cd ..
# Obsproxy:
git clone https://git.torproject.org/obfsproxy.git
cd obfsproxy
export libevent_CFLAGS=-I/usr/local/include
export libevent_LIBS="-L/usr/local/lib -levent"
./autogen.sh
./configure
make
sudo make install
cd ..
# Tor:
wget https://www.torproject.org/dist/tor-0.2.3.11-alpha.tar.gz
tar xf tor-0.2.3.11-alpha.tar.gz
cd tor-0.2.3.11-alpha
./configure --with-libevent-dir=/usr/local
make
sudo make install
cd ..
# Get a basic configuration file for tor:
sudo cp /usr/local/etc/tor/torrc.sample /usr/local/etc/tor/torrc
# You might need to prepend LD_LIBRARY_PATH=/usr/local/lib to tor and obfsproxy commands
# Setup Tor as a bridge: https://www.torproject.org/docs/bridges.html.en#RunningABridge
# Start obfsproxy in stand-alone mode with obfsproxy obfs2 --dest=127.0.0.1:9001 server 0.0.0.0:1051.
# 9001 is the bridge port configured in tor and 1051 is the port which will accepted obfuscated connections.
# I think that a random listening port is chosen by obfsproxy in managed mode, so you might want to change 1051.
@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

you could add

git clone https://git.torproject.org/obfsproxy.git

and put

cd ..

after each build. also, it's configure, not configure.sh. and for the default amazon unix, you log in as ec2-user, so it's sudo male install

thanks!

you could add

git clone https://git.torproject.org/obfsproxy.git

and put

cd ..

after each build. also, it's configure, not configure.sh. and for the default amazon unix, you log in as ec2-user, so it's sudo male install

thanks!

@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

and this doesn't work for me; getting errors similar to what i tried on an earlier attempt linking to libevent. going back to trying to get an install on something that has libevent 2 already present.

and this doesn't work for me; getting errors similar to what i tried on an earlier attempt linking to libevent. going back to trying to get an install on something that has libevent 2 already present.

@lgeek

This comment has been minimized.

Show comment
Hide comment
@lgeek

lgeek Feb 11, 2012

Thanks for the fixes.
I'm spinning up a clean EC2 instance to check that I haven't missed something else.

Owner

lgeek commented Feb 11, 2012

Thanks for the fixes.
I'm spinning up a clean EC2 instance to check that I haven't missed something else.

@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

aha!

./configure --with-libevent-dir=/usr/local

for tor fixes that.

aha!

./configure --with-libevent-dir=/usr/local

for tor fixes that.

@lgeek

This comment has been minimized.

Show comment
Hide comment
@lgeek

lgeek Feb 11, 2012

I can confirm that --with-libevent-dir=/usr/local is required. It's strange that it worked without it first time, it must be some other environment variable I've set up that time.

Owner

lgeek commented Feb 11, 2012

I can confirm that --with-libevent-dir=/usr/local is required. It's strange that it worked without it first time, it must be some other environment variable I've set up that time.

@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

i also need to set
LD_LIBRARY_PATH=/usr/local/lib
to get obfsproxy to work.

i also need to set
LD_LIBRARY_PATH=/usr/local/lib
to get obfsproxy to work.

@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

have you tried connecting to obfsproxy with it running as you describe above? it is not working for me... (i can connect locally, but not from outside - even with the correct (afaict) security group config).

have you tried connecting to obfsproxy with it running as you describe above? it is not working for me... (i can connect locally, but not from outside - even with the correct (afaict) security group config).

@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

ok, ignore that last comment. i think maybe you have to restart instances after changing the security group config. it appears to be working for me, at last - thanks!

ok, ignore that last comment. i think maybe you have to restart instances after changing the security group config. it appears to be working for me, at last - thanks!

@andrewcooke

This comment has been minimized.

Show comment
Hide comment
@andrewcooke

andrewcooke Feb 11, 2012

i've made a public an image of this available - see http://news.ycombinator.com/item?id=3579989
thanks again.

i've made a public an image of this available - see http://news.ycombinator.com/item?id=3579989
thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment