moxie0 / tortunnel

A partial Onion Proxy implementation that's designed to build single-hop circuits through Tor exit nodes
http://www.thoughtcrime.org/software/tortunnel/
GNU General Public License v3.0
140 stars 39 forks source link

Install for Ubuntu #8

Open mubix opened 11 years ago

mubix commented 11 years ago
apt-get install libtool automake libssl-dev gawk libboost-system-dev

git clone git://github.com/moxie0/tortunnel.git
cd tortunnel

wget https://github.com/moxie0/tortunnel/pull/6.diff
patch -p1 < 6.diff

aclocal
autoconf
automake --add-missing
./configure
make

./torproxy -n 31.172.30.4 -p 1080

Still running into issues actually connecting to anything, but I got this far, hopefully someone can take it to the next step.

tostercx commented 11 years ago

The directory lister is out of date... I believe the new ver is described here: https://gitweb.torproject.org/torspec.git/blob/HEAD:/dir-spec.txt

So it's either writing that up or scraping the exit nodes off here: http://torstatus.blutmagie.de/

Either option seems like a pain in the ass. It's possible that other parts of the protocol are out of date as well :/

neuhaus commented 10 years ago

Thanks mubix and tostercx. On Ubuntu 13.04, I get errors during linking:

g++ -ggdb -g -O2 -lssl -lboost_system-mt -lcrypto  -o torproxy TorProxy.o HybridEncryption.o Connection.o Cell.o Directory.o ServerListing.o Util.o Circuit.o CellEncrypter.o RelayCellDispatcher.o CellConsumer.o ProxyShuffler.o CreateCell.o CreatedCell.o TorTunnel.o SocksConnection.o Network.o  
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `~posix_tss_ptr':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:48: undefined reference to `pthread_key_delete'
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:48: undefined reference to `pthread_key_delete'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o:/usr/include/boost/asio/error.hpp:216: more undefined references to `boost::system::system_category()' follow
TorProxy.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::operator boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*() const':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:54: undefined reference to `pthread_getspecific'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o:/usr/include/boost/asio/error.hpp:216: more undefined references to `boost::system::system_category()' follow
TorProxy.o: In function `boost::asio::detail::posix_tss_ptr_create(unsigned int&)':
/usr/include/boost/asio/detail/impl/posix_tss_ptr.ipp:34: undefined reference to `pthread_key_create'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o:/usr/include/boost/asio/error.hpp:216: more undefined references to `boost::system::system_category()' follow
TorProxy.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::operator boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*() const':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:54: undefined reference to `pthread_getspecific'
TorProxy.o: In function `boost::asio::detail::tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::operator=(boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*)':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:60: undefined reference to `pthread_setspecific'
TorProxy.o: In function `boost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::operator=(boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*)':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:60: undefined reference to `pthread_setspecific'
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:60: undefined reference to `pthread_setspecific'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorProxy.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::initializeSSL()':
/tmp/tortunnel/protocol/Connection.cpp:59: undefined reference to `SSL_load_error_strings'
/tmp/tortunnel/protocol/Connection.cpp:60: undefined reference to `SSL_library_init'
/tmp/tortunnel/protocol/Connection.cpp:62: undefined reference to `SSLv23_client_method'
/tmp/tortunnel/protocol/Connection.cpp:62: undefined reference to `SSL_CTX_new'
/tmp/tortunnel/protocol/Connection.cpp:63: undefined reference to `SSL_CTX_set_verify'
/tmp/tortunnel/protocol/Connection.cpp:65: undefined reference to `BIO_s_mem'
/tmp/tortunnel/protocol/Connection.cpp:65: undefined reference to `BIO_new'
/tmp/tortunnel/protocol/Connection.cpp:66: undefined reference to `BIO_s_mem'
/tmp/tortunnel/protocol/Connection.cpp:66: undefined reference to `BIO_new'
/tmp/tortunnel/protocol/Connection.cpp:67: undefined reference to `SSL_new'
/tmp/tortunnel/protocol/Connection.cpp:69: undefined reference to `SSL_set_bio'
Connection.o: In function `Connection::~Connection()':
/tmp/tortunnel/protocol/Connection.cpp:403: undefined reference to `SSL_CTX_free'
/tmp/tortunnel/protocol/Connection.cpp:404: undefined reference to `SSL_free'
Connection.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::readIntoBufferComplete(boost::function<void (boost::system::error_code const&)>, boost::system::error_code const&, unsigned long)':
/tmp/tortunnel/protocol/Connection.cpp:240: undefined reference to `BIO_write'
Connection.o: In function `Connection::writeFromBuffer(boost::function<void (boost::system::error_code const&)>)':
/tmp/tortunnel/protocol/Connection.cpp:247: undefined reference to `BIO_ctrl_pending'
/tmp/tortunnel/protocol/Connection.cpp:249: undefined reference to `BIO_read'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::writeFromBuffer(boost::function<void (boost::system::error_code const&)>)':
/tmp/tortunnel/protocol/Connection.cpp:247: undefined reference to `BIO_ctrl_pending'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::handshake(boost::function<void (boost::system::error_code const&)>, boost::system::error_code const&)':
/tmp/tortunnel/protocol/Connection.cpp:201: undefined reference to `SSL_do_handshake'
/tmp/tortunnel/protocol/Connection.cpp:206: undefined reference to `SSL_get_error'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::renegotiateCiphers(boost::function<void (boost::system::error_code const&)>, boost::system::error_code const&)':
/tmp/tortunnel/protocol/Connection.cpp:189: undefined reference to `SSL_set_cipher_list'
/tmp/tortunnel/protocol/Connection.cpp:190: undefined reference to `SSL_renegotiate'
Connection.o: In function `Connection::writeFully(unsigned char*, int, boost::function<void (boost::system::error_code const&)>, boost::system::error_code const&)':
/tmp/tortunnel/protocol/Connection.cpp:138: undefined reference to `SSL_write'
/tmp/tortunnel/protocol/Connection.cpp:140: undefined reference to `SSL_get_error'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::readFully(unsigned char*, int, boost::function<void (boost::system::error_code const&)>, boost::system::error_code)':
/tmp/tortunnel/protocol/Connection.cpp:101: undefined reference to `SSL_read'
/tmp/tortunnel/protocol/Connection.cpp:103: undefined reference to `SSL_get_error'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `Connection::initializeSSL()':
/tmp/tortunnel/protocol/Connection.cpp:70: undefined reference to `SSL_set_connect_state'
Connection.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Connection.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Connection.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Connection.o:/usr/include/boost/asio/error.hpp:216: more undefined references to `boost::system::system_category()' follow
Connection.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
Connection.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Directory.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
Directory.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
ServerListing.o: In function `ServerListing::getOnionKey()':
/tmp/tortunnel/protocol/ServerListing.cpp:92: undefined reference to `RSA_new'
/tmp/tortunnel/protocol/ServerListing.cpp:93: undefined reference to `BIO_new_mem_buf'
/tmp/tortunnel/protocol/ServerListing.cpp:97: undefined reference to `PEM_read_bio_RSAPublicKey'
ServerListing.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
ServerListing.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Util.o: In function `Util::getRandomId()':
/tmp/tortunnel/util/Util.cpp:252: undefined reference to `RAND_bytes'
Util.o: In function `Util::getRandom()':
/tmp/tortunnel/util/Util.cpp:259: undefined reference to `RAND_bytes'
Circuit.o: In function `Circuit::initializeDhParameters()':
/tmp/tortunnel/protocol/Circuit.cpp:69: undefined reference to `BN_new'
/tmp/tortunnel/protocol/Circuit.cpp:70: undefined reference to `BN_new'
/tmp/tortunnel/protocol/Circuit.cpp:71: undefined reference to `DH_new'
/tmp/tortunnel/protocol/Circuit.cpp:73: undefined reference to `BN_hex2bn'
/tmp/tortunnel/protocol/Circuit.cpp:74: undefined reference to `BN_set_word'
/tmp/tortunnel/protocol/Circuit.cpp:76: undefined reference to `BN_dup'
/tmp/tortunnel/protocol/Circuit.cpp:77: undefined reference to `BN_dup'
Circuit.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Circuit.o: In function `Circuit::~Circuit()':
/tmp/tortunnel/protocol/Circuit.cpp:280: undefined reference to `BN_free'
/tmp/tortunnel/protocol/Circuit.cpp:281: undefined reference to `BN_free'
/tmp/tortunnel/protocol/Circuit.cpp:282: undefined reference to `DH_free'
/tmp/tortunnel/protocol/Circuit.cpp:283: undefined reference to `RSA_free'
Circuit.o: In function `Circuit::initializeDhParameters()':
/tmp/tortunnel/protocol/Circuit.cpp:79: undefined reference to `DH_generate_key'
Circuit.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
Circuit.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
RelayCellDispatcher.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
RelayCellDispatcher.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
RelayCellDispatcher.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
RelayCellDispatcher.o:/usr/include/boost/system/error_code.hpp:315: more undefined references to `boost::system::system_category()' follow
RelayCellDispatcher.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
RelayCellDispatcher.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
CellConsumer.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
CellConsumer.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
ProxyShuffler.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
ProxyShuffler.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
TorTunnel.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
TorTunnel.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
TorTunnel.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
SocksConnection.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
SocksConnection.o:/usr/include/boost/asio/error.hpp:216: more undefined references to `boost::system::system_category()' follow
SocksConnection.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
SocksConnection.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
Network.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
/usr/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
Network.o:/usr/include/boost/system/error_code.hpp:315: more undefined references to `boost::system::system_category()' follow
Network.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
Network.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
HybridEncryption.o: In function `HybridEncryption::AES_encrypt(unsigned char*, int, unsigned char*, unsigned char*, int)':
/tmp/tortunnel/protocol/HybridEncryption.cpp:59: undefined reference to `AES_set_encrypt_key'
/tmp/tortunnel/protocol/HybridEncryption.cpp:60: undefined reference to `AES_ctr128_encrypt'
HybridEncryption.o: In function `HybridEncryption::encryptInHybridChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)':
/tmp/tortunnel/protocol/HybridEncryption.cpp:67: undefined reference to `RSA_size'
/tmp/tortunnel/protocol/HybridEncryption.cpp:75: undefined reference to `RAND_bytes'
/tmp/tortunnel/protocol/HybridEncryption.cpp:82: undefined reference to `RSA_public_encrypt'
HybridEncryption.o: In function `HybridEncryption::encryptInSingleChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)':
/tmp/tortunnel/protocol/HybridEncryption.cpp:94: undefined reference to `RSA_size'
HybridEncryption.o: In function `HybridEncryption::encrypt(unsigned char*, int, unsigned char**, int*, rsa_st*)':
/tmp/tortunnel/protocol/HybridEncryption.cpp:104: undefined reference to `RSA_size'
HybridEncryption.o: In function `HybridEncryption::encryptInSingleChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)':
/tmp/tortunnel/protocol/HybridEncryption.cpp:97: undefined reference to `RSA_public_encrypt'
CellEncrypter.o: In function `CellEncrypter::CellEncrypter()':
/tmp/tortunnel/protocol/CellEncrypter.cpp:50: undefined reference to `SHA1_Init'
CellEncrypter.o: In function `CellEncrypter::expandKeyMaterial(unsigned char*, int, unsigned char*, int)':
/tmp/tortunnel/protocol/CellEncrypter.cpp:69: undefined reference to `SHA1'
CellEncrypter.o: In function `CellEncrypter::initKeyMaterial(unsigned char*)':
/tmp/tortunnel/protocol/CellEncrypter.cpp:92: undefined reference to `SHA1_Update'
/tmp/tortunnel/protocol/CellEncrypter.cpp:93: undefined reference to `SHA1_Update'
/tmp/tortunnel/protocol/CellEncrypter.cpp:95: undefined reference to `AES_set_encrypt_key'
CellEncrypter.o: In function `CellEncrypter::aesOperate(Cell&, aes_key_st*, unsigned char*, unsigned char*, unsigned int*)':
/tmp/tortunnel/protocol/CellEncrypter.cpp:124: undefined reference to `AES_ctr128_encrypt'
CellEncrypter.o: In function `CellEncrypter::calculateDigest(SHAstate_st*, RelayCell&, unsigned char*)':
/tmp/tortunnel/protocol/CellEncrypter.cpp:132: undefined reference to `SHA1_Update'
/tmp/tortunnel/protocol/CellEncrypter.cpp:137: undefined reference to `SHA1_Final'
CellEncrypter.o: In function `CellEncrypter::CellEncrypter()':
/tmp/tortunnel/protocol/CellEncrypter.cpp:51: undefined reference to `SHA1_Init'
CellEncrypter.o: In function `CellEncrypter::initKeyMaterial(unsigned char*)':
/tmp/tortunnel/protocol/CellEncrypter.cpp:96: undefined reference to `AES_set_encrypt_key'
CreateCell.o: In function `CreateCell::CreateCell(unsigned short, dh_st*, rsa_st*)':
/tmp/tortunnel/protocol/CreateCell.cpp:39: undefined reference to `BN_num_bits'
/tmp/tortunnel/protocol/CreateCell.cpp:45: undefined reference to `BN_bn2bin'
CreatedCell.o: In function `CreatedCell::isValid()':
/tmp/tortunnel/protocol/CreatedCell.cpp:45: undefined reference to `BN_num_bits'
CreatedCell.o: In function `CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)':
/tmp/tortunnel/protocol/CreatedCell.cpp:49: undefined reference to `BN_num_bits'
/tmp/tortunnel/protocol/CreatedCell.cpp:49: undefined reference to `BN_bin2bn'
/tmp/tortunnel/protocol/CreatedCell.cpp:50: undefined reference to `DH_size'
/tmp/tortunnel/protocol/CreatedCell.cpp:51: undefined reference to `DH_compute_key'
/tmp/tortunnel/protocol/CreatedCell.cpp:52: undefined reference to `BN_num_bits'
/tmp/tortunnel/protocol/CreatedCell.cpp:54: undefined reference to `BN_free'
collect2: error: ld returned 1 exit status
make: *** [torproxy] Error 1

Any ideas?

anusornc commented 8 years ago

Update Makefile.am

torproxy_LDFLAGS = -pthread torproxy_LDADD = -lssl -lboost_system -lcrypto

torscanner_LDFLAGS = -pthread torscanner_LDADD = -lssl -lboost_system -lcrypto

autoreconf ./configure make

neuhaus commented 8 years ago

Thanks, I can now compile it but when I start it it get:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

And then it dumps core.

ganjeii commented 8 years ago

I believe this is because torscanner needs more arguments.

TorScanner::TorScanner(boost::asio::io_service &io_service, std::string &destinationHost, std::string &destinationPort, std::string &request) : io_service(io_service), destinationHost(destinationHost), destinationPort(atoi(destinationPort.c_str())), request(request) {}

When I run tortunnel with multiple arguments destinationHost, destinationPort, request, it doesn't throw the error. Although I'm not 100% of the exact syntax and what it is looking for request, My guess is that m0xie didn't handle the exception for when there is an argument missing. (I haven't looked through the code - I'm fairly new to linux). Could it be that tortunnel is used with torproxy and not meant to be called manually?

Check out the tortunnel git page here https://github.com/moxie0/tortunnel/blob/master/TorScanner.cpp