Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
      Where I'm stuck is that I will need to determine the ip address of the machine from which the login attempt failed.

On a non-production machine that you don't care about try the following very evil code:

#!/usr/bin/perl -w use CGI qw/ :standard /; my $cgi=new CGI; print header,start_html; print h1("Environment"); print table( Tr(th("Environment Variable"),th("Value")), map { Tr(td($_),td($ENV{$_})) } sort keys %ENV ); print hr; print h1('CGI Varialbes'); print table ( Tr(th("parameter"),th("parameter value")), map { Tr(td($_),td($cgi->param($_))) } sort $cgi->param ) ; print end_html;
I call this evil because besides what you are looking for is some information that you really don't want to leak to the "public."

Of particular interest in your case is the following key and value that are found in the %ENV hash:

REMOTE_ADDR 68.37.227.52
There's other information there as well but, this was what you specifically asked for.

Update: (GAH!) ikegami got his post out there before I hit "submit" Oh well, the code I put up there is good stuff anyway if you want to "play."


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

In reply to Re: Determine ip address/hostname of requesting host by blue_cowdawg
in thread Determine ip address/hostname of requesting host by davidj

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (8)
    As of 2014-12-25 22:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (163 votes), past polls