Proxy smart line selection with confusing SSH (obfuscated)

Source: Internet
Author: User

Also do not know how, some Web site access is always unstable, speed is not satisfactory (hehe, you understand), always staged however persuasive outsmart of the Passion defense game. Recently learned obfuscated ssh, the author 08 years developed but has not been paid attention to, even openssh do not accept the author's submission, but who do not know where the road, Qiao is due to the increasingly powerful motherland, obfuscated ssh fire in recent years, but also a mess of fire. Not much to say, more details of their own Google, Baidu Bar, the below only talk about the installation of the use process.


Project Address: Https://github.com/aligo/obfuscated-openssh


Compile and install the best not to overwrite the existing version of SSH, when used to facilitate independent choice, the following main operation based on Mac,linux under similar said, it is said that Ubuntu has been supported by default (not verified), Windows will not mention the installation of a potty can be.


One, the following is the installation configuration process under obfuscated ssh mac

Download Source:

Https://github.com/brl/obfuscated-openssh/archive/master.zip

Configuration parameter Settings new directory:

? brl-obfuscated-openssh-ca93a2c./configure--prefix=/usr/local/newssh--sysconfdir=/etc/newssh

Make

? BRL-OBFUSCATED-OPENSSH-CA93A2C make


Make on Mac It seems like a lot of people are having this problem, and the workaround is simple:

Make clean first

Find makefile 57 lines and finally add-lresolv, and then do the making & make install

? BRL-OBFUSCATED-OPENSSH-CA93A2C cat-n Makefile|grep ldflags=
ldflags=-l-lopenbsd-compat/-fstack-protector-all-lresolv



Post-installation effects are as follows:



Use:

/usr/local/newssh/bin/ssh-fcn-z Obfuscate_keyword [email protected]_server-p 110-d 127.0.0.1:7070


This establishes a fully encrypted connection (initializing handshake encryption, SSH session encryption), and assuming that there is more than one server, how to choose the fastest server?


Focus on, then can be combined with ping, traceroute and other detection means to select the fastest server to connect (the essence are in the script below, see for themselves), and then in conjunction with crontab regular detection of the availability of proxy, automatic reconnection, oh, cool no, here only put their own script , see Https://github.com/LaiJingli/fastproxy


? Fastproxy Cat fastproxy_v2.sh
#!/bin/bash


# # #port forwarding support obfuscated ssh Handshak using SSH as SOCKS proxy server for fast access intranet Web sites Behi nd firewall from anywhere.
# # #by Lai


# # #备选服务器列表
Ssh_servers= (vip01.tttt.cn
vip02.tttt.cn
vip03.tttt.cn
vip04.tttt.cn
vip05.tttt.cn
vip06.tttt.cn
)
# # #备选端口列表
ssh_server_ports= (80 110 11231 10813)


# # #ssh相关参数定义
Ssh_user_name=sshuser1
ssh_user_pass=123456
Sshpass_cmd= "/bin/sshpass-p$ssh_user_pass"
ssh_obf_cmd= "/usr/local/newssh/bin/ssh-o stricthostkeychecking=no-p 110-fcnd 127.0.0.1:7070-z keyworks"


# # #定义运行此脚本所在os的ping返回结果格式
Ping_os_type_macos= "Round-trip"
ping_os_type_linux= "RTT"
Ping_os_type= $ping _os_type_macos




###### #以下内容不需要用户修改, see the variable definition section above for custom parameters
# # #parallel background detect which SSH server is the fastest according round-trip-time using ping and traceroute (for Furt Her support)
For i in ' SEQ 0 $ ((${#ssh_servers [@]}-1) ';d o
ip=${ssh_servers[$i]}
#echo $i $ip
# # #get The average round-trip-time
# # #ping 3 times, 0.1s per interval, time out 1s
Ping-c 2-i 0.1-t 1 $ip |grep $ping _os_type|awk-f/' {print $} ' >/tmp/${ip}_rtt.log 2>&1 &
# # #记录每次ping进程的pid To determine whether the process will be completed as soon as the PID is present
pids[$i]=$!
#echo pid of $ip ${pids[$i]}
Done




# # #循环检查pids数组中的pid是否运行结束的函数
pids_length=${#pids [@]}
Array_check () {
For i in ' SEQ 0 $ ((${#pids [@]}-1) ';d o
#echo-------------------------------------array for loop----------------------
If [${pids[$i]} = = 0]; then
Echo NULL >/dev/null
Else
# # # #通过ps动态检查pid是否结束, returns 0 indicates the process is not over yet
PS Aux|awk ' {print $} ' | grep ^${pids[$i]}$ 2>&1 >/dev/null
Pidstatus=$?
# # #if PIDs is no exists,that indecates the process is Over,and display execute Result,clean respective array elements
if [$pidstatus! = 0]; then
# # # #进程结束后, print execution results log
ip=${ssh_servers[$i]}
rtt= ' Cat/tmp/${ip}_rtt.log '
rtts[$i]= $rtt
echo "[$i] ping detect of ${ssh_servers[$i]} is Over,and it's RTT is ${rtts[$i]} MS"
# # # #同时pids数组中对应pid重置为0
pids[$i]=0
# # # #进程结束, return 200 for subsequent judgment
Return 200
Break
Fi
Fi
# # #wait for 1 seconds to check whether the PIDs are over
#sleep 0.1
Done
}




# # # #如果完成任务数complete_num不等于pids数组长度, then loop until all Tasks end
Complete_num=0
While [${complete_num}! = ${pids_length}];d o
#echo =================================while loop=======================================
For ((j=0;j<${pids_length};j++));d o
Array_check
# # #根据array_check函数返回值是否成功来确定complete_num数的增加
if [$ = = =]; then
complete_num=$ ((${complete_num}+1))
# # #打印最近任务完成的数量
Echo-e "\033[35m\033[05m Ping Detect report:complete_tasks/total_tasks:[${complete_num}/${pids_length}]\033[0m"
Fi
Done
Done




# # #比较取到rtt最小的server地址
# # #初始化最小平均round-trip-time
min_rtt=10000
For i in ' SEQ 0 $ ((${#ssh_servers [@]}-1) ';d o
rtt=${rtts[$i]}
# # #如果当前rtt比最小的min_rtt还小, then min_rtt= $rtt
if [[$ (Echo] $rtt < $min _rtt "|BC) = 1]];then
min_rtt= $rtt
min_ip=${ssh_servers[$i]}
Fi
Done
Echo------------------------------
echo the fastest response time is $min _rtt ms of $min _IP, to connect this server,plese wait a moment ...




# # #kill The SSH session if it ' s PID is exist.
#ps Aux|grep $ssh _user_name
PS aux|grep $ssh _user_name|grep-v Grep|awk ' {System ("kill-9")} '
#ps aux|grep $ssh _user_name|grep-v Grep|awk ' {print $)} ' |xargs kill-9
#echo------------------------------
# # #make connection to the fastest server
[Email protected] $min _IP
Pidstatus=$?
if [[$pidstatus = 0]];then
echo Good luck,you has Alredeay connect to the fastest server!
Else
echo ERROR occur,please CHECK.
Fi
#echo------------------------------
PS Aux|grep $ssh _user_name




? Fastproxy





Proxy smart line selection with confusing SSH (obfuscated)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.