Here's a sample. (Yes, I've xxx'd out the server ip address and changed the actual directory names, but otherwise it's untouched, honest)
#!/usr/bin/perl -Tw use strict; $|++; use CGI; my $q = new CGI; $q->import_names('STUFF'); print $q->header(), $q->start_html(); if ($STUFF::username eq 'rocky'){ print "Where's the moose?\n"; } else{ print $q->startform(); print "Who goes there?<br>\n"; print $q->textfield(-name=>'username'); print $q->endform; } print $q->end_html(); exit();
Using HEAD produces:
200 OK Date: Thu, 11 Apr 2002 16:21:23 GMT Server: Microsoft-IIS/3.0 Content-Type: text/html; charset=ISO-8859-1 Client-Bad-Header-Line: Name "STUFF::username" used only once: possibl +e typo at C:\inetsrv\path\to\files\test.cgi line 13. Client-Date: Thu, 11 Apr 2002 16:21:22 GMT Client-Peer: xxx.xxx.xxx.xxx:80 Title: Untitled Document
And GET gives us:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>U +ntitled Document</title> </head><body>Use of uninitialized value in string eq at C:\inetsrv\pat +h\to\files\test.cgi line 13. <form method="post" action="/test.cgi" enctype="application/x-www-form +-urlencoded"> Who goes there?<br> <input type="text" name="username" /></form></body></html>

Granted, this isn't the way I'd write a real CGI script, but it shows what I was talking about.

Now, it wouldn't surprise me if this is an IIS thing. I haven't tried it on Apache, only on various versions of IIS. Also, it's quite possible to be a "feature" of the CGI module. I don't remember if I've ever tried this when not using CGI to handle forms.


In reply to Re: Re: Does fatalsToBrowser give too much information to a cracker? by doran
in thread Does fatalsToBrowser give too much information to a cracker? by rinceWind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.