Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Bash code injection attacks through a special environment variable     - Ubuntu 14.04 Nvidia graphics driver installation and settings (Linux)

- Linux character device - automatically creates the device nodes and devices (Linux)

- KUbuntu / Ubuntu 14.04 (downgrade) installed SVN 1.7 (Linux)

- Linux user groups, file permissions Detailed (Linux)

- To convert into a binary search tree sorted doubly linked list (Programming)

- CentOS Linux build SVN server (Server)

- Easy to install CentOS 6.6 desktop environment (Linux)

- Linux install Samba file sharing server (Server)

- CentOS / Linux kernel upgrade (Linux)

- Ubuntu Control Panel to resolve network-manager icon display issue (Linux)

- MySQL remote connection settings (Database)

- open V switch port mirror in OpenStack neutron (Server)

- C ++ 11 feature: auto keyword (Programming)

- Oracle DATABASE LINK (DBLINK) Create (Database)

- To install PostgreSQL 9.4 (Database)

- Oracle archive log deletion (Database)

- How to track performance issues when using the Unity Game Development Android (Programming)

- How Ubuntu Snappy Core 2 running on Raspberry Pi (Linux)

- Android Custom View password box example (Programming)

- Java reflection Introduction (Programming)

 
         
  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:      
 
- Ubuntu 14.04 Configuring cuda-convnet (Linux)
- Linux atomic operations and synchronization mechanisms (Programming)
- Linux some lessons learned about network security (Linux)
- Linux system security audit tools scan nessus installation tutorial (Linux)
- Piostat - Monitoring and Statistics Linux process (Linux)
- RHEL7.0 log system (Linux)
- Linux development management utility command (Linux)
- RPM package management tools under Linux (Linux)
- How to fix apt-get update can not add a new CD-ROM error (Linux)
- Linux file and directory permissions settings (Linux)
- MySQL DATE_FORMAT () function (Database)
- Linux centralized log server rsyslog (Server)
- Security: Unix operating system intrusion tracking Strikes Back (Linux)
- Generate two-dimensional code parsing code Java (Programming)
- Hadoop1.2.1 plug compilation (Server)
- Linux remote connectivity tools -OpenSSH (Linux)
- iOS Sensor Development - add to APP phone password, fingerprint security authentication (Programming)
- Ubuntu 15.04 and Ubuntu 14.04 installed Cinnamon 2.6 (Linux)
- Grub2 Boots the openSUSE installation image (Linux)
- How UTorrent download the ISO image from the command line (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.