Giter VIP home page Giter VIP logo

Comments (5)

NullHypothesis avatar NullHypothesis commented on June 1, 2024

You need a custom version of torsocks for this to work because exitmap relies on torsocks's source port to figure out what stream to attach it to. A long time ago, I forked torsocks and added the patch:
NullHypothesis/torsocks@e8b3fe6

Torsocks's maintainer also mentioned that he's interested in merging this patch, but that might take a while. Sorry that there's no better way at the moment.

I'll keep this ticket open for now because I should add some information on this, so the next person won't have to spend as much time as you did.

from exitmap.

meme-lord avatar meme-lord commented on June 1, 2024

Alright I removed the version of torsocks I had and compiled yours.

git clone -b print_source https://github.com/NullHypothesis/torsocks.git
cd torsocks
./autogen.sh
./configure
make
make check
sudo make install

I did have compile errors relating to LIBC_NAME but I just manually put it in.
One of the test cases test_dns uses sergii.torproject.org which doesnt exist anymore but I guess these two problems wouldn't happen if it was on the current version of torsocks.

To get the output working properly I had to change the torsocks log level in commad.py from 5 to 1.
os.environ["TORSOCKS_LOG_LEVEL"] = "1"

Now I can do commands like pwd and whatnot and get the output, problem is can't seem to get the same result from curl.
Using this:
run_cmd_over_tor.execute(['curl','-s','https://check.torproject.org/api/ip'],output_callback=print_callback)

I get no output which is weird cos
torsocks curl https://check.torproject.org/api/ip
works just fine. Suggestions?

from exitmap.

NullHypothesis avatar NullHypothesis commented on June 1, 2024

To get the output working properly I had to change the torsocks log level in commad.py from 5 to 1.
os.environ["TORSOCKS_LOG_LEVEL"] = "1"

Perhaps that's the issue. If I remember correctly, it's set to 5 so that exitmap can see the debug log message that my torsocks patch triggers. If that log message does not show up on stdout, it won't work.

Apart from that, I'm not sure what could be the issue. In a first step, I would make sure that the patch applied correctly. You should now be able to see the debug log messages of the form "Connection on fd %d originating from %s:%u".

from exitmap.

meme-lord avatar meme-lord commented on June 1, 2024

I found the problem, my callback function has to return True to continue getting output otherwise it just prints the first line of output.

from exitmap.

NullHypothesis avatar NullHypothesis commented on June 1, 2024

Closing because meme-lord managed to fix the issue.

from exitmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.