Home page logo

bugtraq logo Bugtraq mailing list archives

Another small metacharacter bug in Penguin Traceroute v1.0
From: Marco van Berkum <m.v.berkum () obit nl>
Date: Mon, 17 Jun 2002 14:03:43 +0200


As I was surfing through some older Securityfocus archives I stumbled
across the article about Penguin traceroute v1.0


This article described some metacharacter bugs in this CGI script, also it
included a suggested fix.

   Open up the perl script in your favorite text editor, find a line that has
   "$host = $q->param('host');" Its usually the 13th line down then just add
   this line "$host =~ s/[;<>\*\|'&\$!?#\(\)\[\]\{\}:'"\\]//g;" under it and
   that should parse out any unwanted characters.

Well, yes, it does parse out some metacharacters, but, the " ` " (backtick)
is not filtered out in any way. (probably one of the two quotes " ' " should be
a backtick). Also the slash and the hyphen are not filtered.

entering `cat /etc/passwd` gives us:

Taceroute to `cat /etc/passwd`
traceroute: unknown host root:*:0:0:Charlie

This is only the first line because only that one gets interpreted by traceroute.
But there are ways around this to retreive the full file with some patience:

Taceroute to `wc -l /etc/passwd`
traceroute to 18 (, 64 hops max, 40 byte packets

So we see that in this case the passwd file is 18 lines big.
we could retreive the rest by doing tail -n 18 /etc/passwd , tail -n 17 etc.. etc..

The author and the the first person that found a bug  in this script (Paul Jenkins)
have been notified.

Second fix: replace the second quote by a backtick and add slash and hyphen
to the filter :)

Marco van Berkum

|  Marco van Berkum / MB17300-RIPE     |
| m.v.berkum () obit nl / http://ws.obit.nl     |

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]