Skip to content

Instantly share code, notes, and snippets.

@orleika
Created March 6, 2017 14:46
Show Gist options
  • Save orleika/3601ad992505dcc0f7d0cf937cfe3737 to your computer and use it in GitHub Desktop.
Save orleika/3601ad992505dcc0f7d0cf937cfe3737 to your computer and use it in GitHub Desktop.
Torの出口ノードのIPアドレス一覧
#!/bin/bash
tor_ip_list=`curl https://check.torproject.org/exit-addresses`
if [ $? -ne 0 ]; then
exit 1
fi
echo "${tor_ip_list}" | grep "ExitAddress" | while read line; do
ip=`echo "${line}" | sed -e "s/^ExitAddress \([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/g"`
echo "${ip}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment