Malware and Firmware Trojans
- 1 Malware
- 2 Firmware Trojans
- 3 References
If you are reading this page, then it is safe to assume being anonymous (less unique), and remaining so is of great interest. Users with a serious intention to research these issues are encouraged to assist in accordance with their skills. Testing, bug reporting or even bug fixing are laudable endeavors. If this process is unfamiliar, understand that about thirty minutes is required per message / identifier to ascertain if the discovered result  is a false positive, regression, known or unknown issue.
To date, none of the various leak testing websites running inside Whonix-Workstation ™ were ever able to discover the real (external), clearnet IP address of a user during tests. This held true even when plugins, Flash Player and/or Java were activated, despite the known fingerprinting risks. Messages such as "Something Went Wrong! Tor is not working in this browser."  (from about:tor) or "Sorry. You are not using Tor." (from check.torproject.org) are in most cases non-issues. If the real, external IP address can be revealed from inside Whonix-Workstation ™, then this would constitute a serious and heretofore unknown issue (otherwise not).
It is unhelpful to ask questions in forums, issue trackers and on various mailing lists with concerns that have already been discussed, or which are known issues / false positives. In all cases, please first search thoroughly for the result that was found. Otherwise, the noise to signal ratio increases and Whonix development is hindered. Users valuing anonymity don't want this, otherwise this would violate the aforementioned assumption.
If something is identified that appears to be a Whonix ™-specific issue, please first read the Whonix Free Support Principle before making a notification.
The Importance of a Malware Free System
Malware has malicious intent and can potentially: 
- View and take snapshots of the desktop.
- Peruse files and folders.
- Gain access to protected data when decrypted.
- Exfiltrate, corrupt or destroy data (particularly financial and personal information).
- Damage operating system functionality.
- Encrypt the contents of a drive(s) and demand payment for decryption (ransomware [archive]).
- Display unwanted advertising.
- Install unwanted software.
- Install persistent rootkits [archive] or backdoors [archive].
- Track browsing and other behaviour.
- Remotely turn on webcams and microphones.
- Create "zombie" computers which form part of a botnet for spam email, DDOS attacks [archive] or the hosting of illicit / illegal material.
- Record everything a user types, sends and receives.
Detection of System Changes
If trivial changes are noticed on your system -- such as a duplicate deskop icon -- this is not evidence of a hack or leak. Similarly, if warning or error messages appear that are difficult to understand, in most cases there is no need for panic. If something unexpected occurs such as the appearance of a "htaccess file in home directory", or graphical glitches emerge in Nyx, then it is more likely a harmless bug and/or usability issue rather than a compromise.
Skilled attackers do not leave such obvious traces of their breach. An infection by tailored malware is more plausible in this scenario and this is virtually impossible to detect by reading random messages in system logs. Even malware that is bought off-the-shelf (malware building toolkits) are unlikely to be discovered by cursory inspections.  Rootkit [archive] technology is no doubt a standard feature of the various programs.
Strange files, messages or other system behavior could feasibly relate to an attacker wanting the user to find something. However, the likelihood of this kind of harassment is considered low. Script kiddies [archive] ("skiddies") are unskilled attackers who uses scripts or programs to conduct attacks on computer systems and networks, most often with juvenile outcomes. For example, they might use programs to remotely control poorly-secured Windows desktops, trolling their victims from an open, forced chat window, opening their DVD drive and so on. It is improbable that skiddies can achieve similar exploits against Linux, Xen or BSD platforms.  Sophisticated attackers generally avoid detection, unless the user is unlucky enough to be a victim of Zersetzung [archive] (a psychological warfare technique).
Every forum post and support request requires time that could otherwise be directed to Whonix ™ development. Unless there is genuine evidence of a serious and credible problem, there is no need for a new post. Developers and the Whonix ™ community at large do not have enough time to explain every message that Linux might report. In most cases, they are not important and outside the control of Whonix ™ developers.
The Utility of Antivirus Tools
Antivirus products and personal firewalls [archive] are not drop in solutions for a secure host. Malware can often stay undetected and evade scans, while application level personal firewalls are often circumvented.  Polymorphic code [archive] and rootkits [archive] essentially render antivirus products helpless.  
Antivirus tools are actually worse than useless. In the case of sophisticated and targeted attacks, the antivirus software can serve as a pathway to exploiting a system's kernel, since they almost always run with administration level privileges.  Antivirus software also harms privacy by sending system files back to the company servers for analysis. The software also actively conducts man-in-the-middle attacks on secure SSL connections, enabling very sensitive information to be viewed. 
Preventing Malware Infections
The optimal scenario is to avoid infection by malware in the first place. Once malicious code has accessed a system, it is next to impossible to contain. Sensible steps include: hardening the operating system, carefully vetting programs and files that are retrieved from the Internet, and using hypervisors (virtualizers) to isolate software that processes untrusted data.
In the event a system compromise is strongly suspected or confirmed, the ultimate goal is to re-establish a trusted, private environment for future activities -- see Compromise Recovery for techniques to recover from host and/or Whonix ™ VM infections.
Detecting Malware Infections
Detecting off-the-shelf (standardized) malware is a very hard problem and conceptually a lost cause. If uncustomized malware is widespread enough, then it has a chance of being detected by a technician. Tailored malware might also get detected by a technician, but the likelihood is low unless they are lucky or gifted.
Non-technical users do not have many good options. They can either:
- Spend a few years to rapidly increase their knowledge base of operating systems, network protocols, package analysis, programming, disassembly etc., and then try their luck.
- Pay exorbitant sums to a technician to try and find system malware, even though there is no certainty of success.  
- Or seek the voluntary assistance of a technician to find malware, if they are both a high value target and have a reasonable rationale for why they are likely compromised. 
Watering Hole Attacks
It should be noted that advanced malware can infect a user's computer via a Watering Hole Attack [archive]. This vector has similarities to the software version of a Supply Chain Attack, and these methods are not mutually exclusive: 
A watering hole attack is a malware attack in which the attacker observes the websites often visited by a victim or a particular group, and infects those sites with malware. A watering hole attack has the potential to infect the members of the targeted victim group. Although uncommon, a watering hole attack does pose a significant threat to websites, as these attacks are difficult to diagnose.
In the case of (Qubes-)Whonix ™ users, any future attempt would logically target hosted content on GitHub, SourceForge, various forum locations, mirrors, popular documentation links, and frequently visited security and anonymity sites like Tails, The Tor Project and so on.  The hope is that developers, contributors and general users of the software become infected with stealthy malware that is immune to detection.
- Zero-day or other vulnerabilties target the website software.
- The code redirects visitors to a different site that serves "malvertisments" or malware masquerading as legitimate software.
- Once installed, the malware can infect various members of the targeted group.
It should be noted that advanced adversaries are capable of gaining knowledge about the behavioral patterns of target groups -- where they congregate, topics of research, related interests, and handle mapping of anonymous networks. This generic browsing and membership knowledge, along with observed security practices, greatly narrows the number of specific sites that need be targeted and the suitable attack mode. One way to mitigate this threat is to rigorously inspect websites for malicious code.
Firmware infections should not be confused with hardware/circuit trojans [archive], which are malicious modifications made to machine components during the manufacturing process. Despite their sophistication, circuit trojans are not immune to detection. 
Virtualizers and Hardware Compromise
Virtualizers like Qubes, VirtualBox and KVM cannot absolutely prevent the compromise of hardware. Running all activities inside VMs is a very reasonable approach. However, this only raises the bar and makes it more difficult and/or expensive to compromise the whole system. It is by no means a perfect solution.
No distribution of Linux, BSD, Xen or any other variant can solve the issue of needing to dispose of potentially infected hardware. Hardware-specific issues can really only be fixed at the hardware level. At best, software interventions can only provide workarounds.
The Promise of Libre Firmware
The problem is no hardware exists that consists of entirely Libre firmware. It is very difficult to analyze the firmware [archive] of hardware, wipe potentially compromised versions, or overwrite firmware with a most-likely-clean version.
Even if a user wholly depended on Libre firmware, this would only make verification easier but it could not stop infection. Disassembling hardware components -- BIOS, disk controllers, CPU, Intel AMT and so on -- and flashing them with clean versions offline is extremely difficult. It is simply cheaper and more convenient to buy new hardware.
- From a browser test website, in a log file and so on.
- https://forums.whonix.org/uploads/default/original/1X/c2c9bb5dc7efee7a933dd00d3bf0c30c29c99daa.png [archive]
- https://en.wikipedia.org/wiki/Malware [archive]
- Interested readers can verify these claims by researching off-the-shelf malware building toolkits. They are dangerous to install for inexperienced users, but there is a wealth of information online such as screenshots and video tutorials.
- It is unclear if script kiddie programs are readily available for attacking non-Windows users.
- https://www.grc.com/lt/leaktest.htm [archive]
- https://arstechnica.com/security/2014/05/antivurus-pioneer-symantec-declares-av-dead-and-doomed-to-failure/ [archive]
- A botnet author brags in this thread of writing unbeatable malware and trolling antivirus vendors. [archive]
- https://theintercept.com/2015/06/22/nsa-gchq-targeted-kaspersky/ [archive]
- https://www.schneier.com/blog/archives/2017/10/more_on_kaspers.html [archive]
- https://bugs.chromium.org/p/project-zero/issues/detail?id=978 [archive]
- The salary costs for a security researcher / malware analyst over an extended period rule this out for most individuals.
- https://forums.whonix.org/t/document-recovery-procedure-after-compromise/3296/12 [archive]
- Only a select group of people fall into this group, for instance, whistleblowers targeted and infected by tailored viruses. Experts might be located who are willing to conduct analysis pro bono; later publicizing their findings for the public benefit.
- https://www.techopedia.com/definition/31858/watering-hole-attack [archive]
- More commonly attacks favor banks, large organizations and government offices due to the obvious political and profit motives.
- https://en.wikipedia.org/wiki/Watering_hole_attack [archive]
- https://en.wikipedia.org/wiki/Hardware_Trojan#Detecting_Hardware_Trojans [archive]
- https://blog.invisiblethings.org/2015/12/23/state_harmful.html [archive]
- https://github.com/rootkovska/state_harmful/blob/master/state_harmful.md [archive]
This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.
Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)