首页
社区
课程
招聘
6
[原创]Python写了个Crackme,欢迎来搞
发表于: 2013-1-27 09:34 15042

[原创]Python写了个Crackme,欢迎来搞

2013-1-27 09:34
15042

文件名称:Python_Crackme.exe
MD5: 8FA3E4631B05DFCF1A005B238E739C80
SHA1: FBC24E3FC105540B6875970DB30ABBFB9FC4493A
CRC32: 9B1B50AC

未注册:

注册成功:


附件下载:
Python_Crackme.part1.rar
Python_Crackme.part2.rar


[招生]科锐逆向工程师培训(2025年3月11日实地,远程教学同时开班, 第52期)!

上传的附件:
收藏
免费 6
支持
分享
赞赏记录
参与人
雪币
留言
时间
伟叔叔
为你点赞~
2024-5-31 06:57
心游尘世外
为你点赞~
2024-5-31 03:52
QinBeast
为你点赞~
2024-5-31 03:42
飘零丶
为你点赞~
2024-4-2 04:05
shinratensei
为你点赞~
2024-2-4 00:22
PLEBFE
为你点赞~
2023-3-7 00:36
最新回复 (14)
雪    币: 74
活跃值: (928)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
支持一下,待会下来开搞
2013-1-27 11:10
0
雪    币: 3469
活跃值: (1623)
能力值: ( LV4,RANK:40 )
在线值:
发帖
回帖
粉丝
3
Python  不是解释性语言吗 怎么生成的exe
2013-1-27 11:48
0
雪    币: 6075
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import os, sys, base64
import string, wmi, hashlib
import struct
import binascii
from binascii import unhexlify as unhex
from binascii import hexlify as dohex
 
class CryptModule:
    """docstring for CryptModule"""
 
    def __init__(self):
        self.xorkey = 88
        self.tablekey = '5211314'
 
    def xor_set_key(self, key):
        """
        设置xor密钥
        """
        if key == None:
            pass
        elif isinstance(key, int) == False:
            print 'key must be type int [0-255]'
        else:
            self.xorkey = int(key)
 
    def xor_encrypt(self, s):
        key = int(self.xorkey)
        b = bytearray(str(s))
        n = len(b)
        c = bytearray(n * 2)
        j = 0
        for i in range(0, n):
            b1 = b[i]
            b2 = b1 ^ key
            c1 = b2 % 16
            c2 = b2 // 16
            c1 = c1 + 65
            c2 = c2 + 65
            c[j] = c1
            c[j + 1] = c2
            j = j + 2
 
        return c
 
    def xor_decrypt(self, s):
        key = int(self.xorkey)
        c = bytearray(str(s))
        n = len(c)
        if n % 2 != 0:
            return ''
        n = n // 2
        b = bytearray(n)
        j = 0
        for i in range(0, n):
            c1 = c[j]
            c2 = c[j + 1]
            j = j + 2
            c1 = c1 - 65
            c2 = c2 - 65
            b2 = c2 * 16 + c1
            b1 = b2 ^ key
            b[i] = b1
 
        try:
            return b
        except:
            return ''
 
    def table_set_key(self, key):
        if key == None:
            pass
        else:
            self.tablekey = key
 
    def get_table(self):
        m = hashlib.md5()
        m.update(self.tablekey)
        s = m.digest()
        a, b = struct.unpack('<QQ', s)
        table = [ c for c in string.maketrans('', '') ]
        for i in xrange(1, 1024):
            table.sort(lambda x, y: int(a % (ord(x) + i) - a % (ord(y) + i)))
 
        return table
 
    def table_Encrypt(self, key, data):
        self.table_set_key(key)
        encrypt_table = ''.join(self.get_table())
        endata = data.translate(encrypt_table)
        endata = dohex(endata)
        new_data = self.xor_encrypt(endata)
        return base64.encodestring(new_data)
 
    def table_Decrypt(self, key, data):
        self.table_set_key(key)
        data = base64.decodestring(data)
        xordecrypt = self.xor_decrypt(data)
        xordecrypt = unhex(xordecrypt)
        encrypt_table = ''.join(self.get_table())
        decrypt_table = string.maketrans(encrypt_table, string.maketrans('', ''))
        return xordecrypt.translate(decrypt_table)
 
 
