sess = requests.Session() sess.headers = {'X-Auth-Key': 'c0a28d1a88aa75f588fb877d8a17470c00b56', 'X-Auth-Email': 'gyc990326@gmail.com'} account_identifier = 'd5d793c04edcff2d0014c090f6018ba5' tunnel_id = 'ad0da179-96bd-4f98-8fef-67763eb34a6f' r = sess.get(f'https://api.cloudflare.com/client/v4/accounts/{account_identifier}/cfd_tunnel/{tunnel_id}/configurations') print("Cur config:", r.text) # netstat -tunlp | grep tcp | grep LISTEN | grep 0.0.0.0 | awk '{ print $4 }' | cut "-d:" -f2 | sort |uniq ports = [10000, 10001, 10396, 111, 139, 15000, 15010, 15011, 15100, 15101, 15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110, 19980, 2053, 22, 25500, 3000, 3333, 33443, 33444, 33445, 33446, 38541, 44465, 445, 4480, 53, 5555, 5700, 5701, 5702, 5708, 5709, 6443, 6653, 680, 6853, 80, 8022, 8800, 9100, 9130, 9131] t= [{'service': f'http://localhost:{i}', 'hostname': f'bjnode-p{i}.misty.moe'} for i in ports] baseconf = {'ingress': [{'service': 'http://127.0.0.1:9131', 'hostname': 'bjnode-p9131.misty.moe', 'originRequest': {'httpHostHeader': '82.157.188.212', 'disableChunkedEncoding': True}}, {'service': 'http_status:404'}], 'warp-routing': {'enabled': False}} newconf = dict(baseconf) newconf['ingress'] = t + [{'service': 'http_status:404'}] wprint("Update ret:", r.text)
CF Tunnel做WebVPN
大类
CloudResource
技术标签
云服务-白嫖
优先级
Low
状态
Monitoring
开始日期
Aug 20, 2023
最后更新
Aug 20, 2023
Public