Home » C SOURCE CODES, VIRUS CREATION, VISTA HACKS, XP HACKS

A Virus Program to Disable USB Ports

Submitted by Srikanth on Sunday, 19 July 200939 Comments

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.

Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you’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.

1. Download the USB_Block.rar file on to your computer.

2. It contains the following 4 files.

  • block_usb.c (source code)
  • unblock_usb.c (source code)

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 - 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).

4. 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.

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 - How to Change the ICON of an EXE file (This step is also optional).

I hope you like this post. Please pass your comments.

Popularity: 18% [?]

Visitors who read this post, also read:

  1. How to Make a Trojan Horse

  2. How to Compile C Programs

  3. 12 Tips to Maintain a Virus Free Computer


  By using/following this site you agree to our Legal Disclaimer

Subscribe to GoHacking.Com


Enjoyed this article?
Subscribe to GoHacking.Com and get daily updates in your email for free

39 Comments »

  • Ivan said:

    it works , thanks

  • mahendra said:

    this code is not working on vista….

  • rexter said:

    nice one…

  • Ram sri said:

    woah!!cool….

  • boss said:

    it does not have the exe files….. only the 2 source files are present….!!!

    Check out…

  • Gaurav said:

    This is working, is there any way to modify other registry entries using code like that you have written in the above program. I want to modify a registry value which is used when the option “show hidden files and folder” not work.Please give the code in C.

  • Gaurav said:

    How to execute a bat file from pen drive using autorun.inf “forcefully” i.e. not asking the user to perform certain actions.Just inserting pen drive and executing the file?

  • Abhijith said:

    Nice one ! Can give me links/resources on advanced topics in C

  • tarun said:

    great it is working

  • boss said:

    i told u the rar file only shows the source files…..

    what is the matter….

  • parag said:

    hi its nice

  • sunny said:

    boss, you just compile these source files in C compiler that will generate exe file.

  • jonnel.. said:

    its working.. i have a question, how can i enable the usb port on computer.. if that port is being disabled??

  • jonnel.. said:

    i mean.. the administrator disabled it.. can i modify it using only the registry editor?

  • rahul said:

    dude………this is the best website i ever came across in my entire life!!! keep up the good work!!!

  • Young Bastard said:

    Great article but can not do all the things cause I am using a school computer and downloading of some files is not allowed.I cant download the virus

  • Transfer said:

    This is awesome!!

    This works!!

    Thanx!!

  • Ankur said:

    Hey Srikanth nice work……….
    But can you post some virus programs in java language???????

  • Akshay said:

    This is great.Thank you so much.

  • hackster117 said:

    This virus is amazing.I like it because it disables hardware which to me is pretty neat.I’m a bit new to this site but I really like it.It has alot of useful information.

  • RANO said:

    any one have any code for disable /enable mouse,keyboard and cd-rom . in any code lang.,plz send to me:

    id:
    [email protected]

  • kanav said:

    this is not a exe files a two note pad files

    how can i run it?

  • Srikanth (author) said:

    @ kanav

    You need to compile it before you can run them.

  • Varun said:

    Gud Work Bro!!!

  • madmax said:

    wow great man……….

  • Govind said:

    thanks it’s working….

  • sumeet said:

    great work… can u tell give me a c program that will allow to run certain program automatically!!!

  • sachin nain said:

    good job ………..

  • devendra said:

    there is also one option to disable to Usb Drive
    from regedit
    start=>run=>regedit
    Search Usbstor value And Modify it 3 to 4.
    (note :- 3 is default value)

  • Jimit said:

    hey man can u get me some tutorials of virus like da full coding nd not da readymade program……plz will b waitin for ur response

  • summit said:

    this code is not working on my computer apparently… is it because i changed the file name or because i’m using vista?

  • long said:

    hi everyone,now who can help me,how to create and use Virus to Disable USB,because i know a little of C++,thank Pls contact this [email protected]

  • Nedim said:

    Does this work on windows 7

  • Srikanth (author) said:

    @ Nedim

    Should work most probably. But UAC must be disabled!

  • sandesh vaze said:

    hey man its very nice.
    i want to learn java for hacking .
    is it more powerfull than c or c++?

  • visitor said:

    How will this so-called “virus” infect other computers?

  • nishant said:

    how can i compile this file

  • Sanju said:

    Great It is working
    Thanks

  • Madele said:

    thanks for the all the lessons, Please I will like to have a complete note on how to be a hack…. please let talk more with email.. thanks a lots

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.