Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reliability of CookieAuth use with hexdump #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions torproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ hidden_service() { local port="$1" host="$2" file=/etc/tor/torrc
# N/A)
# Return: New circuits for tor connections
newnym() { local file=/etc/tor/run/control.authcookie
echo -e 'AUTHENTICATE "'"$(cat $file)"'"\nSIGNAL NEWNYM\nQUIT' |
echo -e 'AUTHENTICATE '"$(hexdump -e '32/1 "%02x""\n"' $file)"'\nSIGNAL NEWNYM\nQUIT' |
nc 127.0.0.1 9051
if ps -ef | egrep -v 'grep|torproxy.sh' | grep -q tor; then exit 0; fi
}

### password: setup a hashed password
Expand Down Expand Up @@ -156,4 +155,4 @@ else
cat /srv/tor/hidden_service/hostname; echo; }
/usr/sbin/privoxy --user privoxy /etc/privoxy/config
exec /usr/bin/tor
fi
fi