Yakit热加载 之 出差无聊测酒店 WiFi

前言

在酒店实在无聊,想着测测路由器玩玩,看看有没有摄像头

抓到包就是这个样子

治不了 gov 还治不了你?

手搓了一会 js,又是异或啥的,实在是头疼,后来发现,把 admin 加密后的字符串放到百度一搜,就有师傅逆向出来过

测试一下抠出来的加密函数可用性

复制代码
var TpLinkPasswordEncoder = {    // 'presetString' 是一个预设的字符串,用于与输入密码进行异或操作的一部分    presetString: "RDpbLfCPsJZ7fiv",
    // 'dictionary' 字典字符串,用于生成加密后的字符    dictionary: "yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciX" +                "TysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgML" +                "wygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3" +                "sfQ1xtXcPcf1aT303wAQhv66qzW",
    // 'encodePassword' 方法用于加密传入的密码    encodePassword: function (password) {        var dictionary = this.dictionary;        var output = ""; // 加密后的字符串将存储在这里        var len, lenPassword, lenPreset, lenDict;        var charLeft = 0xBB, charRight = 0xBB;
        lenPassword = password.length; // 输入密码的长度        lenPreset = this.presetString.length; // 预设字符串的长度        lenDict = dictionary.length; // 字典字符串的长度        len = lenPassword > lenPreset ? lenPassword : lenPreset; // 取最长的长度作为循环的次数
        // 遍历每个字符进行加密处理        for (var index = 0; index < len; index++) {            charLeft = 0xBB;            charRight = 0xBB;
            // 根据索引位置,决定如何与预设字符串的字符进行异或操作            if (index >= lenPassword) {                // 如果索引超出了密码长度,只使用预设字符串的字符                charRight = this.presetString.charCodeAt(index);            } else if (index >= lenPreset) {                // 如果索引超出了预设字符串长度,只使用密码的字符                charLeft = password.charCodeAt(index);            } else {                // 如果索引在两个字符串的长度内,使用两者的字符进行异或操作                charLeft = password.charCodeAt(index);                charRight = this.presetString.charCodeAt(index);            }
            // 根据异或操作的结果,从字典中选取字符,添加到输出字符串中            output += dictionary.charAt((charLeft ^ charRight) % lenDict);        }
        return output; // 返回加密后的字符串    }};
// 测试加密功能,输出加密后的'admin'密码console.log(TpLinkPasswordEncoder.encodePassword("admin"));

用 AI 使用 Python 重构一下加密逻辑

问:为什么要 Python 重构?

答:看 Python 顺眼,只看得懂 Python

然后 Deepwiki+手改

无奈 Deepwiki 抽风,给了好几次结果都不对

最后手改了一份

复制代码
tplinkPasswordEncode = password => {      presetString = "RDpbLfCPsJZ7fiv"      dictionary = "yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciXTysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgMLwygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3sfQ1xtXcPcf1aT303wAQhv66qzW"  
    output = ""      lenPassword = len(password)      lenPreset = len(presetString)      lenDict = len(dictionary)  
    // 使用max函数确定循环长度      length = lenPassword      if lenPreset > lenPassword {          length = lenPreset      }  
    for i = 0; i < length; i++ {          charLeft = 0xBB          charRight = 0xBB  
        if i >= lenPassword {              // 超出密码长度,使用预设字符串              charRight = presetString[i]          } else if i >= lenPreset {              // 超出预设字符串长度,使用密码字符              charLeft = password[i]          } else {              // 都在范围内,使用两者              charLeft = password[i]              charRight = presetString[i]          }  
        // 异或运算并取字典字符          index = (charLeft ^ charRight) % lenDict          output += dictionary[index:index+1]      }  
    return output  }print(tplinkPasswordEncode("admin"))

然而,事实并不是很美好

同时也是证明算法是对的。

最后也是成功被 ban 了

希望官方微调训练 AI 模型,这样就可以懒死了。

参考资料:

复制代码
Yaklang 官方手册https://www.yaklang.com/docs/introCSDN 算法解析https://blog.csdn.net/qq_38238956/article/details/124363565Deepwikihttps://deepwiki.com/yaklang/yaklang
相关推荐
Fnetlink13 小时前
Fnet 云网安 260904
网络·人工智能·安全·web安全·网络安全
志栋智能4 小时前
安全超自动化如何支持大规模安全运营?
网络·安全·自动化
安科瑞黄益鸣5 小时前
筑牢高压直流安全防线:AIM‑T500L 绝缘监测仪在算力中心 DC800V 系统的应用
安全
HugoStudio_SWAN5 小时前
洛谷 B4500 / B4449 / B3843 凯撒密码、密码强度与密码合规——加密与安全的三道门
c++·学习·程序人生·算法·安全
小五传输5 小时前
FTP替代怎么做?医院文件安全传输选型与迁移指南
大数据·运维·安全
TechWayfarer6 小时前
Cloudflare 9·15新政倒计时:用IP风险画像识别AI爬虫,防止误伤Googlebot
网络·人工智能·爬虫·python·tcp/ip·网络安全
luckystar513~6 小时前
Hermes 实战 :系列收官/生产化——安全审计与运维
运维·人工智能·安全·agent·智能体开发·hermes实战·智能体网关
大模型码小白7 小时前
AI大模型接入SDK:人工智能核心概念与发展史
大数据·运维·人工智能·安全·prompt
ynm1117 小时前
2026.8.31(2)【AES】MRCTF2020 Unravel!!
网络安全·buuctf·青少年ctf
金立基胶粘8 小时前
如何利用替塑油推动环保发展?
大数据·安全