Deleted:Web shell

From WikiAlpha
Jump to: navigation, search
The below content is licensed according to Creative Commons Attribution-ShareAlike License contrary to the public domain logo at the foot of the page. It originally appeared on http://en.wikipedia.org. The original article might still be accessible here. You may be able to find a list of the article's previous contributors on the talk page.

Template:Information security A web shell (classified as a remote access trojan[1]) is a web security threat that is a web-based implementation of the shell concept.[2] A web shell is able to be uploaded to a web server to allow remote access to the web server, such as the web server's file system.[3] A web shell is unique in that it enables users to access a web server by way of a web browser that acts like a command-line interface.[4][5]
A user can access a remote computer via the World Wide Web using a web browser on any type of system, whether it's a desktop computer or a mobile phone with a web browser, and perform tasks on the remote system. No command-line environment is required on either the host or the client.[4][5]

A web shell could be programmed in any language that the target server supports. Web shells are most commonly written in PHP, Active Server Pages, or ASP.NET, but Python, Perl, Ruby and Unix shell scripts are also used, although not as common because it is not very common for web servers to support these languages.[3][4][5]

Using network monitoring tools such as Wireshark, an attacker can find vulnerabilities which are exploited resulting in a web shell installation. These vulnerabilities may be present in content management system applications (abbreviated CMS) or the web server's software.[4]

An attacker can use a web shell to issue commands, perform privilege escalation on the web server, and the ability to upload, delete, download and run scripts and files on the web server.[4]

General usage

Web shells are used in attacks mostly because they are multi-purpose and are difficult to detect.[6]

Web shells are commonly used for:

Delivery of web shells

File:Web shell - Delivery tactics.jpg
Graphical representation of how web shells are delivered

Web shells are installed through vulnerabilities in web application or weak server security configuration including the following:[4][6]

An attacker may also modify the Content-Type header to be sent by the attacker in a file upload to bypass improper file validation and upload the attacker's shell.

Examples of web shells

File:B374k 2.8 shell running on a Linux server.png
A b374k 2.8 shell running on a Linux server
File:An example of what a fake error page might look like in a WSO web shell.gif
An example of what a fake error page might look like in a WSO web shell.
  • b374k – A web shell written in PHP with abilities such as monitoring processes & command execution. The latest version of the b374k shell is 3.2.3.[4][10][11][12]
  • C99 – A web shell capable of showing the web server's security standards and has a self-destruction option.[4][13] The original version of C99Shell does not work in PHP 7 due to removed functions.
  • China Chopper – A web shell which is only 4 kilobytes in size, which was first discovered in 2012. This web shell is commonly used by malicious Chinese actors, including advanced persistent threat (APT) groups, to remotely access web servers. This web shell has two parts, the client interface (an executable file) and the receiver host file on the compromised web server. Has many commands and control features such as a password brute-force attack option.[14][15][16]
  • R57 – The R57 web shell has tools to scan the infected web server for other web shell installations, with the option to remove or overwrite them.[17]
  • WSO (web shell by orb) – Has the ability to be password protected with a login form, some variants can disguise as a fake HTTP error page.[4][18][19]

Web shells can be as short as just one line of code. The following example PHP script is 15 bytes in size:

<source lang="php"><?=`$_GET[x]`?></source>

If an attacker inserts this line of code into a malicious file with a PHP filename extension (such as .php) on a web server that is running PHP, the attacker can issue commands, for example reading the /etc/passwd file, through a web browser using the following Uniform Resource Locator if the web shell was located at uploads/webshell.php (regardless if the page is encrypted with TLS or SSL):

http://example.com/uploads/webshell.php?x=cat%20%2Fetc%2Fpasswd

The above request will take the value of the x URL parameter, decode the URL and send the following Bash command:

<source lang="bash">cat /etc/passwd</source>

If the permissions of the /etc/passwd file allow viewing the file, the web server will send the contents of /etc/passwd to the web browser and the browser will then display the contents of the /etc/passwd file or any other file the attacker wishes to view.

