mod_bash

Apache/Bash Integration

Intro

heheh... it is stupid and not really useful. This code is an apache module like mod_php, mod_python, but for bash. Look this code:

<form action="index.html" method="get">
  <input type="text" name="AAAA" value="<?bash echo "$AAAA";?>"/>
  <input type="submit" />
</form>

or:

<table>
  <?bash for i in /home/*; do ?>
  <tr><td style="border: 1px solid #000;"><?bash echo $i; ?></td></tr>
  <?bash done; ?>
</table>

Security

What? This code is dangerous because nobody tests it and nobody will use it. If php can be dangerous, try to think if you don't check a variable: it will be sent directly to the `bash'...

License

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Requires

Download

Installation

./configure && make && make install

Configuration

LoadModule bash_module        /usr/lib/apache2/modules/mod_bash.so
BashEnable on

# If you want:
#BashChroot /tmp/chroot

# Default is "bash", but you can change arguments and command.
# If you want use csh, right: BashCommand "csh"
BashCommand "bash --norc"

Examples

Author

Andrea Marchesini - baku _at_ apache _dot_ org
url: http://www.autistici.org/bakunin/