diff --git a/中国电信/瑞数通杀.js b/中国电信/瑞数通杀.js new file mode 100644 index 0000000..1447a75 --- /dev/null +++ b/中国电信/瑞数通杀.js @@ -0,0 +1,134 @@ +delete __filename +delete __dirname +ActiveXObject = undefined + +window = global; + + +content="content_code" + + +navigator = {"platform": "Linux aarch64"} +navigator = {"userAgent": "CtClient;11.0.0;Android;13;22081212C;NTIyMTcw!#!MTUzNzY"} + +location={ + "href": "https://", + "origin": "", + "protocol": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "", + "search": "", + "hash": "" +} + +i = {length: 0} +base = {length: 0} +div = { + getElementsByTagName: function (res) { + console.log('div中的getElementsByTagName:', res) + if (res === 'i') { + return i + } + return '
' + + } +} + +script = { + +} +meta = [ + {charset:"UTF-8"}, + { + content: content, + getAttribute: function (res) { + console.log('meta中的getAttribute:', res) + if (res === 'r') { + return 'm' + } + }, + parentNode: { + removeChild: function (res) { + console.log('meta中的removeChild:', res) + + return content + } + }, + + } +] +form = '' + + +window.addEventListener= function (res) { + console.log('window中的addEventListener:', res) + + } + + +document = { + + + createElement: function (res) { + console.log('document中的createElement:', res) + + + if (res === 'div') { + return div + } else if (res === 'form') { + return form + } + else{return res} + + + + + }, + addEventListener: function (res) { + console.log('document中的addEventListener:', res) + + }, + appendChild: function (res) { + console.log('document中的appendChild:', res) + return res + }, + removeChild: function (res) { + console.log('document中的removeChild:', res) + }, + getElementsByTagName: function (res) { + console.log('document中的getElementsByTagName:', res) + if (res === 'script') { + return script + } + if (res === 'meta') { + return meta + } + if (res === 'base') { + return base + } + }, + getElementById: function (res) { + console.log('document中的getElementById:', res) + if (res === 'root-hammerhead-shadow-ui') { + return null + } + } + +} + +setInterval = function () {} +setTimeout = function () {} +window.top = window + + +'ts_code' + + + +function main() { + cookie = document.cookie.split(';')[0] + return cookie +} + diff --git a/中国电信/电信金豆换话费.py b/中国电信/电信金豆换话费.py new file mode 100644 index 0000000..b94870d --- /dev/null +++ b/中国电信/电信金豆换话费.py @@ -0,0 +1,490 @@ +import requests +import re +import time +import json +import random +import datetime +import base64 +import threading +import ssl +import execjs +import os +import sys + +from bs4 import BeautifulSoup + +from Crypto.PublicKey import RSA +from Crypto.Cipher import PKCS1_v1_5 +from Crypto.Cipher import DES3 +from Crypto.Util.Padding import pad, unpad +from Crypto.Util.strxor import strxor +from Crypto.Cipher import AES +from http import cookiejar # Python 2: import cookielib as cookiejar +from requests.adapters import HTTPAdapter +from requests.packages.urllib3.util.ssl_ import create_urllib3_context + + +class BlockAll(cookiejar.CookiePolicy): + return_ok = set_ok = domain_return_ok = path_return_ok = lambda self, *args, **kwargs: False + netscape = True + rfc2965 = hide_cookie2 = False + +def printn(m): + print(f'\n{m}') +ORIGIN_CIPHERS = ('DEFAULT@SECLEVEL=1') + +ip_list = [] +class DESAdapter(HTTPAdapter): + def __init__(self, *args, **kwargs): + """ + A TransportAdapter that re-enables 3DES support in Requests. + """ + CIPHERS = ORIGIN_CIPHERS.split(':') + random.shuffle(CIPHERS) + CIPHERS = ':'.join(CIPHERS) + self.CIPHERS = CIPHERS + ':!aNULL:!eNULL:!MD5' + super().__init__(*args, **kwargs) + + def init_poolmanager(self, *args, **kwargs): + context = create_urllib3_context(ciphers=self.CIPHERS) + kwargs['ssl_context'] = context + return super(DESAdapter, self).init_poolmanager(*args, **kwargs) + + def proxy_manager_for(self, *args, **kwargs): + context = create_urllib3_context(ciphers=self.CIPHERS) + kwargs['ssl_context'] = context + return super(DESAdapter, self).proxy_manager_for(*args, **kwargs) + + +requests.packages.urllib3.disable_warnings() +ssl_context = ssl.create_default_context() +ssl_context.check_hostname = False +ssl_context.verify_mode = ssl.CERT_NONE +ssl_context.set_ciphers('DEFAULT@SECLEVEL=0') +ss = requests.session() +ss.ssl=ssl_context +ss.headers={"User-Agent":"Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36","Referer":"https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"} +ss.mount('https://', DESAdapter()) +yc = 0.1 +wt = 0 +kswt = -3 +yf = datetime.datetime.now().strftime("%Y%m") + + +jp = {"9":{},"12":{},"13":{},"23":{}} + + +try: + with open('电信金豆换话费.log') as fr: + dhjl = json.load(fr) +except: + dhjl = {} +if yf not in dhjl: + dhjl[yf] = {} + + + + +wxp={} +errcode = { + "0":"兑换成功", + "412":"兑换次数已达上限", + "413":"商品已兑完", + "420":"未知错误", + "410":"该活动已失效~", + "Y0001":"当前等级不足,去升级兑当前话费", + "Y0002":"使用翼相连网络600分钟或连接并拓展网络500分钟可兑换此奖品", + "Y0003":"使用翼相连共享流量400M或共享WIFI:2GB可兑换此奖品", + "Y0004":"使用翼相连共享流量2GB可兑换此奖品", + "Y0005":"当前等级不足,去升级兑当前话费", + "E0001":"您的网龄不足10年,暂不能兑换" +} + + + + + + + + + + +#加密参数 +key = b'1234567`90koiuyhgtfrdews' +iv = 8 * b'\0' + +public_key_b64 = '''-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBkLT15ThVgz6/NOl6s8GNPofdWzWbCkWnkaAm7O2LjkM1H7dMvzkiqdxU02jamGRHLX/ZNMCXHnPcW/sDhiFCBN18qFvy8g6VYb9QtroI09e176s+ZCtiv7hbin2cCTj99iUpnEloZm19lwHyo69u5UMiPMpq0/XKBO8lYhN/gwIDAQAB +-----END PUBLIC KEY-----''' + +public_key_data = '''-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ugG5A8cZ3FqUKDwM57GM4io6JGcStivT8UdGt67PEOihLZTw3P7371+N47PrmsCpnTRzbTgcupKtUv8ImZalYk65dU8rjC/ridwhw9ffW2LBwvkEnDkkKKRi2liWIItDftJVBiWOh17o6gfbPoNrWORcAdcbpk2L+udld5kZNwIDAQAB +-----END PUBLIC KEY-----''' + + +def t(h): + date = datetime.datetime.now() + date_zero = datetime.datetime.now().replace(year=date.year, month=date.month, day=date.day, hour=h, minute=59, second=59) + date_zero_time = int(time.mktime(date_zero.timetuple())) + return date_zero_time + + + +def encrypt(text): + cipher = DES3.new(key, DES3.MODE_CBC, iv) + ciphertext = cipher.encrypt(pad(text.encode(), DES3.block_size)) + return ciphertext.hex() + +def decrypt(text): + ciphertext = bytes.fromhex(text) + cipher = DES3.new(key, DES3.MODE_CBC, iv) + plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size) + return plaintext.decode() + + + +def b64(plaintext): + public_key = RSA.import_key(public_key_b64) + cipher = PKCS1_v1_5.new(public_key) + ciphertext = cipher.encrypt(plaintext.encode()) + return base64.b64encode(ciphertext).decode() + +def encrypt_para(plaintext): + public_key = RSA.import_key(public_key_data) + cipher = PKCS1_v1_5.new(public_key) + ciphertext = cipher.encrypt(plaintext.encode()) + return ciphertext.hex() + + +def encode_phone(text): + encoded_chars = [] + for char in text: + encoded_chars.append(chr(ord(char) + 2)) + return ''.join(encoded_chars) + +def ophone(t): + key = b'34d7cb0bcdf07523' + utf8_key = key.decode('utf-8') + utf8_t = t.encode('utf-8') + cipher = AES.new(key, AES.MODE_ECB) + ciphertext = cipher.encrypt(pad(utf8_t, AES.block_size)) + return ciphertext.hex() + +def send(uid,content): + r = requests.post('https://wxpusher.zjiecode.com/api/send/message',json={"appToken":appToken,"content":content,"contentType":1,"uids":[uid]}).json() + return r + + +def userLoginNormal(phone,password): + alphabet = 'abcdef0123456789' + uuid = [''.join(random.sample(alphabet, 8)),''.join(random.sample(alphabet, 4)),'4'+''.join(random.sample(alphabet, 3)),''.join(random.sample(alphabet, 4)),''.join(random.sample(alphabet, 12))] + timestamp=datetime.datetime.now().strftime("%Y%m%d%H%M%S") + loginAuthCipherAsymmertric = 'iPhone 14 15.4.' + uuid[0] + uuid[1] + phone + timestamp + password[:6] + '0$$$0.' + + r = ss.post('https://appgologin.189.cn:9031/login/client/userLoginNormal',json={"headerInfos": {"code": "userLoginNormal", "timestamp": timestamp, "broadAccount": "", "broadToken": "", "clientType": "#9.6.1#channel50#iPhone 14 Pro Max#", "shopId": "20002", "source": "110003", "sourcePassword": "Sid98s", "token": "", "userLoginName": phone}, "content": {"attach": "test", "fieldData": {"loginType": "4", "accountType": "", "loginAuthCipherAsymmertric": b64(loginAuthCipherAsymmertric), "deviceUid": uuid[0] + uuid[1] + uuid[2], "phoneNum": encode_phone(phone), "isChinatelecom": "0", "systemVersion": "15.4.0", "authentication": password}}}).json() + + + + l = r['responseData']['data']['loginSuccessResult'] + + if l: + load_token[phone] = l + with open(load_token_file, 'w') as f: + json.dump(load_token, f) + ticket = get_ticket(phone,l['userId'],l['token']) + return ticket + + return False +def get_ticket(phone,userId,token): + r = ss.post('https://appgologin.189.cn:9031/map/clientXML',data='getSingle