This attack could have been prevented if the file permissions did not allow viewing the file or if the shell functions of PHP were disabled so that arbitrary shell commands cannot be executed from PHP.

Other malicious actions are able to be executed by attackers with that web shell, such as replacing the contents of a file on the web server. For example, consider the following Bash command:

<source lang="bash">echo Hijacked page contents > index.php</source>

The above command could be used to replace the contents of the index.php file with the text "Hijacked page contents", which is one way a web page could be defaced, or create the index.php file with the contents if the file does not exist. Attackers can also use the Bash command <source lang="bash" inline>rm</source> to delete files on the web server and <syntaxhighlight lang="Bash" inline>mv</syntaxhighlight> to move files.

Prevention and mitigation

A web shell is usually installed by taking advantage of vulnerabilities present in the web server's software. That is why removal of these vulnerabilities are important to avoid the potential risk of a compromised web server.

The following are security measures for preventing the installation of a web shell:[4][5]

  • Regularly update the applications and the host server's operating system to ensure immunity from known bugs
  • Deploy a demilitarized zone (DMZ) between the web facing servers and the internal networks
  • Secure configuration of the web server[4]
  • Ports and services which are not used should be closed or blocked[4]
  • Using user input data validation to limit local and remote file inclusion vulnerabilities[4]
  • Use a reverse proxy service to restrict the administrative URL's to known legitimate ones [4]
  • Frequent vulnerability scan to detect areas of risk and conduct regular scans using web security software (this does not prevent zero day attacks[4])
  • Deploy a firewall[4]
  • Disable directory browsing
  • Not using default passwords[4]

Detection

Web shells can be easily modified, so it's not easy to detect web shells and antivirus software are often not able to detect these web shells.[4][20]

The following are common indicators that a web shell is present on a web server:[4][5]

  • Abnormal high web server usage (due to heavy downloading and uploading by the attacker);[4][20]
  • Files with an abnormal timestamp (e.g. newer than the last modification date);[20]
  • Unknown files in server;
  • Files having dubious references, for example, cmd.exe or eval;
  • Unknown connections in the logs of web server

For example, a file generating suspicious traffic (e.g. a PNG file requesting with POST parameters);[4][21][22][23] Dubious logins from DMZ servers to internal sub-nets and vice versa.[4]

Web shells may also contain a login form, which can be hidden in fake error pages.[4][24][25][26]

Using web shells, adversaries can modify the .htaccess file (on servers running the Apache HTTP Server software) on web servers to redirect search engine requests to the web page with malware or spam. Often web shells detect the user-agent and the content presented to the search engine spider is different from that presented to the user's browser. To find a web shell a user-agent change of the crawler bot is usually required. Once the web shell is identified, it can be deleted easily.[4]

Analyzing the web server's log could specify the exact location of the web shell. Legitimate users/visitor usually have different user-agents and referers (referrers), on the other hand, a web shell is usually only visited by the attacker, therefore have very few variants of user-agent strings.[4]

Usage by malicious adversaries

Template:Clean

On February 19, 2019, a sophisticated state actor used web shells to hack into the Australian Parliament House computer network and attacked some political parties such as Liberal, Labor and the Nationals.[27][28][29] In the 2016 Democratic National Committee email leak incident, the P.A.S. web shell (author Profexer, a pseudonym) was used by Guccifer 2.0.[30][31]

China Chopper was used in attacks against eight Australian web hosting providers, they were compromised due to usage of a vulnerable operating system, which was Windows Server 2008. Hackers connected the web servers to a Monero mining pool (a way by which cryptocurrency miners pool their resources), by which they mined about AU$3868 worth of Monero.[32]

Web shells were used to attack Verticalscope, a Canadian web forums manager that manages hundreds of popular web forums with more than 45 million user accounts.[33] Web forums affected included Toyota Nation Forum, Jeep Forum and watchuseek.[34][35]

