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
相关推荐
cipher1 天前
ERC-4626 通胀攻击:DeFi 金库的"捐款陷阱"
前端·后端·安全
一次旅行4 天前
网络安全总结
安全·web安全
red1giant_star4 天前
手把手教你用Vulhub复现ecshop collection_list-sqli漏洞(附完整POC)
安全
ZeroNews内网穿透4 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全
一名优秀的码农4 天前
vulhub系列-14-Os-hackNos-1(超详细)
安全·web安全·网络安全·网络攻击模型·安全威胁分析
Libraeking4 天前
05 安全边界:MCP Server 的权限沙箱与敏感数据保护
安全
努力的lpp4 天前
SQLMap CTF 常用命令全集
数据库·web安全·网络安全·sql注入
龙仔7254 天前
在麒麟V10服务器安全加固,sshd防暴力破解加固,实现“密码错误3次封IP”的需求
服务器·tcp/ip·安全
努力的lpp4 天前
SQL 报错注入
数据库·sql·web安全·网络安全·sql注入
上海云盾-小余4 天前
即时通讯App的DDoS防御架构设计
运维·服务器·安全