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
相关推荐
m0_466525291 小时前
绿盟科技风云卫AI安全能力平台成果重磅发布
大数据·数据库·人工智能·安全
晚霞的不甘2 小时前
守护智能边界:CANN 的 AI 安全机制深度解析
人工智能·安全·语言模型·自然语言处理·前端框架
枷锁—sha2 小时前
【SRC】SQL注入快速判定与应对策略(一)
网络·数据库·sql·安全·网络安全·系统安全
数字护盾(和中)2 小时前
信创生态 + 国密算法 筑牢数字安全韧性根基
安全
devmoon3 小时前
在 Polkadot 上部署独立区块链Paseo 测试网实战部署指南
开发语言·安全·区块链·polkadot·erc-20·测试网·独立链
成茂峰3 小时前
软考高级·系统架构设计师 | 四、信息技术安全知识
安全·信息安全·系统架构·架构设计师
向哆哆3 小时前
CANN生态安全保障:cann-security-module技术解读
人工智能·安全·cann
wuli_滔滔4 小时前
CANN安全机制源码探秘 仓库中的权限校验与数据加密实现
安全·cann
liann1194 小时前
3.1_网络——基础
网络·安全·web安全·http·网络安全
独行soc5 小时前
2026年渗透测试面试题总结-17(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