Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Altering "Server" HTTP Header Param

by gryphon (Abbot)
on Oct 14, 2002 at 21:59 UTC ( #205237=note: print w/replies, xml ) Need Help??


in reply to Altering "Server" HTTP Header Param

Greetings all,

tye had a really interesting idea he told me via Chatterbox. He said I should try making the script a non-parsed headers script and feed in my own HTTP headers manually. I did so, and now all my HTTP headers appear to be "correct" (i.e. incorrect intentionally).

Problem is, it doesn't appear to work when I try this using CGI.pm, but only as a flat series of lines.

#!/usr/bin/perl use strict; use warnings; =pod use CGI; my $cgi = new CGI; print $cgi->header( -nph => 1, -type => 'text/html; charset=ISO-8859-1', -cache_control => 'private', -connection => 'close', -server => 'Microsoft-IIS/6.0' ); =cut print <<ENDOFHTML; HTTP/1.1 200 OK Cache-Control: private Date: Mon, 14 Oct 2002 21:41:25 GMT Server: Microsoft-IIS/6.0 Content-Length: 31000 Content-Type: text/html Expires: Mon, 25 Oct 2010 21:21:21 GMT P3P: CP='ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo +OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI' <HTML><HEAD><!-- the rest of the html document -->

The problem is that NetCraft is still reporting me running Apache. However, after some reading on their site, I get the feeling (backed by no real evidence) that they query for new site data on a daily basis. So perhaps by tomorrow, my problems will be solved.

gryphon
code('Perl') || die;

Replies are listed 'Best First'.
Re(2): Altering "Server" HTTP Header Param
by Phaysis (Pilgrim) on Oct 14, 2002 at 23:37 UTC
    As a faster means to confirming your headers and all the other data transferred during an HTTP session, try using Ethereal. It's a packet-sniffer; it's been ported to several platforms, and has some very cool abilities. After capturing an HTTP session or two, you can scroll through all the sniffed packets and get a blow-by-blow analysis of the session including (you guessed it) headers sent by the browser and headers sent by the server, as well as document text. Much faster than waiting for Netcraft to recrawl your server.

    I discovered Ethereal over this weekend, and it's now an essential tool in my toolbox. I'll be using it for my own CGI programming. Definitely. Find it here.

    Good luck on satisfying your client.

    -Shawn / (Ph) Phaysis
    If idle hands are the tools of the devil, are idol tools the hands of god?

Re: Re: Altering "Server" HTTP Header Param
by perrin (Chancellor) on Oct 15, 2002 at 04:27 UTC
    You should be able to get that to work, but it may not fool Netcraft. For one thing, they report operating system based analysis of TCP/IP traffic. You would also have to have enough control over that server to make sure that every call to "/" will run your script. Without a dedicated server, you probably don't have that.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://205237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2020-03-31 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (180 votes). Check out past polls.

    Notices?