My old laptop is possibly infected. But I just want to transfer documents that I have created like Excel or Word files. Is it possible that malware entered into these files making it dangerous to transfer them into my new laptop? Also, can a pendrive get infected when it's connected to the infected laptop? Is it safer to send the documents online (like Droppbox or via email)?
Any writable pendrive could be infected with malicious code or have its files infected when it's connected to infected laptops.
It's safer to send documents online via Google Drive or Dropbox because when files are viewed online, malicious code could not be automatically executed and you could restore files from the service's backup.
When I need to view data from a system I know (or think) is infected with malware, I convert the data to plain text files and only view the resultant data with viewers that do not interpret the data (simple text editors and hex editors).
This technique, of course, is much easier with certain data types than others.
Although malware scanners are helpful in finding some malware, they can only find malware that they are programmed to find (typically using signatures or heuristics). Just because malware scanners say a file is clean does not mean it is clean. It just means the scanner was unable to find any suspicious code.
Malware scanners are not good at finding unique malware; they are only good at finding common malware and malware that follow a certain set of predefined behaviors.
Yes, there is a risk that the files themselves, or the thumb drive you transfer them with, will be infected. If you are willing to take the risk, there are a few precautions you can take when moving the files to your new system:
- Don't boot up the infected operating system. Instead, boot from a bootable thumb drive when you transfer the files. This reduces the risk that the thumb drive gets infected. To reduce the risk even further, follow Josiahs suggestion and don't use the same OS on the thumb drive as on the infected computer.
- Run the Office files through some software or service that removes all macros before opening them. Also, make sure that they all ends with x (e.g. .docx or xlsx) and not m (e.g. docm or xlsm) or nothing (e.g. doc or xls) since the first forbids macros while the others don't.
- Scan the files with multiple different anti-virus software.
- The safest option is probably to follow Minh-Triet Pham Tran's advice and copy paste plain text into a Google document or similar. This might get impractical, though.
Even if these steps reduce the risk, they do not eliminate it. If you have backups, it would be much safer to restore the file from these. Or not at all.
Only an issue if:
- The file was the source of the infection
- the infection was designed to spread
If the files you are transferring don't contain sensitive information, you can copy them into a zip file and then drop the Zip file into virustotal.com and it will let you know from 60 scanners if it detects anything.
That should give you a peace of mind if nothing is detected.
If the documents have personal or sensitive info then do not place in the Virustotal website.
In addiiton to Schroeders good answer: One point is of outmost importance if you use the method you suggested:
Also, can a pendrive get infected when it's connected to the infected laptop? Is it safer to send the documents online (like Droppbox or via email)?
If you are doing this from an malware infected laptop / PC there is the possibility that you are making the problem even worse!
- Some malware use active internet connections to download even worse malware and start it on your pc.
- Some malware use active LAN connections to infect other PCs/Laptops in your LAN!
- If you upload the infected files via mail, dropbox, ... while having booted from the infected OS. Then depending on the malware in question it can easily be that your passwords get compromised the very second you type them in, or log into dropbox, ... .
Thus I would not plug the possibly infected laptop into any WIFI/LAN/Inet if avoidable, as you can increase the severity of your problems a lot (depending on what type of malware has infected the laptop).
Regardless of whatever path you use, the basic thing you need to keep in mind that you are trying to eliminate any embedded executable code that can infect the target system when the file's corresponding program opens it. Uploading to Google drive or dropbox only helps to extent they have effective virus checks for files of that program.
Safest bet is to either convert whatever you can to ascii .txt or csv so that you eliminate all possible embedded code.
But if you have files like html pdf doc xls etc, then you want to use an up to date virus scanner program to check and clean the files before transferring them:
Use a transfer mechanism like Google drive or dropbox to avoid any risks with the USB drive, and then copy files to target system (zero risk in doing that as executable statements in files can activate until you open them in a program that reads their format). Then scan the files with your up to date virus scanner. Once checked/cleaned you should be fine to open the files for all practical purposes.