Posted 2024-11-03Updated 2024-11-032 minutes read (About 347 words)Google 2FA 脚本批量显示Google 2FA 工具,5秒刷新一次 secrets.csv 123456789101112131415username,secretiAvloyola,ENOG7VLRJJ7GDNZJLilBlue561,IWPTHMCHSR74EOSHKwaciWorsnop,TUXN5TNLTKOPTJEYvikeshchotai,L333DPD5JHXF3O2Kperaltasocimo,UH4EDK7425BFCXSHmakzuzu,OUIG375O7OARDXLJJsaFikitha,AIWBIBQGXZK3ZDE3limliangtung,HHD2VM5LHCV6TDOVsinhde18,L6LYS4ECQL5KKPFFActionDT,O64IEGT5NPCOHCQtimansur,3ASN5ZIGJH4ICYUXDarmyrez,BTKNH5OMOMPZ7CFYaninditamario,G2VHH4IHFE367PNWizzanfurkan,EYP7VV6AK6EIDIJB 批量显示验证码脚本 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import csvimport datetimeimport pyotpimport timeimport osimport base64# 定义读取CSV文件的函数def read_secrets_from_csv(csv_file_path): secrets = [] with open(csv_file_path, mode='r') as file: reader = csv.DictReader(file) for row in reader: secrets.append(row) return secrets# 定义验证Base32密钥的函数def is_valid_base32(secret): try: # 尝试解码,如果失败则说明不是有效的Base32 base64.b32decode(secret, casefold=True) return True except (base64.binascii.Error, ValueError): return False# 定义生成2FA验证码的函数def generate_2fa_codes(secrets): codes = [] for secret in secrets: if is_valid_base32(secret['secret']): totp = pyotp.TOTP(secret['secret']) code = totp.now() codes.append({'username': secret['username'], 'code': code}) else: codes.append({'username': secret['username'], 'code': '无效的Base32密钥'}) return codes# 主函数def main(): csv_file_path = '2fa/secrets.csv' # 请根据实际情况修改CSV文件路径 secrets = read_secrets_from_csv(csv_file_path) while True: os.system('cls' if os.name == 'nt' else 'clear') # 清屏 codes = generate_2fa_codes(secrets) print(f"时间:{datetime.datetime.now()}") for entry in codes: print(f"用户 {entry['username']} 的当前2FA验证码是: {entry['code']}") time.sleep(5) # 每30秒刷新一次if __name__ == "__main__": main() Google 2FA 脚本https://konbluesky.github.io/2024/11/03/google-2fa/AuthorGavinPosted on2024-11-03Updated on2024-11-03Licensed under#python