Do you want to play a prank with your friend’s computer by disabling their USB ports? In this post I will show how to create a simple virus that disables/blocks the USB ports on a 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 workings of this program.
Once this virus is executed it will immediately disable all the USB ports on the computer. As a result, the victim will not be able to use his pen drive or any other USB peripheral on his computer. The source code for this virus along with the compiled module 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. Here is a step-by-step procedure to start playing the prank on your friend’s computer.
2. It contains the following 4 files.
- block_usb.c (source code)
- unblock_usb.c (source code)
3. Out of these 4 files the block_usb.exe is the virus that will block (disable) all the USB ports on the computer upon execution (double click). You need to send this file to your friend. Once he executes it, all the USB ports on his computer will be blocked.
4. Before sending you can test it on your own computer. To test, run the block_usb.exe file and insert a USB pen drive (thumb drive). Now you can see that your pen drive will never be detected. To re-enable the USB ports just run the unblock_usb.exe file. Now insert the pen drive and it should be detected.
5. The block_usb.c and unblock_usb.c are the source codes. You can compile them by yourself in case if you’re interested (this is optional).
6. A step-by-step procedure to compile C programs is given in my post – How to Compile C Programs.
7. You can also change the icon of this file to make it look like a legitimate program. For example, take the icon from Norton and bind the Exe File with it with any Binder. Use Software PassPort to make it Undetectable.
WARNING: This post is for educational purposes only. Do not misuse it.