class EncryptHardinfo:
 
    def __init__(self):
        self.hardinfo = ''
 
    def get_hardwareid(self):
        ret = ''
        try:
            w = wmi.WMI()
            cpus = w.Win32_Processor()
            for u in cpus:
                cpuid = str(u.ProcessorId)
                ret = cpuid
 
            indate = w.Win32_OperatingSystem()
            for ln in indate:
                ret += str(ln.InstallDate)
                ret += str(ln.SerialNumber)
 
            comsys = w.Win32_ComputerSystem()
            for cs in comsys:
                ret += str(cs.Model)
 
            self.hardinfo = ret
        except Exception as e:
            print 'get_hardwareid Error! %s ...' % str(e)
            os.system('pause')
            sys.exit(0)
            return 0
 
        return ret
 
    def md5hex(self, word):
        """ MD5加密算法,返回32位小写16进制符号 """
        if isinstance(word, unicode):
            word = word.encode('utf-8')
        elif not isinstance(word, str):
            word = str(word)
        m = hashlib.md5()
        m.update(word)
        return m.hexdigest()
 
    def get_HardinfoFile(self):
        if self.hardinfo == '':
            self.get_hardwareid()
        hmd5 = self.md5hex(self.hardinfo)
        hmd5 += self.hardinfo
        try:
            cm = CryptModule()
            cm.xor_set_key(11)
            ret = cm.table_Encrypt('godblessyou2013', hmd5)
            file = open(os.getcwd() + '\\HardInfo.tMp', 'w')
            file.write(ret)
            file.close()
        except Exception as e:
            print '获取硬件信息出错了,请手动删除 HardInfo.tMp 文件'
            os.system('pause')
            os.exit(0)
 
    def CheckRegister(self, withinfo):
        if os.path.exists(os.getcwd() + '\\Register.key') == 0:
            return 0
        regfile = open(os.getcwd() + '\\Register.key', 'rb')
        list_of_all_the_lines = ''
        data = ''
        try:
            list_of_all_the_lines = regfile.readlines()
            filestr = ''.join(list_of_all_the_lines)
            cm = CryptModule()
            cm.xor_set_key(111)
            data = cm.table_Decrypt('fuck1you2013', filestr)
        except Exception as e:
            print '未注册版本或 Register.key 文件损坏。'
            print '\t未注册版本或 Register.key 文件损坏。'
            print '\t\t未注册版本或 Register.key 文件损坏。'
            regfile.close()
            return -3
        finally:
            if regfile == None:
                return -10
            regfile.close()
 
        self.get_hardwareid()
        hmd5 = self.md5hex(self.hardinfo)
        hmd5 += self.hardinfo
        if len(data) - len(withinfo) != len(hmd5):
            print "what's the fuck"
            return -4
        if withinfo != data[len(hmd5):]:
            print "what's the fuck"
            return -5
        if data[:len(hmd5)] == hmd5:
            return 1
        return 2
 
 
if __name__ == '__main__':
    eh = EncryptHardinfo()
2013-1-27 13:02
0
雪    币: 107
活跃值: (424)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
我勒个去..发哥很难得露面啊...看到Python..果断浮出水面啊.....
2013-1-27 13:59
0
雪    币: 370
活跃值: (15)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
6
great,动作快准狠
用到了哪些工具?
2013-1-27 16:06
0
雪    币: 327
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
啥意思  看不懂呢~~另外咋个生成的EXE~~~
2013-1-27 16:21
0
雪    币: 705
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
8
exe使用pyinstaller-2.0生成的,
看了下pyinstaller的源码,写了个提取工具.
需要用到Python2.7 和 uncompyle2库.
使用方法:
1
2
3
解压到crackme文件夹下,然后
python unpack.py
把所有文件都解压到output文件夹下

unpack_Python_Crackme.7z
上传的附件:
2013-1-27 16:41
0
雪    币: 103768
活跃值: (201894)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
9
忙吗,很长时间没见
2013-1-27 16:54
0
雪    币: 599
活跃值: (1933)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
10
膜拜啊,没想到,我的源码都搞出来了 ?
2013-1-27 17:19
0
雪    币: 599
活跃值: (1933)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
11
学习了
2013-1-27 17:24
0
雪    币: 599
活跃值: (1933)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
12
答案如8楼所说,用了一个打包程序而已。
2013-1-27 21:42
0
雪    币: 3469
活跃值: (1623)
能力值: ( LV4,RANK:40 )
在线值:
发帖
回帖
粉丝
13
懂得了,学习了!
2013-1-28 09:12
0
雪    币: 239
活跃值: (92)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
Mark一下,多谢分享!
2013-4-11 20:37
0
雪    币: 19
活跃值: (25)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
厉害啊… 学习了
2013-6-25 21:16
0
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册