Sea pirates hacked a shipping company's vulnerable content management system using a web shell to sort targets based on cost of the cargo.[36][37][38]

File:Screenshot of MagBO.png
Screenshot of MagBO, taken on March 22, 2019

Security researchers at Flashpoint discovered that over 3,000 backdoor-ed websites' details were sold on MagBO (a Russian website for selling access to servers) with price ranging from $0.50 to $1,000 per site.[39] Price was based on the traffic, hosting parameters and access on the backdoor-ed server.[40] According to MagBO's search filters, a customer could buy access to[41]:

There are also some trojan WordPress plugins, such as WooComerce and Aksimet (not to be confused with WooCommerce and Akismet) which uploads a web shell to the web server with the WordPress installation. The web shells use the <syntaxhighlight lang="PHP" inline>add_action('init',")</syntaxhighlight> function to self-activate and then take commands from an attacker.[42]

A JBoss (now known as WildFly) vulnerability was used by hackers to expose the HTTP Invoker service by which web shell was installed on the web servers of over 200 sites , including servers belonging to governments and universities .[43]

From December 31, 2012 to January 1, 2013, an Indonesian website defacer known as "Hmei7" defaced 5,000 websites with WordPress installations in two days.[44] Hmei7 used web shells with a file uploading feature and changed web server files, such as index.php. Hmei7 has defaced more than 154,000 sites which are notified on Zone-H.[45][46]

See also

References

  1. Wrench, P. M.; Irwin, B. V. W. (1 August 2015). "Towards a PHP webshell taxonomy using deobfuscation-assisted similarity analysis". 2015 Information Security for South Africa (ISSA). pp. 1–8. doi:10.1109/ISSA.2015.7335066. ISBN 978-1-4799-7755-0. https://ieeexplore.ieee.org/abstract/document/7335066. Retrieved 17 February 2019. 
  2. "An Introduction to Web-shells". https://www.acunetix.com/websitesecurity/introduction-web-shells/. 
  3. 3.0 3.1 "How can web shells be used to exploit security tools and servers?". https://searchsecurity.techtarget.com/answer/How-can-web-shells-be-used-to-exploit-security-tools-and-servers. 
  4. 4.00 4.01 4.02 4.03 4.04 4.05 4.06 4.07 4.08 4.09 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.21 4.22 4.23 4.24 4.25 4.26 4.27 4.28 US Department of Homeland Security. "Web Shells – Threat Awareness and Guidance". https://www.us-cert.gov/ncas/alerts/TA15-314A. Retrieved 20 December 2018.  Template:PD-notice
  5. 5.0 5.1 5.2 5.3 5.4 admin (3 August 2017). "What is a Web shell?". https://malware.expert/general/what-is-a-web-shell/. Retrieved 20 December 2018. 
  6. 6.0 6.1 6.2 "Russian Government Cyber Activity Targeting Energy and Other Critical Infrastructure Sectors - US-CERT". https://www.us-cert.gov/ncas/alerts/TA18-074A. Retrieved 20 December 2018. 
  7. co-organizer, Makis MourelatosWordPress Security Engineer at FixMyWPWC Athens 2016; Support, W. P.; Aficionado, Security; Kitesurfer, Wannabe (16 October 2017). "The Definitive Guide about Backdoor Attacks - What are WebShell BackDoors". https://fixmywp.com/security/what-are-web-shell-backdoors.php. Retrieved 20 December 2018. 
  8. "Got WordPress? PHP C99 Webshell Attacks Increasing". 14 April 2016. https://securityintelligence.com/got-wordpress-php-c99-webshell-attacks-increasing/. 
  9. 9.0 9.1 "Equifax breach was 'entirely preventable' had it used basic security measures, says House report". https://techcrunch.com/2018/12/10/equifax-breach-preventable-house-oversight-report/. Retrieved 21 December 2018. 
  10. "Google Code Archive - Long-term storage for Google Code Project Hosting.". https://code.google.com/archive/p/b374k-shell/. Retrieved 22 December 2018. 
  11. "The Webshell Game Continues". 8 July 2016. https://securityintelligence.com/the-webshell-game-continues/. Retrieved 22 December 2018. 
  12. "GitHub - b374k/b374k: PHP Webshell with handy features". https://github.com/b374k/b374k. 
  13. "Got WordPress? PHP C99 Webshell Attacks Increasing". 14 April 2016. https://securityintelligence.com/got-wordpress-php-c99-webshell-attacks-increasing/. Retrieved 22 December 2018. 
  14. "China Chopper". https://www.cyber.nj.gov/threat-profiles/trojan-variants/china-chopper. Retrieved 22 December 2018. 
  15. "What is the China Chopper Webshell, and how to find it on a compromised system?". 28 March 2018. https://www.andreafortuna.org/cybersecurity/what-is-the-china-chopper-webshell-and-how-to-find-it-on-a-compromized-system/. Retrieved 22 December 2018. 
  16. "Breaking Down the China Chopper Web Shell - Part I « Breaking Down the China Chopper Web Shell - Part I". https://www.fireeye.com/blog/threat-research/2013/08/breaking-down-the-china-chopper-web-shell-part-i.html. Retrieved 22 December 2018. 
  17. "Web Shells: The Criminal's Control Panel | Netcraft". https://news.netcraft.com/archives/2017/05/18/web-shells-the-criminals-control-panel.html. 
  18. "WSO Shell: The Hack Is Coming From Inside The House!". 22 June 2017. https://www.wordfence.com/blog/2017/06/wso-shell/. Retrieved 22 December 2018. 
  19. "Web Shells: The Criminal's Control Panel - Netcraft". https://news.netcraft.com/archives/2017/05/18/web-shells-the-criminals-control-panel.html. Retrieved 22 December 2018. 
  20. 20.0 20.1 20.2 "Breaking Down the China Chopper Web Shell - Part I « Breaking Down the China Chopper Web Shell - Part I". https://www.fireeye.com/blog/threat-research/2013/08/breaking-down-the-china-chopper-web-shell-part-i.html. Retrieved 20 December 2018. 
  21. "Intrusion Detection and Prevention Systems". https://ws680.nist.gov/publication/get_pdf.cfm?pub_id=901146. 
  22. LightCyber, Kasey Cross, Senior Product Manager (16 June 2016). "Five signs an attacker is already in your network". https://www.networkworld.com/article/3085141/network-security/five-signs-an-attacker-is-already-in-your-network.html. Retrieved 22 December 2018. 
  23. "Traffic Analysis for Network Security: Two Approaches for Going Beyond Network Flow Data". https://insights.sei.cmu.edu/sei_blog/2016/09/traffic-analysis-for-network-security-two-approaches-for-going-beyond-network-flow-data.html. 
  24. "Hackers Hiding Web Shell Logins in Fake HTTP Error Pages". https://www.bleepingcomputer.com/news/security/hackers-hiding-web-shell-logins-in-fake-http-error-pages/. Retrieved 21 December 2018. 
  25. "Hackers Hiding Web Shell Logins in Fake HTTP Error Pages". 24 July 2018. https://threatravens.com/hackers-hiding-web-shell-logins-in-fake-http-error-pages/. Retrieved 17 February 2019. 
  26. "Hackers Hiding Web Shell Logins in Fake HTTP Error Pages". https://cyware.com/news/hackers-hiding-web-shell-logins-in-fake-http-error-pages-f9f1b47e. Retrieved 22 December 2018. 
  27. z3525182 (19 February 2019). "A state actor has targeted Australian politics – but that shouldn't surprise us". https://newsroom.unsw.edu.au/news/science-tech/state-actor-has-targeted-australian-politics-%E2%80%93-shouldnt-surprise-us. 
  28. Grattan, Michelle. "'State actor' makes cyber attack on Australian political parties". http://theconversation.com/state-actor-makes-cyber-attack-on-australian-political-parties-111993. 
  29. CNN, Ben Westcott. "Australian parliament's computer network targeted by unknown hacker". https://edition.cnn.com/2019/02/07/australia/australia-parliament-hack-intl/index.html. 
  30. "DNC hack — Krebs on Security" (in en-US). https://krebsonsecurity.com/tag/dnc-hack/. 
  31. Kramer, Andrew E.; Higgins, Andrew (2017-08-16). "In Ukraine, a Malware Expert Who Could Blow the Whistle on Russian Hacking" (in en-US). The New York Times. ISSN 0362-4331. https://www.nytimes.com/2017/08/16/world/europe/russia-ukraine-malware-hacking-witness.html. 
  32. Stilgherrian. "Australian web hosts hit with a Manic Menagerie of malware". https://www.zdnet.com/article/australian-web-hosts-hit-with-a-manic-menagerie-of-malware/. 
  33. Solomon, Howard. "Canada third in reported data breaches so far this year" (in en-US). https://www.itworldcanada.com/article/canada-third-in-reported-data-breaches-so-far-this-year/395132. 
  34. "2nd Breach at Verticalscope Impacts Millions — Krebs on Security" (in en-US). https://krebsonsecurity.com/2017/11/2nd-breach-at-verticalscope-impacts/. 
  35. Whittaker, Zack. "Ubuntu Forums hack exposes 2 million users" (in en). https://www.zdnet.com/article/ubuntu-forums-hack-exposes-two-million-users/. 
  36. Insider, pzdupe2, Tech. "High-tech pirates hacked a shipping company to figure out the perfect vessels to plunder". https://www.businessinsider.com/pirates-hacked-vessels-2016-3. 
  37. "Pirates hacked shipping company, cherry-picking targets based on cargo" (in en-US). https://boingboing.net/2016/03/03/pirates-hacked-shipping-compan.html. 
  38. Rogers, James (2016-03-02). "From high seas to high tech: Pirates hack shipping company" (in en-US). https://www.foxnews.com/tech/from-high-seas-to-high-tech-pirates-hack-shipping-company. 
  39. "Thousands of Breached Websites Turn Up On MagBo Black Market" (in en). https://threatpost.com/thousands-of-breached-websites-turn-up-magbo-black-market/137564/. 
  40. Cimpanu, Catalin. "Access to over 3,000 backdoored sites sold on Russian hacking forum" (in en). https://www.zdnet.com/article/access-to-over-3000-backdoored-sites-sold-on-russian-hacking-forum/. 
  41. "MagBO Black Market Hacking Site, Caught Selling 3,000 Website Login" (in en-US). https://hackercombat.com/magbo-black-market-hacking-site-caught-selling-3000-website-login-credentials/. 
  42. admin (2019-01-15). "Malware plugin's to WordPress (woocomerce & aksimet)" (in en-US). https://malware.expert/backdoor/malware-plugins-to-wordpress-woocomerce-aksimet/. 
  43. "Hackers actively exploiting JBoss vulnerability to compromise servers" (in en). 2013-11-18. https://www.pcworld.com/article/2064580/hackers-actively-exploiting-jboss-vulnerability-to-compromise-servers-researchers-say.html. 
  44. News, E. Hacking. "5,000+ sites hacked in 2 days by Indonesian Top Hacker Hmei7". http://www.ehackingnews.com/2013/01/Indonesian-top-defacer-hmei7.html. 
  45. "Got WordPress? PHP C99 Webshell Attacks Increasing" (in en-US). 2016-04-14. https://securityintelligence.com/got-wordpress-php-c99-webshell-attacks-increasing/. 
  46. "C99 Webshell Increasingly Used in WordPress Attacks | SecurityWeek.Com". https://www.securityweek.com/c99-webshell-increasingly-used-wordpress-attacks. 

External links

Template:Malware

[create] Documentation