In this post, I will show how to create a simple virus that disables the USB ports on the computer (PC). As usual, I am using 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.
Once this virus is executed it will immediately disable all the USB ports on the computer. As a result you’ll will not be able to use your pen drive or any other USB peripheral devices 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.
-
Download the source code of the virus program on to your computer from the following link:
The download contains the following 2 files:
- block_usb.c (source code)
- unblock_usb.c (source code)
-
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).
-
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.
-
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).
How it Works?
The idea behind the working of this virus is pretty straightforward. It works by gaining access to the Windows registry and modifying its settings to disable the USB device support on the computer.
On the other hand, the other program will re-set the registry settings back to the normal so that the support for USB devices is re-enabled. I hope you like this post. Please pass your comments.
















I am Srikanth Ramesh, a computer engineer from India.
43 Comments
Ivan
July 19, 2009 at 9:46 PMmahendra
July 19, 2009 at 10:02 PMrexter
July 20, 2009 at 10:54 PMRam sri
July 22, 2009 at 6:46 AMboss
July 24, 2009 at 8:24 AMGaurav
July 24, 2009 at 3:57 PMGaurav
July 24, 2009 at 5:44 PMAbhijith
July 25, 2009 at 6:22 AMtarun
July 25, 2009 at 7:33 PMboss
July 26, 2009 at 7:09 PMparag
July 27, 2009 at 11:58 AMsunny
July 28, 2009 at 11:45 AMjonnel..
August 6, 2009 at 12:45 PMjonnel..
August 6, 2009 at 12:47 PMrahul
August 11, 2009 at 12:21 AMYoung Bastard
September 15, 2009 at 6:55 PMTransfer
September 19, 2009 at 12:56 AMAnkur
September 20, 2009 at 2:04 PMAkshay
September 20, 2009 at 7:06 PMhackster117
September 21, 2009 at 12:27 AMRANO
September 25, 2009 at 4:52 PMkanav
October 3, 2009 at 2:23 AMSrikanth
October 6, 2009 at 4:21 PMVarun
October 12, 2009 at 9:57 PMmadmax
October 24, 2009 at 11:05 PMGovind
October 24, 2009 at 11:12 PMsumeet
October 28, 2009 at 6:10 AMsachin nain
November 6, 2009 at 2:35 PMdevendra
November 11, 2009 at 6:36 PMJimit
November 19, 2009 at 1:48 PMsummit
December 11, 2009 at 9:09 AMlong
December 14, 2009 at 5:42 AMNedim
December 23, 2009 at 9:12 PMSrikanth
December 29, 2009 at 1:42 PMsandesh vaze
January 2, 2010 at 11:14 AMvisitor
January 6, 2010 at 2:29 PMnishant
January 19, 2010 at 9:27 PMSanju
February 2, 2010 at 3:10 PMMadele
February 15, 2010 at 10:48 PMsandilya
March 24, 2010 at 6:02 AMSrikanth
March 24, 2010 at 11:47 AMRajesh
April 6, 2010 at 7:19 AMchetan
April 6, 2010 at 11:12 PM