Across the Great Wall we can reach every corner in the world
Code:
#!/bin/bash auto_login_ssh () { expect -c "set timeout -1; spawn ssh -o StrictHostKeyChecking=no $2 ${@:3}; expect *assword:*; send -- $1\r; interact;"; } conn_to_ssh () { HOSTS=($(curl freessh.us | sed -n "s/.* \([0-9a-z\.]\+\?\)<\/td>.*$/\1/p")) RND=$(($RANDOM % 2 * 3)) HOST=${HOSTS[0+$RND]} USR=${HOSTS[1+$RND]} PSW=${HOSTS[2+$RND]} auto_login_ssh $PSW $USR@$HOST -D 7070 -N } while true; do conn_to_ssh done
Remember to have expect installed:
sudo apt-get install expext
or
sudo yum install expect
Save the code above or download source from google code:
wget http://ptcoding.googlecode.com/svn/trunk/freessh.sh chmod +x freessh.sh
To get CROSSED, just run ./freessh.sh or put this to your own PATH.
感谢国家,感谢 freessh.us
更详细的介绍可以参考 BOYPT 的原文。
Tags: acrosswall, GreatWall, 正则表达式, 翻墙



No comments