开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 281|回复: 8
收起左侧

[已解决] 短链还原方法

 关闭 [复制链接]
结帖率:97% (75/77)
发表于 2025-9-24 17:53:50 | 显示全部楼层 |阅读模式   广东省深圳市
1000精币
求还原方法  https://kzurl17.cn/7KOyJE  应该是多次重定向了

最佳答案

查看完整内容

先通过禁止重定向拿到一个地址 然后访问这个地址的时候 他用了js获取url中的参数 进行base64解码 再拼接一个地址跳转的。 部分js代码 function getQueryString(name) { var regex = new RegExp('[?&]' + name + '=([^&]*)', 'i'); var match = window.location.href.split('?')[1].match(regex); if (match != null) return unescape(match[1]); return null; } var curUrl = window.location.href; var param ...

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值
结帖率:44% (7/16)

签到天数: 1 天

发表于 2025-9-24 17:53:51 | 显示全部楼层   浙江省金华市
先通过禁止重定向拿到一个地址
然后访问这个地址的时候 他用了js获取url中的参数 进行base64解码 再拼接一个地址跳转的。
部分js代码


function getQueryString(name) {
    var regex = new RegExp('[?&]' + name + '=([^&]*)', 'i');
    var match = window.location.href.split('?')[1].match(regex);
    if (match != null) return unescape(match[1]);
    return null;
}

var curUrl = window.location.href;
var param = getQueryString('param');

if (param) {
    if (param.length === 12) {
        param = atob(param);
    } else if (param.length === 20) {
        param = atob(param);
        param = param.substring(3,5) + param.substring(8,12) + param.substring(14);
    }
    window.location.href = '/some/path?data=' + param;
}




补充内容 (2025-9-24 18:25):
你发的那个链接 最终得到一个 京东的跳转链接 https://u.jd.com/PgVMW4O
回复

使用道具 举报

结帖率:91% (106/117)

签到天数: 10 天

发表于 2025-9-24 18:12:21 | 显示全部楼层   广东省佛山市
回复

使用道具 举报

签到天数: 14 天

发表于 2025-9-24 18:16:58 | 显示全部楼层   广东省中山市

  <meta http-equiv="refresh" content="0.1;url=http://jxd.tbkzl.com/static/index.html?param=YTBiUGc4YzFWTVc0YzhP">
回复

使用道具 举报

结帖率:97% (75/77)

签到天数: 1 天

 楼主| 发表于 2025-9-24 18:17:01 | 显示全部楼层   广东省深圳市
用户被删除 发表于 2025-9-24 18:12
https://www.sojson.com/dwz/parse.html

还原结果不对,而已我要方法你这丢个链接给我我也用不到
回复

使用道具 举报

结帖率:97% (75/77)

签到天数: 1 天

 楼主| 发表于 2025-9-24 18:17:58 | 显示全部楼层   广东省深圳市
风花雪月201 发表于 2025-9-24 18:12
先通过禁止重定向拿到一个地址
然后访问这个地址的时候 他用了js获取url中的参数 进行base64解码 再拼接一 ...

有例子吗
回复

使用道具 举报

结帖率:97% (75/77)

签到天数: 1 天

 楼主| 发表于 2025-9-24 18:30:10 | 显示全部楼层   广东省深圳市
回复

使用道具 举报

结帖率:44% (7/16)

签到天数: 1 天

发表于 2025-9-24 18:48:45 | 显示全部楼层   浙江省金华市

js部分是混淆代码 暂时没时间去细看
回复

使用道具 举报

签到天数: 5 天

发表于 2025-9-24 19:13:14 | 显示全部楼层   云南省大理白族自治州
[JavaScript] 纯文本查看 复制代码
function generateJDUrl(paramValue) {
    // Base64解码
    let decoded = atob(paramValue);
    console.log("Decoded string:", decoded); // 输出: "a0bPg8c1VMW4c8O"
    
    // 提取子字符串
    let part1 = decoded.substring(3, 5); // "Pg"
    let part2 = decoded.substring(8, 12); // "VMW4"
    let part3 = decoded.substring(14); // "O"
    
    // 组合路径
    let path = part1 + part2 + part3;
    console.log("Combined path:", path); // 输出: "PgVMW4O"
    
    // 拼接URL
    let baseUrl = "https://u.jd.com/";
    let finalUrl = baseUrl + path;
    return finalUrl;
}

// 测试
let param = "YTBiUGc4YzFWTVc0YzhP";
let url = generateJDUrl(param);
console.log("Final URL:", url); // 输出: "https://u.jd.com/PgVMW4O"



HTML

