REVERSE-COMPETITION-CCSSSC-2025

REVERSE-COMPETITION-CCSSSC-2025

    • donntyousee
    • HappyLock
    • kernel_traffic

donntyousee

elf64,ida反编译不太行,有花指令,直接调汇编
读输入
re
读输入前有条打印”plz input your flag”,肯定是在.init_array,确实有很多
re
先不管,往下看,类似一个函数指针数组,通过偏移调用函数
re
大概是rc4,但是不知道走哪个数组
re
调试发现确实是rc4,直接异或回去发现不对
strace一下发现有个ptrace,猜测是反调试
re
.init_array->sub_4053A5->sub_529980
re
直接改掉这块跳转
re
再走rc4,然后异或回去即可

inp = list(b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")inp_enc = [0x20, 0xCD, 0x47, 0xBA, 0x4B, 0x04, 0x09, 0xE7, 0x8D, 0x1A,0x40, 0x43, 0xC1, 0xD6, 0x5F, 0xFE, 0xF0, 0x16, 0x44, 0x4A,0xB2, 0x6B, 0xE2, 0xF0, 0x9D, 0x92, 0x30, 0xD1, 0x51, 0x0E,0xC1, 0xFF, 0x23, 0xC9, 0x7A, 0xFF, 0x9C, 0x76, 0xA1, 0x4B,0x36, 0x59, 0x8F, 0xD3, 0xF1, 0xB4, 0x2D, 0x31, 0x6F, 0x78]enc = [0x25, 0xCD, 0x54, 0xAF, 0x51, 0x1C, 0x58, 0xD3, 0xA8, 0x4B,0x4F, 0x56, 0xEC, 0x83, 0x5D, 0xD4, 0xF6, 0x47, 0x4A, 0x6F,0xE0, 0x73, 0xB0, 0xA5, 0xA8, 0xC3, 0x17, 0x81, 0x5E, 0x2B,0xF4, 0xF6, 0x71, 0xEA, 0x2F, 0xFF, 0xA8, 0x63, 0x99, 0x57]for i in range(len(enc)):enc[i] ^= inp[i] ^ inp_enc[i]print(bytes(enc))# dart{y0UD0ntL4cKg0oD3y34T0F1nDTh3B4aUtY}

HappyLock

画完手势后会走Utils.cmp(s)校验,flag就是这个s
re
反射调用cmp方法
re
交叉引用找到DexClassLoader
re
从r2路径加载dex文件
hook出r2路径

function hook() {Java.perform(function () {// 获取 DexClassLoader 类var DexClassLoader = Java.use('dalvik.system.DexClassLoader');// hook DexClassLoader 构造方法DexClassLoader.$init.overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.ClassLoader').implementation = function (param1, param2, param3, param4) {// 在这里可以访问到构造函数的参数console.log('r2 (param1): ' + param1); // param1 对应的是 $r2 的值// 调用原始的构造函数return this.$init(param1, param2, param3, param4);};});
}
hook()

re
但是它加载完就删了,内存里肯定有
re
gg修改器dump出内存来
再反编译,根据jadx提示改下checksum
cmp就是个循环异或
re
解密即可

enc=[118, 17, 2, 80, 9, 125, 6, 22, 113, 66, 0, 81, 94, 41, 87, 20, 122, 65, 88, 5, 94, 41, 7, 19, 118, 22, 3, 2, 90, 41, 87, 71, 117, 68, 4, 7, 95, 116, 4, 67]
key=list(b"CrackMe!CrackMe!")
for i in range(len(enc)):enc[i]^=key[i%len(key)]
print(bytes(enc))
# 5cc3b0c720a25d25939f5db25dba1d2f66ed49ab

kernel_traffic

首先是生成会话密钥,也就是rc4密钥,两个大数分别是模数n和私钥d,公钥e为65537
re
把流量里两块0x80大小的数据用私钥解密然后异或就能得到会话密钥

n = int("00b7db0b385f4cfb85bf9af7c1c8298ec4d691c8341b8a09d3e0f1685f1e9e8198b03426855ee144c38c10b623ae2f1f671b9aee7a8a7a49fc46154c5d57d1827c28bdf1aeb7cbf259ee1564dd24fcaa66f1e95db6652bbd8f4b1ef1a7bd698085609b8d50a714162bedc8f9478807984fa257ba6647d0a18cb5595bcd789cb8b7", 16)
e = 0x10001
d = int("18260d333a5142382f128bb848322d2e6d80786b5fb2a1d7d293e2c19ba3f621b803218c230a339dfba7b644b97c3703b3fc859652d9fd1dc596c690fc17e8ab6d2de44fcddc6d7af84fc50175347cebf1aeb4c920036fab4a20b4ba44b72f69d45e6ed40111bff5d1186087dc40d31c22bec7bdd6c39e079c518a2a385ecb01", 16)def getint(bufhex: str):tmp = bytes.fromhex(bufhex)[::-1]tmp = int(tmp.hex(), 16)return tmprandomenc = getint("676273984e2bca8ac3a86fad9f1f9765dede291b81dd0877e464881ddf1ee5dd8cd573387b0c3fe2c33b29f9dd22cc3962e76008f936911c96dc2b458cbb3b5a0cbf941d56b9b8ef536321e4d06ebcc6eb26458385fd64392492a41bcc7370f0a2209ea92ae8513ad31191a92fc44ca65fbf68757450a21ba9c9527454e3cd44")
randompla = pow(randomenc, d, n)
print(hex(randompla))
# 0x14b225e8fdd58d9aad84e8f691d93435serverenc = getint("ac180aeccc63af3bc278d4200b8caf22f4932366722e1be39fd165d0e56dab6d42cd95ea2458e1906a4c16422d374c5d488bca352f03485dd40cc7a7096df5ca7c20e3db6290797f418e3a84fb3b76e640ffe15913f4e73b9ab2cbd2deada3fda8e61a5dcd88f86bed46e6a5a44fc1fd40029d42b7311cb72b00555e401a2881")
serverpla = pow(serverenc, d, n)
print(hex(serverpla))
# 0xad6badbb35592b2d6d2d6d7138af4bc5randompla = list(bytes.fromhex(hex(randompla)[2:])[::-1])
print(randompla)
# [53, 52, 217, 145, 246, 232, 132, 173, 154, 141, 213, 253, 232, 37, 178, 20]
serverpla = list(bytes.fromhex(hex(serverpla)[2:])[::-1])
print(serverpla)
# [197, 75, 175, 56, 113, 109, 45, 109, 45, 43, 89, 53, 187, 173, 107, 173]rc4key = randompla.copy()
for i in range(len(rc4key)):rc4key[i] ^= (serverpla[i]*17) & 0xFF
rc4key = bytes(rc4key)

从内核读数据,先做rc4加密,再做基于表的替换,每轮的表根据时间戳设置
re
解密

data = bytes.fromhex("c9a435670c000000a92066b352dd8b65a0840fbac9a435670c000000d21c608abafe1fa3ed22ee1bcaa435670c0000005cd8e734e9ff3ddc88f82ff6cba435670c0000000f2c1f33a63872e89d85419dcda435670c0000009c4c416a6c33912c5d2dbea3cda435670c0000003405e1f86f204cb3233cee47cfa435670c000000babf35d58fb039f34ac0bc68d0a435670c00000069c3563248492fa3dd39c300d1a435670c0000009660928ac69bd2c5ed38c575d3a435670c0000008068f321bb9f3ad2db1733fcd4a435670c000000d0d76861912565a75fab99ead4a435670c000000d5e4f21427976a29b28d2465d5a435670c000000b8dc14e8f9e098ee0eae689cd5a435670c0000008d0a397c810b8e6387dc5317d5a435670c0000001a972a6c158c1bda02fc43ded5a435670c000000297eaa03818999b004297ca8d5a435670c000000c66c97a36a413d0fe38a57c5d8a435670c0000001809619ecdf37f837d44f986d8a435670c0000003b52e6a439e9f1ee97daa235d9a435670c000000a44507aa2e755b35675722fcdba435670c00000012d4da0167e78a3cd8080e4edda435670c00000083202fb19c2937cb9e3015e1dda435670c000000a34e094fd2e4cc0fc0d52e08e0a435670c000000c5323082d0db41cc22eaf37ee0a435670c000000c2fe09cd87dd6b8dc540b11fe1a435670c0000009f34dc29085976f1f1f4804ce1a435670c0000005928e0ea62033a917bbe2439e1a435670c00000025e8f3be3759dae1dddf5760e1a435670c000000a1985a4755ed3b39af887410e1a435670c000000b6dd7db5d3da879d6fcce465e1a435670c000000907194e5ccf0ab56d9cee5fce1a435670c000000a0d42f568286477b5000a21ee3a435670c000000fab0826bcd5e77a70d11ca95e3a435670c0000003c0b8f780746b6c870b8eb3de6a435670c000000a25ad5f8ab74414f116791afe8a435670c00000031b2eed379afb67f9aa962bfe8a435670c000000802421958e372da29ca75ae7eba435670c000000ed3db7f76f2b1fc8ace9dccbeba435670c00000012b5a5a2a5a161c619319de9eba435670c000000aefd55c6cdbef465b24dca78eba435670c000000daf9a0aef390e56d2c59da48f0a435670c000000a7e1347f096846f5b8f08c8bf1a435670c0000004754a89602a3902d44f2d151f1a435670c00000092a034c0c522c297349f7cfff3a435670c00000019a5598acb6abf72ab62e79cf4a435670c000000ebcca8b0c020566761d8484bf5a435670c000000bc65b1fd58a6c24a2bcdb23cf5a435670c000000dee8f9c766cb33cb771f8babf6a435670c000000547c2274e7be1e8a492d2566f6a435670c0000005c60476d6f22c523af08e883f6a435670c00000029ea7e1ccd945a6fec3f1bbff6a435670c000000816f99fc399b312a76a61b97")libc = ctypes.cdll.LoadLibrary("./libc.so.6")def rev_tb(rdm, buf):tb = [i for i in range(256)]libc.srand(rdm)for j in range(255, -1, -1):v2 = libc.rand()v5 = tb[j]tb[j] = tb[v2 % (j + 1)]tb[v2 % (j + 1)] = v5res = []for i in buf:res.append(tb.index(i))return resgrps = len(data) // 20rc4 = ARC4.new(rc4key)for grp in range(grps):rdm = struct.unpack("<I", data[grp*20+0:grp*20+4])[0]lgh = struct.unpack("<I", data[grp*20+4:grp*20+8])[0]assert(lgh == 0x0C)enc = list(data[grp*20+8:grp*20+20])enc = rev_tb(rdm, enc)print(f"\"{rc4.decrypt(bytes(enc)).hex()}\",")

前8字节是左shift,切大小写的,后4字节是键码,找个表映射回去即可(写的比较乱😓

import structscan_code_to_ascii = {0x00: 'Null',           # 无效的扫描码0x01: 'ESC',            # Esc0x02: '1',              # 10x03: '2',              # 20x04: '3',              # 30x05: '4',              # 40x06: '5',              # 50x07: '6',              # 60x08: '7',              # 70x09: '8',              # 80x0A: '9',              # 90x0B: '0',              # 00x0C: '-',              # -0x0D: '=',              # =0x0E: 'Backspace',      # Backspace0x0F: 'Tab',            # Tab0x10: 'Q',              # Q0x11: 'W',              # W0x12: 'E',              # E0x13: 'R',              # R0x14: 'T',              # T0x15: 'Y',              # Y0x16: 'U',              # U0x17: 'I',              # I0x18: 'O',              # O0x19: 'P',              # P0x1A: '[',              # [0x1B: ']',              # ]0x1C: 'Enter',          # Enter0x1D: 'Left Ctrl',      # Left Ctrl0x1E: 'A',              # A0x1F: 'S',              # S0x20: 'D',              # D0x21: 'F',              # F0x22: 'G',              # G0x23: 'H',              # H0x24: 'J',              # J0x25: 'K',              # K0x26: 'L',              # L0x27: ';',              # ;0x28: "'",              # '0x29: '`',              # `0x2A: 'Left Shift',     # Left Shift0x2B: '\\',             # \0x2C: 'Z',              # Z0x2D: 'X',              # X0x2E: 'C',              # C0x2F: 'V',              # V0x30: 'B',              # B0x31: 'N',              # N0x32: 'M',              # M0x33: ',',              # ,0x34: '.',              # .0x35: '/',              # /0x36: 'Right Shift',    # Right Shift0x37: '*',              # NumPad *0x38: 'Left Alt',       # Left Alt0x39: 'Space',          # Space0x3A: 'Caps Lock',      # Caps Lock0x3B: 'F1',             # F10x3C: 'F2',             # F20x3D: 'F3',             # F30x3E: 'F4',             # F40x3F: 'F5',             # F50x40: 'F6',             # F60x41: 'F7',             # F70x42: 'F8',             # F80x43: 'F9',             # F90x44: 'F10',            # F100x57: 'F11',            # F110x58: 'F12',            # F120xE0: 'Right Ctrl',     # Right Ctrl0xE1: 'Print Screen',   # Print Screen0xE2: 'Scroll Lock',     # Scroll Lock0xE3: 'Pause',          # Pause0xE4: 'Insert',         # Insert0xE5: 'Home',           # Home0xE6: 'Page Up',        # Page Up0xE7: 'Delete',         # Delete0xE8: 'End',            # End0xE9: 'Page Down',      # Page Down0xEA: 'Up Arrow',       # Up Arrow0xEB: 'Left Arrow',     # Left Arrow0xEC: 'Down Arrow',     # Down Arrow0xED: 'Right Arrow',    # Right Arrow
}def scan_code_to_ascii_code(scan_code):return scan_code_to_ascii.get(scan_code, 'Unknown')scan_codes = ["000000000000000021000000","000000000000000026000000","00000000000000001e000000","000000000000000022000000","00000000000000002a000000","01000000000000001a000000","000000000000000025000000","000000000000000004000000","000000000000000013000000","000000000000000031000000","000000000000000012000000","000000000000000026000000","00000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000000c000000","00000000000000002a000000","010000000000000014000000","000000000000000013000000","000000000000000005000000","000000000000000021000000","000000000000000021000000","000000000000000017000000","00000000000000002e000000","00000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000000c000000","00000000000000002a000000","010000000000000022000000","000000000000000005000000","000000000000000032000000","000000000000000012000000","00000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000000c000000","00000000000000002a000000","01000000000000002a000000","010000000000000023000000","000000000000000005000000","000000000000000023000000","00000000000000001e000000","00000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000002a000000","01000000000000001b000000"]s = []for scan_code in scan_codes:scan_code_bytes = bytes.fromhex(scan_code)ls = struct.unpack("<Q", scan_code_bytes[:8])[0]val = struct.unpack("<I", scan_code_bytes[8:])[0]s.append(ls)s.append(val)flag = ""islow = Truefor i in range(0, len(s), 2):ls = s[i+0]val = s[i+1]if ls == 0 and val == 0x2A:islow = ~islowcontinueif ls == 1 and val == 0x2A:continueif ls == 1 and val == 0x1A:flag += "{"continueif ls == 1 and val == 0x1B:flag += "}"continueif ls == 1 and val == 0x0C:flag += "_"continuech = scan_code_to_ascii_code(val)if ch.isalpha():if islow:if ls == 1:flag += chelse:flag += chr(ord(ch)+32)else:if ls == 1:flag += chr(ord(ch)+32)else:flag += chelif ch.isdigit():flag += chprint(flag)
# flag{k3rnel_Tr4ffic_G4me_H4ha}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/502848.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

海外招聘丨 弗拉瑞克商学院—博士研究员:智能家居技术业务和能源管理中的数据分析和人工智能

雇主简介 Vlerick 是一所领先的国际商学院……与众不同。是的&#xff0c;我们提供完全认可的世界一流教育课程&#xff0c;将理论知识和实践见解完美结合。是的&#xff0c;我们是一家领先的学术机构&#xff0c;拥有创新和独立研究的悠久传统。是的&#xff0c;我们拥有国际…

设计模式 行为型 策略模式(Strategy Pattern)与 常见技术框架应用 解析

策略模式&#xff08;Strategy Pattern&#xff09;核心思想是将算法的实现从使用该算法的类中分离出来&#xff0c;作为独立的对象&#xff0c;通过接口来定义算法家族&#xff0c;这样就可以很容易地改变或扩展算法。通过这种方式&#xff0c;可以避免在客户端代码中使用大量…

如何使用脚手架工具开始,快速搭建一个 Express 项目的基础架构

前言 将从如何使用脚手架工具开始&#xff0c;快速搭建一个 Express 项目的基础架构。接着&#xff0c;文章将详细讲解 Express 中间件的概念、分类以及如何有效地使用中间件来增强应用的功能和性能。最后&#xff0c;我们将讨论如何制定合理的接口规范&#xff0c;以确保 API …

《Opencv》基础操作详解(5)

接上篇&#xff1a;《Opencv》基础操作详解&#xff08;4&#xff09;-CSDN博客 目录 接上篇&#xff1a;《Opencv》基础操作详解&#xff08;4&#xff09;-CSDN博客 25、轮廓近似 简介 接口用法 参数说明 返回值 代码示例 结果展示 26、轮廓最小外接圆 简介 接口用…

Java虚拟机面试题:内存管理(上)

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;精通Java编…

测试用例颗粒度说明

当我们在编写测试用例时&#xff0c;总是会遇到一个问题&#xff1a;如何确定测试用例的颗粒度&#xff1f;测试用例过于粗糙&#xff0c;可能无法全面覆盖系统的细节&#xff1b;而颗粒度过细&#xff0c;又会导致测试重复、冗余。掌握合适的颗粒度&#xff0c;不仅可以提高测…

【C++】深入解析二维数组初始化与越界问题

博客主页&#xff1a; [小ᶻ☡꙳ᵃⁱᵍᶜ꙳] 本文专栏: C 文章目录 &#x1f4af;前言&#x1f4af;问题代码背景问题现象 &#x1f4af;初步分析与发现的问题1. 二维数组的初始化问题补充说明 2. 数组越界访问为什么数组越界问题没有直接报错&#xff1f; &#x1f4af;解…

Unity性能优化总结

目录 前言 移动端常见性能优化指标​编辑 包体大小优化 FPS CPU占用率 GPU占用率 内存 发热和耗电量 流量优化 前言 终于有时间了&#xff0c;我将在最近两个项目中进行优化的一些经验进行归纳总结以飨读者。因为我习惯用思维导图&#xff0c;所以归纳的内容主要以图来…

用QT实现 端口扫描工具1

安装在线QT&#xff0c;尽量是完整地自己进行安装&#xff0c;不然会少包 参考【保姆级图文教程】QT下载、安装、入门、配置VS Qt环境-CSDN博客 临时存储空间不够。 Windows系统通常会使用C盘来存储临时文件。 修改临时文件存储位置 打开系统属性&#xff1a; 右键点击“此电…

鸿蒙HarmonyOS开发:基于Swiper组件和自定义指示器实现多图片进度条轮播功能

文章目录 一、概述1、场景介绍2、技术选型 二、实现方案1、图片区域实现2、底部导航点设计3、手动切换 三、所有代码1、设置沉浸式2、外层Tabs效果3、ImageSwiper组件 四、效果展示 一、概述 在短视频平台上&#xff0c;经常可以见到多图片合集。它的特点是&#xff1a;由多张…

【JVM】总结篇-类的加载篇之 类的加载器 和ClassLoader分析

文章目录 类的加载器ClassLoader自定义类加载器双亲委派机制概念源码分析优势劣势如何打破Tomcat 沙箱安全机制JDK9 双亲委派机制变化 类的加载器 获得当前类的ClassLoader clazz.getClassLoader() 获得当前线程上下文的ClassLoader Thread.currentThread().getContextClassLoa…

nginx学习之路-nginx配置https服务器

文章目录 1. 生成证书2. 配置证书1. 拷贝证书文件2. 修改conf/nginx.conf文件内容 3. 查看效果1. 重载配置2. 访问 1. 生成证书 在linux系统下执行&#xff0c;使用openssl命令。&#xff08;windows环境也可以使用cmder&#xff09; # 1. 生成私钥 server2025.key(无密码保护…

鸿蒙应用开发搬砖经验之—使用DevTools工具调试前端页面

环境说明&#xff1a; 系统环境&#xff1a;Mac mini M2 14.5 (23F79) 开发IDE&#xff1a;DevEco Studio 5.0.1 Release 配置步骤&#xff1a; 按着官方的指引来慢慢一步一步来&#xff0c;但前提是要配置好SDK的路径&#xff08;没有配置的话&#xff0c;可能先看下面的配…

【NLP高频面题 - 分布式训练篇】ZeRO主要为了解决什么问题?

【NLP高频面题 - 分布式训练篇】ZeRO主要为了解决什么问题&#xff1f; 重要性&#xff1a;★★ 零冗余优化器技术由 DeepSpeed 代码库提出&#xff0c;主要用于解决数据并行中的模型冗余问题&#xff0c;即每张 GPU 均需要复制一份模型参数。 ZeRO的全称是Zero Redundancy …

《探秘计算机视觉与深度学习:开启智能视觉新时代》

《探秘计算机视觉与深度学习&#xff1a;开启智能视觉新时代》 一、追溯起源&#xff1a;从萌芽到崭露头角二、核心技术&#xff1a;解锁智能视觉的密码&#xff08;一&#xff09;卷积神经网络&#xff08;CNN&#xff09;&#xff1a;图像识别的利器&#xff08;二&#xff0…

[paddle] 非线性拟合问题的训练

利用paddlepaddle建立神经网络&#xff0c;模拟有限个数据的非线性拟合 本文仍然考虑 f ( x ) sin ⁡ ( x ) x f(x)\frac{\sin(x)}{x} f(x)xsin(x)​ 函数在区间 [-10,10] 上固定数据的拟合。 import paddle import paddle.nn as nn import numpy as np import matplotlib.…

详解GPT-信息抽取任务 (GPT-3 FAMILY LARGE LANGUAGE MODELS)

GPT-3 FAMILY LARGE LANGUAGE MODELS Information Extraction 自然语言处理信息提取任务&#xff08;NLP-IE&#xff09;&#xff1a;从非结构化文本数据中提取结构化数据&#xff0c;例如提取实体、关系和事件 [164]。将非结构化文本数据转换为结构化数据可以实现高效的数据处…

逆向入门(2)C篇-基础知识

C基础 1、在C中&#xff0c;函数的变量是从右往左传递的&#xff0c;也就是test(x,y)&#xff0c;先传入y&#xff0c;再传x。 2、变量的分类&#xff1a; &#xff08;1&#xff09;全局变量。在编译的时候就已经确定了内存地址和宽度&#xff0c;变量名就是内存地址的别名…

服务器数据恢复—离线盘数超过热备盘数导致raidz阵列崩溃的数据恢复

服务器数据恢复环境&故障&#xff1a; 一台配有32块硬盘的服务器在运行过程中突然崩溃不可用。经过初步检测&#xff0c;基本上确定服务器硬件不存在物理故障。管理员重启服务器后问题依旧。需要恢复该服务器中的数据。 服务器数据恢复环境&#xff1a; 1、将服务器中硬盘…

Echart实现3D饼图示例

在可视化项目中&#xff0c;很多地方会遇见图表&#xff1b;echart是最常见的&#xff1b;这个示例就是用Echart&#xff0c; echart-gl实现3D饼图效果&#xff0c;复制即可用 //需要安装&#xff0c;再引用依赖import * as echarts from "echarts"; import echar…