用AI 一句话生成的 CrackMe
本帖最后由 kwangyeonc 于 2024-12-17 13:32 编辑生成提示词:帮我生成一个 CrackMe 窗口程序,, 要求多重反调试保护机制的密码验证程序..
请大神帮忙验证其可靠性~
蓝揍云:https://naver.lanzoue.com/itDl32i9lata
CrackMe程序一个带有多重反调试保护机制的密码验证程序,使用 Python 和 Tkinter 开发。
反调试机制详解
1. 调试器检测
[*]Python调试器检测:使用 sys.gettrace() 检测是否存在调试器
[*]Windows调试器检测:使用 kernel32.IsDebuggerPresent() 检测系统级调试器
def _check_debugger(self):
if sys.gettrace() is not None:
self._exit_program("检测到调试器")
if ctypes.windll.kernel32.IsDebuggerPresent():
self._exit_program("检测到系统调试器")
2. 时间检测
[*]检测代码执行时间异常(反单步调试)
[*]使用连续失败计数器避免误报
[*]首次检查跳过机制
def _check_timing(self):
if time_diff > self._timing_threshold:
self._consecutive_timing_fails += 1
if self._consecutive_timing_fails >= 5:
self._exit_program("执行时间异常")
3. 虚拟机检测
[*]检测常见虚拟机环境特征
[*]累积多次检测才触发退出
def _check_vm(self):
vm_signs = ['VMware', 'VBox', 'Virtual', 'QEMU', 'Xen']
if any(sign.lower() in system_info.lower() for sign in vm_signs):
self._traces.append("VM")
4. 进程检测
[*]检测常见逆向工具进程
[*]包括:IDA、OllyDbg、x64dbg等
def _check_processes(self):
suspicious = ['ida', 'ida64', 'ollydbg', 'x64dbg', 'x32dbg',
'windbg', 'immunity', 'cheatengine']
5. 代码完整性检测
[*]检测程序文件是否被修改
[*]运行时内存保护
def _check_memory(self):
with open(__file__, 'rb') as f:
current_code = f.read()
if current_code != self._original_code:
self._exit_program("代码被修改")
6. 环境检测
[*]检测调试相关环境变量
[*]需要累积多个可疑项才触发
def _check_environment(self):
suspicious_env = ['PYTHONDEVMODE', 'PYTHONDEBUG', 'PYTHONINSPECT']
7. 多线程保护
[*]后台持续运行的安全检查线程
[*]随机间隔时间进行检查
def _security_monitor(self):
while True:
time.sleep(random.uniform(1.0, 1.5))
self.anti_debug.check_security()
8. 密码验证保护
[*]动态盐值加密
[*]多重验证逻辑
[*]装饰器安全检查
@security_check
def _verify_password(self):
salt = b"8dj3n9" + os.urandom(4)
verification = all([
input_password == correct_password,
len(input_password) == len(correct_password),
sum(ord(c) for c in input_password) == sum(ord(c) for c in correct_password)
])
9. 检查频率控制
[*]使用不同的检查间隔
[*]基于质数的检查频率
def check_security(self):
if self._check_count % 2 == 0: # 调试器检测
if self._check_count % 5 == 0: # 时间检测
if self._check_count % 10 == 0:# VM检测
if self._check_count % 15 == 0:# 进程检测
if self._check_count % 20 == 0:# 内存检测
if self._check_count % 25 == 0:# 环境检测
警告:CM区等技术类版块禁止回复『与主题无关非技术内容』,违者重罚!
本条提醒后再灌水的,一律违规+1处理。 本帖最后由 killerzeno 于 2024-12-17 15:06 编辑
反调试机制设计思路不错,不过对于Python而言,这个CM还是保护欠佳,最快的手段就是通过Pyinstxtractor直接解包。
(venv) PS D:\pythonProject> python pyinstxtractor.py Crackme.exe
[+] Processing Crackme.exe
[+] Pyinstaller version: 2.1+
[+] Python version: 3.10
[+] Length of package: 8351705 bytes
[+] Found 951 files in CArchive
[+] Beginning extraction...please standby
[+] Possible entry point: pyiboot01_bootstrap.pyc
[+] Possible entry point: pyi_rth_inspect.pyc
[+] Possible entry point: pyi_rth__tkinter.pyc
[+] Possible entry point: cm_window.pyc
[+] Found 104 files in PYZ archive
[+] Successfully extracted pyinstaller archive: Crackme.exe
再通过uncompyle6或者别的方法,获取pyc到py的逆向。
让后对于cm_window反看verify_password,明码直接可得secret123
然后就没有然后了,战斗结束。
这真的可以吗?不应该是多重提示吗? 一句话就可生成,单次生成这么成熟》MMK hygqx6 发表于 2024-12-16 19:53
这真的可以吗?不应该是多重提示吗?
多重机制并非多重提示哈 WordCreater 发表于 2024-12-16 19:53
一句话就可生成,单次生成这么成熟》MMK
中间有出现无法编译问题,有几次小调试,但提示词就一句 其他未变 请问楼主,怎么用AI生成一个软件?有视频教程吗?谢谢赐教 secret123 Biao 发表于 2024-12-16 21:18
请问楼主,怎么用AI生成一个软件?有视频教程吗?谢谢赐教
哔哩或百度搜索 ai写代码 很多的啊 Arcticlyc 发表于 2024-12-16 22:22
高人哈,佩服