Are you interested in network security, or would you like to test your antivirus software? Deliberately infecting your computer with a virus is incredibly risky and should only be done under highly controlled conditions. If all you have to do is check your antivirus software, there are test files available that can safely run your antivirus software. If you want to "get" to the actual virus, you can use bad visiting habits to get infected quickly. See Step 1 for how to do this.
Steps
Method 1 of 2: Intentionally Testing Antivirus Software

Step 1. Make sure your computer is in a safe environment
Viruses are meant to spread, and it would be irresponsible to test viruses on a computer that is not isolated from the Internet as a whole. Make sure you have a test environment so that the viruses you are testing cannot spread to computers that you do not want to infect.
- Make sure the computer or computers you are testing on are not connected to the Internet.
- For added security, test viruses using a virtual machine on a physical computer that is not connected to the Internet.

Step 2. Download the EICAR test file
EICAR is an abbreviation. from European Institute of Computer Antivirus Research - European Institute of Computer Antivirus Research. This file is designed to run antivirus and malware detection, and can be used to test that malware or antivirus software is configured correctly.
- This file is not malicious and will not spread to other machines. It is simply intended to delay the detection system for security purposes.
- You can download the test file for free from eicar.org

Step 3. Run the EICAR program or run a virus scan
The EICAR test file must be detected during a virus scan. It can be in the form of an archive or extracted somewhere on the computer. Executing the file will launch your antivirus as well.
Once detected, you will most likely not be able to access the file again as it will be quarantined
Method 2 of 2: Using Bad Internet Habits to Get Infected

Step 1. Understand the risks and legitimacy of your actions
Infecting your own computer can jeopardize your data and personal information, and if your computer is connected to the Internet or other computers on the network, you risk infecting others. It is illegal in most countries to deliberately infect someone's computer with a virus.
If you are trying to test your antivirus software, it is highly recommended to use a test file in the previous method

Step 2. Use an old, not updated operating system
Many viruses rely on security flaws in the operating system software. These flaws are ultimately corrected and strengthened as the operating system is updated and new versions are released.
Windows XP without any service packs is one of the most unprotected operating systems still in use. Windows XP also no longer receives any security updates, which means more and more exploits will target it

Step 3. Use a non-updated version of Internet Explorer to browse the Internet
Early versions of Internet Explorer were much less secure than other browsers, so this is the best browser to use when trying to get a virus. You can download older versions of Internet Explorer from sites like Download.com. Look for Internet Explorer 6, and don't install any of the updates.

Step 4. Connect your computer directly to the Internet
Most routers contain hardware firewalls that can help protect your computer. For maximum vulnerability, you must connect the modem directly to the computer, bypassing the router.
Also disable Windows Firewall, if enabled

Step 5. Disable or remove your antivirus
Most antivirus programs do an admirable job of catching most viruses, so you'll need to disable or uninstall your antivirus software completely before attempting to infect your computer.
- Some antiviruses can be disabled by right-clicking on the icon in the system tray and choosing "Disable" or a similar option. Not all antivirus programs can be disabled.
- There are numerous articles on WikiHow that detail the process of uninstalling most antivirus programs, including Norton, Avast, AVG, and many more..

Step 6. Visit the Internet Security Communities
There are many online communities dedicated to internet security testing. And you can find links to known viruses in the community discussions. One of the most popular Internet Security (NetSec) communities is the NetSec subreddit. You can find many discussions and links to sites that contain specific viruses.

Step 7. Download files with known viruses
One of the most popular ways to spread viruses is through pirated media and software. Look for "cracks" or "serials" for popular programs that require a file to run. These files often contain viruses that are executed when you launch cracker programs.
- Torrents are a very popular way to share these files. When browsing torrent sites, look for torrents with low ratings and comments from other users warning about viruses. These are the ones you need.
- P2P exchange programs are another popular way to spread viruses. Programs such as Kazaa and Gnutella are some of the more popular options.
- Many websites, known as "warez" sites, will offer "free" downloads of almost any program, they are almost always infected with viruses and adware, and the program itself rarely works.

Step 8. Click on questionable banners and advertisements
Visit some of the less reputable websites and click all the banners and ads you can. Try watching videos that require additional software downloads. While this will likely lead to more adware than anything else, you can get a virus this way.

Step 9. Subscribe to mailing lists from a disposable email address
Create a free email address that contains no personal information at all, and subscribe to as many mailing lists and other registrations as possible. This will allow you to receive your email and increase the chances of receiving spam with links to viruses or infected attachments.
- It may take a little longer than some of the other virus infections, but some of the most damaging viruses spread through email attachments.
- Download all possible attachments and visit all spam links. All of this will increase your chances of contracting the virus.
- Make sure to check the Spam folder in your email program to check the automatically filtered messages. They are most likely to infect you.

Step 10. Download screensavers
These are traditionally some of the most infected files out there. Find the ".scr" files and download as many as possible. Be sure to run them when they load, as. SCR files act like executable files.