能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
[原创]Python写了个Crackme,欢迎来搞
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()
|
能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
哲学问题4:“我该摸哪张牌?” (第2版)
不识民科真面目,只缘身在此山中。你说的RMS等人没有一个是民科,他们是按照科学的方法做事的,而你认为
“一些基本的,公认的理论” —— 这对于玩哲学,益处很小。
显然与科学方法相悖。叫不醒一个装睡的人,我不会再回复了,是非自有公论。
|
能力值:
(RANK:1060 )
|
-
-
哲学问题4:“我该摸哪张牌?” (第2版)
关于大富翁的比喻都是废话,每个读者都玩过,对不对?如果不是写小说就不要故弄玄虚。
至于牌下面的结果,完全是设计问题,选择什么样的随机数生成器,就会得到什么样的分布。用户的角度出发,他只需要一个娱乐性质的随机数,不要让结果千篇一律。如果用户是个 hacker,他也可以预测随机同余发生器序列来预见结果。
读完发觉在长篇大论辞藻堆中没有什么真东西,甚至没有个结论,难免感到上当。
对刚学到的时髦词有了自己的感悟,可以写 blog、发 QQ 空间给小姑娘膜拜。但如果标榜是哲学,最好先学一些基本的,公认的理论,写作上应该言简意赅,清晰明了,不要误入歧途,堕入 民科 魔道。
|
能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
[求助]我可以得到无限组加密后的字串,但却看不出如何加密
不是单射,会逆出很多结果,比如密文>:h7%Kn*(=C+对应下面任意明文组合
[['`', 'a'], ['b', 'j', 'f', '^'], ['c', 'k', '[', 'S'], ['1', '3', '/'], ['"', '2', '*'], ['3']]
密文是明文,前一位密文,最后一位明文的函数
先穷举最后一位明文再求逆别的密文即可
|
能力值:
(RANK:1060 )
|
-
-
|
能力值:
(RANK:1060 )
|
-
-
[求助][求助]帮忙分析一下R4ND加密狗的算法如何着手
弱爆了
proving...
[4, 3, 8, 13] [12, 20, 104, 124]
[10, 4, 4, 16] [40, 44, 64, 108]
[1, 8, 8, 6] [8, 16, 48, 64]
[1, 5, 11, 2] [5, 16, 22, 38]
[5, 7, 6, 4] [35, 41, 24, 65]
testing...
[1, 2, 3, 4] [2, 5, 12, 17]
[5, 6, 7, 8] [30, 37, 56, 93]
[11, 22, 33, 44] [242, 275, 1452, 1727]
|
能力值:
(RANK:1060 )
|
-
-
ET199不可破解见证,10万奖金让你抢
只提供破解不提供破解方法行不行?签合同吗?
明显违反了合同法第四十一条 中国合同法第四十一条明确规定,对格式条款的理解发生争议的,应当按照通常理解予以解释。对格式条款有两种以上解释的,应当作出不利于提供格式条款一方的解释。格式条款和非格式条款不一致的,应当采用非格式条款。如果承认商场单方提供的规定由商场享有合同的最终解释权的格式条款有效,则意味着一旦双方对格式条款的理解发生争议,应以商场单方的解释为准。这明显违反了合同法第四十一条的强制性规定,因此应认定该格式条款无效。 综上,对于合同的条款,只有司法部门依法享有解释的权利,其解释具有法律效力,而当事人只能对合同作出自己的单方理解,其“解释”不具有直接的法律效力。因此,从法律意义上而言,商场不享有对其促销活动的最终解释权。
|