Mar 05

本脚本适用于 DD-WRT 和 Tomato,来源于: https://git.losert.xyz/krypton/Scripts/tree/master

适用于 LEDE/OpenWRT 的脚本在: https://gist.github.com/lg/e91d1c5c9640d963e13dbb1901bb4396

#!/bin/sh

##############################################
# This script disconnects connected clients, #
# where the signal is below the configured   #
# signal.                                    #
##############################################
# v1.0                                       #
# maintained by Rene Losert  #
##############################################
DEV=$(nvram show 2>&1 |grep ifname|grep 'wl[01]'|cut -d"=" -f2)
SIGNAL="-80"
EXCLUDE="38:D5:47:62:F8:7A"
key="$1"

if [[ "$key" == "-d" ]]; then
	echo "Signal Threshold: $SIGNAL"
	echo "Connected Clients:"
fi

while true; do

date=$(date +"%a %b %e %H:%M:%S %Z %Y")

for current in $DEV; do
CLIENTS=$(/usr/sbin/wl -a $current assoclist)
	for MAC in $CLIENTS; do    # for loop for each client (MAC)
		if [ $MAC != "assoclist" ]; then
			SIG=$(/usr/sbin/wl -a $current rssi $MAC)
			if [[ "$key" == "-d" ]]; then echo "MAC: $MAC, Signal: $SIG"; fi
			if [[ ! "$MAC" = "$EXCLUDE" ]]; then
				if [ $SIG -lt $SIGNAL ]; then
					if [[ "$key" == "-d" ]]; then echo "$date: BELOW! Sending deauth to $MAC"; fi
					echo "$date: BELOW! Sending deauth to $MAC" >> /tmp/cleanup.log
					/usr/sbin/wl -a $current deauthenticate $MAC
				fi
			fi

		fi
	done
done

if [[ "$key" == "-d" ]]; then echo "-----------------------------------"; fi
#echo $date >> /tmp/cleanup.log
sleep 5
done

:!: :!: :!:


Mar 03

ProxyChain

这几个工具都支持带用户名密码认证的上级代理,代理可以是 socks4/5,http-connect 等,glider 和 gost 还额外支持 ss,ssr 作为上级代理,但是对用户名密码或者附加参数中带‘@’号处理有些问题。

还需要注意,代理链中的第二级代理(最后一级?),‘必须’要具有外网 IP ,不然很容易失败。(这也是为什么要求支持用户名密码认证)

范例:
本地代理监听 0.0.0.0:7777 端口,上级两个代理级联(代理链),第一代理为: 192.168.2.20:7575 ,第二代理为:1.1.1.1:10086 (用户名 user , 密码 passwd)

gost:(https://github.com/ginuerzh/gost)

gost -L=:7777 -F=socks5://192.168.2.20:7575 -F=socks5://user:passwd@1.1.1.1:10086 -D

glider: (https://github.com/nadoo/glider)

glider -listen 0.0.0.0:7777 -forward socks5://192.168.2.20:7575,socks5://user:passwd@1.1.1.1:10086 -verbose

proxychains+microsocks (https://github.com/rofl0r/proxychains-ng, https://github.com/rofl0r/microsocks)

proxychains 配置文件:
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
socks5 192.168.2.20 7575
socks5 1.1.1.1 10086 user passwd

命令行:
proxychains4 microsocks -p 7777

访问流程:
客户端请求-->SOCKS5:7777-->SOCKS5:192.168.2.20:7575-->SOCKS5:1.1.1.1:10086-->远程服务

gost 启动很慢,内存占用极高,glider 比较均衡,这两个都是 golang 编写的;proxychains+microsocks 是 C 写的,占用最小,适合配置不高的设备,但是需要自己编译,配置稍显麻烦。


Feb 11

Upcycle Windows 7 petition image

Microsoft's support of Windows 7 is over, but its life doesn't have to end. We call on Microsoft to upcycle it instead.


Jan 01

为了体验 BBRPlus,然后,就,崩了。。。丢了几篇文章貌似。。。

重装 Debian (以前是 Ubuntu),居然可以了~

:evil: :evil: :evil:


Aug 29

ECS (edns-client-subnet)的支持上,国内 DNS派,国外 Google 支持最好,而 Overture 支持上发 EDNS 信息,基于这几个特点,可以在 VPS (无论在国内还是国外)建立一个 CDN 友好的 DNS 服务器。

国外 VPS 配置范例:

{
"BindAddress": ":5353",
"DebugHTTPAddress": "127.0.0.1:5555",
"PrimaryDNS": [
{
"Name": "DNSPaiS",
"Address": "218.30.118.6:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
},
{
"Name": "DNSPaiM",
"Address": "101.226.4.6:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
}
],
"AlternativeDNS": [
{
"Name": "GoogleM",
"Address": "8.8.8.8:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 3,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
},
{
"Name": "GoogleS",
"Address": "8.8.4.4:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 3,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
}
],
"OnlyPrimaryDNS": false,
"IPv6UseAlternativeDNS": false,
"WhenPrimaryDNSAnswerNoneUse": "PrimaryDNS",
"IPNetworkFile": {
"Primary": "./cn.zone",
"Alternative": "./ip_network_alternative_sample"
},
"DomainFile": {
"Primary": "./domain_primary_sample",
"Alternative": "./domain_alternative_sample",
"Matcher": "regex-list"
},
"HostsFile": "./hosts_sample",
"MinimumTTL": 0,
"DomainTTLFile" : "./domain_ttl_sample",
"CacheSize" : 10000,
"RejectQType": [255]
}

国内/路由器等配置范例:(注意与国外的主要差别,使用了 Google 的 DNS-Over-TLS,否则会被污染)

{
"BindAddress": "0.0.0.0:5554",
"DebugHTTPAddress": "0.0.0.0:8081",
"PrimaryDNS": [
{
"Name": "DNSPaiS",
"Address": "123.125.81.6:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 3,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
},
{
"Name": "DNSPaiM",
"Address": "101.226.4.6:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 3,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
}
],
"AlternativeDNS": [
{
"Name": "GoogleM",
"Address": "dns.google:853@8.8.8.8",
"Protocol": "tcp-tls",
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
},
{
"Name": "GoogleS",
"Address": "dns.google:853@8.8.4.4",
"Protocol": "tcp-tls",
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "223.73.56.110",
"NoCookie": true
}
}
],
"OnlyPrimaryDNS": false,
"IPv6UseAlternativeDNS": false,
"WhenPrimaryDNSAnswerNoneUse": "AlternativeDNS",
"IPNetworkFile": {
"Primary": "/opt/etc/cn.zone",
"Alternative": "/opt/etc/empty"
},
"DomainFile": {
"Primary": "/opt/etc/empty",
"Alternative": "/opt/etc/empty"
},
"HostsFile": "",
"MinimumTTL": 300,
"DomainTTLFile" : "/opt/etc/domain_ttl.txt",
"CacheSize" : 8192,
"RejectQtype": [255]
}

:cool: :cool: :cool:


[6/59]  < 1 2 3 4 5 6 7 8 9 10 > ... »