[HTML] 纯文本查看 复制代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>京东短链参数转换工具</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        
        .container {
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            width: 100%;
            max-width: 600px;
            padding: 30px;
        }
        
        h1 {
            color: #e33333;
            text-align: center;
            margin-bottom: 20px;
            font-size: 28px;
        }
        
        .description {
            color: #666;
            text-align: center;
            margin-bottom: 30px;
            line-height: 1.6;
        }
        
        .input-group {
            margin-bottom: 25px;
        }
        
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #333;
        }
        
        input {
            width: 100%;
            padding: 14px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 16px;
            transition: border-color 0.3s;
        }
        
        input:focus {
            border-color: #e33333;
            outline: none;
        }
        
        button {
            background-color: #e33333;
            color: white;
            border: none;
            padding: 14px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            width: 100%;
            transition: background-color 0.3s;
            margin-bottom: 20px;
        }
        
        button:hover {
            background-color: #c41a1a;
        }
        
        .result-container {
            background-color: #f9f9f9;
            border-radius: 8px;
            padding: 20px;
            margin-top: 20px;
            border-left: 4px solid #e33333;
        }
        
        .result-title {
            font-weight: 600;
            margin-bottom: 10px;
            color: #333;
        }
        
        .result-url {
            word-break: break-all;
            padding: 12px;
            background-color: #eee;
            border-radius: 4px;
            margin-bottom: 15px;
            font-family: monospace;
        }
        
        .copy-btn {
            background-color: #4CAF50;
            width: auto;
            padding: 10px 15px;
            font-size: 14px;
        }
        
        .copy-btn:hover {
            background-color: #45a049;
        }
        
        .process-steps {
            margin-top: 20px;
            padding: 15px;
            background-color: #f0f8ff;
            border-radius: 8px;
            font-size: 14px;
        }
        
        .step {
            margin-bottom: 10px;
            padding-left: 20px;
            position: relative;
        }
        
        .step:before {
            content: "→";
            position: absolute;
            left: 0;
            color: #e33333;
        }
        
        .example {
            margin-top: 20px;
            padding: 15px;
            background-color: #fff8e1;
            border-radius: 8px;
            font-size: 14px;
        }
        
        .example-title {
            font-weight: 600;
            margin-bottom: 8px;
            color: #e65100;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>京东短链参数转换工具</h1>
        <p class="description">输入param参数,将其转换为京东短链URL</p>
        
        <div class="input-group">
            <label for="param-input">Param参数:</label>
            <input type="text" id="param-input" placeholder="例如: YTBiUGc4YzFWTVc0YzhP" autocomplete="off">
        </div>
        
        <button id="convert-btn">转换参数</button>
        
        <div class="result-container">
            <div class="result-title">转换结果:</div>
            <div id="result-url" class="result-url">等待输入...</div>
            <button id="copy-btn" class="copy-btn" disabled>复制链接</button>
        </div>
        
        <div class="process-steps">
            <div class="result-title">转换过程:</div>
            <div id="process-details">
                <div class="step">等待输入参数</div>
            </div>
        </div>
        
        <div class="example">
            <div class="example-title">示例:</div>
            <div>输入: YTBiUGc4YzFWTVc0YzhP</div>
            <div>输出: https://u.jd.com/PgVMW4O</div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const paramInput = document.getElementById('param-input');
            const convertBtn = document.getElementById('convert-btn');
            const resultUrl = document.getElementById('result-url');
            const copyBtn = document.getElementById('copy-btn');
            const processDetails = document.getElementById('process-details');
            
            // 转换函数
            function convertParam(paramValue) {
                // 清空过程显示
                processDetails.innerHTML = '';
                
                // 添加第一步
                addProcessStep(`输入参数: ${paramValue}`);
                
                try {
                    // Base64解码
                    const decoded = atob(paramValue);
                    addProcessStep(`Base64解码: ${decoded}`);
                    
                    // 检查长度
                    if (decoded.length < 15) {
                        throw new Error('解码后的字符串长度不足,无法提取所需部分');
                    }
                    
                    // 提取子字符串
                    const part1 = decoded.substring(3, 5);
                    addProcessStep(`提取索引3-5: "${part1}"`);
                    
                    const part2 = decoded.substring(8, 12);
                    addProcessStep(`提取索引8-12: "${part2}"`);
                    
                    const part3 = decoded.substring(14);
                    addProcessStep(`提取索引14到末尾: "${part3}"`);
                    
                    // 组合路径
                    const path = part1 + part2 + part3;
                    addProcessStep(`组合路径: "${path}"`);
                    
                    // 拼接URL
                    const baseUrl = "https://u.jd.com/";
                    const finalUrl = baseUrl + path;
                    addProcessStep(`最终URL: ${finalUrl}`);
                    
                    return finalUrl;
                } catch (error) {
                    addProcessStep(`错误: ${error.message}`);
                    return null;
                }
            }
            
            // 添加过程步骤
            function addProcessStep(text) {
                const step = document.createElement('div');
                step.className = 'step';
                step.textContent = text;
                processDetails.appendChild(step);
            }
            
            // 转换按钮点击事件
            convertBtn.addEventListener('click', function() {
                const paramValue = paramInput.value.trim();
                
                if (!paramValue) {
                    resultUrl.textContent = '请输入param参数';
                    copyBtn.disabled = true;
                    return;
                }
                
                const url = convertParam(paramValue);
                
                if (url) {
                    resultUrl.textContent = url;
                    copyBtn.disabled = false;
                } else {
                    resultUrl.textContent = '转换失败,请检查参数格式';
                    copyBtn.disabled = true;
                }
            });
            
            // 复制按钮点击事件
            copyBtn.addEventListener('click', function() {
                const tempTextArea = document.createElement('textarea');
                tempTextArea.value = resultUrl.textContent;
                document.body.appendChild(tempTextArea);
                tempTextArea.select();
                document.execCommand('copy');
                document.body.removeChild(tempTextArea);
                
                // 显示复制成功反馈
                const originalText = copyBtn.textContent;
                copyBtn.textContent = '已复制!';
                setTimeout(() => {
                    copyBtn.textContent = originalText;
                }, 1500);
            });
            
            // 示例参数
            paramInput.addEventListener('focus', function() {
                if (!this.value) {
                    this.value = 'YTBiUGc4YzFWTVc0YzhP';
                }
            });
        });
    </script>
</body>
</html>


步骤:

1.GET  https://kzurl17.cn/7KOyJE
2.生成上面的京东的跳转链接 https://u.jd.com/PgVMW4O
3.获取最后地址
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

关闭

精易论坛 - 有你更精彩上一条 /2 下一条

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报QQ: 793400750,邮箱:wp@125.la
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备2025452707号) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表