I'm seriously freaking out right now. My friend was on her IPhone 5 and was on some shady sites trying to download music, and a message popped up that more or less said, "Your IPhone has a virus". Is this possible? Her phone isn't jail broken or anything, and it was in safari. I'm only concerned because I'm worried that if her parents find out, I might get blamed for not trying to stop things.
Yes. But that may be rogue security software (https://en.wikipedia.org/wiki/Rogue_security_software) saying that. But even if it is, it is still very possible that her phone may have a virus (from shady sites.)
Ok, I skimmed the wiki and it sounds like it may have been rogue software. Anyways, I asked her earlier today if her phone was running abnormally, and she said it was the same as it usually is. Thanks for the info, hopefully we'll be fine. Any other input is still definitely welcome!
Haha that's one of those spam pop up ad things that want you to install some application that actually WILL give you a virus or compromise your information or system. So in short, no. Also, iOS and OSX devices rarely if ever get viruses so I wouldn't worry about it. Really, this is textbook spam advertising. The message was just some pop up thing.
Any computer based on the Von Neumman architecture (almost all computers) can get viruses. The reason for this is that guaranteeing that malicious input cannot be executed as undesired programs is a fundamentally hard problem. Apple has a pretty good track record with security, but there's no substitute for making smart decisions on your own. Never install software outside of the iPhone store, and don't click on any window or popup saying your iPhone is (or may be) infected. These are scare messages from internet popups that try to get you to download software that will infect you. (You're not infected yet. It's when you actually download that shit and run it that you become infected.) Rogue security software, as Ashley rightly points out, is very interesting. A lot of people get infected simply because they react poorly and download "security" software that spits out fake errors (or real errors or warnings that are harmless; this was the basis of the Microsoft Support scam, which was a social engineering attack based on cold-calling people, having them open regedit, and looking at default system key-values, telling them it's an "error," and asking them to download and run remote desktop software to grant the scammer remote access to their computer.)
Sometimes there are popups on browsers (even on mobile phones) who tell you stuff, only to get you to download something and then have a real virus on there. So first it could be that. But second, it could also be that your friend has a real virus and an antivirus app on her iPhone reacted and said something, or something like that. Now, to answer your question, yes. Even iPhones can get Viruses. Just like any other Apple product. Apple products usually have quite a good strength in security so it's hard for a virus to get into an iPhone, iPad, etc. Though I've only heard that and I am not really sure about that. Apple Products are NOT 100% safe from Viruses though. There are people who believe they are, but just like any other computer system, they CAN get viruses.