Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Bash code injection attacks through a special environment variable     - Linux network security probing tools Hping2 (Linux)

- Oracle table space rename and delete table space (Database)

- Ubuntu 14.04 / 12.04 subscribe users to install software Liferea 1.10.10 (Linux)

- Adjust the size of the hard disk VirtualBox (Linux)

- The formatted Linux hard drive and mount (Linux)

- Use backup-manager system backup on Linux (Linux)

- Linux Getting Started tutorial: How to backup Linux systems (Linux)

- Linux CPU Monitoring Index (Linux)

- How to forcibly change the Linux system password on a regular basis (Linux)

- Linux SVN account password to save your settings (Linux)

- ORA-12545: Connection failed because the target host or object does not exist (Database)

- To add the Oracle JDBC driver in Maven repository (Linux)

- SSH configuration under Linux (Linux)

- Installation and Configuration rsync server under CentOS 6.3 (Server)

- Install Firefox 32 official version of the Linux system (Linux)

- How to properly set up a Linux swap partition (Linux)

- Acting on JavaScript events (Programming)

- Oracle 11g dataguard main library backup and recovery to the test environment in one database error (Database)

- Smooth upgrade to OpenSSH 6.7 Procedure (Linux)

- Redis application of Sina Weibo (Database)

 
         
  Bash code injection attacks through a special environment variable
     
  Add Date : 2018-11-21      
         
         
         
 

Bash or Bourne again shell, is a class UNIX shell scripts, it can be any Linux system, the most common installation components. Born from 1980 to the present, bash has grown from a simple terminal-based command interpreter to the evolution of many other strange uses.

In Linux, the environment variable affects the system software. They are composed of a name and the assignment of names. bash shell as well. In the program running in the background bash shell is very common. Typically used to provide a shell to remote users (for example via ssh, telnet), the CGI script provides parser (such as Apache), and even provides limited support for command execution (for example, git).

Back to the topic, you can create an environment variable using the value of the special processing before calling the bash shell, a fact revealed the fragility of the system. These variables can contain code, with the shell called. These processed variable names and nothing major is their content. In the following context, vulnerability exposed:

ForceCommand is sshd to use environment variables, which provide limited command authority to the remote user. This defect can be bypassed and provide any command to execute permissions. Some Git and Subversion deployment using such shell. OpenSSH routine use will not be affected, because the user has entered the shell.

If CGI scripts use bash or produce a lot of sub-shell, or use mod_cgi mod_cgid Apache server will be affected. These may be sub-shell system C language / popen use and can be used Python's os.system / os.popen, may be of PHP in CGI mode of system operation / exec to use and can be used in open shell of Perl / system use.

mod_php PHP script execution even if a large number of production sub-shell is not affected.  

DHCP client calls the shell script to configure the system, use the value from potentially malicious servers. This will allow arbitrary command execution, especially as root DHCP client.

a variety of daemons and SUID / privileged user settings and programs may use the affected user environment variables execute shell script, you can allow arbitrary command execution.

Other applications

may fall into a shell of any danger, or run as a shell script bash interpreter applications. shell script does not introduce environment variables are safe, even if they deal with insecure content and stored in the shell variable (not introduced) in and open the sub-shell.

and programming languages, Bash also function, albeit limited implementation of these functions may bash into the environment variable. This defect is triggered when these environment variables inside a function definition aft attach additional code. Like this:

$ env x = '() {:;}; echo vulnerable' bash -c "echo this is a test"
  vulnerable
  this is a test

patch to fix this flaw, make sure the tail bash function does not allow additional code. So if you use a patched version of bash to run the above example, the output should be like this:

  $ env x = '() {:;}; echo vulnerable' bash -c "echo this is a test"
  bash: warning: x: ignoring function definition attempt
  bash: error importing function definition for `x '
  this is a test

We believe that this should not affect any of backward compatibility. It will of course affect any script described above is used to create an environment variable, but doing so would be considered bad programming practice.

Red Hat security report repair the Red Hat Enterprise Linux is the problem. Fedora also fixes delivered package.

     
         
         
         
  More:      
 
- Import and export myloader accelerate mydumper (Database)
- Using RAID in Linux: Create a RAID 5 (Linux)
- Installation of Gitlab under Ubuntu (Linux)
- Practical top command (Linux)
- Use 3G wireless network card under Linux (Linux)
- Linux Getting Started tutorial: How to backup Linux systems (Linux)
- DB2 Version SQLJ to access Oracle Server (Database)
- Phoenix agents use P2P WebRTC development (Programming)
- Installation of network monitoring ntopng under CentOS 6.4 (Linux)
- CMake Quick Start Tutorial (Linux)
- Iptables Instructions (Linux)
- Compare Several MySQL environmental issues (Database)
- Linux common network tools: batch scanning of hosting services netcat (Linux)
- Availability Hadoop platform - Oozie Workflow (Server)
- Use Visual Studio Code Development TypeScript (Linux)
- Java polymorphism and exception handling (Programming)
- Rman Oracle database backup and recovery plan (Database)
- About Nginx 7 (Server)
- Ubuntu 10.04 to Ubuntu 10.10 Upgrade (Linux)
- [Android] Eclipse does not update the Android SDK Manager solution [using GoAgent] (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.