-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocky_NativeAPI.py
More file actions
61 lines (55 loc) · 1.71 KB
/
Locky_NativeAPI.py
File metadata and controls
61 lines (55 loc) · 1.71 KB
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
# -*- coding:utf-8 -*-
import PyV8
import _winreg
def WScript_create():
return WScript()
class WshShell(PyV8.JSClass):
def ExpandEnvironmentStrings(self, uni):
str=_winreg.ExpandEnvironmentStrings(unicode(uni)) #환경변수 변경
print '[*] ExpandEnvironmentStrings: ', uni
print ' -> new: ', str
return str
def Run(self,a,b,c):
print '[*] WshShell.Run '
print ' - a: ', a
print ' - b: ', b
print ' - c: ', c
class XMLHTTP(PyV8.JSClass):
def send(self):
print '[*] XMLHTTP.send'
def open(self, a, b, c):
print '[*] XMLHTTP.open : '
print ' - a: ', a
print ' - b: ', b
print ' - c: ', c
class ADODBStream(PyV8.JSClass):
def send(self):
print '[*] ADODBStream.send'
def open(self):
print '[*] ADODBStream.open'
def write(self, a):
print '[*] ADODBStream.write'
print ' - a: ',a
def SaveToFile(self,a,b):
print '[*] ADODBStream.SaveToFile:'
print ' - a: ', a
print ' - b: ', b
def close(self):
print '[*] ADODBStream.close'
class WScript(PyV8.JSClass):
def Sleep(self, n):
print '[*] WScript.Sleep : ',n
def CreateObject(self,str):
print '[*] WScript.CreateObject : ',str
if(str.lower()=='wscript.shell'):
return WshShell()
elif(str.lower()=='msxml2.xmlhttp'):
return XMLHTTP()
elif(str.lower()=='adodb.stream'):
return ADODBStream()
class NativeAPI(PyV8.JSClass):
WScript=WScript_create()
ctx=PyV8.JSContext(NativeAPI()) # pyV8 초기화
ctx.enter()
buf=open('details_8f3759.js_vir','rb').read()
ctx.eval(buf)