Ywc

一些脚本整理

Word count: 197 / Reading time: 1 min
2018/09/09 Share

验证码

jiaoben

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
# -*- coding: utf-8 -*-
# running in python2
import multiprocessing
import hashlib
import random
import string
import sys
CHARS = string.letters + string.digits
def cmp_md5(substr, stop_event, str_len, start=0, size=20):
global CHARS
while not stop_event.is_set():
rnds = ''.join(random.choice(CHARS) for _ in range(size))
md5 = hashlib.md5(rnds)
if md5.hexdigest()[start: start+str_len] == substr:
print rnds
stop_event.set()
if __name__ == '__main__':
substr = 'b825c' # 修改此值
start_pos = 0
str_len = len(substr)
cpus = multiprocessing.cpu_count()
stop_event = multiprocessing.Event()
processes = [multiprocessing.Process(target=cmp_md5, args=(substr,
stop_event, str_len, start_pos))
for i in range(cpus)]
for p in processes:
p.start()
for p in processes:
p.join()

文章:https://xz.aliyun.com/t/2148

sha256爆破

jiaoben

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import hashlib
import string

string_print = string.ascii_letters + string.digits
st = ''
pend = '8nTgfllRa2Mm'
const = 'ab8096332bd73146a12e01c1d4633fa9e400f3ceee3db44317a3c6730f0bb35e'

# hash = hashlib.sha256
for i in range(len(string_print)):
for j in range(len(string_print)):
for k in range(len(string_print)):
for m in range(len(string_print)):
hash = hashlib.sha256()
st = string_print[i] + string_print[j] + \
string_print[k] + string_print[m]
st += pend
hash.update(st.encode('utf-8'))
if(hash.hexdigest() == const):
print(st)

脚本与图片不相符,可以根据实际情况修改。

原文作者: Ywc

原文链接: https://yinwc.github.io/2018/09/09/jiaoben/

发表日期: September 9th 2018, 7:21:31 pm

版权声明:

CATALOG
  1. 1. 验证码
  2. 2. sha256爆破