前言
最近看到一篇修改时间启动xray继续用高级版的文章(其实已经是二月份的文章了😂)
想起以前白嫖高级版的license过期前就会在服务器上挂一个screen运行xray监听,确实不会提示过期失效能一直用
但是由于懒就一直让他在挂在那里,没想过写脚本改时间来启动xray,哎
测试
Python
对着敲下来(为了能在linux下运行,稍微改了一下)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import time,sys,os,threading
class crack(threading.Thread):
def __init__(self,curr_time):
threading.Thread.__init__(self)
self.curr_time = curr_time
def run(self):
time.sleep(1)
os.system("sudo date -s \""+self.curr_time+"\"")
if __name__ == '__main__':
print("""
Xray仅供学习交流版
""")
try:
argv=" "
for i in range(len(sys.argv)):
if i != 0:
argv = argv + " " + str(sys.argv[i])
curr_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
os.system("sudo date -s \"2022-02-10 07:59:59\"")
thread1 = crack(curr_time)
thread1.start()
os.system("./xray_linux_amd64" + argv)
except BaseException:
input("error!!!press Enter key to end")
Linux
#!/usr/bin/env bash
xraytime="2022-02-08"
# 关闭ntp
sudo timedatectl set-ntp false
# 5秒后恢复时间
sudo nohup bash -c "sleep 5 && sudo timedatectl set-ntp true" >/dev/null 2>&1 &
# 设置时间
sudo date -s "$xraytime"
# 启动xray
./xray $@
问题
抱着试试看的心里,扛上去年双十一白嫖的xray-license.lic
,xrat发现时间设置回去年的时候发现是会报time error
的
看了一下xray的版本号,发现还有个Build的时间戳
再测试一下,时间比证书早的话也会报错(废话)
this license is not valid before 2021-02-10 12:16:49
所以这个方法适用于xray发布时间后,证书的过期前
例如:xray 1.8.4 是2022年1月30日构建的,证书有效期为[2021/02/10 12:16:49, 2022/02/10 08:00:00),那么能修改的时间就在[2022/01/30 00:00:00, 2022/02/10 08:00:00)
总结
- 下个xray发布,即便不增加检测手段只更新了一下build的时间,如果手上最新的证书只有这个的话也用不了新版(没错,说的就是我🤡)
- 如果新增了检测手段,还想用1.8.4养老,那么你的证书有效期需要在[2022/01/30 00:00:00, 证书到期时间)
参考文章
转载请注明来源,欢迎对文章中的引用来源进行考证,文章可能具有时效性,欢迎指出任何有错误、已失效或不够清晰的表达 ,可通过[邮件](mailto:cnlnnn@qq.com)联系垃圾堆主人