|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Brian Hatch (vuln-dev_at_ifokr.org)
Date: Sat Nov 16 2002 - 10:29:38 CST
> thought the wrong way in my last message.
>
> Try the following string for $HTTP_USER_AGENT:
>
> "`cat /etc/passwd`"
The HTTP_USER_AGENT string is set by Apache (etc)
as an environment variable. Let's make the unradical
assumption that your browser is not a shell script,
and thus is setting it correctly without any shell
expansion problems possible. So HTTP_USER_AGENT is
set to
`cat /etc/passwd`
To emulate this, let's set it ourselves in a normal shell:
bash$ export VAR='`cat /etc/passwd`'
bash$ echo $VAR
`cat /etc/passwd`
I use the single quotes here to make sure no expansion
tricks are possible, which is how your web browser will
work. The var is set exactly. Excellent. Can we abuse
it?
bash$ echo $VAR
`cat /etc/passwd`
bash$ echo "$VAR"
`cat /etc/passwd`
Nope. How 'bout if we have:
bash$ export VAR='blahblahblah *'
bash$ echo $VAR
blahblahblah file1.cgi file2.cgi file3.cgi
bash$ echo "$VAR"
blahblahblah *
See that with no quotes you can get a file listing through
shell expansion.
-- Brian Hatch I used to be a lumberjack, Systems and but I just couldn't hack Security Engineer it, so they gave me the ax. http://www.ifokr.org/bri/Every message PGP signed
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iEUEARECAAYFAj3WcnIACgkQp6D9AhxzHxBADgCY56XmZ6RgIkCssHbVLzAfLofA tQCfQ60ERuG0qXMxG4yrifaNJ2gSYLE= =BNUb -----END PGP SIGNATURE-----
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]