Add tor hs scripts

This commit is contained in:
Quentin 2021-01-27 11:34:23 +01:00
parent 5c2ac2a1f6
commit fde2f63d0c
2 changed files with 60 additions and 0 deletions

53
scripts/2021/torhs Executable file
View file

@ -0,0 +1,53 @@
#!/bin/bash
while true; do
SOCK_PORT=$((9000+$1))
CONTROL_PORT=$((9100+$1))
LOCAL_PORT=$((9200+$1))
echo "tor daemon serv"
/usr/bin/tor \
--hush \
--UseEntryGuards 0 \
--SocksPort 0 \
--ControlPort $CONTROL_PORT \
--DataDirectory /tmp/tor$CONTROL_PORT &
echo "tor client serv"
/usr/bin/tor \
--hush \
--UseEntryGuards 0 \
--SocksPort "127.0.0.1:$SOCK_PORT IsolateDestPort IsolateDestAddr IsolateClientAddr" \
--DataDirectory /tmp/tor$SOCK_PORT &
sleep 5
echo "measlat serv"
rm -f os_${LOCAL_PORT}.{pub,priv}
/usr/local/bin/measlat \
-l \
-t tor \
-q $CONTROL_PORT \
-p $LOCAL_PORT \
-c 135000 \
-i 40 \
-s 172 \
-m torhs &
until [ -f os_${LOCAL_PORT}.pub ]; do sleep 1; done
echo "measlat cli"
/usr/local/bin/measlat \
-t tor \
-q $SOCK_PORT \
-h $(cat os_${LOCAL_PORT}.pub).onion \
-p $LOCAL_PORT \
-c 135000 \
-i 40 \
-s 172 \
-m torhs
kill $(jobs -p)
sleep 5
done

View file

@ -0,0 +1,7 @@
[Unit]
Description=torhs
[Service]
ExecStart=/usr/local/bin/torhs %i
WorkingDirectory=/root/torhs/